8/22/2019 Chapter5 Network Layer
1/74
NETWORK LAYER DESIGN ISSUES
Network Layer The network layer is concerned with getting
packets from the source to the destination
The Network layer is the lowest layer that deals
with end to end transmissionDesign Issues
These issues include the service provided to the
transport layer
Routing of the packets through the subnet
Congestion control
Connection of multiple networks together
8/22/2019 Chapter5 Network Layer
2/74
Chapter 5 : Network Layer
8/22/2019 Chapter5 Network Layer
3/74
Services to transport layer
Network layer runs in the IMPs andthe Transport layer runs in the
Hosts.
Services provided by the networklayer defines the servicesa provided
by the subnet
8/22/2019 Chapter5 Network Layer
4/74
Goals to design
The services should be independent from
the subnet technology.
The subnet should shielded of the subnets
present
Network addresses should use a uniform
numbering plan even across LANs and
WANs.
8/22/2019 Chapter5 Network Layer
5/74
Connection oriented
The freedom of services provided to the
Transport layer degenerates into two
factions
a) Connection oriented
b) connection less service.
8/22/2019 Chapter5 Network Layer
6/74
Differences
Issues Connection Connectionless
Initial setup Required Not possible
Destination only needed on every
address during setuppacket
Packet Guaranteed Not
8/22/2019 Chapter5 Network Layer
7/74
differences
Control Done by Done by
Error Network Lay Transport Layer
Flow Network Layer Network Layer
Option
Negation
Possible
YesNo
Identifiers Yes No
8/22/2019 Chapter5 Network Layer
8/74
MIXTURES OF SERVICES
Layers Connection oriented Connectionless
service service
76
5
4
3
2
1
8/22/2019 Chapter5 Network Layer
9/74
OSI network service Primitives
1. That apply at the boundary between the network
layer and transport layer.
2. Both connection-oriented and connection lessprimitives are provided
3. A connection is a pair of conceptual queues
between two NASP
4. One queue for traffic in each direction.
5. The OSI connection -oriented network service
6. Primitives are listed grouped into four categories
8/22/2019 Chapter5 Network Layer
10/74
Connection oriented
N-CONNECT .request ( callee,
aks_wanted,exp_wanted,qos, user_data )
N_CONNECT.indication ( )
N-CONNECT.responce ( responer,acks_wanted,exp_wanted,
qos,user_data )
N-CONNECT.conformation( )
N_DISCONNECT.request (originator ,reason,user_
data,responding_address )
N-DISCONNECT.indication( )
8/22/2019 Chapter5 Network Layer
11/74
Connection oriented
N-DATA.request (user_data) N-DATA.indication (user_data)
N_DATA-ACKNOWLEDGE.request()
N-DATA-ACKNOWLEDGE.indiction()
N-DATA.request (user_data) N-DATA.indication (user_data)
N_DATA-ACKNOWLEDGE.request()
N-DATA-ACKNOWLEDGE.indiction()
N-RESET.indication(originator,reason )
N-RESET.response()
N-REPORT.confirm()
8/22/2019 Chapter5 Network Layer
12/74
Connectionless oriented N-UNITDATA.request (source_
address,destination_add, qos,user_data )
N-UNITDATA.indication( )
N-FACILITY.request (qos)
N-FACILITY.indication(drstinati on_address,qos,reason )
N-REPORT.indication (destination_ address,qos,) callee: NASP to be called
caller:NASP used by calling
transport entity
Acks_wanted: Boolean flag
8/22/2019 Chapter5 Network Layer
13/74
terminology
callee: NASP to be called
caller:NASP used by calling
transport entity Acks_wanted: Boolean flag
8/22/2019 Chapter5 Network Layer
14/74
terminology
Exp_wanted :Boolean flag
Qos:Quality of service
User_data: Bytes transmitted but not examined
8/22/2019 Chapter5 Network Layer
15/74
terminology
Responder: NASP connected to
at the destination
Originator:Specification ofwho initiated the N-RESET
Reason: Specification of why the
event happened
8/22/2019 Chapter5 Network Layer
16/74
network layer
One of the functions of the network layer
is to provide a uniform naming for the
Transport layer to use
8/22/2019 Chapter5 Network Layer
17/74
network layer
The second orIDI ( initial Domain Identifier
) field
specifies the domain to which the number
in the
Dsp part belongs.
8/22/2019 Chapter5 Network Layer
18/74
NASP address
The full NASP address is variable
length
upto 40 decimal digits or 20 bytes
long.
8/22/2019 Chapter5 Network Layer
19/74
NSAPS
In the analogy ,the telephone
sockets are the NSAPs
and the telephone numbersare the NSAP addresses.
8/22/2019 Chapter5 Network Layer
20/74
INTERNAL ORGANIZATION
OF THE NETWORK LAYER
The OSI model does not provide
a specification of the key
algorithm, such as routing and
congestion control
8/22/2019 Chapter5 Network Layer
21/74
INTERNAL ORGANIZATION
In subnet design (as opposed to
OSI), We will use the
subnet terms "IMPS"and "HOST"
instead of
"network layer" and "transport layer"
8/22/2019 Chapter5 Network Layer
22/74
INTERNAL ORGANIZATION
The internal operation of the
subnet,a connection is
usually called a VIRTUAL CIRCUIT,
8/22/2019 Chapter5 Network Layer
23/74
INTERNAL ORGANIZATION
the independent packets of the
connectionless
organization are DATAGRAMS,
in analogy with telegrams
8/22/2019 Chapter5 Network Layer
24/74
INTERNAL ORGANIZATION
Virtual circuits are generally used
in subnets whose
primary service is connection
oriented
8/22/2019 Chapter5 Network Layer
25/74
INTERNAL ORGANIZATION
In contrast with a datagram subnet
no routes are worked out in advance
,even if the sevice
is connection-oriented
8/22/2019 Chapter5 Network Layer
26/74
INTERNAL ORGANIZATION
to forward packets for each
of the currently open Virtual
circuits passing through it.
8/22/2019 Chapter5 Network Layer
27/74
INTERNAL ORGANIZATION
If packet flowing over a given
virtual circuit always
take through the subnet, each
IMP must remember where
8/22/2019 Chapter5 Network Layer
28/74
OSI Network service primitives
user 1 user2
oprior to establishing a connection
network layer
NSAP
8/22/2019 Chapter5 Network Layer
29/74
OSI networklayer serviceprimitives
After establishing a connection
user 1 user2
queue
8/22/2019 Chapter5 Network Layer
30/74
After threee packets have been sent and
recieved
OSI networklayer serviceprimitives
user 1
packet
oo o
user 2
8/22/2019 Chapter5 Network Layer
31/74
Network addresses
The format of OSI network addresses(NSAPs)
AFI IDI DSP
idp
IDP:initialdomain part
AFI:Authority and format indicator
IDI:initialDomain identifier
DSP:Domain specific part
8/22/2019 Chapter5 Network Layer
32/74
subnet
a
b c
d
e f
h
h h
h
hh
8/22/2019 Chapter5 Network Layer
33/74
Eight virtual circuits through the
subnet originating at A originating at b
0 - abcd 0 - bcd
1 -aefd 1 -bae 2 -abfd 2 -bf
3 -aec
4 -aecdfb
8/22/2019 Chapter5 Network Layer
34/74
changes as the packet
progresses line
packet
4 3 1
2
H TO A A TO E E TO C
C TO D D TO F F TO B
0 0
8/22/2019 Chapter5 Network Layer
35/74
AND DATAGRAMS WITHIN
THE SUBNETS
BOTH HAVE THEIR SUPPORTERS
AND DETRACTORS
THE MAIN OBJECTIVES ARE IMP
MEMORY
SPACE AND BANDWIDTH
8/22/2019 Chapter5 Network Layer
36/74
DIFFERENCES
VIRTUAL CIRCUITS ALLOW PACKETS
TO
CONTAIN CIRCUIT NUMBERS INSTEAD
OF
FULL DESTINATION ADDRESSES
8/22/2019 Chapter5 Network Layer
37/74
COMPARISION OF DATAGRAM AND
VIRTUALCIRCUIT SUBNETS
Datagram circuit setup not possible
Virtual circuit it is required
Data gram addressing is from the sourceto the destination
In VC each packet contains a short
VC number
8/22/2019 Chapter5 Network Layer
38/74
comparision
Datagram each packet is routed
independently
In VC route is choosen when the
VC is setup
In Datagram congestion control
is difficultIn VC it is easy if enough buffers
are allocated
8/22/2019 Chapter5 Network Layer
39/74
Routing
In real function Network layer is
routing packets from the source tothe destination
Te algorithms that choose the route
and Data structures that they use
are a major area of Network layer
design
R i l i h
8/22/2019 Chapter5 Network Layer
40/74
Routing algorithm
The routing algorithm is that part of the
network layer software
responsible for desiding which
output line an incoming packet
is to be transmitted on
8/22/2019 Chapter5 Network Layer
41/74
routing Algorithms
The routing algorithms must be
able to cope with the changes in
the topology and traffic withoutrequiring all jobs in all hosts to
be abortedand the network to
be rebooted every time some IMPcrashes
8/22/2019 Chapter5 Network Layer
42/74
Congestion
When too many packets are
present in the subnet, performance
degrades ,
this situation is called
congestion
8/22/2019 Chapter5 Network Layer
43/74
congestion
d -------------------capacity
congestion
desirede
liv
ered
packets sent
perfect
8/22/2019 Chapter5 Network Layer
44/74
congestion
Congestion tends to feed upon
itself and become worse
If an IMP has no free buffer,it must ignore newly arriving
packets.
Diff b t ti
8/22/2019 Chapter5 Network Layer
45/74
Differences between congestion
control and flow control
congestion control is concerned
about the subnet is able to carry the
offered traffic.
Flow control , in contrast ,relates
to the point-to -point traffic between agiven sender and a given reciever.
8/22/2019 Chapter5 Network Layer
46/74
Internetworking
Just as Congestion control is
closely related to the primary
function of the network layer,
routing, so is Networking.
8/22/2019 Chapter5 Network Layer
47/74
InterNetworking
Routing aside, another problem
with Internetworking is that not
all networks use the same protocols.
Different protocols imply different packet
formats,headers,flow- control,development
rules,and more.
8/22/2019 Chapter5 Network Layer
48/74
Internetworking
As a consequence , When
packets move from network
to network, conversions
are necessary.
8/22/2019 Chapter5 Network Layer
49/74
Routing Algorithm Definition
1. Routing is the decision which path to take
2. A routing algorithm decides which output link an
incoming packet should be transmitted on
3. A routing table contains the mappings from thenetworks and host addresses to output ports on the router
4. The routing algorithm builds this table
8/22/2019 Chapter5 Network Layer
50/74
The Optimality Principle
1. Optimal routes without regard to network, topology and
traffic
2. Optimal routes form a tree rooted at the destination
3. The tree is called the sink tree
4. The goal of all routing algorithms is to discover and use
the sink trees for all routers.
8/22/2019 Chapter5 Network Layer
51/74
Routing Algorithms Overview
Nonadaptive Algorithms
do not base their routing decisions on
mesurements or estimates of the current
traffic and topology.
Adaptive Algorithms
attempt to change their routing decisions to
reflect changes in topology and the currenttraffic.
8/22/2019 Chapter5 Network Layer
52/74
Nonadaptive Algorithms
Non-adaptive routing algorithms do not base their
routing decisions on the current state of the
network, This Procedure is sometimes called static
routing.
Examples:1. Flooding
2. Shortest Path Routing
8/22/2019 Chapter5 Network Layer
53/74
Flooding Algorithm
Every incoming packet is sent out on every
outgoing line except the one it arrived on,
No routing table, no lookup!
Problem: Vast number of duplicated packets
Reducing Flooding Algorithms Duplicate
8/22/2019 Chapter5 Network Layer
54/74
Solution 1: Hop counter
Have a hop counter in the packet header
Routers decrement each arriving packets hop
Counter
Routers discard a packet with hop count=0
Ideally, the hop counter should be initialized to the
length of the path from the source to the destination.
Hop count defines the Horizon of the packet, which
is how far a node can see.
Solution 2: Sequence Numbers Require the first routerhop to put a sequence number in each packet it
receives from its hosts
Each router maintains a table listing the sequence-
Reducing Flooding Algorithms Duplicate
Packets
8/22/2019 Chapter5 Network Layer
55/74
Flooding Uses
1. Used in small networks or limited horizon order
100s of nodes
2. Military Applications
1. Large number of routers is desirable2. If one router is taken out (by a bomb?) flooding will
still get packets to their destinations
3. Distributed Databases
1. Simultaneous updates of multiple databases can be donewith a single packet transmission
2. Gnutella search is an example, uses horizon
8/22/2019 Chapter5 Network Layer
56/74
Shortest Path Routing
This routing is conceptually simple.
It is a widely used technique to build a
graph of the subnet.
Nodes: IMPs
Arcs: Communication lines
Dijkstras algorithm are well-known.
8/22/2019 Chapter5 Network Layer
57/74
A Graph of the Subnet Undirected
Weighted
Geographic Distance
Mean queuing and transmission delay
for a standard test packet as determinedby hourly or daily test runs.
A
B C
E F D
G H
1
22
6 4
2
7
3
3
22
8/22/2019 Chapter5 Network Layer
58/74
Dijkstras Algorithm
Each node is labeled (in parentheses) with
its distance from the source node along
the best known path.
A
B C
E F D
G H
1
22
6 4
2
7
3
3
22
8/22/2019 Chapter5 Network Layer
59/74
Dijkstras Algorithm (contd)
We want to find the shortest pathfrom A to D.
Initially, no paths are known, so all
nodes are labeled with infinity.
A
B(-) C(-)
E(-) F(-) D(-)
G(-) H(-)
8/22/2019 Chapter5 Network Layer
60/74
Dijkstras Algorithm (contd)
We start out by marking node A (theworking node) as permanent.
We examine each of the nodes
adjacent A, relabeling each one withthe distance to A.
A
B(2, A) C(-)
E(-) F(-) D(-)
G(6, A) H(-)
2
6
8/22/2019 Chapter5 Network Layer
61/74
Dijkstras Algorithm (contd)
We make B with the smallest label
permanent.
B becomes the new working node.
A
B(2, A) C(-)
E(-) F(-) D(-)
G(6, A) H(-)
8/22/2019 Chapter5 Network Layer
62/74
Dijkstras Algorithm (contd)
We examine each of the nodes adjacent
B, relabeling each one with the distance to
B.
A
B(2, A) C(9 B)
E(4, B) F(-) D(-)
G(6, A) H(-)
2
7
8/22/2019 Chapter5 Network Layer
63/74
Dijkstras Algorithm (contd)
We make E with the smallest label
permanent.
E becomes the new working node.
A
B(2, A) C(9, B)
E(4, B) F(-) D(-)
G(6, A) H(-)
8/22/2019 Chapter5 Network Layer
64/74
E(4, B)
Dijkstras Algorithm (contd)
We examine each of the nodes adjacent
E, relabeling each one with the distance to
E.
1 2A
B(2, A) C(9, B)
F(6 E) D(-)
G(5, E) H(-)
8/22/2019 Chapter5 Network Layer
65/74
Dijkstras Algorithm (contd)
We make G with the smallest label
permanent.
G becomes the new working node.
A
B(2, A) C(9, B)
E(4, B) F(6, E) D(-)
G(5, E) H(-)
8/22/2019 Chapter5 Network Layer
66/74
E(4, B)
Dijkstras Algorithm (contd)
We examine each of the nodes adjacent
G, relabeling each one with the distance to
G.
4
A
B(2, A) C(9, B)
F(6, E) D(-)
G(5, E) H(9 G)
8/22/2019 Chapter5 Network Layer
67/74
Dijkstras Algorithm (contd)
We make F with the smallest label
permanent.
F becomes the new working node.
A
B(2, A) C(9, B)
E(4, B) F(6, E) D(-)
G(5, E) H(9, G)
8/22/2019 Chapter5 Network Layer
68/74
E(4, B)
Dijkstras Algorithm (contd)
We examine each of the nodes adjacent
F, relabeling each one with the distance to
F.
2A
B(2, A) C(9, B)
F(6, E) D(-)
G(5, E) H(8, F)
3
8/22/2019 Chapter5 Network Layer
69/74
Dijkstras Algorithm (contd)
We make H with the smallest label
permanent.
H becomes the new working node.
A
B(2, A) C(9, B)
E(4, B) F(6, E) D(-)
G(5, E) H(8, F)
8/22/2019 Chapter5 Network Layer
70/74
E(4, B)
Dijkstras Algorithm (contd)
We examine each of the nodes adjacent
H, relabeling each one with the distance to
H.
2
A
B(2, A) C(9, B)
F(6, E) D(10, F)
G(5, E) H(8, F)
8/22/2019 Chapter5 Network Layer
71/74
Dijkstras Algorithm (contd)
We make C with the smallest label
permanent.
C becomes the new working node.
E(4, B)A
B(2, A) C(9, B)
F(6, E) D(10, F)
G(5, E) H(8, F)
8/22/2019 Chapter5 Network Layer
72/74
Dijkstras Algorithm (contd)
We examine each of the nodes adjacent
C, relabeling each one with the distance to
C.
E(4, B)A
B(2, A) C(9, B)
F(6, E) D(10, F)
G(5, E) H(8, F)
3
8/22/2019 Chapter5 Network Layer
73/74
Dijkstras Algorithm (contd)
We make D with the smallest label
permanent.
D becomes the new working node.
E(4, B)A
B(2, A) C(9, B)
F(6, E) D(10, F)
G(5, E) H(8, F)
8/22/2019 Chapter5 Network Layer
74/74
Dijkstras Algorithm (contd)
The shortest path (Dijkstras) algorithm
from Source A to Destination D.
E(4, B)A
B(2, A) C(9, B)
F(6, E) D(10, H)
G(5 E) H(8 F)