Unit Iii
Unit Iii
Network Layer
Network layer design issues: Store and forward packet switching- services provided to the
transport layer- Implementation of connection less service-Implementation of connection oriented
service-Comparison of virtual circuit and datagram networks. Routing algorithms: Shortest path
algorithms-flooding-distance vector routing-Links state routing congestion control algorithms:
Approaches to congestion control-Load shedding.
• Network layer provides services to the transport layer at the network layer and
transport layer interface.
• The services should be independent of router technology.
• In theory, network layer provides both connection oriented and connection less
services, reliable, unreliable services.
• But practically reliable connection oriented service and unreliable connection less
service is followed.
• Connection oriented service should have following properties before sending data.
1) Establish a connection
2) Use a connection
3) Release a connection
• Communication is in both direction and sequence.
Implementation of connection oriented service (Virtual circuit subnet):
B C D
VC no.:
A E
H G F
State information Have a subnet table Does not have subnet table
and follows no state
information.
Routing Route choosen when virtual Each packet is routed
circuit is setup all packets independently.
follow this route
Router failure All virtual circuit passed Packets passed through fail
through the failed router are router are only terminated.
terminated
• A host with a packet to send transmits its to the nearest router, either on LAN, or
point link to the ISP.
• A packet is stored there until it has fully arrived and the output line is free.
• Then it is forwarded to the next router along the until it reaches the destination host.
ISP’s equipment
Routers
B C
Host 1 A
1
A G Host 2
D
F E
Packet
Routing Algorithms:
• The main function of the network layer is routing packets from source to
destination.
• Routing algorithms gives best output line.
Properties of routing algorithms:
• Simplicity - Easy to understand
• Roburstness - For testing
• Stability - Security
• Correctness - Being error free
B 7 C
2 2 3 3
A E F D
4
6 G 4 4 H 2
Travelling of packets:
Initial stage:
B(α,-) C(α,-)
2 2 3 3
6 1 4 2
G(α,-) 4 H(α,-)
B (2,A) 7 C(α,-)
2 2 3 3
6 1 4 2
G(α,-) 4 H(α,-)
B-E:
B(2,A) 7 C(α,-)
2 2 3 3
G(α,-) 4 H(α,-)
E-G:
B(2,A) 7 C(α,-)
2 2 3 3
G(5,E) 4 H(α,-)
G-H:
B(2,A) 7 C(α,-)
2 2 3 2
G(5,E) 4 H(9,G)
H-D:
B(2,A) 7 C(α,-)
2 2 3 2
G(5,E) 4 H(9,G)
Flooding Algorithms:
• Every incoming packet is send out on every outgoing line except the one it arrived
on.
0
A
1
A 2 0 0 0
A
0 0 0
0
A
0 0
• By sending echo packets each router compute the delay to reach its neighbours.
A D
B C
E H
F G
I L
J K
K H I A
24 0
21 20 A
28 36 12 B
31
18
36 25 C
19
27
24 8 D
40
7 14 E
22 30
40 20 23 F
19 31
31 G
18
6 20
19 H
0 17
2 0
4 21
10 11 I
7 9
0 J
22 22 24
33 K
9
9 29
L
For example:
J H G 7+6=13 MSec
J A G 9+18=27 MSec
J K G 10+31=41 MSec
J I G 11+31=42 MSec
Therefore, to reach J G through H is the best line. Since it takes only 13 MSec.
Disadvantage:
• It uses link state routers to exchange messages that allow each router to learn the
entire network topology.
Construct a packet:
• Once the information needed has been collected, next step is to build a packet
containing all the data.
2) Sequence number
3)Age
those neighbours.
Example:
B
A
13
12
59
B 2 C
4 6 1 3
A 7 D
5 E 8 F
C D
E
F
14 15
16
17
58 57
56
55
D 3 C 3
A 5
B 6
E 1 F 7
C 1
E 8
B 2
F 8
D 7
• The fundamental idea is to use flooding algorithm to distribute link state packets.
• But if router crashes, it lost its sequence number the solution to this problem is to
include age of each packet.
• The send flag means that the packet must be send on the indicated line.
A 12 59 0 1 1 1 0 0
C 21 59 1 0 1 0 1 0
F 20 58 1 1 0 0 0 1
• In table, the link state packet from A arrive directly so it must be send to C and F
and acknowledge to A.
Congestion:
• When two many packets are present in the subnet performance degrades.
• Slow processor.
• Insufficient memory
• ‘Low bandwidth
• Congestion control solutions are classified into two groups. They are,
Admission control:
• Once a congestion has been signal, no more virtual circuit are setup until the
problem solved.
Traffic Throttling:
• When congestion is occurred, it must tell the senders to throttle back there
transmission and slow down.
Choke packets:
• This approach can be used in both virtual circuit and datagram subnet.
• Choke packet is a special packet that is send from congested area to sender host.
• Over long distances, sending a choke packet to the source host does not work well
because the reactions is slow.
• Hence to reduce transmission rate immediately over long distances use hop by hop
choke packets.
• When none of the above methods make the congestion disappear, routers follow
load shedding method.
Host 1 R R Host 2
R R
1 2 3 4
Congested area
Choke packets
Load shedding:
Load shedding method means simply through the packets from congested area when they
cannot handle.