Hierarchical Our routing study thus far - idealization • all routers identical • network “flat” Routing Protocols … not true in practice scale: with 200 million administrative autonomy destinations: • = network of networks • can’t store all dest’s in • each network admin may want routing tables! to control routing in its own • routing table exchange network would swamp links!

Hierarchical Routing Interconnected ASes

• aggregate routers into regions, “autonomous Gateway 3c 3a 2c systems” (AS) 3b 2a • Direct link to router AS3 2b 1c • routers in same AS run in another AS AS2 1a 1b same 1d AS1 • Forwarding table is – “intra-AS” routing configured by both protocol intra- and inter-AS – routers in different AS Intra-AS Inter-AS can run different intra-AS Routing Routing routing algorithm algorithm algorithm routing protocol – Intra-AS sets entries for Forwarding internal dests table – Inter-AS & Intra-As sets entries for external dests

1 Example: Setting forwarding table in router Inter-AS tasks 1d • Suppose router in AS1 AS3 receives datagram for 1. to propagate this • Suppose AS1 learns (via inter-AS protocol) that subnet x is which dest is outside of reachability AS1 needs: reachable via AS3 (gateway 1c) but not via AS2. AS1 2. to learn which dests are • Inter-AS protocol propagates reachability info to all internal – Router should forward reachable through AS2 routers. packet towards one of the gateway routers, but and which through info to • Router 1d determines from intra-AS routing info that its which one? all routers in AS1 interface I is on the least cost path to 1c. Job of inter-AS routing! • Puts in forwarding table entry (x,I).

3c 3a 2c 3c 3b 2a 3a 2c AS3 3b 2a 2b AS3 1c AS2 2b 1c AS2 1a 1b 1d AS1 1a 1b 1d AS1

Example: Choosing among multiple ASes Example: Choosing among multiple ASes

• Now suppose AS1 learns from the inter-AS protocol • Now suppose AS1 learns from the inter-AS protocol that subnet x is reachable from AS3 and from AS2. that subnet x is reachable from AS3 and from AS2. • To configure forwarding table, router 1d must • To configure forwarding table, router 1d must determine towards which gateway it should forward determine towards which gateway it should forward packets for dest x. packets for dest x. • Hot potato routing: send packet towards closest of two • This is also the job on inter-AS routing protocol! routers.

3c Use routing info Determine from 3a 2c Learn from inter-AS Hot potato routing: 3b 2a from intra-AS forwarding table the AS3 2b protocol that subnet protocol to determine Choose the interface I that leads x is reachable via costs of least-cost gateway 1c AS2 to least-cost gateway. multiple gateways paths to each that has the Enter (x,I) in 1a 1b of the gateways smallest least cost 1d AS1 forwarding table

2 Intra-AS Routing RIP ( Routing Information Protocol)

• Distance vector algorithm • Also known as Interior Gateway Protocols • Included in BSD-UNIX Distribution in 1982 (IGP) • Distance metric: # of hops (max = 15 hops) • Most common Intra-AS routing protocols:

From router A to subsets: – RIP: Routing Information Protocol u v destination hops u 1 – OSPF: A B w v 2 w 2 – IGRP: Interior Gateway Routing Protocol x 3 x y 3 (Cisco proprietary) z C D z 2 y

RIP advertisements RIP: Example z • Distance vectors: exchanged among w x y neighbors every 30 sec via Response A D B Message (also called advertisement) C • Each advertisement: list of up to 25 Destination Network Next Router Num. of hops to dest. destination nets within AS w A 2 y B 2 z B 7 x -- 1 …. …. .... Routing table in D

3 RIP: Example

Dest Next hops RIP: Link Failure and Recovery w - 1 Advertisement x - 1 from A to D If no advertisement heard after 180 sec --> z C 4 …. … ... neighbor/link declared dead z – routes via neighbor invalidated w x y – new advertisements sent to neighbors A D B – neighbors in turn send out new C advertisements (if tables changed) Destination Network Next Router Num. of hops to dest. w A 2 y B 2 z B A 7 5 x -- 1 …. …. .... Routing table in D

RIP Table processing OSPF (Open Shortest Path First) • RIP routing tables managed by application- • “open”: publicly available level process called route-d (daemon) • Uses Link State algorithm • advertisements sent in UDP packets, – LS packet dissemination periodically repeated – Topology map at each node – Route computation using Dijkstra’s algorithm routed routed

Transprt Transprt • OSPF advertisement carries one entry per (UDP) (UDP) neighbor router network forwarding forwarding network (IP) table table (IP) • Advertisements disseminated to entire AS (via link link flooding) physical physical – Carried in OSPF messages directly over IP (rather than TCP or UDP

4 OSPF “advanced” features (not in Hierarchical OSPF 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 Internet inter-AS routing: BGP • Two-level hierarchy: local area, backbone. – Link-state advertisements only in area • BGP (): the de facto – each nodes has detailed area topology; only know standard direction (shortest path) to nets in other areas. • BGP provides each AS a means to: • Area border routers: “summarize” distances to nets in 1. Obtain subnet reachability information from own area, advertise to other Area Border routers. neighboring ASs. • Backbone routers: run OSPF routing limited to 2. Propagate reachability information to all AS- backbone. internal routers. • Boundary routers: connect to other AS’s. 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 BGP basics Distributing reachability info

• Pairs of routers (BGP peers) exchange routing info • With eBGP session between 3a and 1c, AS3 sends prefix over semi-permanent TCP connections: BGP sessions reachability info to AS1. – BGP sessions need not correspond to physical links. • 1c can then use iBGP do distribute this new prefix reach info to • When AS2 advertises a prefix to AS1, AS2 is all routers in AS1 promising it will forward any datagrams destined to • 1b can then re-advertise new reachability info to AS2 over 1b-to- that prefix towards the prefix. 2a eBGP session • When router learns of new prefix, creates entry for prefix in its – AS2 can aggregate prefixes in its advertisement forwarding table.

3c 3c 3a 2c 3a 2c 3b 2a 3b 2a AS3 2b AS3 1c 2b AS2 1c AS2 1a 1b 1a 1b AS1 1d AS1 1d eBGP session eBGP session iBGP session iBGP session

Path attributes & BGP routes BGP route selection

• When advertising a prefix, advert includes BGP attributes. • Router may learn about more than 1 route to – prefix + attributes = “route” some prefix. Router must select route. • Two important attributes: • Elimination rules: – AS-PATH: contains ASs through which prefix advertisement has 1. Local preference value attribute: policy decision passed: AS 67 AS 17 2. Shortest AS-PATH – NEXT-: Indicates specific internal-AS router to next-hop AS. (There may be multiple links from current AS to next-hop- 3. Closest NEXT-HOP router: hot potato routing AS.) 4. Additional criteria • When gateway router receives route advertisement, uses import policy to accept/decline.

6 BGP messages BGP routing policy

legend : provide r • BGP messages exchanged using TCP. B networ k X • BGP messages: W A customer

– OPEN: opens TCP connection to peer and C network : authenticates sender Y – UPDATE: advertises new path (or withdraws Figure 4.-5BGPnew: a simple BGP scenario old) • A,B,C are provider networks – KEEPALIVE keeps connection alive in • X,W,Y are customer (of provider networks) absence of UPDATES; also ACKs OPEN request • X is dual-homed: attached to two networks – NOTIFICATION: reports errors in previous – X does not want to route from B via X to C msg; also used to close connection – .. so X will not advertise to B a route to C

BGP routing policy (2) Why different Intra- and Inter-AS routing?

legend : provide r B networ k Policy: X • Inter-AS: admin wants control over how its traffic routed, W A customer who routes through its net. network : C • Intra-AS: single admin, so no policy decisions needed Y Scale: • A adFivguerret is4.e-5BsG Pton eBw: tah simplee pat hBGP A Wscenario • hierarchical routing saves table size, reduced update • B advertises to X the path BAW traffic • Should B advertise to C the path BAW? Performance: – No way! B gets no “revenue” for routing CBAW since neither W • Intra-AS: can focus on performance nor C are B’s customers • Inter-AS: policy may dominate over performance – B wants to force C to route to w via A – B wants to route only to/from its customers!

7 Placing routing into context

8