cse123a discussion session 2007/03/08 ryo sugihara
Post on 22-Dec-2015
225 views
TRANSCRIPT
Route computation
• Router needs to know “which port to forward”– Done by “routing table”
• But how to make routing table?– By exchanging routing information– What kind of information?
RouterA
BC
D
Prefix Link001* A0* B01* C11* C110* Ddefault B
Routing table
Distance vector & Link state
• Two ways to exchange routing info– Distance vector
• Exchange “distance to a destination”• Each router knows the next hop for each dest
– One hop of the stortest path to the dest
– Link state• Exchange “my neighbors (and costs)”• Each router knows whole network topology
– compute the shortest paths by Dijkstra’s algorithm
General strategy• R1 (somehow) knows CSE is distance one from itself
• R1 tells the neighbors (=R2, R3) about it– DV: “CSE is distance one from me”– LS: “I have link with CSE (d=1), R2 (d=5), and R3 (d=1)”
R1
R2
R3
R4
R5
5
1
2
3
8
10
4
CSE
1
Distance vector
• R1 tells “CSE is distance one from me!”– to R2 and R3
R1
R2
R3
R4
R5
5
1
2
3
8
10
4
CSE
“CSE = 1”
“CSE = 1”1
What happens at R2?
5
2
3
p1
p2
p3
“CSE = 1”
R2
Net dist... ...
CSE 6... ...
Net dist... ...
CSE inf... ...
Net dist... ...
CSE inf... ...
Net dist... ...
CSE 6... ...
iface...p1...
Routing table
• Table for each interface• One routing table
Distance vector
• Router forwards distance info to others when its routing table is updated
R1
R2
R3
R4
R5
5
1
2
3
8
10
4
CSE
“CSE = 6”
“CSE = 2”
“CSE = 2”
“CSE = 2”
“CSE = 6”
1
What happens at R2?
5
2
3
p1
p2
p3
R2
Net dist... ...
CSE 6... ...
Net dist... ...
CSE 4... ...
Net dist... ...
CSE inf... ...
Net dist... ...
CSE 6... ...
iface...p1...
“CSE = 2”
4 p2
Routing table
In case of link failure,
• Switch to backup route• Problem: “Count-to-infinity problem” (next)
5
2
3p1
p2
p3
R2
Net dist... ...
CSE 6... ...
Net dist... ...
CSE 4... ...
Net dist... ...
CSE inf... ...
Net dist... ...
CSE 4... ...
iface...p2...
Routing table
inf
6 p1
Count-to-infinity problem
R1
2
1
3
CSE
p1
p2
p3
p4
Net distCSE 2
Net distCSE 6
Net distCSE 2
ifacep3
Routing table
Net distCSE 3
Net distCSE 5
Net distCSE 3
ifacep1
Routing table
inf
inf
5 p2
6 p4
“CSE = 5”
8
8 p4
“CSE = 8”
11
11 p2
R2
R31
Link state
• R1 broadcasts “I have link with CSE (d=1), R2 (d=5), and R3 (d=1)”– It will be flooded to the entire network
R1
R2
R3
R4
R5
5
1
2
3
8
10
4
CSE
LSP
LSP
R1
R2
R3CSE 1
5
1
LSP =
1
Link state
• Each router has the entire graph– In DV, it only knew next hop for each dest.
• Each router computes next hop for each dest. – By Dijkstra’s algorithm
R1
R2
R3
R4
R5
5
1
2
3
8
10
4
CSE
1
Intelligent flooding• Without “intelligence”, LSP may loop
• Solution: add “sequence number” to LSP– If a router received a “newer” LSP, it forwards– Otherwise, it discards
• Other issues:– Subtle problems: “source jumping”, “aging” lecture notes– How Dijkstra’s algorithm works
http://en.wikipedia.org/wiki/Dijkstra's_algorithm
R1
R2
R3
R4
R5
5
1
2
3
8
10
4
CSE
LSP
LSP1