CN CS-602 Unit-IV 1707930228
CN CS-602 Unit-IV 1707930228
Syllabus: Network Layer: Need, Services Provide, Design Issues, Routing Algorithms: Least Cost Routing
Algorithm, Dijkstra's Algorithm, Bellman-ford Algorithm, Hierarchical Routing, Broadcast Routing,
Multicast Routing. IP Addresses, Header Format, Packet Forwarding, Fragmentation and Reassembly,
ICMP, Comparative Study of IPv4 & IPv6.
There are two types of service that can be provided by the network layer:
An unreliable connectionless service.
A connection-oriented, reliable or unreliable, service.
Network Layer: Design Issues:
a) Store-and-Forward Packet Switching
b) Services Provided to the Transport Layer
c) Implementation of Connectionless Service
d) Implementation of Connection-Oriented Service
a) Store-and-Forward Packet Switching:
A host with a packet to send transmits it to the nearest router, either on its own LAN or over a point-to-
point link to the carrier. The packet is stored there until it has fully arrived so the checksum can be verified.
Then it is forwarded to the next router along the path until it reaches the destination host, where it is
delivered. This mechanism is store-and-forward packet switching.
Fig. 4.2 Store and Forward Packet Switching
b) Services Provided to the Transport Layer:
The network layer services have been designed with the following goals:
The services should be independent of the router technology.
The transport layer should be shielded from the number, type, and topology of the routers present.
The network addresses should be made available to the transport with a uniform numbering plan, even
across LANs and WANs.
2.Non-Adaptive Routing Algorithm: These algorithms do not base their routing decisions on
measurements and estimates of the current traffic and topology. Instead the route to be taken in going
from one node to the other is computed in advance, off-line, and downloaded to the routers when the
network is booted. This is also known as static routing. This can be further classified as follows:
1. Flooding: Flooding adapts the technique in which every incoming packet is sent on every outgoing line
except the one on which it arrived. One problem with this method is that packets may go in a loop. As a
result of this a node may receive several copies of a particular packet which is undesirable. Some
techniques adapted to overcome these problems are as follows:
Sequence Numbers: Every packet is given a sequence number. When a node receives the packet it sees
its source address and sequence number. If the node finds that it has sent the same packet earlier then it
will not transmit the packet and will just discard it.
Hop Count: Every packet has a hop count associated with it. This is decremented (or incremented) by
one by each node which sees it. When the hop count becomes zero (or a maximum possible value) the
packet is dropped.
Spanning Tree: The packet is sent only on those links that lead to the destination by constructing a
spanning tree routed at the source. This avoids loops in transmission but is possible only when all the
intermediate nodes have knowledge of the network topology.
2. Random Walk: In this method a packet is sent by the node to one of its neighbours randomly. This
algorithm is highly robust. When the network is highly interconnected, this algorithm has the property of
making excellent use of alternative routes. It is usually implemented by sending the packet onto the least
queued link.
Fig. 4.5 (a) Subnet (b) Sink Tree for Router (b)
Shortest Path Algorithm (Least Cost Routing Algorithm):
In the path length between each node is measured as a function of distance, Bandwidth, average traffic,
communication cost, mean queue length, measured delay.
By changing the weighing function, the algorithm then computes the shortest path measured according
to any one of a number of criteria or a combination of criteria.
Each node of graph representing a router and each arc of the graph representing a communication link.
Each link has a cost associated with it.
A graph G is:
G= (N, E), Where N: nodes that represent routers, Where E: edges that represent physical links.
Each edge has a value representing its cost.
Find a path between the source and destination that has least cost.
Two algorithms for computing the shortest path between two nodes of a graph are:-
1. Dijkstra’s Algorithm 2. Bellman-Ford Algorithm
Dijkstra's Algorithm:
Compute the least cost path from one node to all other nodes in the network.
Iterative algorithm - After the kth iteration, the least cost paths for k destination nodes are found.
D(v): cost of the least cost path from source node to destination v
p(v): previous node of v along the least-cost path from source.
N’: set of nodes to which the least-cost path is found.
Hierarchical Routing:
As the number of routers becomes large, the overhead involved in maintaining routing information
becomes prohibitive.
Internet providers want to manage their network as they wish, while still being able to connect to other
networks.
Routing within the same AS (Autonomous System) is called “Intra-domain” routing.
One or more routers in an AS (Autonomous System) are responsible to forward packets to destinations
outside AS.
Inter-AS routing protocol: – Obtain reachability information from neighbouring ASs, and Propagate the
reachability information to all routers in AS.
Routing between two different AS (Autonomous System) is called, “Inter-domain” routing.
Multicast Routing:
Multicast routing is special case of broadcast routing with significance difference and challenges. In
broadcast routing, packets are sent to all nodes even if they do not want it. But in Multicast routing, the
data is sent to only nodes which wants to receive the packets.
IPV4 Header:
IPV6 Header:
Packet forwarding:
Packet forwarding is the basic method for sharing information across systems on a network. Packets are
transferred between a source interface and a destination interface, usually on two different systems.
When you issue a command or send a message to a nonlocal interface, your system forwards those
packets onto the local network.
The interface with the destination IP address that is specified in the packet headers then retrieves the
packets from the local network. If the destination address is not on the local network, the packets are then
forwarded to the next adjacent network, or hop.