EE : Intra-domain routing Ion Stoica September 0, 00 (* this presentation is based on the on-line slides of J. Kurose & K. Rose)
Internet Routing Internet organized as a two level hierarchy First level autonomous systems (S s) - S region of network under a single administrative domain S s run an intra-domain routing protocols - istance Vector, e.g., RIP - Link State, e.g., OSPF Between S s runs inter-domain routing protocols, e.g., Border Gateway Routing (BGP) - e facto standard today, BGP-4 istoica@cs.berkeley.edu
Example Interior router BGP router S- S- S- istoica@cs.berkeley.edu
Intra-domain Routing Protocols Based on unreliable datagram delivery istance 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 ijkstra - Each network periodically floods immediate reachability information to other routers - Fast convergence, but high communication and computation overhead istoica@cs.berkeley.edu 4
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, B E F istoica@cs.berkeley.edu
Link State Routing lgorithm ijkstra s algorithm Net topology, link costs known to all nodes - ccomplished via link state broadcast - ll nodes have same info ompute 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 (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 istoica@cs.berkeley.edu 6
ijsktra s lgorithm Initialization: S = {}; for all nodes v 4 if v adjacent to then (v) = c(,v); 6 else (v) = ; 7 8 Loop 9 find w not in S such that (w) is a minimum; 0 add w to S; update (v) for all v adjacent to w and not in S: (v) = min( (v), (w) + c(w,v) ); // new cost to v is either old cost to v or known 4 // shortest path cost to w plus cost from w to v until all nodes in S; istoica@cs.berkeley.edu 7
Example: ijkstra s lgorithm Step 0 4 start S (B),p(B), (),p(), (),p(), (E),p(E) (F),p(F) B E F istoica@cs.berkeley.edu 8
Example: ijkstra s lgorithm Step 0 4 start S (B),p(B), (),p(), 4, (),p(), (E),p(E), (F),p(F) B E F istoica@cs.berkeley.edu 9
Example: ijkstra s lgorithm Step 0 4 start S E (B),p(B), (),p(), 4,,E (),p(), (E),p(E), (F),p(F) 4,E B E F istoica@cs.berkeley.edu 0
Example: ijkstra s lgorithm Step 0 4 start S E EB (B),p(B), (),p(), 4,,E (),p(), (E),p(E), (F),p(F) 4,E B E F istoica@cs.berkeley.edu
Example: ijkstra s lgorithm Step 0 4 start S E EB EB (B),p(B), (),p(), 4,,E (),p(), (E),p(E), (F),p(F) 4,E B E F istoica@cs.berkeley.edu
Example: ijkstra s lgorithm Step 0 4 start S E EB EB EBF (B),p(B), (),p(), 4,,E (),p(), (E),p(E), (F),p(F) 4,E B E F istoica@cs.berkeley.edu
ijkstra s lgorithm: iscussion lgorithm complexity: n nodes - Each iteration: need to check all nodes, w, not in S - n*(n+)/ comparisons: O(n**) - More efficient implementations possible: O(n*log(n)) Oscillation possible - E.g., link cost = amount of carried traffic +e 0 0 B 0 e e initially +e 0 +e B 0 0 recompute routing 0 +e B 0 0 +e recompute +e 0 B 0 +e e recompute istoica@cs.berkeley.edu 4
istance Vector Routing lgorithm Iterative: continues until no nodes exchange info synchronous: nodes need not exchange info/iterate in lock step! istributed: each node communicates only with directlyattached neighbors Routing (distance) table data structure each router maintains - Row for each possible destination - olumn for each directly-attached neighbor to node - Entry in row Y and column Z of node distance from to Y, via Z as next hop Z ( Y, Z) = c(, Z) + min { ( Z, w)} w istoica@cs.berkeley.edu
Example: istance (Routing) Table 6 E (,) E (,) E (,B) B E 8 = c(e,) + min { (,w)} w = + = 4 = c(e,) + min { (,w)} w = + = B = c(e,b) + min { (,w)} w = 8+6 = 4 loop! loop! destination E () istoica@cs.berkeley.edu 6 B cost to destination via 7 6 4 B 4 8 9 4
Routing Table Forwarding Table E () cost to destination via B Outgoing link to use, cost 4, destination B 7 6 8 9 4 destination B,,4 4, istance (routing) table Forwarding table istoica@cs.berkeley.edu 7
istance 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 Each node: 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 istoica@cs.berkeley.edu 8
istance Vector lgorithm t all nodes, : Initialization: for all adjacent nodes v: (*,v) = /* the * operator means "for all rows" */ 4 (v,v) = c(,v) for all destinations, y 6 send min (y,w) to each neighbor /* w over all 's neighbors */ w istoica@cs.berkeley.edu 9
istance Vector lgorithm (cont d) 8 loop 9 wait (until I see a link cost change to neighbor V 0 or until I receive update from neighbor V) if (c(,v) changes by d) /* change cost to all dest's via neighbor v by d */ 4 /* note: d could be positive or negative */ for all destinations y: (y,v) = (y,v) + d 6 7 else if (update received from V wrt destination Y) 8 /* shortest path from V to some Y has changed */ 9 /* V has sent a new value for its min V w (Y,w) */ 0 /* call this received new value is "newval" */ for the single destination y: (Y,V) = c(,v) + newval if we have a new min w (Y,w) for any destination Y 4 send new value of min w (Y,w) to all neighbors 6 forever istoica@cs.berkeley.edu 0
Example: istance Vector lgorithm Y 7 Z istoica@cs.berkeley.edu
Example: istance Vector lgorithm Y 7 Z (Y,Z) Z = c(,z) + min { (Y,w)} w = 7+ = 8 (Z,Y) Y = c(,y) + min { (Z,w)} w = + = istoica@cs.berkeley.edu
Example: istance Vector lgorithm Y 7 Z istoica@cs.berkeley.edu
Example: istance Vector lgorithm Y 7 Z istoica@cs.berkeley.edu 4
istance Vector: Link ost hanges Link cost changes: - Node detects local link cost change - Updates distance table (line ) - If cost change in least cost path, notify neighbors (lines,4) 4 Y 0 Z good news travels fast algorithm terminates istoica@cs.berkeley.edu
istance Vector: Link ost hanges Link cost changes - Good news travels fast - Bad news travels slow - count to infinity problem! 60 4 Y 0 Z algorithm continues on! istoica@cs.berkeley.edu 6
istance Vector: Poisoned Reverse If Z routes through Y to get to : - Z tells Y its (Z s) distance to is infinite (so Y won t route to via Z) - Will this completely solve count to infinity problem? 60 4 Y 0 Z algorithm terminates istoica@cs.berkeley.edu 7
Link State vs. istance Vector Per node message complexity LS: O(n*e) messages; n number of nodes; e number of edges V: O(d) messages; where d is node s degree omplexity LS: O(n**) with O(n*e) messages V: 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 V: - V node can advertise incorrect path cost - each node s table used by others; error propagate through network istoica@cs.berkeley.edu 8