Lecture05 Routing
Lecture05 Routing
Lecture 5: Routing
Professor Peter Marbach
Department of Computer Science
University of Toronto
Packet Routing and Forwarding
Forwarding IP datagrams
Class-based vs. CIDR
Routing Techniques
Naïve: Flooding
Distance vector: Distributed Bellman Ford Algorithm
Link state: Dijkstra’s Shortest Path First-based
Algorithm
RR22
RR11 RR44
1 1 4
R1 R2 R4 R6
2 2 3
2
R7 3
R5 2
R3 4 B
R8
1 1 4
R1 R2 R4 R6
2 2 3
2
R7 3
R5 2
R3 4 B
R8
Learn more at
http://www.lumeta.com
R1
Advantages:
Simple
Every destination in the network is reachable.
Disadvantages:
Some routers receive a packet multiple times.
Packets can go round in loops forever.
Inefficient.
1 1 4
R1 R2 R4 R6
2 2 3
2
R7 3
R5 2
R3 4
R8
4
R3 R8
v 2 y
3 1
1
u
x 4 z
2 1
5 t du(z) = min{c(u,v) + dv(z),
w 4 3
s c(u,w) + dw(z)}
B 4 B B 0 B F 1
2
C – C – 6
D – D 3 D 1
3 D
E 2 E E – A 4
F 6 F F 1 F B
1 1 1
R1 R2 R3 R4
At each step of the algorithm, router adds the next shortest
(i.e. lowest-cost) path to the tree.
2 2
3 1 3 1
1 1
4 4
2 1 2 1
5 5
4 3 4 3
2 2
3 1 3 1
1 1
4 4
2 1 2 1
5 5
4 3 4 3
CSC 458/CSC 2209 – Computer Networks University of Toronto – Fall 2019 24
Dijkstra’s Algorithm Example
2 2
3 1 3 1
1 1
4 4
2 1 2 1
5 5
4 3 4 3
2 2
3 1 3 1
1 1
4 4
2 1 2 1
5 5
4 3 4 3
CSC 458/CSC 2209 – Computer Networks University of Toronto – Fall 2019 25
Shortest-Path Tree
Reliable Flooding
Resend LSP over all links other than incident link, if the
sequence number is newer. Otherwise drop it.