IP Forwarding 5-44 omputer Networking Lecture : Intra-omain Routing RIP (Routing Information Protocol) & OSPF (Open Shortest Path First) The Story So Far IP addresses are structured to reflect Internet structure IP packet headers carry these addresses When Packet rrives at Router Examine header to determine intended destination Look up in table to determine next hop in path Send packet out appropriate port This/next lecture How to generate the forwarding table Router" 2 Graph Model Routes from Node Represent each router as node irect link between routers represented by edge Symmetric links undirected graph Edge 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 Forwarding Table for est ost Next Hop 0 4 6 E 7 E 2 E F 5 E Properties Some set of shortest paths forms tree Shortest path spanning tree Solution not unique E.g., -E-F-- also has cost 7 3 4
Ways to ompute Shortest Paths Outline entralized ollect graph structure in one place Use standard graph algorithm isseminate routing tables Link-state Every node collects complete graph structure Each computes shortest paths from it Each generates own routing table istance-vector No one has copy of graph Nodes construct their own tables iteratively Each sends information about its table to neighbors istance Vector Link State Routing Hierarchy 5 6 istance-vector Method istance-vector Update Initial Table for est ost Next Hop 0 4 E 2 E F 6 F 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 7 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) # Found better path return d,z # Updated cost / next hop else return d(x,y), nexthop(x,y) # Existing cost / next hop y! 8 2
lgorithm Start ellman-ford algorithm Repeat For every node x For every neighbor z For every destination y d(x,y) Update(x,y,z) Until converge Optimum -hop paths! Table for Table for 0 4 4 0 3 E 2 E E F 6 F F F Table for Table for Table for E Table for F 2 6 3 0 0 E E E 0 E E 3 E F F F F 3 F F 0 F 9 0 Iteration # Iteration #2 Optimum 2-hop paths! Optimum 3-hop paths! Table for Table for Table for Table for 0 4 7 F 7 E 2 E F 5 E 4 0 2 F 3 E 4 F F F 0 4 6 E 7 E 2 E F 5 E 4 0 2 F 3 E 4 F F F Table for Table for Table for E Table for F Table for Table for Table for E Table for F 7 F 7 2 5 6 F 7 2 5 2 F 3 4 F 2 F 3 4 F 0 4 F 0 4 F 0 2 0 5 F 2 E 4 F E E 0 E E 3 E E 4 F E 5 E 0 E E 3 E F F F 2 F 3 F F 0 F F F F 2 F 3 F F 0 F 2 3
istance Vector: Link ost hanges istance Vector: Link ost hanges Link cost changes: Node detects local link cost change Updates distance table If cost change in least cost path, notify neighbors 4 X Y 50 Z Link cost changes: Good news travels fast ad news travels slow - count to infinity problem! 60 4 X Y 50 Z good news travels fast algorithm terminates algorithm continues on! 3 4 istance Vector: Split Horizon istance Vector: Poison Reverse If Z routes through Y to get to X : Z does not advertise its route to X back to Y??? 60 4 X Y Z 50 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? 60 4 X Y Z 50 algorithm terminates 5 6 4
Poison Reverse Failures Routing Information Protocol (RIP) Table for 7 F Table for Table for 3 Forced! Update! Table for 9 Table for 8 Forced! Update! etter! Route! Table for 4 Forced! Update! Forced! Update!!!! Table for 9 Forced! Update! Table for 5 Table for F Table for F Iterations don t converge ount to infinity Solution Make infinity smaller What is upper bound on maximum path length? 7 Earliest IP routing protocol (982 S) urrent standard is version 2 (RF 723) Features Every link has cost Infinity = 6 Limits to networks where everything reachable within 5 hops Sending Updates Every router listens for updates on UP port 520 RIP message can contain entries for up to 25 table entries 8 RIP Updates Initial When router first starts, asks for copy of table for every neighbor Uses it to iteratively generate own table Periodic Every 30 seconds, router sends copy of its table to each neighbor Neighbors use it to iteratively update their tables Triggered When every entry changes, send copy of entry to neighbors Except for one causing update (split horizon rule) Neighbors use it to update their tables RIP Staleness / Oscillation ontrol Small Infinity ount to infinity doesn t take very long See huck Norris isn t the only one that can count to infinity (twice!) J (http://www.count-to-infinity.com/) Route Timer Every route has timeout limit of 80 seconds Reached when haven t received update from next hop for 6 periods If not updated, set to infinity Soft-state refresh à important concept! ehavior When router or link fails, can take minutes to stabilize 9 20 5
Outline Link State Protocol oncept istance Vector Link State Routing Hierarchy Every node gets complete copy of graph Every node floods network with data about its outgoing links Every node computes routes to every other node Using single-source, shortest-path algorithm Process performed whenever needed When connections die / reappear 2 22 Sending Link States by Flooding ijkstra s lgorithm X Wants to Send Information Sends on all outgoing links X (a) X (b) Given Graph with source node s and edge costs c(u,v) etermine least cost path from s to every node v Shortest Path First lgorithm When Node Y Receives Information from Z Send on all links other than Z X (c) X (d) Traverse graph in order of least cost from source 23 24 6
ijkstra s lgorithm: oncept ijkstra s lgorithm: Initially Horizon! Node Sets one lready have least cost path to it Horizon: 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! 25 No nodes done Source in horizon one! Horizon!! urrent Path osts! Unseen! 26 ijkstra s lgorithm: Initially one!! d(v) to node shown in red Only consider links from done nodes Horizon! Unseen! urrent Path osts! 27 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 Horizon! Unseen! urrent Path osts! 28 7
ijkstra s lgorithm ijkstra s lgorithm one! Horizon! 5! urrent Path osts! Unseen! one! Horizon! Unseen! urrent Path osts! Repeat Update d(v) values an cause addition of new nodes to horizon 29 30 ijkstra s lgorithm Link State haracteristics Final tree shown in green 5! With consistent LSs*, all nodes compute consistent loop-free paths an still have transient loops * Link State ata ase X 3 5 2 Packet from à may loop around if knows about failure and & do not 3 32 8
OSPF Routing Protocol OSPF Reliable Flooding Open Open standard created by IETF Shortest-path first nother name for ijkstra s algorithm More prevalent than RIP 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 3600 Sequence number Incremented each time sending new link information 33 34 OSPF Flooding Operation Flooding Issues Node X Receives LS from Node Y With Sequence Number q Looks for entry with same origin/link I ases No entry present dd entry, propagate to all neighbors other than Y Entry present with sequence number p < q Update entry, propagate to all neighbors other than Y Entry present with sequence number p > q Send entry back to Y To tell Y that it has out-of-date information Entry present with sequence number p = q Ignore it 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 0 Other routers may have entries with higher sequence numbers Router will send out LSs with number 0 Will get back LSs with last valid sequence number p Router sets sequence number to p+ & resends 35 36 9
doption of OSPF RIP viewed as outmoded Good when networks small and routers had limited memory & computational power OSPF dvantages Fast convergence when configuration changes 37 omparison of LS and V lgorithms Message complexity LS: with n nodes, E links, O(nE) 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: Node can advertise incorrect link cost Each node computes its own table V: Node can advertise incorrect path cost Each node s table used by others (error propagates) 38 Outline Routing Hierarchies istance Vector Link State Routing Hierarchy Flat routing doesn t scale Storage à Each 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 Need lower diameters networks Solution: area hierarchy 39 40 0
reas ivide network into areas reas can have nested sub-areas Hierarchically address nodes in a network Sequentially number top-level areas Sub-areas of area are labeled relative to that area Nodes are numbered relative to the smallest containing area 4 Routing Hierarchy rea-order! Router! ackbone reas! Lower-level reas! Partition Network into reas Within area Each node has routes to every other node Outside area Each node has routes for other top-level areas only Inter-area packets are routed to nearest appropriate border router onstraint: no path between two sub-areas of an area can exit that area 42 rea Hierarchy ddressing Path Sub-optimality 2 an result in sub-optimal paths. 2. 2.2 2.2.2 2 2. 2.2.2..2.2.2 3 2.2...2.2. start end 2.2. 3 3.2. 3. 3.2 3 hop red path vs. 2 hop green path 3. 3.2 43 44
Next Lecture: GP How to connect together different ISPs 45 2