IP orwarding 5-5- omputer Networking 5- Lecture : Routing Peter Steenkiste all www.cs.cmu.edu/~prs/5-- The Story So ar IP addresses are structured to reflect Internet structure IP packet headers carry these addresses When Packet rrives at Router xamine header to determine intended destination Look up in table to determine next hop in path longest prefix match Send packet out appropriate port This/next lecture How to generate the forwarding table Router Generic Router rchitecture Third Generation Routers Header Processing ata Hdr ata Hdr Lookup Update Queue IP ddress Header Packet M prefixes Off-chip RM IP ddress ddress Table Next Hop uffer Memory Off-chip RM rossbar : Switched ackplane Line ard Local uffer Memory wding Table M PU ard Routing Table Periodic ontrol updates Line ard Local uffer Memory wding Table M
Graph Model Routes from Represent each router as node irect link between routers represented by edge Symmetric links undirected graph dge cost c(x,y) denotes measure of difficulty of using link delay, $ cost, or congestion level Task etermine least cost path from every node to every other node Path cost d(x,y) = sum of link costs orwarding Table for est ost Next Hop 7 5 Set of shortest paths forms tree Shortest path spanning tree Solution is not unique.g., ---- also has cost 7 5 Ways to ompute Shortest Paths Outline entralized ollect graph structure in one place Use standard graph algorithm isseminate routing tables istance Vector Link-state very node collects complete graph structure ach computes shortest paths from it ach generates its own routing table istance-vector No one has copy of graph s construct their own tables iteratively ach sends information about its table to neighbors Link State Routing Hierarchy 7 8
istance-vector Method istance-vector Update Initial Table for est ost Next Hop Idea t any time, have cost/next hop of best known path to destination Use cost when no path known Initially Only have entries for directly connected nodes 9 c(x,z) x z d(z,y) d(x,y) Update(x,y,z) d c(x,z) + d(z,y) # ost of path from x to y with first hop z if d < d(x,y) # ound better path return d,z # Updated cost / next hop else return d(x,y), nexthop(x,y) # xisting cost / next hop y lgorithm Start ellman-ord algorithm Repeat or every node x or every neighbor z or every destination y d(x,y) Update(x,y,z) Until converge Optimum -hop paths Table for Table for Table for Table for Table for Table for // Lecture : Intra-omain Routing
Iteration # Iteration # Optimum -hop paths Optimum -hop paths Table for Table for Table for Table for 7 7 5 Table for Table for Table for Table for 7 5 Table for Table for Table for Table for 7 7 5 7 5 5 5 istance Vector: Link ost hanges istance Vector: Link ost hanges Link cost changes: detects local link cost change Updates distance table If cost change in least cost path, notify neighbors X Y 5 Z Link cost changes: Good news travels fast ad news travels slow - count to infinity problem! X Y 5 Z Table at good Y news travels fast Z algorithm terminates algorithm continues on! 5
istance Vector: Split istance Vector: Poison Reverse If Z routes through Y to get to X : Z does not advertise its route to X back to Y??? X Y Z 5 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) Immediate notification of unreachability, rather than split horizon timeout waiting for advertisement Will this completely solve count to infinity problem? X Y Z 5 algorithm terminates 7 8 Poison Reverse ailures Routing Information Protocol (RIP) Table for 7 Table for Table for orced Update Table for 9 Table for 8 orced Update etter Route Table for orced Update orced Update Table for 9 orced Update Table for 5 Table for Table for Iterations don t converge ount to infinity Solution Make infinity smaller What is upper bound on maximum path length? 9 arliest IP routing protocol (98 S) urrent standard is version (R 7) eatures very link has cost Infinity = - Limits network diameter to 5 hops Routers exchange different types of updates Initial: asks for copy of table for every neighbor when it starts Uses it to iteratively generate own table Periodic: sends copy of its table to each neighbor every sec Neighbors use it to iteratively update their tables Triggered: send copy of entry to neighbors when entry changes xcept for one causing update (split horizon rule) Neighbors use it to update their tables 5
Outline istance Vector Link State Routing Hierarchy Link State Protocol oncept very node gets complete copy of graph very node floods network with data about its outgoing links very node computes routes to every other node Using single-source, shortest-path algorithm Process performed whenever needed When connections die / reappear Sending Link States by looding ijkstra s lgorithm X Wants to Send Information Sends on all outgoing links When Y Receives Information from Z Send on all links other than Z X (a) X (c) X (b) X (d) Given Graph with source node s and edge costs c(u,v) etermine least cost path from s to every node v Shortest Path irst lgorithm Traverse graph in order of least cost from source
ijkstra s lgorithm: oncept ijkstra s lgorithm: Initially Sets one lready have least cost path to it : Reachable in hop from node in one Unseen: annot reach directly from node in one one 5 Label d(v) = path cost from s to v Path Keep track of last link in path Unseen urrent Path osts 5 No nodes done in horizon one urrent Path osts Unseen ijkstra s lgorithm: Initially one d(v) to node shown in red Only consider links from done nodes Unseen urrent Path osts 7 ijkstra s lgorithm one 5 Select node v in horizon with minimum d(v) dd link used to add node to shortest path tree Update d(v) information Unseen urrent Path osts 8 7
ijkstra s lgorithm ijkstra s lgorithm one 5 urrent Path osts Unseen one Unseen urrent Path osts Repeat Update d(v) values an cause addition of new nodes to horizon 9 ijkstra s lgorithm Link State haracteristics inal tree shown in green 5 With consistent LSs*, all nodes compute consistent loop-free paths an still have transient loops *Link State ata ase 5 Packet from may loop around if knows about failure and & do not 8
OSP Routing Protocol Open standard created by IT Shortest-path first nother name for ijkstra s algorithm Has basically replaced RIP RIP viewed as outmoded OSP has fast convergence when configuration changes OSP can scale to very large networks using areas OSP Reliable looding Transmit link state advertisements Originating router Typically, minimum IP address for router Link I I of router at other end of link Metric ost of link Link-state age Incremented each second Packet expires when reaches Sequence number Incremented each time sending new link information looding Issues When should it be performed Periodically When status of link changes etected by connected node What happens when router goes down & back up Sequence number reset to Other routers may have entries with higher sequence numbers Router will send out LSs with number Will get back LSs with last valid sequence number p Router sets sequence number to p+ & resends 5 reas: Scaling to Larger Networks rea-order Router ackbone reas Lower-level reas Within area: ach node has routes to every other node Outside area: ach node has routes for other top-level areas only Inter-area packets are routed to nearest border router onstraint: no path between two sub-areas of an area can exit that area May no longer have shortest path routes 9
omparison of LS and V lgorithms Message complexity LS: with n nodes, links, O(n) messages V: exchange between neighbors only Speed of onvergence LS: Relatively fast omplex computation, but can forward before computation may have transient loops V: convergence time varies may have routing loops count-to-infinity problem faster with triggered updates Space requirements: LS maintains entire topology V maintains only neighbor state Robustness: router malfunctions LS: can advertise incorrect link cost ach node computes its own table V: can advertise incorrect path cost ach node s table used by others (error propagates) 7 Outline istance Vector Link State Routing Hierarchy 8 Routing Hierarchies Inter and Intra-omain Routing lat routing doesn t scale Storage ach node cannot be expected to store routes to every destination (or destination network) onvergence times increase ommunication Total message count increases Key observation Need less information with increasing distance to destination Solution: hierarchy Inter and intra domain routing in the Internet reas inside OSP Switched LN technologies Inter omain Intra omain + reas Switched thernet Intra omain 7 8