0% found this document useful (0 votes)
8 views46 pages

Unit 03

The document discusses the network layer of the OSI model, focusing on data packet delivery and routing processes. It covers various routing types, including static, dynamic, default, direct, and indirect routing, along with their advantages and disadvantages. Additionally, it explains routing algorithms like Distance Vector and Link State, hierarchical routing, broadcast and multicast routing, and the concept of network congestion and its control.

Uploaded by

anvisuri05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views46 pages

Unit 03

The document discusses the network layer of the OSI model, focusing on data packet delivery and routing processes. It covers various routing types, including static, dynamic, default, direct, and indirect routing, along with their advantages and disadvantages. Additionally, it explains routing algorithms like Distance Vector and Link State, hierarchical routing, broadcast and multicast routing, and the concept of network congestion and its control.

Uploaded by

anvisuri05
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 46

Unit - 03

 The network layer or layer 3 of


the OSI (Open Systems
Interconnection) model is
concerned delivery of data
packets from the source to the
destination across multiple hops
or links. It is the lowest layer that
is concerned with end − to − end
transmission.
What is routing?
 Network routing is the process of selecting a

best path across one or more networks. The


principles of routing can apply to any type of
network, from telephone networks to public
transportation. In packet-switching networks,
such as the Internet, routing selects the paths
for Internet Protocol (IP) packets to travel from
their origin to their destination. These Internet
routing decisions are made by specialized
pieces of network hardware called routers.
Network layer design
 Network layer design issues:
The network layer comes with some design issues they are described as
follows:
 1. Store and Forward packet switching:
The host sends the packet to the nearest router. This packet is stored there
until it has fully arrived once the link is fully processed by verifying the
checksum then it is forwarded to the next router till it reaches the
destination. This mechanism is called “Store and Forward packet switching.”
 2. services provided to Transport Layer:
Through the network/transport layer interface, the network layer transfers
it’s services to the transport layer.
 Connectionless – The routing and insertion of packets into subnet is
done individually. No added setup is required.
 Connection-Oriented – Subnet must offer reliable service and all the
packets must be transmitted over a single route.
 3. Routing:
It is the most important functionality. The network layer chooses the most
relevant and best path for the data transmission from source to destination.
 4. Multiplexing and de multiplexing
Routing can be classified into three categories:

Static Static Routing

Routing The network administrator manually creates, maintains and


updates the Static routing table. The route for every network is
Dynamic manually configured on every router. With this, you can control
Routing/ routing at a very deep level. But this approach is impractical for
Adaptive large networks.
advantages of the lower static routing
Default
In the static routing, the CPU overhead is very low.
Routing
Overhead is not present at all in the bandwidth because routers do
not share updates with each other.
https:// With Static routing, you can control the network at the deep level.
www.youtube.com/
watch?v=hdpnoOcrGck
https:// disadvantages of the lower static routing
www.youtube.com/
watch?v=gQtgtKtvRdo If there is a change in the network, then it has to do manually on
all routers.
If any link goes down, there is no fault tolerant in it.
Static routing is impractical for large networks.
 Dynamic Routing –
Dynamic routing makes automatic adjustment
of the routes according to the current state of
the route in the routing table. Dynamic routing
uses protocols to discover network destinations
and the routes to reach it.
 Automatic adjustment will be made to reach
the network destination if one route goes
down.
 examples of dynamic routing protocol:
 RIP (Routing Information Protocol)
 IGRP (Interior Gateway Routing Protocol)
 EIGRP - (Enhanced Interior Gateway Routing
Protocol)
advantages of dynamic routing
Dynamic routing can be easily configured on large networks.
 Automatically able to choose a better path.
 Able to load balance between different links.

disadvantages of lower dynamic routing
Dynamic routing uses bandwidth.
 The router has an additional load on the CPU.
 Route's choice is in the hands of the routing protocol. The administrator
cannot do anything.

Default Routing
•Default Routing is a technique in which a router is configured to send all
the packets to the same hop device, and it doesn't matter whether it
belongs to a particular network or not. A Packet is transmitted to the
device for which it is configured in default routing.
•Default Routing is used when networks deal with the single exit point.
Direct / Indirect Routing
 Direct routing is the process of sending data to the same network or
we have the sender and the receiver at the same point.
 When the packet needs to be send in the same network means the
source and the destination are at the same point then direct routing
needs to be used.
Indirect routing is the process where the sender and
the receiver address are different . This is the case
where the packet must be forwarded by a node that
knows how to reach the destination .

When a machine wishing to send an IP packet to a


second machine must send that packet through a
third machine, the route the packet will travel is said
to be an ``indirect route'' and the selection of the
intermediary machine is called ``indirect routing''.
Routing Algorithm (Distance Vector Algorithm )
 Distance vector routing algorithms require that each node
exchanges information between neighbors, that is to say
between nodes directly connected. Therefore, each node can
keep updated a table by adding information on all its neighbors .
 Historically known as the old ARPANET routing algorithm (or
known as Bellman-Ford algorithm).
 Distance Vector Algorithm –
 A router transmits its distance vector to each of its neighbours in
a routing packet.
 Each router receives and saves the most recently received
distance vector from each of its neighbors.
 A router recalculates its distance vector when:
 It receives a distance vector from a neighbour containing
different information than before.
 It discovers that a link to a neighbour has gone down.
 Dx(y) = Estimate of least cost from x to y
 C(x,v) = Node x knows cost to each neighbor v
 Dx = [Dx(y): y ∈ N ] = Node x maintains distance vector
 Node x also maintains its neighbors' distance vectors
 – For each neighbor v, x maintains Dv = [Dv(y): y ∈ N ]
 Advantages of Distance Vector routing –
• Simple to implement:
• This protocol is considered straightforward and easy to set up, even for network
administrators with less experience.
• Low resource usage:
• Requires minimal processing power and memory compared to more complex
routing protocols.
• Scalability for smaller networks:
• Well-suited for small to medium-sized networks where the number of devices
and network changes are manageable.
• Dynamic updates:
• Automatically adjusts routing tables based on information received from
neighbors, allowing for adaptation to network changes.
 Disadvantages of Distance Vector routing –
 It is slower to converge than link state.
 It is at risk from the count-to-infinity problem.
 It creates more traffic than link state since a hop count change must be
propagated to all routers and processed on each router. Hop count updates take
place on a periodic basis, even if there are no changes in the network topology,
Link state routing
 Link state routing is a method in which each router shares its neighbourhood’s
knowledge with every other router in the internetwork. In this algorithm, each
router in the network understands the network topology then makes a routing
table depend on this topology.
 The three keys to understand the Link State Routing algorithm:
 Knowledge about the neighbourhood: Instead of sending its routing table, a
router sends the information about its neighborhood only. A router broadcast its
identities and cost of the directly attached links to other routers.
 Flooding: Each router sends the information to every other router on the
internetwork except its neighbours. This process is known as Flooding. Every
router that receives the packet sends the copies to all its neighbours. Finally, each
and every router receives a copy of the same information.
 Information sharing: A router sends the information to every other router only
when the change occurs in the information.
 Features of link state routing protocols –
 Link state packet – A small packet that contains routing information.
 Link state database – A collection information gathered from link state packet.
 Shortest path first algorithm (Dijkstra algorithm) – A calculation performed on the
database results into shortest path
 Routing table – A list of known paths and interfaces.
 Calculation of shortest path –
To find shortest path, each node need to run the famous Dijkstra algorithm. This famous
algorithm uses the following steps:
 Step-1: The node is taken and chosen as a root node of the tree, this creates the tree with
a single node, and now set the total cost of each node to some value based on the
information in Link State Database
 Step-2: Now the node selects one node, among all the nodes not in the tree like structure,
which is nearest to the root, and adds this to the tree.The shape of the tree gets changed .
 Step-3: After this node is added to the tree, the cost of all the nodes not in the tree needs
to be updated because the paths may have been changed.
 Step-4: The node repeats the Step 2. and Step 3. until all the nodes are added in the tree
shortest path algorithms

 In computer networks, the shortest path algorithms aim to find the optimal paths
between the network nodes so that routing cost is minimized. They are direct
applications of the shortest path algorithms proposed in graph theory.

 Consider that a network comprises of N vertices (nodes or network devices) that


are connected by M edges (transmission lines). Each edge is associated with a
weight, representing the physical distance or the transmission delay of the
transmission line. The target of shortest path algorithms is to find a route
between any pair of vertices along the edges, so the sum of weights of edges is
minimum. If the edges are of equal weights, the shortest path algorithm aims to
find a route having minimum number of hops.

 Dijkstra’s Algorithm
 Input − A graph representing the network; and a source node, s
Dijkstra Algorithm-
 Dijkstra Algorithm is a very famous greedy algorithm.
 It is used for solving the single source shortest path problem.
 It computes the shortest path from one particular source node to all other remaining
nodes of the graph.
 It is important to note the following points regarding Dijkstra Algorithm-
 Dijkstra algorithm works only for connected graphs.
 Dijkstra algorithm works only for those graphs that do not contain any negative
weight edge.
 It only provides the value or cost of the shortest paths.
 By making minor modifications in the actual algorithm, the shortest paths can be
easily obtained.
 Dijkstra algorithm works for directed as well as undirected graphs.
 Algorithm-
 Input Data-Cost Adjacency Matrix for Graph G, say cost Source vertex, say s
 Output Data-Spanning tree having shortest path from s to all other vertices in G
 Steps:
1. Initialize all nodes with a tentative distance of infinity, except the source
node, which is set to 0.
2. Mark all nodes as unvisited.
3. For the current node, update the distances to its neighbors.
4. Select the unvisited node with the smallest tentative distance as the next
node.
5. Repeat until all nodes are visited.
 Complexity: O(V²) with a simple implementation, but with a priority queue, it
can be improved to O(E + V log V), where V is the number of vertices and E is
the number of edges.
 Example: If we have a graph representing cities and roads, Dijkstra’s
algorithm will find the shortest path from one city to all others.
Hierarchical Routing
 In hierarchical routing, routers are classified in groups known as regions. Each router has
only the information about the routers in its own region and has no information about
routers in other regions. So routers just save one record in their table for every other
region.
Hierarchical Structure
The network is divided into multiple levels. At each level, there is a hierarchy of routers that handle routing
within that level or between different levels.
2. Routing within Regions (Intra-domain Routing)
Within each region or subnet, routing is done by routers using local information, such as the IP addresses and
network topology within that region.
3. Routing between Regions (Inter-domain Routing)
When data needs to travel between different regions or subnets, routers at higher levels (often called border
routers or gateway routers) are responsible for forwarding the data.
These routers maintain routing information to other regions or networks and handle the communication
between different areas.
4. Reduced Routing Table Size
In hierarchical routing, instead of every router needing to know the complete network topology, routers only
need to know about the local region or domain and the routes to other regions.
5. Scalability
Hierarchical routing is particularly useful for large networks because it simplifies the routing process and
scales efficiently as the network grows.
broadcast routing
 Broadcast Routing refers to the process of efficiently transmitting a message
from a single source node to all other nodes in a network. Unlike unicast routing
(which is one-to-one communication) and multicast routing (one-to-many
communication), broadcast routing ensures that a message or data packet is
delivered to every node in the network.
 Broadcast routing is particularly important in network environments where there
is a need for a single message to be disseminated to all participants or devices,
such as in the case of network discovery protocols, or certain types of routing
updates and network maintenance tasks.
Types of Broadcast Routing
1. Flooding
•Flooding is the most basic form of broadcast routing.
When a node receives a broadcast message, it forwards it to all of its neighbors, except
the one from which it just received the message. This process continues until all nodes
in the network have received the message.
•Advantages: Very simple to implement, guarantees that every node receives the
broadcast.
•Disadvantages: Flooding leads to redundant messages, which causes network
congestion and inefficiency.
 Spanning Tree-Based Broadcast
• In this approach, a spanning tree is created for the broadcast process, ensuring
that the message is sent along a tree structure where each edge is only used once,
eliminating redundancy.
• The network creates a broadcast tree, and the message is forwarded through the
tree, ensuring that it reaches all nodes without causing loops or multiple
transmissions over the same link.
 Controlled Flooding
• Controlled Flooding is a more sophisticated version of flooding that aims to limit
the redundancy of broadcasts.
• The flooding process is controlled by using a combination of time-to-live (TTL)
values, hop count, or neighboring node information to restrict how far a
message can propagate. This reduces redundant messages by ensuring that a
broadcast message doesn’t travel too far.
Multicast Routing
 Multicast Routing is a method used in computer networks to efficiently send
data from a single source to multiple destination nodes (but not all nodes) in a
network. Unlike unicast (one-to-one communication) and broadcast (one-to-all
communication), multicast allows one-to-many communication where data is
sent to a specific group of receivers, reducing unnecessary traffic and improving
network efficiency.

Key Concepts of Multicast Routing


1.Multicast Group: A multicast communication involves sending a message to a
specific group of devices, identified by a multicast address. Each device that wants
to receive the multicast message joins the group and listens for the messages.
2.Multicast Addressing: A special type of IP address is used for multicast
communication. In IPv4, addresses in the range of 224.0.0.0 to 239.255.255.255
are reserved for multicast,
3.Multicast Tree: To efficiently route multicast traffic, multicast routing protocols use
a multicast tree to distribute the data. The tree determines the paths that data will
Network Congestion

 Congestion is a situation in Communication


Networks in which too many packets are
present in a part of the subnet, performance
degrades. Congestion in a network may occur
when the load on the network (i.e. the number
of packets sent to the network) is greater than
the capacity of the network (i.e. the number of
packets a network can handle.). Network
congestion occurs in case of traffic overloading.
Congestion Control
 Congestion Control refers to techniques and mechanisms that can
either prevent congestion, before it happens, or remove congestion,
after it has happened.
 These two categories/policies are:
 1. Open loop
 2. Closed loop

 Open Loop Congestion Control


 • In this method, policies are used to prevent the congestion before it
happens.
 • Congestion control is handled either by the source or by the
destination.
 • The various methods used for open loop congestion control are:
 Retransmission Policy
 • The sender retransmits a packet, if it feels that the packet it has sent is lost or corrupted.
 • However retransmission in general may increase the congestion in the network. But we
need to implement good retransmission policy to prevent congestion.
 • The retransmission policy and the retransmission timers need to be designed to optimize
efficiency and at the same time prevent the congestion.
 Window Policy
 • To implement window policy, selective reject window method is used for congestion
control.
 • Selective Reject method is preferred over Go-back-n window as in Go-back-n method,
when timer for a packet times out, several packets are resent, although some may have
arrived safely at the receiver. Thus, this duplication may make congestion worse.
 Acknowledgement Policy
 • The acknowledgement policy imposed by the receiver may also affect congestion.
 • If the receiver does not acknowledge every packet it receives it may slow down the
sender and help prevent congestion.
 • Acknowledgments also add to the traffic load on the network. Thus, by sending fewer
acknowledgements we can reduce load on the network.
 Closed Loop Congestion Control

 • Closed loop congestion control mechanisms try to remove the congestion after it happens.
 • The various methods used for closed loop congestion control are:
 Backpressure
 • Back pressure is a node-to-node congestion control that starts with a node and propagates, in
the opposite direction of data flow. The backpressure technique can be applied only to virtual
circuit networks.
 Choke Packet

 • In this method of congestion control, congested router or node sends a special type of packet
called choke packet to the source to inform it about the congestion.
 • Here, congested node does not inform its upstream node about the congestion as in
backpressure method.
 • In choke packet method, congested node sends a warning directly to the source station i.e. the
intermediate nodes through which the packet has traveled are not warned.
 implicit Signaling
 • In implicit signaling, there is no communication between the congested node or nodes and the
source.
Congestion control algorithms
 Leaky Bucket Algorithm

 • It is a traffic shaping mechanism that controls the amount


and the rate of the traffic sent to the network.
 • A leaky bucket algorithm shapes bursty traffic into fixed rate
traffic by averaging the data rate.
 • Imagine a bucket with a small hole at the bottom.
 • The rate at which the water is poured into the bucket is not
fixed and can vary but it leaks from the bucket at a constant
rate. Thus (as long as water is present in bucket), the rate at
which the water leaks does not depend on the rate at which the
water is input to the bucket
 Token bucket Algorithm

 • The leaky bucket algorithm allows only an average (constant) rate of data flow. Its
major problem is that it cannot deal with bursty data.
 • A leaky bucket algorithm does not consider the idle time of the host. For example, if
the host was idle for 10 seconds and now it is willing to sent data at a very high speed
for another 10 seconds, the total data transmission will be divided into 20 seconds and
average data rate will be maintained. The host is having no advantage of sitting idle
for 10 seconds.
 • To overcome this problem, a token bucket algorithm is used. A token bucket
algorithm allows bursty data transfers.
 A token bucket algorithm is a modification of leaky bucket in which leaky bucket
contains tokens.
 • In this algorithm, a token(s) are generated at every clock tick. For a packet to be
transmitted, system must remove token(s) from the bucket.
 • Thus, a token bucket algorithm allows idle hosts to accumulate credit for the future in
form of tokens.
IP Addressing:

 Please refer course pack


Subnetting

 Subnetting is the strategy used to


partition a single physical network into
more than one smaller logical sub-
networks (subnets).
IP Addressing :
Internet Protocol (IP)
The Internet Protocol (IP) is a protocol, or set of rules,
for routing and addressing packets of data so that they
can travel across networks and arrive at the correct
destination. Data traversing the Internet is divided into
smaller pieces, called packets. IP information is
attached to each packet, and this information helps
routers to send packets to the right place. Every device
or domain that connects to the Internet is assigned an
IP address, and as packets are directed to the IP
address attached to them, data arrives where it is
needed.
 The length of datagram is variable.
 The Datagram is divided into two parts: header and data.
 The length of header is 20 to 60 bytes.
 The header contains information for routing and delivery of the packet.
User Datagram Protocol (UDP)

 Like IP, UDP is connectionless and unreliable protocol. It doesn’t require making a
connection with the host to exchange data. Since UDP is unreliable protocol, there
is no mechanism for ensuring that data sent is received.

 UDP transmits the data in form of a datagram. The UDP datagram consists of five
parts as shown in the following diagram:
Transmission Control Protocol (TCP)
 TCP is a connection oriented protocol and offers end-to-end packet delivery. It acts
as back bone for connection. It exhibits the following key features:
 Transmission Control Protocol (TCP) corresponds to the Transport Layer of OSI
Model.
 TCP is a reliable and connection oriented protocol.
 TCP offers:
 Stream Data Transfer.
 Reliability.
 Efficient Flow Control
 Full-duplex operation.
 Multiplexing.
 TCP offers connection oriented end-to-end packet delivery.
 TCP Services
 Stream Deliver Service
 TCP protocol is stream oriented because it allows the sending process to send data as
stream of bytes and the receiving process to obtain data as stream of bytes.
 Sending and Receiving Buffers
 It may not be possible for sending and receiving process to produce and obtain data
at same speed, therefore, TCP needs buffers for storage at sending and receiving
ends.
 Bytes and Segments
 The Transmission Control Protocol (TCP), at transport layer groups the bytes into a
packet. This packet is called segment. Before transmission of these packets, these
segments are encapsulated into an IP datagram.
 Connection Oriented Service
 TCP offers connection oriented service in the following manner:
 TCP of process-1 informs TCP of process – 2 and gets its approval.
 TCP of process – 1 and TCP of process – 2 and exchange data in both the two
directions.
 After completing the data exchange, when buffers on both sides are empty, the two
TCP’s destroy their buffers.
Trivial File Transfer Protocol (TFTP)

 Trivial File Transfer Protocol is also used to transfer the files but it transfers
the files without authentication. Unlike FTP, TFTP does not separate control and
data information. Since there is no authentication exists, TFTP lacks in security
features therefore it is not recommended to use TFTP.
 Key points
 TFTP makes use of UDP for data transport. Each TFTP message is carried in
separate UDP datagram.
 The first two bytes of a TFTP message specify the type of message.
 The TFTP session is initiated when a TFTP client sends a request to upload or
download a file.
S.N. Parameter FTP TFTP

1 Operation Transferring Transferring


Files Files

2 Authenticatio Yes No
n

3 Protocol TCP UDP

4 Ports 21 – Control, Port 3214, 69,


20 – Data 4012

5 Control and Separated Separated


Data

6 Data Transfer Reliable Unreliable


Internet Control Protocol

 The ICMP stands for Internet Control Message


Protocol. It is a network layer protocol. It is
used for error handling in the network layer,
and it is primarily used on network devices
such as routers. As different types of errors
can exist in the network layer, so ICMP can be
used to report these errors and to debug
those errors.
IGMP

 stands for Internet Group Management


Protocol. It is a protocol that allows
several devices to share one IP address
so they can all receive the same data.
IGMP is a network layer protocol used to
set up multicasting on networks that use
the Internet Protocol version 4 (IPv4).
Specifically, IGMP allows devices to join
a multicast group.
Mobile Internet Protocol (or Mobile IP)

 Mobile IP is a communication protocol (created by extending


Internet Protocol, IP) that allows the users to move from one
network to another with the same IP address.
 It ensures that the communication will continue without user’s
sessions or connections being dropped. This is an IETF
(Internet Engineering Task Force) standard communications
protocol designed to allow mobile devices' (such as laptop,
PDA, mobile phone, etc.) users to move from one network
 to another while maintaining their permanent IP (Internet
Protocol) address.
IPIV and IPV6

 IPv4 produces 4 billion addresses,. IPv6 is the next


generation of IP addresses. The main difference
between IPv4 and IPv6 is the address size of IP
addresses. The IPv4 is a 32-bit address, whereas
IPv6 is a 128-bit hexadecimal address. IPv6 provides
a large address space, and it contains a simple
header as compared to IPv4.
Ipv4 Ipv6

Address length IPv4 is a 32-bit address. IPv6 is a 128-bit address.

Fields IPv4 is a numeric address that consists of 4 fields IPv6 is an alphanumeric address that consists of 8
which are separated by dot (.). fields, which are separated by colon.

Classes IPv4 has 5 different classes of IP address that IPv6 does not contain classes of IP addresses.
includes Class A, Class B, Class C, Class D, and
Class E.

Number of IP address IPv4 has a limited number of IP addresses. IPv6 has a large number of IP addresses.

VLSM It supports VLSM (Virtual Length Subnet Mask). It does not support VLSM.
Here, VLSM means that Ipv4 converts IP
addresses into a subnet of different sizes.

Address configuration It supports manual and DHCP configuration. It supports manual, DHCP, auto-configuration, and
renumbering.

Address space It generates 4 billion unique addresses It generates 340 undecillion unique addresses.

End-to-end connection integrity In IPv4, end-to-end connection integrity is In the case of IPv6, end-to-end connection integrity
unachievable. is achievable.

Security features In IPv4, security depends on the application. This In IPv6, IPSEC is developed for security purposes.
IP address is not developed in keeping the security
feature in mind.

You might also like