Announcements CS 6 Network Architecture and Protocols Lecture 8 Godmar Back Project A due Apr 8 (toda) Project B due in parts: Apr 9 and Ma 6 See link to NY Times article on RFC Project B Project B Highlevel View Suppose node calls inbound RPC Outbound/ Inbound over TCP Simulated link in topolog write_msg(/*port=*/, data) Simulator Overview Simulator calls outbound to n read_msg(/*from*/, /*port*/, data) Sim Project B: Under the hood Uses discrete event simulation Events are: packet received, r epired, cost change, link failure Virtual cost change on link connecting n and n n receives msg from n on port Routing Algorithms r on n epires, n calls write_msg(,..)
Routing Algorithm Classification Global or decentralied information? Global: all routers have complete topolog, link cost info link state algorithms Decentralied: router knows phsicallconnected neighbors, link costs to neighbors iterative process of computation, echange of info with neighbors distance vector algorithms Static or dnamic? Static: routes change slowl over Dnamic: routes change more quickl periodic update in response to link cost changes Note: Global/decentralied classification does not sa where routing computation is performed, it sas what information one has when computing routes 7 Link State Routing Routers periodicall broadcast link state information link state messages or LSA (link state advertisement) broadcast via sequencenumber controlled flooding All routers acquire complete connectivit + link cost information of entire network Each router computes routing table from that obtained topolog Dijkstra s shortest path to other routers, from computing router this becomes forwarding table 8 Distance Vector Algorithm () BellmanFord Equation (dnamic programming) Define d () := cost of leastcost path from to Then d () = min {c(,v) + d v () } where min is taken over all neighbors of 9 BellmanFord Eample () Clearl, d v () =, d () =, d w () = v w u BF equation sas: d u () = min { c(u,v) + d v (), c(u,) + d (), c(u,w) + d w () } = min { +, +, + } = Node that achieves minimum is net hop in shortest path forwarding table 0 Distance Vector Algorithm () D () = estimate of least cost from to Distance vector: D = [D (): N ] Node knows cost to each neighbor v: c(,v) Node maintains D = [D (): N ] Node also maintains its neighbors distance vectors (at least temporaril) For each neighbor v, maintains D v = [D v (): N ] Distance Vector Algorithm () Basic Idea: Each node periodicall sends its own distance vector estimate to neighbors When a node receives new DV estimate from neighbor, it updates its own DV using BF equation: D () min v {c(,v) + D v ()} for each node N Under minor, natural conditions, the estimate D () converges to actual least cost d ()
Distance Vector Algorithm () Iterative, asnchronous: each local iteration caused b: local link cost change DV update message from 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 of msg from neighbor) recompute estimates if DV to an dest has changed, notif neighbors Eample DV Routing 0 Eample (cont d) Eample (cont d) D () min v {c(,v) + D v ()} for each node N Converged after iterations 0 0 What if link cost changes? 6 Distance Vector: Link Cost Changes Link cost changes: node detects local link cost change updates routing info, recalculates distance vector if DV changes, notif neighbors good news travels fast At t 0, detects the linkcost change, updates its DV, and informs its neighbors. At t, receives the update from and updates its table. It computes a new least cost to and sends its neighbors its DV. At t, receives s update and updates its distance table. s least costs do not change and hence does not send an message to. 7 CountToInfinit Before change: 6 to via 7 to via 8 8 to via
Distance Vector: Link Cost Changes Link cost changes: good news travels fast bad news travels slow count to infinit problem! iterations before algorithm stabilies Poisoned reverse: 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 completel solve count to infinit problem? 9 Poisoned Reverse After change: 6 to via Don t tell dist to to via 0 Comparison of LS and DV algorithms Message compleit LS: with n nodes, E links, O(nE) msgs sent DV: echange between neighbors onl convergence varies Speed of Convergence LS: O(n ) algorithm requires O(nE) msgs ma have oscillations DV: convergence varies ma be routing loops counttoinfinit problem Robustness: what happens if router malfunctions? LS: node can advertise incorrect link cost each node computes onl its own table DV: DV node can advertise incorrect path cost each node s table used b others error propagates thru network Hierarchical Routing Our routing stud thus far idealiation all routers identical network flat not true in practice scale: with 00 million destinations: can t store all dest s in routing tables! routing table echange would swamp links! administrative autonom internet = network of networks each network admin ma want to control routing in its own network Hierarchical Routing Interconnected ASes aggregate routers into regions, autonomous sstems (AS) routers in same AS run same routing protocol intraas routing protocol routers in different AS ma run different intra AS routing protocols Gatewa router Direct link to router in another AS Eample: [] a c d b IntraAS Routing algorithm AS Forwarding table InterAS Routing algorithm AS Forwarding table is configured b both intra and interas routing algorithm IntraAS sets entries for internal dests InterAS & IntraAS sets entries for eternal dests
Suppose router in AS AS the gatewa routers, but a InterAS tasks c d b AS needs:. to learn which dests are reachable through AS and which through. to propagate this reachabilit info to all routers in AS Job of interas routing! AS AS InterAS tasks (cont d) Suppose router in AS AS the gatewa routers, but route to c a b d Scenario Destination is reachable through single AS InterAS must propagate this Least cost path to c information inside AS is interface l, add (, l) to routing table AS Spread AS in AS: use gatewa c to get to AS does not advertise route to 6 Suppose router in AS AS the gatewa routers, but a Hot Potato Routing c d b Scenario : Destination is reachable through multiple AS: Hot potato routing: send packet towards closest of two routers AS AS 7 Suppose router in AS AS the gatewa routers, but route to c a b d Hot Potato Routing Scenario : Destination is reachable through multiple AS: Hot potato routing: send packet b is closer than c, towards closest of two interface k leads to routers b, so add (, k) to routing table Spread AS in AS: AS c and b lead to AS route to 8 Summar Routing algorithms: Link State Distance Vector Hierarchical Routing AS: autonomous sstems Net: application to Internet/IP 9