SlideShare a Scribd company logo
The Network Layer
Unit-III
OSI Reference
Model
The OSI Reference Model
a) OSI stands for Open Systems Interconnection. It has been
developed by ISO – ‘International Organization of
Standardization‘, in the year 1984. It is a 7 layer architecture with
each layer having specific functionality to perform. All these 7
layers work collaboratively to transmit the data from one person to
another across the globe.
7
Layers
a) 7.Application Layer
b) 6. Presentation Layer
c) 5. Session Layer
d) 4. Transport Layer
e) 3. Network Layer
f) 2. Data Link Layer
g) 1. Physical Layer
All
People
Seem
To
Need
Data
Processing
Unit-3-Part-1 [Autosaved].ppt
The interaction between layers in the OSI
model
Unit-3-Part-1 [Autosaved].ppt
Application layer : The application layer is responsible for providing
services to the user . It serves as a window for users and application
processes to access network service. It contains a variety of protocols that
are commonly needed by users. (HTTP,SMTP)
Presentation Layer: A Presentation layer is mainly concerned with the
syntax and semantics of the information exchanged between the two
systems. It acts as a data translator for a network.
This layer handles the interoperability between the different encoding
methods. It converts the data from sender-dependent format into a common
format and changes the common format into receiver-dependent format at
the receiving end.
Session Layer : The Session layer is used to establish, maintain and
synchronizes the interaction between communicating devices.
It Establishes a connection between two processes and adds some
checkpoints when transmitting the data in a sequence. This process is
known as Synchronization and recovery.
Transport Layer :The main responsibility of the transport layer is to
transfer the data completely. This layer can be termed as an end-to-end
layer as it provides a point-to-point connection between source and
destination to deliver the data reliably.
No duplication of data and also provides acknowledgement of data
transfer
Network Layer : Network layer works for the transmission of data
from one host to the other located in different networks.
It also takes care of packet routing i.e. selection of the shortest path to
transmit the packet, from the number of routes available
Data Link Layer : The data link layer translates the physical's raw bit
stream into packets known as Frames. This layer is responsible for the
error-free transfer of data frames. It defines the format of the data on
the network.
Physical Layer : The lowest layer of the OSI reference model is the
physical layer.
It is responsible for the actual physical connection between the devices.
The physical layer contains information in the form of bits.
It is responsible for transmitting individual bits from one node to the
next.
3. Network Layer (Layer 3) :
 Network layer works for the transmission of data from one host to the other
located in different networks.
 It also takes care of packet routing i.e. selection of the shortest path to transmit
the packet, from the number of routes available.
 The sender & receiver’s IP address are placed in the header by the network layer.
a) The functions of the Network layer are :
1. Routing: The network layer protocols determine which route is
suitable from source to destination. This function of network layer
is known as routing.
2. Logical Addressing: In order to identify each device on
internetwork uniquely, network layer defines an addressing
scheme.
3. The sender & receiver’s IP address are placed in the header by
network layer. Such an address distinguishes each device
uniquely and universally.
Network Layer Design Isues
• Store-and-Forward Packet Switching
• Services Provided to the Transport Layer
• Implementation of Connectionless Service
• Implementation of Connection-Oriented Service
• Comparison of Virtual-Circuit and Datagram Subnets
Store-and-Forward Packet Switching
The environment of the network layer protocols.
fig 5-1
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.
Services Provided to the Transport Layer
1. The service should be independent of the router technology.(services
may be connection less or connection oriented)
2. The transport layer should be shielded from the number, type, and
topology of the routers present.(i.e. unnecessary to the transport
layer)
3. The network addresses made available to the transport layer should
use a uniform numbering plan, even across LANs and WANs.
Implementation of Connectionless Service
Routing within a datagram subnet.
Destination outgoing line
Implementation of Connectionless Service
• In this packets are injected into the subnet individually and routed
independently of each other.
• In this context, the packets are frequently called
datagrams and the subnet is called as datagram subnet
Implementation of Connection-Oriented Service
Routing within a virtual-circuit subnet.
Implementation of Connection-Oriented Service
• In connection-oriented service a path from the source router to the
destination router must be established before any data packets can
be sent.
• This connection is called a VC (virtual circuit), in analogy with the
physical circuits set up by the telephone system, and the subnet is
called a virtual-circuit subnet.
Comparison of Virtual-Circuit and
Datagram Subnets
5-4
Routing Algorithms
• The Optimality Principle
• Shortest Path Routing
• Flooding
• Distance Vector Routing
• Link State Routing
• Hierarchical Routing
• Broadcast Routing
• Multicast Routing
• Routing for Mobile Hosts
• Routing in Ad Hoc Networks
Routing Algorithms
The routing algorithm is that part of the network layer software responsible
for deciding which output line an incoming packet should be transmitted.
• If the subnet uses datagrams internally, this decision must be made anew for
every arriving data packet since the best route may have changed since last time.
• If the subnet uses virtual circuits internally, routing decisions are made only when
a new virtual circuit is being set up. Thereafter, data packets just follow the
previously-established route.
• The latter case is sometimes called session routing because a route remains
in force for an entire user session (e.g., a login session at a terminal or a file
transfer).
The properties desirable in a routing algorithm are:
1. Correctness.
2. Simplicity.
3. Robustness.
4. Stability.
5. Fairness.
6. Optimality.
Routing Algorithms (2)
Conflict between fairness and optimality.
The Optimality Principle
(a) A subnet. (b) A sink tree for router B.
The Optimality Principle
• Optimality principle : it states that if router J is on the optimal path from
router I to router K, then the optimal path from J to K also falls along the
same route.
• The set of optimal routes from all sources to a given destination form a
tree rooted at the destination. Such a tree is called a sink tree.
• The sink tree not necessarily be unique, other trees with the same path
lengths may exists.
• The goal of all routing algorithms is to discover and use the sink tree for
all routers.
• Since a sink tree is indeed a tree, it does not contain any loops, so each
packet will be delivered within a finite and bounded number of hops.
» X y
» I
A
C
B
Types of Routing Algorithms
• Nonadaptive (static)
– Do not use measurements of current conditions
– Static routes are downloaded at boot time
• Adaptive Algorithms
– Change routes dynamically
• Gather information at runtime
– locally
– from adjacent routers
– from all other routers
• Change routes
– Every delta T seconds
– When load changes
– When topology changes
• Find the shortest path from a specified source to all other
destinations in the network.
• Given a network topology and a set of weights
describing the cost to send data across each link in the
network
• Shortest path algorithm first developed by E. W. Dijkstra
Shortest Path Routing
(a nonadaptive routing algorithm)
Shortest Path Routing
• Dijkstra (1959) shortest path alg. Between two nodes.
• Each node is labelled (in parenthesis) with its distance from the sourse node
along the best known path.
• Initially, no paths are known , so
Shortest Path Routing
(a nonadaptive routing algorithm)
Mark the source node as permanent.
Designate the source node as the working node.
Set the tentative distance to all other nodes to infinity.
While some nodes are not marked permanent
Compute the tentative distance from the source to all nodes
adjacent to the working node. If this is shorter than the
current tentative distance replace the tentative distance of
the destination and record the label of the working node
there.
Examine ALL tentatively labeled nodes in the graph.
Select the node with the smallest value and make it the new
working node. Designate the node permanent.
Shortest Path Routing
• Each node is labeled (in parentheses) with its distance from the
source node along the best known path.
• Initially, no paths are known, so all nodes are labeled with infinity.
As the algorithm proceeds and paths are found, the labels may
change, reflecting better paths.
• A label may be either tentative or permanent.
• Initially, all labels are tentative.
• When it is discovered that a label represents the shortest possible
path from the source to that node, it is made permanent and never
changed thereafter.
Shortest Path Routing
• We want to find the shortest path from A to D.
• We start out by marking node A as permanent, indicated by a filled-in
circle.
• Then we examine, in turn, each of the nodes adjacent to A (the working
node), relabeling each one with the distance to A.
• Whenever a node is relabeled, we also label it with the node from which
the probe was made so that we can reconstruct the final path later.
• Having examined each of the nodes adjacent to A, we examine all the
tentatively labeled nodes in the whole graph and make the one with the
smallest label permanent, This one becomes the new working node.
• We now start at B and examine all nodes adjacent to it. If the sum of the label on B
and the distance from B to the node being considered is less than the label on that
node, we have a shorter path, so the node is relabeled.
• After all the nodes adjacent to the working node have been inspected and the
tentative labels changed if possible, the entire graph is searched for the tentatively-
labeled node with the smallest value. This node is made permanent and becomes the
working node for the next round.
Example of Shortest Path Routing
(2,A)
(10,F)
(4,B) (6,E)
(8,F)
A
E
B
F
H
D
Dijkstra's algorithm
Dijkstra's algorithm to compute the shortest path through a graph.
5-8 top
Dijkstra's algorithm to compute the shortest path through a graph.
5-8
bottom
Dijkstra's algorithm
– Flooding :Every incoming packet is sent on every
outgoing line except the one it is arrived.
– Always finds the shortest path quickly
– Also finds many long paths
It generates vast number of duplicate packets. In fact an
infinite number .
Measures need to take to damp the process.
One such measure is to have a HOP Counter contained
in the header of each packet. The hop counter values
get decremented at each hop moving forwarded and
packets discarded when it becomes zero
Ideally ,hop counter should initialize to the length of
the path from source to destination.
Flooding
(a nonadaptive routing algorithm)
2. Sequence numbering to the packets:
It avoids sending the same packet
1---x
2 2---x 1 0
0----x
Using hop counter
Sequence numbering
1---x 1--x
1--x 1---x 1---??
A
C
D
B
A
B
D
C
• It is also known as Bellman-Ford Routing
Or Ford Fulkerson Algorithm
• I
Distance Vector Routing
(an adaptive routing algorithm)
• It is also known as Bellman-Ford Routing Or Ford Fulkerson
Algorithm
• Distance vector routing algorithms operate by having each router
maintain a table (i.e, a vector) giving the best known distance to
each destination and which line to use to get there.
• These tables are updated by exchanging information with the
neighbors.
• Routers replace routes in their own routing tables anytime that
neighbors have found better routes.
• The Information of routing table provided from neighbors contains
– Outgoing line used for destination
– Estimate of time or distance
• can be number of hops, time delay, packet queue length, etc.
Distance Vector Routing
(an adaptive routing algorithm)
Distance Vector Routing
(a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.
Routing table for b
B A B A -1 1 9
B C A -8 5 3 2
B-D-E-C-A-20 4
Routing table for b
B C B C -3
B A C -6
B-D-E-C-15
B----D
B--A--C--D—10
B—C—D—7
B—E—D--11
A
C
B
E
D
FROM J LINE TO B
JB— JA+JB—18+12=20
JI+IB—10+36=46
JH+HB—12+31=43
JK+KB—6+28=43
JC— JA+AC—8+25=33
JI+IC—10+18=28
JH+HC—12+19=31
JK+KC—6+36=42
JE- JA+AE=8+14=22
JI+IE=10+7=17
JH+HE=12+30=42
JK+KE=6+22=28
Distance Vector Routing
• Consider how J computes its new route to router G. It knows that it
can get to A in 8 msec, and A claims to be able to get to G in 18 msec,
so J knows it can count on a delay of 26 msec to G if it forwards
packets bound for G to A.
• Similarly, it computes the delay to G via I, H, and K as 41 (31 + 10),
18 (6 + 12), and 37 (31 + 6) msec, respectively.
• The best of these values is 18,
• so it makes an entry in its routing table that the delay to G is 18 msec
• and that the route to use is via H.
• The same calculation is performed for all the other destinations, with
the new routing table shown in the last column of the figure.
Distance Vector Routing (2)
The count-to-infinity problem.
Distance Vector Routing- The Count to infinity Problem
• Distance vector routing works in theory but has a serious drawback
in practice: It reacts rapidly to good news, but leisurely to bad news.
• To see how fast good news propagates, consider the five-node
(linear) subnet of fig (a),
• where the delay metric is the number of hops. Suppose A is down
initially and all the other routers know this. In other words, they
have all recorded the delay to A as infinity.
• When A comes up, the other routers learn about it via the vector
exchanges.
• At the time of the first exchange,
• B learns that its left neighbor has zero delay to A. B now makes an
entry in its routing table that A is one hop away to the left. All the
other routers still think that A is down.
Link State Routing
Each router must do the following five steps:
1. Discover its neighbors, learn their network address.
2. Measure the delay or cost to each of its neighbors.
3. Construct a packet telling all it has just learned.
4. Send this packet to all other routers.
5. Compute the shortest path to every other router.
1). Discovering Your Neighbors
a) Send “Hello” packet on each point-to-point line. Destination node
replies with its address.
Learning about the Neighbors
(a) Nine routers and a LAN. (b) A graph model of (a).
2.) Measuring Line Cost
 Send an “ECHO” packet over the line.
 Destination is required to respond to “ECHO” packet
immediately.
 Measure the time required for this operation.
 Question: Should we measure just the time it takes to
transmit the packet, or should we include the time that
the packet waits in the queue?
Argument 2:
• We should include the time that the packet spends in the queue, as
this provides a more accurate picture of the real delays.
• We should only include the transmission times, otherwise the
network is likely to oscillate between preferred paths.
• If only band width is considered (load is ignored), this problem does
not occur.
• To avoid oscillations in the choice of best path, it may be wise to
distribute the load over multiple lines, with some known fraction
going over each line.
Measuring Line Cost
A subnet in which the East and West parts are connected by two lines.
Building Link State Packets
(a) A subnet. (b) The link state packets for this subnet.
Distributing the Link State Packets
• Use selective flooding
• Sequence numbers prevent duplicate packets from being propagated
• Lower sequence numbers are rejected as obsolete
• This algorithm has few problems, but manageable.
• First: If the sequence number wrap around, (use 32-bit Sequence
Number, one link per second, it would take 137 years to wrap
around.).
• Second: If a router ever crashes, it will lose track of its Sequence
Number. If its starts again at 0 , the next packet will be rejected as a
duplicate.
• Third: if a sequence number is ever corrupted.
 The solution to all these problems is to indicate age of each packet
after the sequence number and decrement it once per second. When
the age hits zero , the information from the router is discarded.
Distributing the Link State Packets
The packet buffer for router B in the previous slide (Fig. 5-13).
Computing the New Routes
 Dijkstra’s Shortest Path algorithm is used to determine the shortest
path to each destination.
Hierarchical Routing
• Addresses the growth of routing tables
• Routers are divided into regions
• Routers know the routes for their own regions only
• Works like telephone routing
• Possible hierarchy
– city, state, country, continent
• Optimal number of levels for an N router subnet is lnN
• It may be required to group the
• Regions into clusters,
• Clusters into zones,
• Zones into groups and so on…
Hierarchical Routing
Hierarchical routing.
Hierarchical Routing
 The full routing table for router 1A has 17 entries.
 When routing has done hierarchically, there are 7-entries.
When a single network becomes very large,
Ex: consider a subnet with 720-routers.
• If there is no hierarchy, each router should need 720-routing table entries.
• If subnet is partitioned into 24-regions of 30-routers each, two level hierarchy. Each
router needs 30-local entries and 23-remote entries for a total of 53-entries.
• If three-level hierarchy is chosen, with 8-clusters, each containing 9-regions of 10-
routers each.
• Each router needs 10-entries for local router, 8-entries for routing to other regons
within its own cluster, and 7-entries for distant clusters. For a total of (10+8+7) 25
entries.
Broadcast Routing
• Sending a packet to all destinations simultaneously is called Broadcasting.
• Many methods are there:
• 1. sourse to simply send a packet to each destination.
• 2. flooding is another method.
• It generates too many packets and consumes too much space.
Multi destination Routing
Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The
tree built by reverse path forwarding.

More Related Content

PPTX
Computer Networks-Network layer Concepts
PPTX
Network Layer
PPTX
Network layer new
PPTX
Network layer
PDF
Network layer (Unit 3) part1.pdf
PPTX
CN-UNIT-3 __Network Layer (2).pptx
PPTX
Computer networks for cse Unit-3 (1).pptx
PDF
4af46e43-4dc7-4b54-ba8b-3a2594bb5269 j.pdf
Computer Networks-Network layer Concepts
Network Layer
Network layer new
Network layer
Network layer (Unit 3) part1.pdf
CN-UNIT-3 __Network Layer (2).pptx
Computer networks for cse Unit-3 (1).pptx
4af46e43-4dc7-4b54-ba8b-3a2594bb5269 j.pdf

Similar to Unit-3-Part-1 [Autosaved].ppt (20)

PPT
Network Layer
PPTX
Module 3 Part B - computer networks module 2 ppt
PPTX
Network Layer
PDF
Computer Network Unit IV - Lecture Notes - Network Layer
PPT
Network Layer,Computer Networks
PPTX
NETWORK LAYER PRESENTATION IP ADDRESSING UNIT-3.pptx
PDF
CN R16 -UNIT-5.pdf
PDF
COMPUTER NETWORKS CHAPTER 3 NETWORK LAYER NOTES CSE 3RD year sem 1
PDF
Ip protocol tedting
 
PPT
Network layer
PPTX
Chapter_4_V7.01 Network Layer Batch 3.pptx
PPT
NETWORK LAYER.ppt
PPT
network layer full chapter_ready.ppt
PPT
destination. The network layer must know the topology of the subnet and choos...
PPT
Network_Layer.ppt
PPT
routing algorithms in computer Networks.ppt
PPTX
Network software
PPTX
VY NETWORK LAYER 66j6jPART 1 3r324 25.pptx
PPT
routing-Network182912222222222918298181.ppt
PPT
unit3- ppt computer networks - network layer
Network Layer
Module 3 Part B - computer networks module 2 ppt
Network Layer
Computer Network Unit IV - Lecture Notes - Network Layer
Network Layer,Computer Networks
NETWORK LAYER PRESENTATION IP ADDRESSING UNIT-3.pptx
CN R16 -UNIT-5.pdf
COMPUTER NETWORKS CHAPTER 3 NETWORK LAYER NOTES CSE 3RD year sem 1
Ip protocol tedting
 
Network layer
Chapter_4_V7.01 Network Layer Batch 3.pptx
NETWORK LAYER.ppt
network layer full chapter_ready.ppt
destination. The network layer must know the topology of the subnet and choos...
Network_Layer.ppt
routing algorithms in computer Networks.ppt
Network software
VY NETWORK LAYER 66j6jPART 1 3r324 25.pptx
routing-Network182912222222222918298181.ppt
unit3- ppt computer networks - network layer
Ad

More from Ramya Nellutla (17)

PDF
Module -6.pdf Machine Learning Types and examples
PDF
Module 5.pdf Machine Learning Types and examples
PPTX
Unit -3.pptx cloud Security unit -3 notes
PPT
MOBILE SECURITY -UNIT -II PPT IV- PROFESSIONAL ELEFCTIVE
PPTX
Unit-1Mobile Security Notes Mobile Communication
PPT
artificial Intelligence unit1 ppt (1).ppt
PDF
Deep network notes.pdf
PDF
pentration testing.pdf
PPTX
Deep Learning.pptx
PDF
Unit-I PPT.pdf
PDF
- Social Engineering Unit- II Part- I.pdf
PPTX
Datamodels.pptx
PDF
E5-roughsets unit-V.pdf
PPTX
Unit-3.pptx
PDF
Unit-II -Soft Computing.pdf
PPT
SC01_IntroductionSC-Unit-I.ppt
PPTX
- Fuzzy Systems -II.pptx
Module -6.pdf Machine Learning Types and examples
Module 5.pdf Machine Learning Types and examples
Unit -3.pptx cloud Security unit -3 notes
MOBILE SECURITY -UNIT -II PPT IV- PROFESSIONAL ELEFCTIVE
Unit-1Mobile Security Notes Mobile Communication
artificial Intelligence unit1 ppt (1).ppt
Deep network notes.pdf
pentration testing.pdf
Deep Learning.pptx
Unit-I PPT.pdf
- Social Engineering Unit- II Part- I.pdf
Datamodels.pptx
E5-roughsets unit-V.pdf
Unit-3.pptx
Unit-II -Soft Computing.pdf
SC01_IntroductionSC-Unit-I.ppt
- Fuzzy Systems -II.pptx
Ad

Recently uploaded (20)

PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
Geodesy 1.pptx...............................................
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
PDF
Digital Logic Computer Design lecture notes
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
web development for engineering and engineering
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Sustainable Sites - Green Building Construction
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
Geodesy 1.pptx...............................................
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Internet of Things (IOT) - A guide to understanding
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Digital Logic Computer Design lecture notes
Foundation to blockchain - A guide to Blockchain Tech
web development for engineering and engineering
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
CH1 Production IntroductoryConcepts.pptx
Sustainable Sites - Green Building Construction
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx

Unit-3-Part-1 [Autosaved].ppt

  • 3. The OSI Reference Model a) OSI stands for Open Systems Interconnection. It has been developed by ISO – ‘International Organization of Standardization‘, in the year 1984. It is a 7 layer architecture with each layer having specific functionality to perform. All these 7 layers work collaboratively to transmit the data from one person to another across the globe.
  • 4. 7 Layers a) 7.Application Layer b) 6. Presentation Layer c) 5. Session Layer d) 4. Transport Layer e) 3. Network Layer f) 2. Data Link Layer g) 1. Physical Layer All People Seem To Need Data Processing
  • 6. The interaction between layers in the OSI model
  • 8. Application layer : The application layer is responsible for providing services to the user . It serves as a window for users and application processes to access network service. It contains a variety of protocols that are commonly needed by users. (HTTP,SMTP) Presentation Layer: A Presentation layer is mainly concerned with the syntax and semantics of the information exchanged between the two systems. It acts as a data translator for a network. This layer handles the interoperability between the different encoding methods. It converts the data from sender-dependent format into a common format and changes the common format into receiver-dependent format at the receiving end. Session Layer : The Session layer is used to establish, maintain and synchronizes the interaction between communicating devices. It Establishes a connection between two processes and adds some checkpoints when transmitting the data in a sequence. This process is known as Synchronization and recovery.
  • 9. Transport Layer :The main responsibility of the transport layer is to transfer the data completely. This layer can be termed as an end-to-end layer as it provides a point-to-point connection between source and destination to deliver the data reliably. No duplication of data and also provides acknowledgement of data transfer Network Layer : Network layer works for the transmission of data from one host to the other located in different networks. It also takes care of packet routing i.e. selection of the shortest path to transmit the packet, from the number of routes available Data Link Layer : The data link layer translates the physical's raw bit stream into packets known as Frames. This layer is responsible for the error-free transfer of data frames. It defines the format of the data on the network.
  • 10. Physical Layer : The lowest layer of the OSI reference model is the physical layer. It is responsible for the actual physical connection between the devices. The physical layer contains information in the form of bits. It is responsible for transmitting individual bits from one node to the next.
  • 11. 3. Network Layer (Layer 3) :  Network layer works for the transmission of data from one host to the other located in different networks.  It also takes care of packet routing i.e. selection of the shortest path to transmit the packet, from the number of routes available.  The sender & receiver’s IP address are placed in the header by the network layer.
  • 12. a) The functions of the Network layer are : 1. Routing: The network layer protocols determine which route is suitable from source to destination. This function of network layer is known as routing. 2. Logical Addressing: In order to identify each device on internetwork uniquely, network layer defines an addressing scheme. 3. The sender & receiver’s IP address are placed in the header by network layer. Such an address distinguishes each device uniquely and universally.
  • 13. Network Layer Design Isues • Store-and-Forward Packet Switching • Services Provided to the Transport Layer • Implementation of Connectionless Service • Implementation of Connection-Oriented Service • Comparison of Virtual-Circuit and Datagram Subnets
  • 14. Store-and-Forward Packet Switching The environment of the network layer protocols. fig 5-1
  • 15. 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.
  • 16. Services Provided to the Transport Layer 1. The service should be independent of the router technology.(services may be connection less or connection oriented) 2. The transport layer should be shielded from the number, type, and topology of the routers present.(i.e. unnecessary to the transport layer) 3. The network addresses made available to the transport layer should use a uniform numbering plan, even across LANs and WANs.
  • 17. Implementation of Connectionless Service Routing within a datagram subnet. Destination outgoing line
  • 18. Implementation of Connectionless Service • In this packets are injected into the subnet individually and routed independently of each other. • In this context, the packets are frequently called datagrams and the subnet is called as datagram subnet
  • 19. Implementation of Connection-Oriented Service Routing within a virtual-circuit subnet.
  • 20. Implementation of Connection-Oriented Service • In connection-oriented service a path from the source router to the destination router must be established before any data packets can be sent. • This connection is called a VC (virtual circuit), in analogy with the physical circuits set up by the telephone system, and the subnet is called a virtual-circuit subnet.
  • 21. Comparison of Virtual-Circuit and Datagram Subnets 5-4
  • 22. Routing Algorithms • The Optimality Principle • Shortest Path Routing • Flooding • Distance Vector Routing • Link State Routing • Hierarchical Routing • Broadcast Routing • Multicast Routing • Routing for Mobile Hosts • Routing in Ad Hoc Networks
  • 23. Routing Algorithms The routing algorithm is that part of the network layer software responsible for deciding which output line an incoming packet should be transmitted. • If the subnet uses datagrams internally, this decision must be made anew for every arriving data packet since the best route may have changed since last time. • If the subnet uses virtual circuits internally, routing decisions are made only when a new virtual circuit is being set up. Thereafter, data packets just follow the previously-established route. • The latter case is sometimes called session routing because a route remains in force for an entire user session (e.g., a login session at a terminal or a file transfer). The properties desirable in a routing algorithm are: 1. Correctness. 2. Simplicity. 3. Robustness. 4. Stability. 5. Fairness. 6. Optimality.
  • 24. Routing Algorithms (2) Conflict between fairness and optimality.
  • 25. The Optimality Principle (a) A subnet. (b) A sink tree for router B.
  • 26. The Optimality Principle • Optimality principle : it states that if router J is on the optimal path from router I to router K, then the optimal path from J to K also falls along the same route. • The set of optimal routes from all sources to a given destination form a tree rooted at the destination. Such a tree is called a sink tree. • The sink tree not necessarily be unique, other trees with the same path lengths may exists. • The goal of all routing algorithms is to discover and use the sink tree for all routers. • Since a sink tree is indeed a tree, it does not contain any loops, so each packet will be delivered within a finite and bounded number of hops.
  • 27. » X y » I A C B
  • 28. Types of Routing Algorithms • Nonadaptive (static) – Do not use measurements of current conditions – Static routes are downloaded at boot time • Adaptive Algorithms – Change routes dynamically • Gather information at runtime – locally – from adjacent routers – from all other routers • Change routes – Every delta T seconds – When load changes – When topology changes
  • 29. • Find the shortest path from a specified source to all other destinations in the network. • Given a network topology and a set of weights describing the cost to send data across each link in the network • Shortest path algorithm first developed by E. W. Dijkstra Shortest Path Routing (a nonadaptive routing algorithm)
  • 30. Shortest Path Routing • Dijkstra (1959) shortest path alg. Between two nodes. • Each node is labelled (in parenthesis) with its distance from the sourse node along the best known path. • Initially, no paths are known , so
  • 31. Shortest Path Routing (a nonadaptive routing algorithm) Mark the source node as permanent. Designate the source node as the working node. Set the tentative distance to all other nodes to infinity. While some nodes are not marked permanent Compute the tentative distance from the source to all nodes adjacent to the working node. If this is shorter than the current tentative distance replace the tentative distance of the destination and record the label of the working node there. Examine ALL tentatively labeled nodes in the graph. Select the node with the smallest value and make it the new working node. Designate the node permanent.
  • 32. Shortest Path Routing • Each node is labeled (in parentheses) with its distance from the source node along the best known path. • Initially, no paths are known, so all nodes are labeled with infinity. As the algorithm proceeds and paths are found, the labels may change, reflecting better paths. • A label may be either tentative or permanent. • Initially, all labels are tentative. • When it is discovered that a label represents the shortest possible path from the source to that node, it is made permanent and never changed thereafter.
  • 33. Shortest Path Routing • We want to find the shortest path from A to D. • We start out by marking node A as permanent, indicated by a filled-in circle. • Then we examine, in turn, each of the nodes adjacent to A (the working node), relabeling each one with the distance to A. • Whenever a node is relabeled, we also label it with the node from which the probe was made so that we can reconstruct the final path later. • Having examined each of the nodes adjacent to A, we examine all the tentatively labeled nodes in the whole graph and make the one with the smallest label permanent, This one becomes the new working node. • We now start at B and examine all nodes adjacent to it. If the sum of the label on B and the distance from B to the node being considered is less than the label on that node, we have a shorter path, so the node is relabeled. • After all the nodes adjacent to the working node have been inspected and the tentative labels changed if possible, the entire graph is searched for the tentatively- labeled node with the smallest value. This node is made permanent and becomes the working node for the next round.
  • 34. Example of Shortest Path Routing
  • 36. Dijkstra's algorithm Dijkstra's algorithm to compute the shortest path through a graph. 5-8 top
  • 37. Dijkstra's algorithm to compute the shortest path through a graph. 5-8 bottom Dijkstra's algorithm
  • 38. – Flooding :Every incoming packet is sent on every outgoing line except the one it is arrived. – Always finds the shortest path quickly – Also finds many long paths It generates vast number of duplicate packets. In fact an infinite number . Measures need to take to damp the process. One such measure is to have a HOP Counter contained in the header of each packet. The hop counter values get decremented at each hop moving forwarded and packets discarded when it becomes zero Ideally ,hop counter should initialize to the length of the path from source to destination. Flooding (a nonadaptive routing algorithm)
  • 39. 2. Sequence numbering to the packets: It avoids sending the same packet 1---x 2 2---x 1 0 0----x Using hop counter Sequence numbering 1---x 1--x 1--x 1---x 1---?? A C D B A B D C
  • 40. • It is also known as Bellman-Ford Routing Or Ford Fulkerson Algorithm • I Distance Vector Routing (an adaptive routing algorithm)
  • 41. • It is also known as Bellman-Ford Routing Or Ford Fulkerson Algorithm • Distance vector routing algorithms operate by having each router maintain a table (i.e, a vector) giving the best known distance to each destination and which line to use to get there. • These tables are updated by exchanging information with the neighbors. • Routers replace routes in their own routing tables anytime that neighbors have found better routes. • The Information of routing table provided from neighbors contains – Outgoing line used for destination – Estimate of time or distance • can be number of hops, time delay, packet queue length, etc. Distance Vector Routing (an adaptive routing algorithm)
  • 42. Distance Vector Routing (a) A subnet. (b) Input from A, I, H, K, and the new routing table for J.
  • 43. Routing table for b B A B A -1 1 9 B C A -8 5 3 2 B-D-E-C-A-20 4 Routing table for b B C B C -3 B A C -6 B-D-E-C-15 B----D B--A--C--D—10 B—C—D—7 B—E—D--11 A C B E D
  • 44. FROM J LINE TO B JB— JA+JB—18+12=20 JI+IB—10+36=46 JH+HB—12+31=43 JK+KB—6+28=43 JC— JA+AC—8+25=33 JI+IC—10+18=28 JH+HC—12+19=31 JK+KC—6+36=42 JE- JA+AE=8+14=22 JI+IE=10+7=17 JH+HE=12+30=42 JK+KE=6+22=28
  • 45. Distance Vector Routing • Consider how J computes its new route to router G. It knows that it can get to A in 8 msec, and A claims to be able to get to G in 18 msec, so J knows it can count on a delay of 26 msec to G if it forwards packets bound for G to A. • Similarly, it computes the delay to G via I, H, and K as 41 (31 + 10), 18 (6 + 12), and 37 (31 + 6) msec, respectively. • The best of these values is 18, • so it makes an entry in its routing table that the delay to G is 18 msec • and that the route to use is via H. • The same calculation is performed for all the other destinations, with the new routing table shown in the last column of the figure.
  • 46. Distance Vector Routing (2) The count-to-infinity problem.
  • 47. Distance Vector Routing- The Count to infinity Problem • Distance vector routing works in theory but has a serious drawback in practice: It reacts rapidly to good news, but leisurely to bad news. • To see how fast good news propagates, consider the five-node (linear) subnet of fig (a), • where the delay metric is the number of hops. Suppose A is down initially and all the other routers know this. In other words, they have all recorded the delay to A as infinity. • When A comes up, the other routers learn about it via the vector exchanges. • At the time of the first exchange, • B learns that its left neighbor has zero delay to A. B now makes an entry in its routing table that A is one hop away to the left. All the other routers still think that A is down.
  • 48. Link State Routing Each router must do the following five steps: 1. Discover its neighbors, learn their network address. 2. Measure the delay or cost to each of its neighbors. 3. Construct a packet telling all it has just learned. 4. Send this packet to all other routers. 5. Compute the shortest path to every other router.
  • 49. 1). Discovering Your Neighbors a) Send “Hello” packet on each point-to-point line. Destination node replies with its address.
  • 50. Learning about the Neighbors (a) Nine routers and a LAN. (b) A graph model of (a).
  • 51. 2.) Measuring Line Cost  Send an “ECHO” packet over the line.  Destination is required to respond to “ECHO” packet immediately.  Measure the time required for this operation.  Question: Should we measure just the time it takes to transmit the packet, or should we include the time that the packet waits in the queue?
  • 52. Argument 2: • We should include the time that the packet spends in the queue, as this provides a more accurate picture of the real delays. • We should only include the transmission times, otherwise the network is likely to oscillate between preferred paths. • If only band width is considered (load is ignored), this problem does not occur. • To avoid oscillations in the choice of best path, it may be wise to distribute the load over multiple lines, with some known fraction going over each line.
  • 53. Measuring Line Cost A subnet in which the East and West parts are connected by two lines.
  • 54. Building Link State Packets (a) A subnet. (b) The link state packets for this subnet.
  • 55. Distributing the Link State Packets • Use selective flooding • Sequence numbers prevent duplicate packets from being propagated • Lower sequence numbers are rejected as obsolete • This algorithm has few problems, but manageable. • First: If the sequence number wrap around, (use 32-bit Sequence Number, one link per second, it would take 137 years to wrap around.). • Second: If a router ever crashes, it will lose track of its Sequence Number. If its starts again at 0 , the next packet will be rejected as a duplicate. • Third: if a sequence number is ever corrupted.  The solution to all these problems is to indicate age of each packet after the sequence number and decrement it once per second. When the age hits zero , the information from the router is discarded.
  • 56. Distributing the Link State Packets The packet buffer for router B in the previous slide (Fig. 5-13).
  • 57. Computing the New Routes  Dijkstra’s Shortest Path algorithm is used to determine the shortest path to each destination.
  • 58. Hierarchical Routing • Addresses the growth of routing tables • Routers are divided into regions • Routers know the routes for their own regions only • Works like telephone routing • Possible hierarchy – city, state, country, continent • Optimal number of levels for an N router subnet is lnN • It may be required to group the • Regions into clusters, • Clusters into zones, • Zones into groups and so on…
  • 60. Hierarchical Routing  The full routing table for router 1A has 17 entries.  When routing has done hierarchically, there are 7-entries. When a single network becomes very large, Ex: consider a subnet with 720-routers. • If there is no hierarchy, each router should need 720-routing table entries. • If subnet is partitioned into 24-regions of 30-routers each, two level hierarchy. Each router needs 30-local entries and 23-remote entries for a total of 53-entries. • If three-level hierarchy is chosen, with 8-clusters, each containing 9-regions of 10- routers each. • Each router needs 10-entries for local router, 8-entries for routing to other regons within its own cluster, and 7-entries for distant clusters. For a total of (10+8+7) 25 entries.
  • 61. Broadcast Routing • Sending a packet to all destinations simultaneously is called Broadcasting. • Many methods are there: • 1. sourse to simply send a packet to each destination. • 2. flooding is another method. • It generates too many packets and consumes too much space.
  • 62. Multi destination Routing Reverse path forwarding. (a) A subnet. (b) a Sink tree. (c) The tree built by reverse path forwarding.