3. Introduction
Dr. K. Adisesha
3
Network Layer:
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.
➢ The Internet Protocol (IP) is one of the main protocols used at this layer, along with
several other protocols for routing, testing, and encryption
4. Introduction
Dr. K. Adisesha
4
Network Layer Design Issues:
The "network layer" is the part of the Internet communications process where these
connections occur, by sending packets of data back and forth between different
networks..
➢ The designers who are concerned with designing this layer needs to cater to certain
issues.
➢ The design issues can be elaborated under four heads −
❖ Store − and − Forward Packet Switching
❖ Services to Transport Layer
❖ Providing Connection Oriented Service
❖ Providing Connectionless Service
5. Design Issues
Dr. K. Adisesha
5
Store − and − Forward Packet Switching:
The network layer operates in an environment that uses 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.”
6. Design Issues
Dr. K. Adisesha
6
Services to Transport Layer:
Through the network/transport layer interface, the network layer transfers it’s services
to the transport layer.
➢ The transport layer needs to be protected from the type, number and topology of the
available router.
➢ The network addresses for the transport layer should use uniform numbering pattern
also at LAN and WAN connections.
➢ Based on the connections there are 2 types of services provided :
❖ 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.
7. Network Layer
Dr. K. Adisesha
7
Network Layer Functions:
The main functions performed by the network layer are:.
➢ Logical Addressing: The data link layer implements the physical addressing and
network layer implements the logical addressing. The network layer adds a header to
the packet which includes the logical addresses of both the sender and the receiver.
➢ Routing: When a packet reaches the router's input link, the router will move the
packets to the router's output link.
➢ Internetworking: This is the main role of the network layer that it provides the logical
connection between different types of networks.
➢ Fragmentation: The fragmentation is a process of breaking the packets into the
smallest individual data units that travel through different networks.
8. Network Layer
Dr. K. Adisesha
8
Network Addressing:
Network Addressing is one of the major responsibilities of the network layer. Network
addresses are always logical, i.e., software-based addresses.
➢ A host is also known as end system that has one link to the network.
➢ An IP address is 32-bit long. An IP address is divided into sub-classes:
❖ Class A
❖ Class B
❖ Class C
❖ Class D
❖ Class E
9. Network Layer
Dr. K. Adisesha
9
Routing:
Routing is the process of moving data from one device to another device. These are two
other services offered by the network layer.
➢ In Network layer, a router is used to forward the packets from the source to the
destination.
➢ The network layer specifies some strategies which find out the best possible route.
➢ The routing algorithm determines the values that are inserted in the forwarding table.
➢ The routing algorithm can be centralized or decentralized.
➢ A router forwards a packet by examining a packet's header field and then using the
header field value to index into the forwarding table.
10. Network Layer Routing
Dr. K. Adisesha
10
Routing:
When a device has multiple paths to reach a destination, it always selects one path by
preferring it over others. This selection process is termed as Routing.
➢ In a network, there are a number of routes available from the source to the destination.
➢ Routing is the process of moving data from
one device to another device.
➢ The routing algorithm determines the values
that are inserted in the forwarding table.
➢ The routing algorithm can be centralized or
decentralized.
11. Network Layer Routing
Dr. K. Adisesha
11
Routing Algorithm:
Properties of Routing Algorithm:
➢ Correctness: The routing algorithm should be correct enough to deliver the right packet to the
right destination.
➢ Simplicity: It should be simple enough to implement and also to manipulate.
➢ Robustness: It should be robust enough to adapt to the situation in which the desired path is
congested.
➢ Stability: The routing algorithm should come to equilibrium after running a certain amount of
time and after accommodating the changes in the network.
➢ Fairness: The routing algorithm should be fair to all the hosts in delivering the data sent by
them. Although some situations may require non-fairness to implement optimality.
➢ Optimality: To achieve efficient routing one or more of the metrics should be optimized. The
metric may be the number of hops, delay bandwidth etc.
12. Network Layer Routing
Dr. K. Adisesha
12
Routing:
A router is always configured with some default route which tells the router where to
forward a packet if there is no route found for specific destination.
➢ Routes can be statically configured or dynamically learnt and route can be configured
to be preferred over others.
➢ In case there are multiple path existing to reach the same destination, router can make
decision based on the following information.
❖ Hop Count
❖ Bandwidth
❖ Metric
❖ Prefix-length
❖ Delay
13. Network Layer Routing
Dr. K. Adisesha
13
Routing Algorithm:
In order to transfer the packets from source to the destination, the network layer must
determine the best route through which packets can be transmitted.
➢ The routing protocol is a routing algorithm that provides the best path from the source
to the destination.
➢ The best path is the path that has the "least-cost path" from source to the destination.
➢ The Routing algorithm is divided into two categories:
❖ Adaptive Routing algorithm
❖ Non-adaptive Routing algorithm
14. Network Layer Routing
Dr. K. Adisesha
14
Adaptive Routing algorithm:
This algorithm makes the routing decisions based on the topology and network traffic.
➢ An adaptive routing algorithm is also known as dynamic routing algorithm.
➢ An adaptive routing algorithm can be classified into three parts:
❖ Centralized algorithm: It is also known as global routing algorithm as it computes the
least-cost path between source and destination by using complete and global knowledge
about the network.
❖ Isolation algorithm: It is an algorithm that obtains the routing information by using local
information rather than gathering information from other nodes.
❖ Distributed algorithm: It is also known as decentralized algorithm as it computes the
least-cost path between source and destination in an iterative and distributed manner.
15. Network Layer Routing
Dr. K. Adisesha
15
Non-Adaptive Routing algorithm:
Non Adaptive routing algorithm is also known as a static routing algorithm. When
booting up the network, the routing information stores to the routers.
➢ Non Adaptive routing algorithms do not take the routing decision based on the
network topology or network traffic.
➢ The Non-Adaptive Routing algorithm is of two types:
➢ Flooding: In case of flooding, every incoming packet is sent to all the outgoing links except
the one from it has been reached. The disadvantage of flooding is that node may contain
several copies of a particular packet.
➢ Random walks: In case of random walks, a packet sent by the node to one of its neighbors
randomly. An advantage of using random walks is that it uses the alternative routes very
efficiently.
16. Network Layer Routing
Dr. K. Adisesha
16
Distance Vector Routing Algorithm:
The Distance vector algorithm is a dynamic algorithm. It is mainly used in ARPANET.
➢ Each router maintains a distance table known as Vector.
➢ The Distance vector algorithm is iterative, asynchronous and distributed.
❖ Distributed: It is distributed in that each node receives information from one or more of
its directly attached neighbors, performs calculation and then distributes the result back to
its neighbors.
❖ Iterative: It is iterative in that its process continues until no more information is available
to be exchanged between neighbors.
❖ Asynchronous: It does not require that all of its nodes operate in the lock step with each
other.
17. Network Layer Routing
Dr. K. Adisesha
17
Distance Vector Routing Algorithm:
Routing decision in networks, are mostly taken on the basis of cost between source and
destination. Hop count plays major role here.
➢ Shortest path is a technique which uses various algorithms to decide a path with
minimum number of hops.
➢ Common shortest path algorithms are:
❖ Dijkstra's algorithm
❖ Bellman Ford algorithm
❖ Floyd Warshall algorithm
18. Network Layer Routing
Dr. K. Adisesha
18
Distance Vector Routing Algorithm:
Distance vector routing is an asynchronous algorithm in which node x sends the copy
of its distance vector to all its neighbors.
➢ In Distance vector routing, the cost is based on hop count.
➢ With the Distance Vector Routing algorithm, the node x contains the following routing
information:
❖ For each neighbor v, the cost c(x,v) is the path cost from x to directly attached neighbor, v.
❖ The distance vector x, i.e., Dx = [ Dx(y) : y in N ], containing its cost to all destinations, y,
in N.
❖ The distance vector of each of its neighbors, i.e., Dv = [ Dv(y) : y in N ] for each neighbor
v of x.
❖ The equation is given below: dx(y) = minv{ c(x,v) + dv(y)} for each node y in N
19. Network Layer Routing
Dr. K. Adisesha
19
Hierarchical Routing Algorithm:
In hierarchical routing, the routers are divided into regions. Each router has complete
details about how to route packets to destinations within its own region.
➢ This is essentially a 'Divide and Conquer' strategy.
➢ Thus, the network is viewed at two levels:
❖ The Sub-network level, where each node in a region has information about its peers in the
same region and about the region's interface with other regions. Different regions may
have different 'local' routing algorithms.
❖ The Network Level, where each region is considered as a single node connected to its
interface nodes. The routing algorithms at this level handle the routing of packets between
two interface nodes, and is isolated from intra-regional transfer.
20. Network Layer Routing
Dr. K. Adisesha
20
Hierarchical Routing Algorithm:
In hierarchical routing, the routers are divided into regions. Each router has complete
details about how to route packets to destinations within its own region.
➢ Networks can be organized in hierarchies of many levels; e.g. local networks of a city
at one level, the cities of a country at a level above it, and finally the network of all
nations.
➢ Example – City, State, Country, Continent.
➢ In Hierarchical routing, the interfaces need to store information about:
❖ All nodes in its region which are at one level below it.
❖ Its peer interfaces.
❖ At least one interface at a level above it, for outgoing packages.
21. Network Layer Routing
Dr. K. Adisesha
21
Link State Routing:
Link state routing is a technique in which each router shares the knowledge of its
neighborhood with every other router in the internetwork.
➢ The three keys to understand the Link State Routing algorithm:
❖ Knowledge about the neighborhood: 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 neighbors. Every router that receives the packet sends the copies to all its
neighbors.
❖ Information sharing: A router sends the information to every other router only when the
change occurs in the information.
22. Network Layer Routing
Dr. K. Adisesha
22
Link State Routing:
Link state routing is a technique in which each router shares the knowledge of its
neighborhood with every other router in the internetwork.
➢ Link State Routing has two phases:
➢ Reliable Flooding
❖ Initial state: Each node knows the cost of its neighbors.
❖ Final state: Each node knows the entire graph.
➢ Route Calculation : Each node uses Dijkstra's algorithm on the graph to calculate the
optimal routes to all nodes.
➢ The Link state routing algorithm is also known as Dijkstra's algorithm which is used to find
the shortest path from one node to every other node in the network.
➢ The Dijkstra's algorithm is an iterative, and it has the property that after kth iteration of the
algorithm, the least cost paths are well known for k destination nodes.
23. Network Layer Routing
Dr. K. Adisesha
23
Link State Routing:
Link state routing is a technique in which each router shares the knowledge of its
neighborhood with every other router in the internetwork.
➢ Link State Routing has two phases:
➢ Reliable Flooding
❖ Initial state: Each node knows the cost of its neighbors.
❖ Final state: Each node knows the entire graph.
➢ Route Calculation : Each node uses Dijkstra's algorithm on the graph to calculate the
optimal routes to all nodes.
➢ The Link state routing algorithm is also known as Dijkstra's algorithm which is used to find
the shortest path from one node to every other node in the network.
➢ The Dijkstra's algorithm is an iterative, and it has the property that after kth iteration of the
algorithm, the least cost paths are well known for k destination nodes.
24. Network Congestion
Dr. K. Adisesha
24
Network Congestion:
A state occurring in network layer when the message traffic is so heavy that it slows
down network response time.
➢ Congestion means the load is greater than the resources available over a network to handle
➢ Effects of Congestion:
❖ As delay increases, performance decreases.
❖ If delay increases, retransmission occurs, making situation worse.
➢ Congestion control: is a mechanism that controls the entry of data packets into the network,
enabling a better use of a shared network infrastructure and avoiding congestive collapse.
➢ There are two congestion control algorithm which are as follows:
❖ Leaky Bucket Algorithm
❖ Token bucket Algorithm
25. Network Congestion
Dr. K. Adisesha
25
Leaky Bucket Algorithm:
The leaky bucket algorithm discovers its use in the context of network traffic shaping or
rate-limiting.
➢ Imagine a bucket with a small hole in the bottom, no matter at what rate water enters
the bucket, the outflow is at constant rate.
➢ A leaky bucket execution and a token bucket execution are
predominantly used for traffic shaping algorithms.
➢ This algorithm is used to control the rate at which traffic is sent to
the network and shape the burst traffic to a steady traffic stream.
➢ The large area of network resources such as bandwidth is not being
used effectively.
26. Network Congestion
Dr. K. Adisesha
26
Token bucket Algorithm:
In the token bucket, algorithm tokens are generated at each tick for an incoming packet
to be transmitted, it must capture a token and the transmission takes place at the same
rate.
➢ It is a control algorithm that indicates when traffic should be sent. This order comes based on
the display of tokens in the bucket.
➢ The bucket contains tokens. Each of the tokens defines a packet of
predetermined size. Tokens in the bucket are deleted for the ability to
share a packet.
➢ When tokens are shown, a flow to transmit traffic appears in the display
of tokens.
➢ No token means no flow sends its packets. Hence, a flow transfers
traffic up to its peak burst rate in good tokens in the bucket.
27. Network Congestion
Dr. K. Adisesha
27
Admission Control:
It is one of techniques that is widely used in virtual-circuit networks to keep congestion
at bay.
➢ The idea is do not set up a new virtual circuit unless the network can carry the added
traffic without becoming congested.
➢ Admission control can also be combined with traffic aware routing by considering
routes around traffic hotspots as part of the setup procedure.
➢ Example: Take two networks
❖ (a) A congestion network
❖ (b) The portion of the network that is not congested.
➢ A virtual circuit A to B is also shown −