Routing Protocols scale: with 200 million destinations: can t store all dest s in routing tables! routing table exchange would swamp links! Hierarchical Routing Our routing study thus far - idealization all routers identical flat not true in practice administrative autonomy internet = of s each admin may want to control routing in its own Hierarchical Routing aggregate routers into regions, autonomous systems (S) routers in same S run same routing protocol intra-s routing protocol routers in different S can run different intra-s routing protocol Gateway router Direct link to router in another S Interconnected Ses Intra-S Routing algorithm Forwarding table Inter-S Routing algorithm Forwarding table is configured by both intra- and inter-s routing algorithm Intra-S sets entries for internal dests Inter-S & Intra-s sets entries for external dests 1
Inter-S tasks Suppose router in receives datagram for which dest is outside of Router should forward packet towards one of the gateway routers, but which one? 1. to propagate this reachability needs: 2. to learn which dests are reachable through and which through info to all routers in Job of inter-s routing! Example: Setting forwarding table in router Suppose learns (via inter-s protocol) that subnet x is reachable via (gateway ) but not via. Inter-S protocol propagates reachability info to all internal routers. Router determines from intra-s routing info that its interface I is on the least cost path to. Puts in forwarding table entry (x,i). Example: Choosing among multiple Ses Now suppose learns from the inter-s protocol that subnet x is reachable from and from. To configure forwarding table, router must determine towards which gateway it should forward packets for dest x. This is also the job on inter-s routing protocol! Example: Choosing among multiple Ses Now suppose learns from the inter-s protocol that subnet x is reachable from and from. To configure forwarding table, router must determine towards which gateway it should forward packets for dest x. Hot potato routing: send packet towards closest of two routers. Learn from inter-s protocol that subnet x is reachable via multiple gateways Use routing info from intra-s protocol to determine costs of least-cost paths to each of the gateways Hot potato routing: Choose the gateway that has the smallest least cost Determine from forwarding table the interface I that leads to least-cost gateway. Enter (x,i) in forwarding table 2
Intra-S Routing lso known as Interior Gateway Protocols (IGP) Most common Intra-S routing protocols: RIP ( Routing Information Protocol) Distance vector algorithm Included in SD-UNIX Distribution in 1982 Distance metric: # of hops (max = 15 hops) RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco proprietary) u z C D v y w x From router to subsets: destination hops u 1 v 2 w 2 x 3 y 3 z 2 RIP advertisements Distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) Each advertisement: list of up to 25 destination nets within S RIP: Example w x y D C Destination Network Next Router Num. of hops to dest. w 2 y 2 z 7 x -- 1..... Routing table in D z 3
Dest Next hops w - 1 x - 1 z C 4.... RIP: Example dvertisement from to D w x y D C Destination Network Next Router Num. of hops to dest. w 2 y 2 z 7 5 x -- 1..... Routing table in D z RIP: Link Failure and Recovery If no advertisement heard after 180 sec --> neighbor/link declared dead routes via neighbor invalidated new advertisements sent to neighbors neighbors in turn send out new advertisements (if tables changed) RIP Table processing RIP routing tables managed by applicationlevel process called route-d (daemon) advertisements sent in UDP packets, periodically repeated Transprt (UDP) (IP) link physical routed forwarding table forwarding table routed Transprt (UDP) (IP) link physical OSPF (Open Shortest Path First) open : publicly available Uses Link State algorithm LS packet dissemination Topology map at each node Route computation using Dijkstra s algorithm OSPF advertisement carries one entry per neighbor router dvertisements disseminated to entire S (via flooding) Carried in OSPF messages directly over IP (rather than TCP or UDP 4
OSPF advanced features (not in RIP) Security: all OSPF messages authenticated (to prevent malicious intrusion) Multiple same-cost paths allowed (only one path in RIP) For each link, multiple cost metrics for different TOS (e.g., satellite link cost set low for best effort; high for real time) Integrated uni- and multicast support: Multicast OSPF (MOSPF) uses same topology data base as OSPF Hierarchical OSPF in large domains. Hierarchical OSPF Hierarchical OSPF Two-level hierarchy: local area, backbone. Link-state advertisements only in area each nodes has detailed area topology; only know direction (shortest path) to nets in other areas. rea border routers: summarize distances to nets in own area, advertise to other rea order routers. ackbone routers: run OSPF routing limited to backbone. oundary routers: connect to other S s. Internet inter-s routing: GP GP (order Gateway Protocol): the de facto standard GP provides each S a means to: 1. Obtain subnet reachability information from neighboring Ss. 2. Propagate reachability information to all Sinternal routers. 3. Determine good routes to subnets based on reachability information and policy. allows subnet to advertise its existence to rest of Internet: I am here 5
GP basics Pairs of routers (GP peers) exchange routing info over semi-permanent TCP connections: GP sessions GP sessions need not correspond to physical links. When advertises a prefix to, is promising it will forward any datagrams destined to that prefix towards the prefix. can aggregate prefixes in its advertisement Distributing reachability info With egp session between and, sends prefix reachability info to. can then use igp do distribute this new prefix reach info to all routers in can then re-advertise new reachability info to over -to- egp session When router learns of new prefix, creates entry for prefix in its forwarding table. egp session egp session igp session igp session Path attributes & GP routes When advertising a prefix, advert includes GP attributes. prefix + attributes = route Two important attributes: S-PTH: contains Ss through which prefix advertisement has passed: S 67 S 17 NEXT-HOP: Indicates specific internal-s router to next-hop S. (There may be multiple links from current S to next-hop- S.) When gateway router receives route advertisement, uses import policy to accept/decline. GP route selection Router may learn about more than 1 route to some prefix. Router must select route. Elimination rules: 1. Local preference value attribute: policy decision 2. Shortest S-PTH 3. Closest NEXT-HOP router: hot potato routing 4. dditional criteria 6
GP messages GP messages exchanged using TCP. GP messages: OPEN: opens TCP connection to peer and authenticates sender UPDTE: advertises new path (or withdraws old) KEEPLIVE keeps connection alive in absence of UPDTES; also CKs OPEN request NOTIFICTION: reports errors in previous msg; also used to close connection W GP routing policy C Figure 4.5-GPnew: a simple GP scenario X Y legend: provider customer :,,C are provider s X,W,Y are customer (of provider s) X is dual-homed: attached to two s X does not want to route from via X to C.. so X will not advertise to a route to C W GP routing policy (2) C Figure 4.5-GPnew: a simple GP scenario X Y legend: provider customer : advertises to the path W advertises to X the path W Should advertise to C the path W? No way! gets no revenue for routing CW since neither W nor C are s customers wants to force C to route to w via wants to route only to/from its customers! Why different Intra- and Inter-S routing? Policy: Inter-S: admin wants control over how its traffic routed, who routes through its net. Intra-S: single admin, so no policy decisions needed Scale: hierarchical routing saves table size, reduced update traffic Performance: Intra-S: can focus on performance Inter-S: policy may dominate over performance 7
Placing routing into context 8