You are on page 1of 42

Part 4: Network Layer

Part A: Algorithms

CSC 450/550
Summary

1) The Problem
2) The Dijkstra’s Shortest Path Algorithm
3) Distance Vector Routing
4) Link State Routing
5) Hierarchical Routing
6) Routing in Ad Hoc Networks

CSC 450/550
1. The Problem (1)
•Store-and-Forward Packet Switching
•Services Provided to the Transport Layer
•Connectionless Service
•Connection-Oriented Service

CSC 450/550
1. The Problem (2): Packet Switching

fig 5-1

The environment of the network layer protocols.

CSC 450/550
1. The Problem (3): Connectionless
Service

Routing within a diagram subnet.


CSC 450/550
1. The Problem (4): Connection-
Oriented Service

Routing within a virtual-circuit subnet.


CSC 450/550
1. The Problem (5): Connectionless
VS. Connection-Oriented

CSC 450/550
2 Shortest Path Algorithm

The first 5 steps used in computing the shortest path from A to D.


The arrows indicate the working node.
CSC 450/550
3 Distance Vector Routing (1)

(a) A subnet. (b) Input from A, I, H, K, and the new


routing table for J.

CSC 450/550
3 Distance Vector Routing (2)

The count-to-infinity problem.

CSC 450/550
3 Distance Vector Routing (3): Loop-
Breaking Heuristics
Set infinity to a limited number, e.g. 16.
Split horizon
Split horizon with poison reverse

CSC 450/550
3 Example: A
B
C
A 0
B D0
C D E
A 1 A
D 2 B
E C
2
10 E D
2 E 0
A B C A
B 0 B
C C 0 Initialization
D D
E
E
CSC 450/550
A1
A 0 B
B 10 C 2
C D0
D 1 E 2
A 1 D A
E 2 B
C 2
2
10 E D 2
2 E 0
A 10 B C A
B 0 B
C C 0 Direct
D D 2 Neighbours
E
E2
CSC 450/550
A1
A 0 B 11
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B
C 2
2
10 E D 2
2 E 0
A 10 B C A 3
B 0 Neighbours
B
C C 0 of neighbours
D 11 D 2
E
E2
CSC 450/550
A1
A 0 B 11
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B 13
C 2
2
10 E D 2
2 E 0
A 10 B C A 3 Neighbours
B 0 B 13 of neighbours
C 13 C 0
D 11 of neighbours
D 2
E 13
E2
CSC 450/550
A1
A 0 B 11
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B 13
C 2
2
10 E D 2
2 E 0
A 10 B C A 3
B 0 Stable
B 13
C 13 C 0 convergence
D 11 D 2
E 13
E2
CSC 450/550
A1
A 0 B 11
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B 13
C 2
2
10 E D 2
2 E 0
B 1
A 10 C A 3
B 0 Good news:
B 13
C 13 A new link!
C 0
D 11 D 2
E 13
E2
CSC 450/550
A1
A 0 B 11
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B 13
C 2
2
10 E D 2
2 E 0
A 10 B 1 C A 3
B 0 Direct
B1
C 1 C 0 endpoints
D 11 know
D 2
E 13
E2
CSC 450/550
A1
A 0 B3
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B3
C 2
2
10 E D 2
2 E 0
A4 B 1 C A 3
B 0 Neighbours
B1
C 1 C 0 know
D3 D 2
E3
E2
CSC 450/550
A1
A 0 B3
B4 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B3
C 2
2
10 E D 2
2 E 0
A4 B 1 C A 3
B 0 Neighbours
B1
C 1 of neighbours
C 0
D3 D 2
know
E3
E2
CSC 450/550
A1
A 0 B3
B4 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B3
C 2
2
10 E D 2
2 E 0
A4 B 1 C A 3
B 0 B1
A happy and
C 1 C 0 stable network
D3 D 2
E3
E2
CSC 450/550
A1
A 0 B3
B4 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B3
C 2
2
10 E D 2
2 E 0
A4 B C A 3 Bad news:
B 0 B1 Link crash!!
C 1 C 0
D3 D 2
E3
E2
CSC 450/550
A1
A 0 B3
B4 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B3
C 2
2
10 E D 2
2 E 0
A B C A 3
B 0 Direct
B
C endpoints
C 0
D D 2
know
E
E2
CSC 450/550
A1
A 0 B3
B4 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B3
C 2
2
10 E D 2
2 E 0
A 10 B C A 3
B 0 B
C C 0
D D 2
E
E2
CSC 450/550
A1
A 0 B3
B4 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B3
C 2
2
10 E D 2
2 E 0
A 10 B C A 3 Get help
B 0 B5 from
C 13 C 0
D 11 neighbours
D 2
E 13
E2
CSC 450/550
A1
A 0 B7
B4 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B7
C 2
2
10 E D 2
2 E 0
A 10 B C A 3 Routing loop
B 0 B5 (due to
C 13 C 0
D 11 inconsistent
D 2
E 13 state info)
E2
CSC 450/550
A1
A 0 B7
B8 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B7
C 2
2
10 E D 2
2 E 0
A 10 B C A 3
B 0 B9
C 13 C 0
D 11 D 2
E 13
E2
CSC 450/550
A1
A 0 B 11
B8 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B 11
C 2
2
10 E D 2
2 E 0
A 10 B C A 3
B 0 Counting
B9
C 13 C 0 to infinity…
D 11 D 2
E 13
E2
CSC 450/550
A1
A 0 B 11
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B 11
C 2
2
10 E D 2
2 E 0
A 10 B C A 3
B 0 B 13
C 13 C 0
D 11 D 2
E 13
E2
CSC 450/550
A1
A 0 B 11
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B 13
C 2
2
10 E D 2
2 E 0
A 10 B C A 3
B 0 B 13
C 13 C 0
D 11 D 2
E 13
E2
CSC 450/550
A1
A 0 B 11
B 10 C 2
C 3 D0
D 1 E 2
A 1 D A3
E 3 2 B 13
C 2
2
10 E D 2
2 E 0
A 10 B C A 3
B 0 Stability
B 13
C 13 C 0 again
D 11 D 2
E 13
E2
CSC 450/550
4 Link State Routing (1)
Each router must do the following:
• Discover its neighbors, learn their network
address.
• Measure the delay or cost to each of its
neighbors.
• Construct a packet telling all it has just learned.
• Send this packet to all other routers.
• Compute the shortest path to every other router.

CSC 450/550
4 Link State Routing (2): Learning
about the Neighbors

(a) Nine routers and a LAN.


(b) A graph model of (a).

CSC 450/550
4 Link State Routing (3): Measuring
Line Cost
A subnet in which the East and West parts are
connected by two lines.

CSC 450/550
4 Link State Routing (4): Building
Link State Packets

(a) A subnet. (b) The link state packets for this


subnet.

CSC 450/550
4 Link State Routing (5): Distributing
the Link State Packets
The packet buffer for router B in the previous slide (Fig.
5-13).

CSC 450/550
5 Hierarchical Routing
Hierarchical routing.

CSC 450/550
6. Routing in Ad Hoc Networks (1)
Possibilities when the routers are mobile:
Military vehicles on battlefield.
• No infrastructure.

A fleet of ships at sea.


• All moving all the time

Emergency works at earthquake .


• The infrastructure destroyed.

A gathering of people with notebook computers.


• In an area lacking 802.11.

CSC 450/550
6. Routing in Ad Hoc Networks (2):
Route Discovery

(a) Range of A's broadcast.


(b) After B and D have received A's broadcast.
(c) After C, F, and G have received A's broadcast.
(d) After E, H, and I have received A's broadcast.
Shaded nodes are new recipients. Arrows show possible reverse routes.
CSC 450/550
6. Routing in Ad Hoc Networks (3):
Route Discovery

Format of a ROUTE REQUEST packet.

CSC 450/550
6. Routing in Ad Hoc Networks (4):
Route Discovery

Format of a ROUTE REPLY packet.

CSC 450/550
6. Routing in Ad Hoc Networks (5):
Route Maintenance
(a) D's routing table before G goes down.
(b) The graph after G has gone down.

CSC 450/550

You might also like