Chapter 4: Introdction (forarding and roting) Reie of qeeing theor Roting algorithms Link state, Distance Vector Roter design and operation IP: Internet Protocol IP4 (datagram format, addressing, ICMP, NAT) Ip6 Roting in the Internet Atonomos Sstems Roting protocols (RIP, OSPF, BGP) Interpla beteen roting, forarding roting algorithm local forarding table header ale otpt link 000 00 0 00 ale in arriing packet s header 0
Roting Algorithm classification Static or dnamic? Static: rotes change slol oer time manal configration Dnamic: rotes change more qickl periodic pdates in response to link cost changes Global or decentralied information? Global: all roters hae complete topolog, link cost info link state algorithms Decentralied: roter knos phsicallconnected neighbors, link costs to neighbors iteratie process of comptation, echange of info ith neighbors distance ector algorithms Graph abstraction Graph: G = (N,E) N = set of roters = {,,,,, } E = set of links ={ (,), (,), (,), (,), (,), (,), (,), (,), (,) } Remark: Real netork roting algorithms tpicall se DIRECTED graphs.
Graph abstraction: costs c(, ) = cost of link (, ) - e.g., c(,) = cost cold be (hop cont) inersel related to bandidth, inersel related to congestion, cont of packets in qee, some combination of aboe Cost of path (,,,, p ) = c(, ) + c(, ) + + c( p-, p ) Qestion: What s the least-cost path beteen and? Roting algorithm: algorithm that finds least-cost path from sorce to destination. Principle of Optimalit If node B lies on an optimal path from node A to node C, then an optimal path from node B to node C also lies along the same path. Wh does this propert hold?
Principal of Optimalit The reslt is that the set of optimal rotes from all sorces to a gien destination form sink tree rooted a the destination. In general, is the sink tree niqe? A Link-State Roting Algorithm Dijkstra s algorithm In-memor graph of netork netork topolog, link costs knon to all nodes accomplished b flooding link state adertisements all nodes hae same info comptes least cost paths from one node (sorce) to all other nodes gies forarding table for that node iteratie: after k iterations, kno least cost path to k destinations Notation: c(,): link cost from node to ; = if not direct neighbors D(): crrent ale of cost of path from sorce to dest. p(): predecessor node along path from sorce to M: set of nodes hose least cost path definitiel knon 4
Basic Idea Find the shortest paths from a gien sorce node to all other nodes Proceeds in stages bild the sink tree one branch at a time. B the kth stage, the shortest paths to the k nodes closest to the sorce hae been determined (and added to set M) At (k + )st stage, that node not alread in M that has the shortest path from the sorce is added to M As nodes are added to M, their path from the sorce is defined. Dijsktra s Algorithm Initialiation: M= {} for all nodes 4 if adjacent to then D() = c(,) 6 else D() = 7 8 Loop 9 find not in M sch that D() is a minimm 0 add to M pdate D() for all adjacent to and not in M : D() = min( D(), D() + c(,) ) /* ne cost to is either old cost to or knon 4 shortest path cost to pls cost from to */ ntil all nodes in M
Dijkstra s algorithm: eample Step M D(V)p() D(W)p() D()p() D(Y)p() D(Z)p() Dijkstra s algorithm: reslt Reslting shortest-path tree from : Reslting forarding table in : destination link (,) (,) (,) (,) (,) 6
Bellman-Ford Algorithm Proceeds in stages. Find the shortest paths from a gien sorce sbject to the constraint that the paths contain at most one link Net, find all that contain to links....and so on. Bellman-Ford Variables: c(,) = link cost h = ma nmber of links in path at crrent stage D h () = cost of least-cost path from sorce to node nder the constraint of no more than h links 7
Algorithm Let s be the sorce node Initialie D 0 (n) = for all n s For each sccessie h > 0, D h+ (n) = min j [D h (j) + c(j,n)] When does the algorithm halt? Bellman-Ford Eample Sorce = h D h () D h () D h () D h () D h () 8
Comparison Both Dijkstra s algorithm and the Bellman- Ford algorithm conerge to shortest path soltions nder static conditions. Compleit? Sitabilit for distribted implementation? Distance Vector Protocol D () = estimate of least cost from to Node knos cost to each neighbor : c(,) Node maintains distance ector D = [D (): є N ] Node also maintains its neighbors distance ectors For each neighbor, maintains D = [D (): є N ] 9
Distance Vector Protocol Bellman-Ford Eqation Define D () := cost of least-cost path from sorce to Then D () = min {c(,) + D () } here min is taken oer all neighbors of Distance ector protocol Basic idea: From time to time, each node sends its on distance ector estimate to neighbors Asnchronos When a node receies ne DV estimate from neighbor, it pdates its on DV sing B-F eqation: D () min {c(,) + D ()} for each node N Under normal conditions, the estimates D () conerge to the actal least cost d () 0
Distance Vector Algorithm Iteratie, asnchronos: each local iteration cased b: local link cost change DV pdate message from neighbor Distribted: each node notifies neighbors onl hen its DV changes neighbors then notif their neighbors if necessar Each node: ait for (change in local link cost or msg from neighbor) recompte estimates if DV to an dest has changed, notif neighbors Distance Vector Eample
Comparison of LS and DV algorithms Message compleit LS: ith n nodes, E links, O(nE) msgs sent DV: echange beteen neighbors onl conergence time aries Speed of Conergence LS: O(n ) algorithm reqires O(nE) msgs ma hae oscillations DV: conergence time aries roting loops possible cont-to-infinit problem Robstness: hat happens if roter malfnctions? LS: node can adertise incorrect link cost each node comptes onl its on table DV: DV node can adertise incorrect path cost each node s table sed b others error propagates throgh netork DV Cont to Infinit So in this eample, the Bellman-Ford algorithm ill conerge for each roter, the ill hae entries for each other. B ill kno that it can get to C at a cost of, and A ill kno that it can get to C ia B at a cost of. Sorce: https://.geeksforgeeks.org/compter-netork-rote-poisoningconting-infinit-problem/
DV Cont to Infinit (cont) If the link beteen B and C is disconnected, then B ill kno that it can no longer get to C ia that link and ill remoe it from it s table. Before it can send an pdates it s possible that it ill receie an pdate from A hich ill be adertising that it can get to C at a cost of. B can get to A at a cost of, so it ill pdate a rote to C ia A at a cost of. A ill then receie pdates from B later and pdate its cost to 4. The ill then go on feeding each other bad information toard infinit.