1 / 53

Distance Vector Routing

Distance Vector Routing. EE 122, Fall 2013 Sylvia Ratnasamy http://inst.eecs.berkeley.edu/~ee122/. How Distance-Vector (DV) works. Each router maintains its shortest distance to every destination via each of its neighbors. Neighbor (next-hop). F rom node A. A.

guang
Télécharger la présentation

Distance Vector Routing

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Distance Vector Routing EE 122, Fall 2013 Sylvia Ratnasamy http://inst.eecs.berkeley.edu/~ee122/

  2. How Distance-Vector (DV) works Each router maintains its shortest distance to every destination via each of its neighbors Neighbor (next-hop) From node A A distC(A, D): shortest distance from A to D via C Destinations

  3. How Distance-Vector (DV) works Each router computes its shortest distance to every destination via any of its neighbors MIN { distB(A,B), distC(A, B) } A’s distance vector (DV) From node A A

  4. How Distance-Vector (DV) works How does A initialize its dist() table and DV? A’s DV From node A A

  5. How Distance-Vector (DV) works A B C c(A,B) Link costs c(A,C) How does A initialize its dist() table and DV?

  6. How Distance-Vector (DV) works Each router initializes its dist() table based on its immediate neighbors and link costs A’s DV From node A A B C c(A,B) c(A,C)

  7. How Distance-Vector (DV) works Each router sends its DV to its immediate neighbors A’s DV From node A A B C c(A,B) c(A,C)

  8. How Distance-Vector (DV) works From node B A’s DV B’s DV Routers process received DVs 5 A B C c(A,B) c(A,C)

  9. How Distance-Vector (DV) works From node B A’s DV B’s DV Routers process received DVs 11 5 A B C 7 7 c(A,C) new =c(B,A) + mindist(A, C) new =c(B,A) + mindist(A, D) And repeat…

  10. Distance Vector Routing • Each router knows the links to its neighbors • Each router has provisional “shortest path” to every other router -- its distance vector (DV) • Routers exchange this DV with their neighbors • Routers look over the set of options offered by their neighbors and select the best one • Iterative process converges to set of shortest paths

  11. Distance Vector 0 At node A 1 Initialization: 2 for alldestinations V do 3 ifVis neighbor of A 4 distV(A, V) = mindist(A,V) = c(A,V); else distV(A, V) = mindist(A,V) = ∞; sendmindist(A, *) to all neighbors loop: 8 wait (until A sees a link cost change to neighbor V /* case 1 */ 9 or until A receives mindist(V,*) from neighbor V) /* case 2 */ if(c(A,V) changes by ±d) /*  case 1 */ for all destinations Y do distV(A,Y) = distV(A,Y) ± d else /*  case 2:*/ for all destinations Y do distV(A,Y) = c(A,V) + mindist(V, Y); update mindist(A,*) 15 if(there is a change in mindist(A, *)) 16 sendmindist(A, *) to all neighbors 17 forever • c(i,j): link cost from node i to j • distZ(A,V): shortest dist. from A to V via Z • mindist(A,V): shortest dist. from A to V

  12. Distance Vector 0 At node A 1 Initialization: 2 for alldestinations V do 3 ifVis neighbor of A 4 distV(A, V) = mindist(A,V) = c(A,V); else distV(A, V) = mindist(A,V) = ∞; sendmindist(A, *) to all neighbors loop: 8 wait (until A sees a link cost change to neighbor V /* case 1 */ 9 or until A receives mindist(V,*) from neighbor V) /* case 2 */ if(c(A,V) changes by ±d) /*  case 1 */ for all destinations Y do distV(A,Y) = distV(A,Y) ± d else /*  case 2:*/ for all destinations Y do distV(A,Y) = c(A,V) + mindist(V, Y); update mindist(A,*) 15 if(there is a change in mindist(A, *)) 16 sendmindist(A, *) to all neighbors 17 forever • c(i,j): link cost from node i to j • distZ(A,V): shortest dist. from A to V via Z • mindist(A,V): shortest dist. from A to V

  13. C D B A Example: Initialization from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  14. C D B A Example: C sends update to A from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  15. C D B A Example: C sends update to A 3 2 1 1 7 from Node A

  16. C D B A Example: C sends update to A 3 2 1 1 7 from Node A

  17. C D B A Example: C sends update to A 3 2 1 1 7 from Node A

  18. C D B A Example: now B sends update to A from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  19. C D B A Example: now B sends update to A from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  20. C D B A Example: now B sends update to A from Node B from Node D 3 2 1 1 from Node C 7 from Node A Make sure you know why this is 5, not 4!

  21. C D B A Example: now B sends update to A from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  22. C D B A Make sure you understand why some entries are still ∞ All nodes knows the best two-hop paths. Make sure you believe this Example: After 1st Full Exchange from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  23. C D B A Example: Now A sends update to B from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  24. C D B A This will come back to bite us Example: Now A sends update to B from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  25. C D B A Example: End of 2nd Full Exchange Check:All nodes knows the best three-hop paths. from Node B from Node D 3 2 1 1 from Node C 7 from Node A Check

  26. C D B A No change in DVs  Convergence! Example: End of 3nd Full Exchange from Node B from Node D 3 2 1 1 from Node C 7 from Node A

  27. Intuition • Initial state: best one-hop paths • One simultaneous round: best two-hop paths • Two simultaneous rounds: best three-hop paths • … • Kth simultaneous round: best (k+1) hop paths • Must eventually converge • as soon as it reaches longest best path • …..but how does it respond to changes in cost? The key here is that the starting point is not the initialization, but some other set of entries. Convergence could be different!

  28. C A B Link cost changes here DV: Link Cost Changes 1 4 1 50 via Stable state C sends its DV to A, B A-B changed B sends itsDV to A, C A sends its DV to B, C Node A to Note: none of B’s paths use link (A,C) deduct 3 from distancesdistB(A,*) and distA(B,*) Node B Node C “good news travels fast”

  29. C B A Link cost changes here DV: Link Cost Changes 60 4 1 50 via Stable state A-B changed Node A to add 56 to distancesdistB(A,*) and distA(B,*) Node B Node C

  30. C A B Link cost changes here DV: Link Cost Changes 60 4 1 50 via Stable state C sends its DV to A, B A-B changed B sends itsDV to A, C A sends its DV to B, C Node A to This is the “Counting to Infinity” Problem Node B Node C “bad news travels slowly” (not yet converged)

  31. The “Poisoned Reverse” Rule • Heuristic to avoid count-to-infinity • If B routes via C to get to A: • B tells C its (B’s) distance to A is infinite (so C won’t route to A via B)

  32. C B A Link cost changes here DV: Poisoned Reverse 60 4 1 If B routes through C to get to A:B tells C its (B’s) distance to A is infinite 50 via Stable state A-B changed Node A to Node B ∞ ∞ Node C

  33. C B A Link cost changes here DV: Poisoned Reverse 60 4 1 If B routes through C to get to A:B tells C its (B’s) distance to A is infinite 50 via Stable state A-B changed B sends itsDV to A, C A sends its DV to B, C Node A to Node B ∞ ∞ ∞ ∞ ∞ ∞ Node C ∞ ∞

  34. C B A Link cost changes here DV: Poisoned Reverse 60 4 1 If B routes through C to get to A:B tells C its (B’s) distance to A is infinite 50 via Stable state A-B changed B sends itsDV to A, C A sends its DV to B, C Node A to Node B ∞ ∞ ∞ ∞ ∞ ∞ Node C ∞ ∞

  35. C B A Link cost changes here DV: Poisoned Reverse 60 4 1 If B routes through C to get to A:B tells C its (B’s) distance to A is infinite 50 via Stable state C sends its DV to A, B A-B changed B sends itsDV to A, C A sends its DV to B, C Node A to Node B ∞ ∞ ∞ ∞ ∞ ∞ Node C ∞ ∞ ∞ ∞ Converges after C receives another update from B

  36. Will Poison-Reverse Completely Solve the Count-to-Infinity Problem? D 100 1 ∞ 4 B 4 100 1 100 1 ∞ 1 1 ∞ 6 3 ∞ 1 A C ∞ 2 2 5 Numbers in blue denote the best cost to destination D advertised along the link

  37. A few other inconvenient aspects • What if we use a non-additive metric? • E.g., maximal capacity • What if routers don’t use the same metric? • I want low delay, you want low loss rate? • What happens if nodes lie?

  38. E.g.: All nodes want to maximize capacity A high capacity link gets reduced to low capacity Problem:“cost” does not change around loop Additive measures avoid this problem!

  39. E.g.: no agreement on metrics Cares about price, then loss Cares about delay, then price Low price link Low loss link Low delay link Cares about loss, then delay Low delay link Low loss link Low price link

  40. Must agree on loop-avoiding metric • When all nodes minimize same metric • And that metric increases around loops • Then process is guaranteed to converge

  41. What happens when routers lie? • What if a router claims a 1-hop path to everywhere? • All traffic from nearby routers gets sent there • How can you tell if they are lying? • Can this happen in real life? • It has, several times….

  42. Recap: DV • Core idea: tell your immediate neighbors about your least cost distance to all nodes • Recall LS: tell all nodes about your immediate neighbors • Each node maintains global state • O(N) forwarding tables, where N is #nodes • The same is true for LS • Vulnerable to convergence problems • count-to-infinity and loops • LS faces similar (not identical) concerns • Not robust to nodes lying • The same is truefor LS

  43. Routing Information Protocol (RIP) • Implementation of Distance Vector • Nodes send distance vectors every 30 seconds • … or, when an update causes a change in routing • Link costs in RIP • All links have cost 1 • Valid distances of 1 through 15 (16 represents infinity) • Small “infinity” smaller“counting to infinity”problem • RIP is limited to fairly small networks • E.g., Princeton uses RIP • But UCB uses OSPF (LS-based protocol)

  44. Let’s back up for a minute…

  45. What are desirable goals for a routing solution? • “Least cost” paths • Avoid loops, converge quickly • Scalable • #messages • table size • processing complexity • Secure (later in the course) • Policy/rich metrics (later in the course) • Load balanced (later in the course)

  46. What are desirable goals for a routing solution? • “Least cost” paths • Avoid loops, converge quickly • Scalable • #messages • table size • processing complexity • Secure (later in the course) • Policy/rich metrics (later in the course) • Load balanced (later in the course)

  47. Any ideas on how to avoid loops? • Hint:

  48. Any ideas on how to improve scaling? • Hint:

  49. More thoughts on routing…

  50. *cast Routes (later in the course) • Our model so far: find a route between two specific endpoints -- e.g., route from A to B • this is called a unicast route • What other forms of communication might A want? • broadcast: send to all • multicast: send to all members of a group • anycast: send to any member of a group • What if A and B want to communicate along more than one path? • multipath routing

More Related