Presentation is loading. Please wait.

Presentation is loading. Please wait.

EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)

Similar presentations


Presentation on theme: "EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)"— Presentation transcript:

1 EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)

2 istoica@cs.berkeley.edu2 Internet Routing  Internet organized as a two level hierarchy  First level – autonomous systems (AS’s) -AS – region of network under a single administrative domain  AS’s run an intra-domain routing protocols -Distance Vector, e.g., RIP -Link State, e.g., OSPF  Between AS’s runs inter-domain routing protocols, e.g., Border Gateway Routing (BGP) -De facto standard today, BGP-4

3 istoica@cs.berkeley.edu3 Example AS-1 AS-2 AS-3 Interior router BGP router

4 istoica@cs.berkeley.edu4 Intra-domain Routing Protocols  Based on unreliable datagram delivery  Distance vector -Routing Information Protocol (RIP), based on Bellman-Ford -Each neighbor periodically exchange reachability information to its neighbors -Minimal communication overhead, but it takes long to converge, i.e., in proportion to the maximum path length  Link state -Open Shortest Path First Protocol (OSPF), based on Dijkstra -Each network periodically floods immediate reachability information to other routers -Fast convergence, but high communication and computation overhead

5 istoica@cs.berkeley.edu5 Routing  Goal: determine a “good” path through the network from source to destination -Good means usually the shortest path  Network modeled as a graph -Routers  nodes -Link  edges Edge cost: delay, congestion level,… A E D CB F 2 2 1 3 1 1 2 5 3 5

6 istoica@cs.berkeley.edu6 A Link State Routing Algorithm Dijkstra’s algorithm  Net topology, link costs known to all nodes -Accomplished via “link state broadcast” -All nodes have same info  Compute least cost paths from one node (‘source”) to all other nodes  Iterative: after k iterations, know least cost path to k closest destinations Notations  c(i,j): link cost from node i to j; cost infinite if not direct neighbors  D(v): current value of cost of path from source to destination v  p(v): predecessor node along path from source to v, that is next to v  S: set of nodes whose least cost path definitively known

7 istoica@cs.berkeley.edu7 Dijsktra’s Algorithm 1 Initialization: 2 S = {A}; 3 for all nodes v 4 if v adjacent to A 5 then D(v) = c(A,v); 6 else D(v) = ; 7 8 Loop 9 find w not in S such that D(w) is a minimum; 10 add w to S; 11 update D(v) for all v adjacent to w and not in S: 12 D(v) = min( D(v), D(w) + c(w,v) ); 13 // new cost to v is either old cost to v or known 14 // shortest path cost to w plus cost from w to v 15 until all nodes in S;

8 istoica@cs.berkeley.edu8 Example: Dijkstra’s Algorithm Step 0 1 2 3 4 5 start S A D(B),p(B) 2,A D(C),p(C) 5,A D(D),p(D) 1,A D(E),p(E) D(F),p(F) A E D CB F 2 2 1 3 1 1 2 5 3 5

9 istoica@cs.berkeley.edu9 Example: Dijkstra’s Algorithm Step 0 1 2 3 4 5 start S A AD D(B),p(B) 2,A D(C),p(C) 5,A 4,D D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) A E D CB F 2 2 1 3 1 1 2 5 3 5

10 istoica@cs.berkeley.edu10 Example: Dijkstra’s Algorithm Step 0 1 2 3 4 5 start S A AD ADE D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E A E D CB F 2 2 1 3 1 1 2 5 3 5

11 istoica@cs.berkeley.edu11 Example: Dijkstra’s Algorithm Step 0 1 2 3 4 5 start S A AD ADE ADEB D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E A E D CB F 2 2 1 3 1 1 2 5 3 5

12 istoica@cs.berkeley.edu12 Example: Dijkstra’s Algorithm Step 0 1 2 3 4 5 start S A AD ADE ADEB ADEBC D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E A E D C B F 2 2 1 3 1 1 2 5 3 5

13 istoica@cs.berkeley.edu13 Example: Dijkstra’s Algorithm Step 0 1 2 3 4 5 start S A AD ADE ADEB ADEBC ADEBCF D(B),p(B) 2,A D(C),p(C) 5,A 4,D 3,E D(D),p(D) 1,A D(E),p(E) 2,D D(F),p(F) 4,E A E D CB F 2 2 1 3 1 1 2 5 3 5

14 istoica@cs.berkeley.edu14 Dijkstra’s Algorithm: Discussion  Algorithm complexity: n nodes -Each iteration: need to check all nodes, w, not in S -n*(n+1)/2 comparisons: O(n**2) -More efficient implementations possible: O(n*log(n))  Oscillation possible -E.g., link cost = amount of carried traffic A D C B 1 1+e e 0 e 1 1 0 0 initially A D C B 2+e 0 0 0 1+e 1 … recompute routing A D C B 0 2+e 1+e 1 0 0 … recompute A D C B 2+e 0 e 0 1+e 1 … recompute

15 istoica@cs.berkeley.edu15 Distance Vector Routing Algorithm  Iterative: continues until no nodes exchange info  Asynchronous: nodes need not exchange info/iterate in lock step!  Distributed: each node communicates only with directly- attached neighbors  Routing (distance) table data structure – each router maintains -Row for each possible destination -Column for each directly-attached neighbor to node -Entry in row Y and column Z of node X  distance from X to Y, via Z as next hop

16 istoica@cs.berkeley.edu16 Example: Distance (Routing) Table A E D CB 6 8 1 2 1 2 D () A B C D A1764A1764 B 14 8 9 11 D5542D5542 E cost to destination via destination D (C,D) E c(E,D) + min {D (C,w)} D w = = 2+2 = 4 D (A,D) E c(E,D) + min {D (A,w)} D w = = 2+3 = 5 D (A,B) E c(E,B) + min {D (A,w)} B w = = 8+6 = 14 loop!

17 istoica@cs.berkeley.edu17 Routing Table  Forwarding Table D () A B C D A1764A1764 B 14 8 9 11 D5542D5542 E cost to destination via destination ABCD ABCD A,1 D,5 D,4 D,2 Outgoing link to use, cost destination Distance (routing) table Forwarding table

18 istoica@cs.berkeley.edu18 Distance Vector Routing: Overview  Each local iteration caused by: -Local link cost change -Message from neighbor: its least cost path change from neighbor  Each node notifies neighbors only when its least cost path to any destination changes -Neighbors then notify their neighbors if necessary wait for (change in local link cost of msg from neighbor) recompute distance table if least cost path to any dest has changed, notify neighbors Each node:

19 istoica@cs.berkeley.edu19 Distance Vector Algorithm 1 Initialization: 2 for all adjacent nodes v: 3 D (*,v) = /* the * operator means "for all rows" */ 4 D (v,v) = c(X,v) 5 for all destinations, y 6 send min D (y,w) to each neighbor /* w over all X's neighbors */ X X X w At all nodes, X:

20 istoica@cs.berkeley.edu20 Distance Vector Algorithm (cont’d) 8 loop 9 wait (until I see a link cost change to neighbor V 10 or until I receive update from neighbor V) 11 12 if (c(X,V) changes by d) 13 /* change cost to all dest's via neighbor v by d */ 14 /* note: d could be positive or negative */ 15 for all destinations y: D (y,V) = D (y,V) + d 16 17 else if (update received from V wrt destination Y) 18 /* shortest path from V to some Y has changed */ 19 /* V has sent a new value for its min D (Y,w) */ 20 /* call this received new value is "newval" */ 21 for the single destination y: D (Y,V) = c(X,V) + newval 22 23 if we have a new min D (Y,w) for any destination Y 24 send new value of min D (Y,w) to all neighbors 25 26 forever w XX X X X w w V

21 istoica@cs.berkeley.edu21 Example: Distance Vector Algorithm X Z 1 2 7 Y

22 istoica@cs.berkeley.edu22 Example: Distance Vector Algorithm X Z 1 2 7 Y D (Y,Z) X c(X,Z) + min {D (Y,w)} w = = 7+1 = 8 Z D (Z,Y) X c(X,Y) + min {D (Z,w)} w = = 2+1 = 3 Y

23 istoica@cs.berkeley.edu23 Example: Distance Vector Algorithm X Z 1 2 7 Y

24 istoica@cs.berkeley.edu24 Example: Distance Vector Algorithm X Z 1 2 7 Y

25 istoica@cs.berkeley.edu25 Distance Vector: Link Cost Changes X Z 1 4 50 Y 1 algorithm terminates “good news travels fast”  Link cost changes: -Node detects local link cost change -Updates distance table (line 15) -If cost change in least cost path, notify neighbors (lines 23,24)

26 istoica@cs.berkeley.edu26 Distance Vector: Link Cost Changes X Z 1 4 50 Y 60 algorithm continues on!  Link cost changes -Good news travels fast -Bad news travels slow - “count to infinity” problem!

27 istoica@cs.berkeley.edu27 Distance Vector: Poisoned Reverse X Z 1 4 50 Y 60 algorithm terminates  If Z routes through Y to get to X: -Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z) -Will this completely solve count to infinity problem?

28 istoica@cs.berkeley.edu28 Link State vs. Distance Vector Per node message complexity  LS: O(n*e) messages; n – number of nodes; e – number of edges  DV: O(d) messages; where d is node’s degree Complexity  LS: O(n**2) with O(n*e) messages  DV: convergence time varies -may be routing loops -count-to-infinity problem Robustness: what happens if router malfunctions?  LS: -node can advertise incorrect link cost -each node computes only its own table  DV: -DV node can advertise incorrect path cost -each node’s table used by others; error propagate through network


Download ppt "EE 122: Intra-domain routing Ion Stoica September 30, 2002 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)"

Similar presentations


Ads by Google