CS 557 Inter-Domain Routing Introduction to BGP Routing Tutorial slides from Tim Griffin, 2001 Spring 2013
Inter-domain Routing 2153 11537 1706 52 FRGP Level 3 ARIZONA ColoState • Autonomous Systems (AS) • Border Gateway Protocol (BGP)
Autonomous System (AS) • Definition of an AS – An autonomous system is an autonomous routing domain – the administration of an AS appears to other ASes to have a single coherent interior routing plan and presents a consistent picture of what networks are reachable through it. • Internet consists of thousands of ASes. – Our objective is to understand routing between the Autonomous Systems – First describe the types of ASes and peering relationships • Remaining Slides Modified and Re-ordered from first half of Tim ’ s Tutorial
Nontransit vs. Transit ASes Internet Service ISP 2 2 providers (often) ISP 1 1 have transit networks NE NET A Nontransit AS Traffic NEVER might be a corporate flows from ISP 1 or campus network. through NET A to ISP 2 Could be a “ content (At least not intentionally!) provider ” IP traffic 4
Selective Transit NE NET B NE NET C NET A provides transit between NET B and NET C NET A DOES NOT NE NET A and between NET D provide transit and NET C Between NET D and NET B NE NET D IP traffic Most transit networks transit in a selective manner… 5
Customers and Providers pr provider ider provider customer IP traffic cus customer omer Customer pays provider for access to the Internet
Customers Don ’ t Always Need BGP pr provider ider Nail up routes 192.0.2.0/24 pointing to customer Nail up default routes 0.0.0.0/0 pointing to provider. cus customer omer 192.0.2.0/24 Static routing is the most common way of connecting an autonomous routing domain to the Internet. This helps explain why BGP is a mystery to many …
Customer-Provider Hierarchy IP traffic provider customer
The Peering Relationship Peers provide transit between peer peer their respective customers provider customer Peers do not provide transit between peers traffic traffic NOT Peers (often) do not exchange $$$ allowed allowed
Peering Provides Shortcuts Peering also allows connectivity between peer peer the customers of “ Tier 1 ” providers. provider customer
BGP-4 • BGP = B order G ateway P rotocol • Is a Policy-Based routing protocol • Is the de facto EGP of today ’ s global Internet • Relatively simple protocol, but configuration is complex and the entire world can see, and be impacted by, your mistakes. • 1989 : BGP-1 [RFC 1105] Replacement for EGP (1984, RFC 904) – • 1990 : BGP-2 [RFC 1163] • 1991 : BGP-3 [RFC 1267] • 1995 : BGP-4 [RFC 1771] Support for Classless Interdomain Routing (CIDR) – 11
BGP Operations Establish session on AS1 TCP port 179 BGP session Exchange all active routes AS2 While connection is ALIVE exchange Exchange incremental route UPDATE messages updates 12
Two Types of BGP Neighbor Relationships • External Neighbor (eBGP) in a different Autonomous Systems • Internal Neighbor (iBGP) in the same Autonomous System AS1 iBGP is routed (using IGP!) eBGP iBGP AS2 13
iBGP Peers Fully Meshed • iBGP is needed to eBGP update avoid routing loops within an AS • Injecting external routes into IGP does not scale and causes BGP policy information iBGP updates to be lost • BGP does not provide “ shortest path ” routing • Is iBGP an IGP? NO! iBGP neighbors do not announce routes received via iBGP to other iBGP neighbors. 14
Four Types of BGP Messages • Open : Establish a peering session. • Keep Alive : Handshake at regular intervals. • Notification : Shuts down a peering session. • Update : Announcing new routes or withdrawing previously announced routes. announcement = prefix + attributes values 15
BGP Attributes Value Code Reference Value Code Reference ----- --------------------------------- --------- ----- --------------------------------- --------- 1 ORIGIN [RFC1771] 1 ORIGIN [RFC1771] 2 AS_PATH [RFC1771] 2 AS_PATH [RFC1771] 3 NEXT_HOP [RFC1771] 3 NEXT_HOP [RFC1771] Tim ’ s 4 MULTI_EXIT_DISC [RFC1771] 4 MULTI_EXIT_DISC [RFC1771] 5 LOCAL_PREF [RFC1771] 5 LOCAL_PREF [RFC1771] tutorial 6 ATOMIC_AGGREGATE [RFC1771] 6 ATOMIC_AGGREGATE [RFC1771] 7 AGGREGATOR [RFC1771] 7 AGGREGATOR [RFC1771] will cover 8 COMMUNITY [RFC1997] 8 COMMUNITY [RFC1997] these 9 ORIGINATOR_ID [RFC2796] 9 ORIGINATOR_ID [RFC2796] 10 CLUSTER_LIST [RFC2796] 10 CLUSTER_LIST [RFC2796] attributes 11 DPA [Chen] 11 DPA [Chen] 12 ADVERTISER [RFC1863] 12 ADVERTISER [RFC1863] 13 RCID_PATH / CLUSTER_ID [RFC1863] 13 RCID_PATH / CLUSTER_ID [RFC1863] 14 MP_REACH_NLRI [RFC2283] 14 MP_REACH_NLRI [RFC2283] 15 MP_UNREACH_NLRI [RFC2283] 15 MP_UNREACH_NLRI [RFC2283] 16 EXTENDED COMMUNITIES [Rosen] 16 EXTENDED COMMUNITIES [Rosen] ... ... 255 reserved for development 255 reserved for development Not all attributes From IANA: http://www.iana.org/assignments/bgp-parameters need to be present in every announcement
Attributes are Used to Select Best Routes 192.0.2.0/24 pick me! 192.0.2.0/24 192.0.2.0/24 pick me! pick me! Given multiple routes to the same 192.0.2.0/24 pick me! prefix, a BGP speaker must pick at most one best route (Note: it could reject them all!)
So Many Choices peer peer provider customer AS 4 Frank ank ’ s s AS 3 Int nter ernet net Bar arn n AS 2 AS 1 Which route should 13.13.0.0/16 Frank pick to 13.13.0.0./16? 18
BGP Route Processing Open ended programming. Constrained only by vendor configuration language Apply Policy = Apply Policy = Receive Based on Best Transmit filter routes & filter routes & BGP Attribute Routes BGP tweak attributes tweak attributes Updates Values Updates Apply Import Best Route Best Route Apply Export Policies Selection Table Policies Install forwarding Entries for best Routes. IP Forwarding Table 19
Route Selection Process Highes Highest Local Local Pref efer erence ence Enf nfor orce ce rela elations ionships hips Shor hortes est ASPATH H Lowes Lo est MED traf affic ic engineer engineering ing i-BGP i-B GP < e-B e-BGP GP Lo Lowes est IGP GP cos cost to o BGP GP egres ess Thr hrow up up hands hands and and Lowes Lo est rout outer er ID br break eak ties ies
ASPATH Attribute AS 1129 135.207.0.0/16 AS Path = 1755 1239 7018 6341 Global Access AS 1755 135.207.0.0/16 135.207.0.0/16 AS Path = 1239 7018 6341 Ebone AS Path = 1129 1755 1239 7018 6341 AS 12654 AS 1239 RIPE NCC 135.207.0.0/16 RIS project AS Path = 7018 6341 Sprint 135.207.0.0/16 AS7018 AS Path = 3549 7018 6341 135.207.0.0/16 AS Path = 6341 AT&T AS 3549 AS 6341 135.207.0.0/16 AT&T Research Global Crossing AS Path = 7018 6341 135.207.0.0/16 21 Prefix Originated
Loop Prevention AS 7018 BGP at AS YYY will Don on ’ t Accept ccept! ! never accept a route with ASPATH 12.22.0.0/16 containing YYY . ASPATH = 1 333 7018 877 AS 1 22
Traffic Often Follows ASPATH 135.207.0.0/16 ASPATH = 3 2 1 AS 1 AS 3 AS 4 AS 2 135.207.0.0/16 IP Packet Dest = 135.207.44.66
… But It Might Not AS 2 filters all subnets with masks longer than /24 135.207.0.0/16 ASPATH = 1 135.207.0.0/16 135.207.44.0/25 ASPATH = 3 2 1 ASPATH = 5 AS 1 AS 3 AS 4 AS 2 135.207.0.0/16 IP Packet Dest = 135.207.44.66 From AS 4, it may look like this AS 5 packet will take path 3 2 1, but it 135.207.44.0/25 actually takes path 3 2 5
Shorter Doesn ’ t Always Mean Shorter Mr. BGP says that path 4 1 is better In fairness: than path 3 2 1 could you do Duh! uh! this “ right ” and still scale? AS 4 Exporting internal AS 3 state would dramatically AS 2 increase global instability and amount of routing state AS 1
Shedding Inbound Traffic with ASPATH Padding Hack AS 1 1 pr provider ider 192.0.2.0/24 192.0.2.0/24 ASPATH = 2 2 2 ASPATH = 2 primary backup Padding will (usually) force inbound cus customer omer 192.0.2.0/24 traffic from AS 1 AS 2 to take primary link 26
Recommend
More recommend