Welcome to CS 56: Adanced Computer Networks Prof. Yanhua Li Time: 9:00am 9:50am M, T, R, and F Location: Fuller 0 Fall 07 A-term Some slides are originall the course materials of the tetbook Computer Networking: A Top Down Approach, 7th edition, b Jim Kurose, Keith Ross, Addison-Wesle March 06. Copright 996-07 J.F Kurose and K.W. Ross, All Rights Resered.
Chapter 5: outline 5. routing algorithms link state distance ector Network Laer 4-
Interpla between routing, forwarding routing algorithm local forwarding table dest address output link address-range address-range address-range address-range 4 routing algorithm determines end-end-path through network forwarding table determines local forwarding at this router IP destination address in arriing packet s header Network Laer 4-
Graph abstraction 5 graph: G = (N,E) u w 5 N = set of routers = { u,, w,,, } E = set of links ={ (u,), (u,), (u,w), (,), (,w), (,w), (,), (w,), (w,), (,) } aside: graph abstraction is useful in other network contets, e.g., PP, where N is set of peers and E is set of TCP connections Network Laer 4-4
Graph abstraction: costs u 5 w 5 c(, ) = cost of link (, ) e.g., c(w,) = 5 cost could alwas be, or inersel related to bandwidth. cost of path (,,,, p ) = c(, ) + c(, ) + + c( p-, p ) ke question: what is the least-cost path between u and? routing algorithm: algorithm that finds that least cost path Network Laer 4-5
Routing algorithm classification Q: global or decentralied information? global: all routers hae complete topolog, link cost info link state algorithms decentralied: router knows phsicallconnected neighbors, link costs to neighbors iteratie process of computation, echange of info with neighbors distance ector algorithms Q: static or dnamic? static: routes change slowl oer time dnamic: routes change more quickl periodic update in response to link cost changes Network Laer 4-6
Chapter 5: outline 5. routing algorithms link state distance ector Network Laer 4-7
A Link-State Routing Algorithm Dijkstra s algorithm net topolog, link costs known to all nodes accomplished ia link state broadcast all nodes hae same info computes least cost paths one node ("source ) to all other nodes gies forwarding table for that node iteratie: after k iterations, know least cost path to k nearest dest. s notation: gien src u c(,): link cost node to ; = if not direct neighbors D(): current alue of cost of path source to dest. p(): predecessor node along path source to N': set of nodes whose least cost path definitiel known Network Laer 4-8
hop Dijsktra s Algorithm k hops 0 Collect global topolog info Initialiation: N' = {u} for all nodes 4 if adjacent to u 5 then D() = c(u,) 6 else D() = 7 8 Loop 9 find w not in N' such that D(w) is a minimum 0 add w to N' update D() for all adjacent to w and not in N' : D() = min( D(), D(w) + c(w,) ) /* new is either old or known 4 shortest path w plus cost w to */ 5 until all nodes in N' notation: gien src u D(): current alue of cost of path source to dest. p(): predecessor node along path source to N': set of nodes whose least cost path definitiel known Network Laer 4-9
Dijkstra s algorithm: eample D() p() D(w) p(w) D() p() D() p() D() p() Step N' 0 u 7,u,u 5,u uw 6,w 5,u,w uw 6,w,w 4, uw 0, 4, 4 uw, 5 uw notes: construct shortest path b tracing predecessor nodes ties can eist (can be broken arbitraril) u 5 D() = min( D(), D(w) + c(w,) ) w 4 8 7 7 4 9 Network Laer 4-0
Dijkstra s algorithm: another eample 5 w 5 u Network Laer 4-
Network Laer 4- Dijkstra s algorithm: another eample Step 0 4 5 N' u u u u uw uw D(),p(),u,u,u D(w),p(w) 5,u 4,,, D(),p(),u D(),p(), D(),p() 4, 4, 4, u w 5 5
Dijkstra s algorithm: eample () resulting shortest-paths u: w u resulting forwarding table in u: destination w link (u,) (u,) (u,) (u,) (u,) Network Laer 4-
Chapter 5: outline 5. routing algorithms link state distance ector Network Laer 4-4
Distance ector algorithm Bellman-Ford equation (dnamic programming) let d () := cost of least-cost path to then d () = min {c(,) + d () } cost neighbor to destination neighbor min taken oer all neighbors of Network Laer 4-5
Bellman-Ford eample u 5 w 5 clearl, d () = 5, d () =, d w () = B-F equation sas: d u () = min { c(u,) + d (), c(u,) + d (), c(u,w) + d w () } = min { + 5, +, 5 + } = 4 node achieing minimum is net hop in shortest path, used in forwarding table Network Laer 4-6
Distance ector algorithm D () = estimate of least cost to maintains distance ector D = [D (): є N ] node : knows each neighbor : c(,) maintains its neighbors distance ectors. For each neighbor, maintains D = [D (): є N ] Network Laer 4-7
Distance ector algorithm ke idea: time-to-time, each node sends its own distance ector estimate to neighbors when receies new DV estimate neighbor, it updates its own DV using B-F equation: D () min {c(,) + D ()} for each node N under minor, natural conditions, the estimate D () conerge to the actual least cost d () Network Laer 4-8
Distance ector algorithm iteratie, asnchronous: each local iteration caused b: local link cost change DV update message neighbor distributed: each node notifies neighbors onl when its DV changes neighbors then notif their neighbors if necessar each node: wait for (change in local link cost or msg neighbor) recompute estimates if DV to an dest has changed, notif neighbors Network Laer 4-9
node table 0 7 D () = min{c(,) + D (), c(,) + D ()} = min{+0, 7+} = 0 0 7 0 D () = min{c(,) + D (), c(,) + D ()} = min{+, 7+0} = node table 0 7 node table 7 0 time Network Laer 4-0
node table node table 0 7 0 D () = min{c(,) + D (), c(,) + D ()} = min{+0, 7+} = 0 0 7 0 0 7 0 7 0 0 0 0 0 0 0 D () = min{c(,) + D (), c(,) + D ()} = min{+, 7+0} = 7 node table 7 0 0 7 0 0 0 0 0 time Network Laer 4-
Distance ector: link cost changes link cost changes: node detects local link cost change updates routing info, recalculates distance ector if DV changes, notif neighbors 4 50 good news traels fast t 0 : detects link-cost change, updates its DV, informs its neighbors. t : receies update, updates its table, computes new least, sends its neighbors its DV. t : receies s update, updates its distance table. s least costs do not change, so does not send a message to. Network Laer 4-
Distance ector: link cost changes link cost changes: node detects local link cost change bad news traels slow - count to infinit problem! 44 iterations before algorithm stabilies: see tet D()=6, D()=5 60 4 50 D()=4, D()=5 D()=8, D()=7 60 4 50 D()=8, D()=9 60 4 44 iterations D()=6, D()=5 50 D()=6, D()=7 D()=4, D()=5 60 4 50 D()=4, D()=5 Network Laer 4-
Comparison of LS and DV algorithms message compleit LS: with n nodes, E links, O(nE) msgs sent DV: echange between neighbors onl conergence time aries robustness: what happens if router malfunctions? LS: node can adertise incorrect link cost each node computes onl its own table DV: DV node can adertise incorrect path cost each node s table used b others error propagate thru network Network Laer 4-4
Questions? Network Laer 4-5