170 likes | 296 Views
CSE123A discussion session. 2007/03/08 Ryo Sugihara. Topics. Review Network Layer (2,3): Route computation Distance vector Link state. Where are we now?. Routing table. Prefix. Link. B. 001*. A. C. 0*. B. Router. A. 01*. C. 11*. C. D. 110*. D. default. B.
E N D
CSE123A discussion session 2007/03/08 Ryo Sugihara
Topics • Review • Network Layer (2,3): Route computation • Distance vector • Link state
Routing table Prefix Link B 001* A C 0* B Router A 01* C 11* C D 110* D default B 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?
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
Example R2 R4 3 CSE (132.239.10.0/24) 5 R1 8 1 2 4 1 R3 10 R5
R2 R4 3 5 CSE R1 8 2 4 1 R3 10 R5 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)” 1
R2 R4 3 5 CSE R1 8 2 4 1 R3 10 R5 Distance vector • R1 tells “CSE is distance one from me!” • to R2 and R3 “CSE = 1” 1 “CSE = 1”
Net Net dist dist ... ... ... ... CSE CSE inf inf ... ... ... ... What happens at R2? Routing table Net dist iface R2 ... ... ... CSE 6 p1 ... ... ... Net dist p3 p1 ... ... “CSE = 1” 3 CSE 6 ... ... 5 p2 • Table for each interface • One routing table 2
R2 R4 3 5 CSE R1 8 2 4 1 R3 10 R5 Distance vector • Router forwards distance info to others when its routing table is updated “CSE = 6” “CSE = 6” “CSE = 2” 1 “CSE = 2” “CSE = 2”
Net dist ... ... CSE inf ... ... What happens at R2? Routing table Net dist iface R2 ... ... ... CSE 4 6 p1 p2 ... ... ... Net dist p3 p1 ... ... 3 CSE 6 ... ... 5 Net dist ... ... CSE 4 ... ... p2 “CSE = 2” 2
Net dist ... ... 6 p1 CSE inf ... ... inf In case of link failure, • Switch to backup route • Problem: “Count-to-infinity problem” (next) Routing table Net dist iface R2 ... ... ... CSE 4 p2 ... ... ... Net dist p3 p1 ... ... 3 CSE 6 ... ... 5 Net dist ... ... CSE 4 ... ... p2 2
Routing table 5 p2 Net dist Net dist iface 11 p2 inf CSE 3 CSE 3 p1 Net dist 11 CSE 5 “CSE = 5” “CSE = 8” Net dist CSE 6 8 Routing table Net dist Net dist iface CSE 2 CSE 2 p3 inf 6 p4 8 p4 Count-to-infinity problem R2 p1 2 CSE p2 3 p4 R1 1 R3 1 p3
R2 R4 3 5 CSE R1 8 2 4 1 R3 10 R5 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 R2 5 LSP = R1 CSE 1 R3 1 LSP 1 LSP
R2 R4 3 5 CSE R1 8 2 4 1 R3 10 R5 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 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 R2 R4 3 LSP CSE 5 R1 1 8 2 LSP 4 R3 1 R5 10