Internet Routing 14-740: Fundamentals of Computer Networks Bill Nace Material from Computer Networking: A Top Down Approach, 6 th edition. J.F. Kurose and K.W. Ross
Looking Ahead Lab #2 just due Quiz #2 next week (1 Nov) Content: Lecture 9-17 45 minutes, in class 75 minutes to accomplish 2
traceroute Hierarchical Routing Interior Gateway Protocols Exterior Gateway Protocols BGP Path Attributes Principles of Operation Route Selection Algorithm 3
Routing Everything How do you run LS or DV algorithm on the entire Internet? 55,000+ organizations 630,000+ routers How long until algorithm converges? See cidr-report.org 4
LS / DV on the Internet 2 Problems Scale Administrative Autonomy Organizations like to have control over their own routers Solution Hierarchical Routing! 5
Hierarchical Routing Collect routers into groups (say along organizational lines) Autonomous System (AS) Internals of an AS routed independently Use some standard algorithm to route among organizations 6
Autonomous System A collection of physical networks with a unified administrative routing policy ISP A Corporate network A Campus network 7
Autonomous System Number An AS may get an AS number (ASN) ASNs represent units of routing policy An AS can have 1 ASN (CMU is ASN #9) Multiple ASNs: MCI picked up 701-705 when it bought UUNet No ASN (common if single-homed) 8
Hierarchical Routing An Interior Gateway Protocol (IGP) routes packets within an AS Intra-domain routing An Exterior Gateway Protocol (EGP) maintains connectivity among ASes Inter-domain routing AS1 AS2 AS3 AS4 9
Example AS 4 assigned the IP range 128.2.130.0/24 IGP used to find local destinations 128.2.130.2 can find 128.2.130.1 EGP advertises the aggregate to all ASes AS1 can find 128.2.130.0/24 AS1 doesn t know about particular hosts AS1 AS2 Border Gateway (Router) I can reach 128.2.130.0/24 128.2.130.3 AS3 AS4 128.2.130.1 128.2.130.2 I am connected to 128.2.130.1 10
Advantages of Hierarchical Routing Scalability: works for 684,000+ routers Policy: AS can route how it wants Privacy: AS internals not exposed Performance Intra-AS routing: Focuses on performance Inter-AS routing: Focuses on policy (e.g. business relationships) 11
traceroute Hierarchical Routing Interior Gateway Protocols Exterior Gateway Protocols BGP Path Attributes Principles of Operation Route Selection Algorithm 12
Routing Protocols Real Internet Routing Protocols Link State Distance Vector IGP OSPF IS-IS RIP EIGRP EGP BGP 13
OSPF: Open Shortest Path First Straightforward implementation of Dijkstra s algorithm Flooding messages are broadcast OSPF messages are via IP, protocol 89 OSPF responsible for reliability, error correction Open means non-proprietary 14
OSPF Features Link weights are configurable by sysadmin No policy, just mechanisms Security: LS updates are authenticated Multiple same-cost paths allowed Support for hierarchy within routing domain 15
OSPF Hierarchy Very similar to the IGP/EGP relationship Route within an area to a border router Border routers connect using another area Backbone Flooding / LS run only within an area Area Border Routers Backbone Area 2 Border router Area 1 Area 3 16
IS-IS Intermediate System to Intermediate System A LS algorithm developed by OSI Republished as RFC 1142 Common in large ISPs Excellent stability features Less chatty than OSPF Can scale to support larger networks OSPF is common in med-large enterprises 17
RIP RIP = Routing Information Protocol Pretty straight implementation of ideal DV Link weight is always 1 (hop count) Cost is from source router to destination subnet (i.e. 1 more than the router-to-router cost) Max cost of 15. Thus, AS diameter must be 15 18
RIP Communication Routers exchange RIP advertisement Sent every 30 seconds Advertisements act as a heartbeat with 180 second timeouts RIP message also used to request specific route info from neighbor Sent over UDP port 520 19
Application Layer Wait! RIP messages are sent w/ UDP? Yep! RIP is an application layer process (routed), using transport layer to send messages But, it modifies forwarding table in network layer Application Transport: UDP Network: IP routed RIP Protocol 1. routed uses UDP to send RIP messages 2. routed then updates forwarding table 20
EIGRP Enhanced Interior Gateway Routing Protocol Proprietary Cisco protocol DV with optimizations for quick convergence use of router resources 21
traceroute Hierarchical Routing Interior Gateway Protocols Exterior Gateway Protocols BGP Path Attributes Principles of Operation Route Selection Algorithm 22
Exterior Gateway Protocols EGP provides each AS a means to Obtain network reachability information from neighboring AS Propagate the reachability information to all routers internal to the AS Determine good routes to subnets based on the reachability information and on AS policy Advertise its existence to the rest of the Internet! 23
Border Gateway Protocol BGP-4 is the de-facto EGP of Internet Difficult to imagine an internet with multiple EGPs Uses path vector routing algorithm Is heavily policy-based Relatively simple protocol, but configuration is complex and the entire world can see, and be impacted by, your mistakes 24
Some History Version 4 implemented in 1994 (to allow CIDR addressing) RFC 1771 & 4271 Back during the good old days (i.e. security not a concern) Based on the fact that everyone cooperates and plays nice Lots of research analyzing and securing BGP 25
Principle of Operation A BGP session is established between routers AS1 Establish session on TCP port 179 BGP Session Exchange all active routes AS2 Exchange route UPDATE messages While connection is ALIVE 26
BGP Messages OPEN: Sets up the BGP session KEEPALIVE: Confirms liveness to neighbor NOTIFICATION: Signals an error before underlying TCP connection is closed UPDATE: Primary message to communicate information about routes Announce or withdraw routes Route = prefix + path attributes 27
BGP Neighbor Relations AS1 ebgp runs between ASes ibgp within an AS Generally a complete mesh Connections are routed using IGP ebgp Session ibgp Sessions AS2
traceroute Hierarchical Routing Interior Gateway Protocols Exterior Gateway Protocols BGP Path Attributes Principles of Operation Route Selection Algorithm 29
BGP Path Attributes Route = Prefix + Attributes A critical BGP feature Describes the prefix or the path to the prefix Part of UPDATE message Not all attributes need to be present in every route announcement ORIGIN AS-PATH NEXT-HOP MED LOCAL-PREF COMMUNITY EXTENDED-COMMUNITY ORIGINATOR-ID CLUSTER-LIST ATOMIC AGGREGATE AGGREGATOR... and many more
Attribute: AS-PATH An ordered list of ASes through which the route announcement has passed Each AS prepends its ASN before sending the announcement to another AS Used in Route selection Route filtering Preventing and detecting loops 31
Attribute: NEXT-HOP The IP address used to reach the prefix The IP address of the router interface that begins the AS-PATH For ebgp, NEXT-HOP is the IP address of the ebgp neighbor For ibgp, if the route originated inside of the AS, the NEXT-HOP is the originating router For ibgp, if the route originated outside of the AS, the NEXT-HOP advertised by ebgp should be carried unaltered into ibgp 32
Attribute: MED MED: Multi-Exit Discriminator Used to specify preference when 2+ routes exist AS1 AS2 (announcing routes) sets MED, to indicate its preference 19.87.42/24 with MED=10 AS2 19.87.42/24 with MED=100 AS1 (receiving route) uses MED to select link Some ASes ignore MEDs, Why? MEDs only meaningful for comparing routes from the same AS Lower MED is preferred Customer 19.87.42/24
Attribute: LOCAL-PREF AS1 19.87.42/24 Metric used to select among multiple routes to the same prefix Set locally at an AS AS2 AS3 Exchanged between ibgp speakers only. Local to the AS Higher LOCAL-PREF is preferred AS4 BGP Table at AS4: Dest AS Path Local Pref 19.87.42.0/24 AS3 AS1 300 19.87.42.0/24 AS2 AS1 100
traceroute Hierarchical Routing Interior Gateway Protocols Exterior Gateway Protocols BGP Path Attributes Principles of Operation Route Selection Algorithm 35
Route Announcement UPDATE message PREFIX: 19.87.42.0/24 NEXT-HOP: 19.87.3.1 AS-PATH: 1 AS2 190.255.11.1 AS1 19.87.3.1 AS4 19.87.8.1 Customer 19.87.42/24 PREFIX: 19.87.42.0/24 NEXT-HOP: 19.87.8.1 AS-PATH: 1 AS3 150.211.1.1 36
Route Propagation PREFIX: 19.87.42.0/24 NEXT-HOP: 19.87.3.1 AS-PATH: 1 AS2 PREFIX: 19.87.42.0/24 NEXT-HOP: 190.255.11.1 AS-PATH: 2 1 190.255.11.1 AS1 19.87.3.1 AS4 19.87.8.1 Customer 19.87.42/24 PREFIX: 19.87.42.0/24 NEXT-HOP: 19.87.8.1 AS-PATH: 1 AS3 150.211.1.1 PREFIX: 19.87.42.0/24 NEXT-HOP: 150.211.1.1 AS-PATH: 3 1 At each hop: ASN gets prepended to AS-PATH, NEXT-HOP is changed Anything else? LOCAL-PREF? MED? ORIGIN? 37
AS-PATH Loops An AS will (usually) not accept route containing its own AS number For loop detection and prevention AS-PATH: 3 2 1 AS1 AS2 AS3 AS4 AS-PATH: 1 AS-PATH: 2 1 AS-PATH: 3 2 1 38
Route Withdrawal UPDATE message: withdrawn routes field WITHDRAW: 19.87.42.0/24 AS2 190.255.11.1 FORMER Customer 19.87.42/24 AS1 19.87.3.1 19.87.8.1 150.211.1.1 AS4 WITHDRAW: 19.87.42.0/24 AS3
Route Withdrawal WITHDRAW: 19.87.42.0/24 AS2 WITHDRAW: 19.87.42.0/24 190.255.11.1 FORMER Customer 19.87.42/24 19.87.3.1 AS1 19.87.8.1 WITHDRAW: 19.87.42.0/24 150.211.1.1 AS4 WITHDRAW: 19.87.42.0/24 AS3 Path attributes are associated with route announcements, not route withdrawals
traceroute Hierarchical Routing Interior Gateway Protocols Exterior Gateway Protocols BGP Path Attributes Principles of Operation Route Selection Algorithm 41
Choosing a Route? AS2 PREFIX: 19.87.42.0/24 NEXT-HOP: 190.255.11.1 AS-PATH: 2 1 AS1 19.87.3.1 190.255.11.1 19.87.8.1 AS4 Customer 19.87.42/24 AS3 150.211.1.1 PREFIX: 19.87.42.0/24 NEXT-HOP: 150.211.1.1 AS-PATH: 3 1 Which route to 19.87.42.12 should a router internal to AS4 use? 42
Route Selection Algorithm 1. Drop routes with inaccessible NEXT-HOP 2. Prefer route with largest LOCAL-PREF 3. Prefer route with shortest AS-PATH 4. Prefer route with smallest MED (if from same AS) 5. Prefer ebgp route over ibgp 6. Prefer path with lowest IGP metric 7. Prefer path by lowest BGP IDs Each router vendor puts in its own tweaks 43
Choosing a Route? AS2 PREFIX: 19.87.42.0/24 NEXT-HOP: 190.255.11.1 AS-PATH: 2 1 AS1 19.87.3.1 190.255.11.1 19.87.8.1 AS4 Customer 19.87.42/24 AS3 150.211.1.1 PREFIX: 19.87.42.0/24 NEXT-HOP: 150.211.1.1 AS-PATH: 3 1 Which route to 19.87.42.12 should a router internal to AS4 use? 44
Trick Question AS2 PREFIX: 19.87.42.0/24 NEXT-HOP: 190.255.11.1 AS-PATH: 2 1 AS1 19.87.3.1 190.255.11.1 19.87.8.1 AS4 Customer 19.87.42/24 AS3 150.211.1.1 PREFIX: 19.87.42.0/24 NEXT-HOP: 150.211.1.1 AS-PATH: 3 1 Do not know LOCAL-PREF AS path lengths are the same Do not know IGP metrics Do not know BGP IDs 45
Real World Example Just-for-fun, read about a global routing situation where China diverted 15% of the Internet's traffic for 18 minutes Man-in-the-middle attack? Probably not Interesting analysis based on BGP routing knowledge and lots of traceroute data? Definitely http://www.renesys.com/blog/2010/11/ chinas-18-minute-mystery.shtml 46
Lesson Objectives Now, you should be able to: describe heirarchical routing and describe how it solves the scale and administrative autonomy problems of internet-scale routing describe AS and ASNs, including common ASN scenarios identify and describe the following IGPs: OSPF, IS-IS, RIP, EIGRP describe the hierarchy features of OSPF 47
You should be able to: describe how the architecture of RIP allows it to use UDP describe the mission, operation, operating state, neighbor relations and message types of BGP4 describe the use of the AS-PATH, NEXT-HOP, MED and LOCAL-PREF attributes
You should be able to: describe how BGP route announcements propagate through the network and show how the attributes are changed in response describe how BGP interacts with the IGP to populate the forwarding table describe BGP route processing inside the router, including how the router decides if it should "filter" a packet (hint: it never decides to "filter" a packet)