Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Border Gateway Protocol (BGP). 2 Contents  Internet connectivity and BGP  connectivity services, AS relationships  BGP Basics  BGP sessions, BGP.

Similar presentations

Presentation on theme: "1 Border Gateway Protocol (BGP). 2 Contents  Internet connectivity and BGP  connectivity services, AS relationships  BGP Basics  BGP sessions, BGP."— Presentation transcript:

1 1 Border Gateway Protocol (BGP)

2 2 Contents  Internet connectivity and BGP  connectivity services, AS relationships  BGP Basics  BGP sessions, BGP messages, BGP attributes  BGP Policy Control: Examples  Cisco filtering mechanisms  BGP Misconfiguration

3 3 Autonomous System Multiple Routers Same Routing policy Single Routing Protocol Single Ownership

4 4 ASs & AS Numbers (ASNs) 64512 through 65535 are “private” Genuity: 1 MIT: 3 Harvard: 11 Yale: 29 UCLA: 52 AT&T: 7018, 5075, …, 6341, … UUNET: 701, 702, 284, 12199, … Sprint: 1239, 1240, 6211, 6242, … … ASNs represent units of routing policy Currently over 30,000 in use.

5 5 U of Minnesota Neighborhood AS 1 Genuity AS 57 UMN GigaPoP AS 7018 AT&T AS 3908 SuperNet (Qwest) AS 217 UMN AS 1998 State of Minnesota

6 6 Having Internet Connectivity To have complete Internet connectivity you must be able to reach all destinations on the net. Your packets have to get delivered to every destination. This is easy (default routes). Packets from everywhere else have to “find you”. This is done by having your ISP(s) advertise routes for you.

7 7 Forwarding Process IP Forwarding Table Router 1. Remove a packet from an input queue 3. Match packet’s destination to a table entry 2. Check for sanity, decrement TTL field 4. Place packet on correct output queue If queues get full, just drop packets! If queues get full, just drop packets! IP Forwarding Process

8 8 Dynamic Routing: Intra- vs. Inter-AS AS 1 AS 2 BGP EGP = Exterior Gateway Protocol IGP = Interior Gateway Protocol Metric based: OSPF, IS-IS, RIP, EIGRP (cisco) Policy based: BGP OSPF EIGRP

9 9 To allow networks (ASs) to tell other networks (ASs) about “routes” (parts of the IP address space) that they are “responsible” for and how to reach them –Using “route advertisements”, or “promises” - also called “NLRI” or “network-layer reachability information” –“Path-vector” routing protocol Policy-based: allow ISPs to richly express their routing policy, both in selecting outbound paths and in announcing internal routes –keep this in mind as we progress! Relatively “simple” protocol, but configuration is complex and the entire world can see, and be impacted by, your mistakes BGP: The Glue of Internet

10 10 BGP: Some Basics BGP exchanges routes between ASs. When routes are exchanged, ASNs are stamped on the routes “on the way out” –adding one “AS hop” per network traversed -> AS path Routes are exchanged over “peering sessions”, which run on top of TCP, port 179. –The routes are “objects”, or “bags” of “attributes” BGP is actually two protocols –iBGP, designed for “internal” route exchange –eBGP, designed for “external” route exchange 1995: BGP-4 [RFC 1771] ; 2006: BGP-4 [RFC 4271]

11 11 BGP: Net Prefixes, ASNs and Route Advertisements AS 4969 AS 5000 AS 6461 AS 701 AS 12001 BGP route advertisement: Net prefix: AS path: 4969 6461

12 12 BGP Route Advertisement Think of a BGP route as a “promise” –If I advertise, I promise that if you deliver traffic destined to any IP address within to me, I know how to deliver it (at least as well as anyone else) By making sure these routes, or “promises”, are heard by all ASes, your provider ensures a return path for all of your packets –Sending routes out causes IP traffic to come in

13 13 BGP Route Advertisements and IP Address Space If my customer has, I generally will not announce that route separately, if it is covered by my, aggregate route. Recall that routers use “longest prefix matching” to look up forwarding table –If one of my customers’ ISPs is advertising, all incoming traffic from other networks will start flowing in that pipe. –so I must “punch a hole” in my aggregate announcement and advertise and

14 14 Autonomous Routing Domains Don’t Always Need BGP or an ASN Qwest Yale University Nail up default routes pointing to Qwest Nail up routes pointing to Yale 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 …

15 15 Number of Used ASNs Source: Geoff Huston,

16 16 Growth of BGP Routes Source: Geoff Huston,, Nov. 3, 2002 Percentage of IPv4 space advertised

17 17 BGP Operations (Simplified) Establish session on TCP port 179 Exchange all active routes Exchange incremental updates While connection is ALIVE exchange route UPDATE messages AS1 AS2 BGP session router A router B

18 18 BGP (Peering) Sessions BGP session set up over TCP –When session set up, both sides flood the other end with all of their best BGP routes –Over time, only incremental updates are exchanged –If session dies, all associated routes must be withdrawn BGP peers (neighbors) must be specified explicitly BGP session set-up: Cisco Example Router A in AS 1 router bgp 1 neighbor remote-as 2 Router B in AS 2 router bgp 1 neighbor remote-as 1 AS1 AS2 BGP session router A router B

19 19 EBGP vs. IBGP Sessions EBGP: between (usually directly-connected) routers in different ASs IBGP: between (BGP-speaking) routers in same AS Different (operational) rules and polices apply! AS 7007 XP AS 1239 AS 6079 AS 701 AS 4006

20 20 iBGP AS 3847 IBGP speakers are (usually) fully meshed IBGP session set up: Router A in AS 3847 router bgp 3847 neighbor remote-as 3847 neighbor remote-as 3847 Router B in AS 3847 router bgp 3847 neigbhor remote-as 3847 neighbor remote-as 3847 Router C in AS 3847 router bgp 3847 neigbhor remote-as 3847 neigbhor remote-as 3847 B A c

21 21 BGP Messages: Four Types 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. route announcement = prefix + attributes values

22 22

23 23

24 24

25 25

26 26 What Is an Attribute? Attribute encoded in a TLV (type-length-value) format. Attribute length is 4 bytes long Attributes can be transitive (across ASs) or non- transitive (between AS neighbors only) Some are mandatory: e.g., AS Path, Next-Hop, etc. Next Hop AS Path...... MED...

27 27 BGP Attributes Value Code Reference ----- --------------------------------- --------- 1 ORIGIN [RFC1771] 2 AS_PATH [RFC1771] 3 NEXT_HOP [RFC1771] 4 MULTI_EXIT_DISC [RFC1771] 5 LOCAL_PREF [RFC1771] 6 ATOMIC_AGGREGATE [RFC1771] 7 AGGREGATOR [RFC1771] 8 COMMUNITY [RFC1997] 9 ORIGINATOR_ID [RFC2796] 10 CLUSTER_LIST [RFC2796] 11 DPA [Chen] 12 ADVERTISER [RFC1863] 13 RCID_PATH / CLUSTER_ID [RFC1863] 14 MP_REACH_NLRI [RFC2283] 15 MP_UNREACH_NLRI [RFC2283] 16 EXTENDED COMMUNITIES [Rosen]... 255 reserved for development From IANA: Most important attributes Not all attributes need to be present in every announcement

28 28 AS Path Attribute

29 29 Sequence of AS(s) a route has traversed. Provides a mechanism for loop detection. Policies may be applied based on AS path. Local AS added only when send to external peer. *Shortest AS path preferred AS Path Attribute AS3847 AS1673 AS701 AS3561 3847 701 i 3847 1673 i 3847 3561 i 3847 i AS6201 E C F G D B A

30 30 Next Hop Attribute Next-hop IP address to reach a network. Router A will advertise to router B with a next-hop of With IBGP, the next-hop does not change. IGPs should carry route to next- hops, using intelligent forwarding decision (i.e., via IGP). AS 6201 AS 3847 A B A B.202 C

31 31 Attributes are Used to Select Best Routes pick me! pick me! pick me! pick me! Given multiple routes to the same prefix, a BGP speaker must pick at most one best route (Note: it could reject them all!)

32 32 Route Selection Summary Highest Local Preference Shortest ASPATH Lowest MED i-BGP < e-BGP Lowest IGP cost to BGP egress Lowest router ID traffic engineering Enforce relationships (provider-customer, peer) Throw up hands and break ties

33 33 Local Preference Attribute Local to AS –transitive throughout your network. It is never advertised to an eBGP peer. Used to influence BGP path selection AS 6201 AB 100 Preferred by all AS3847 routers 80 AS 3847 G FE CD Default 100 –Highest local-pref preferred For example, you can express the policy “prefer private connect” by making the “local_pref” be 150 and leaving all other peers at 100.

34 34 eBGP vs. iBGP Revisited eBGP Rules: By default, only talks to directly-connected router. Sends the one best BGP route for each destination. Sends all of the important “attributes”; omits the “local preference” attribute. Adds (prepends) the speaker’s ASN to the “AS- Path” attribute. Usually rewrites the “next-hop” attribute.

35 35 eBGP vs. iBGP Revisited (cont’d) iBGP Rules: Can talk to routers many hops away by default. Sends all attributes. Leaves the “as-path” attribute alone. Doesn’t touch the “next hop” attribute. With iBGP, next-hop is not a router directly connected. –So a “recursive lookup” is needed. –After the next-hop is found, a second lookup is made to figure out how to send the packet “in the direction” of the next-hop.

36 36 iBGP and Next-Hop: Example In AS 2828: Router A: “next hop” for will be the serial interface on Router D in AS1239 router This is true even in Router B’s and Router C’s forwarding table. AS 1239 AS 2828 A B C D E

37 37 BGP Route Processing Best Route Selection Apply Import Policies Best Route Table Apply Export Policies Install forwarding Entries for best Routes. Receive BGP Updates Best Routes Transmit BGP Updates Apply Policy = filter routes & tweak attributes Based on Attribute Values IP Forwarding Table Apply Policy = filter routes & tweak attributes Open ended programming. Constrained only by vendor configuration language

38 38 BGP Router - Processing Routes For each route received: –If it’s a valid route AND passes any filters, it must be put into the BGP routing table. –Then, unless it is replacing a duplicate, a best-path computation must be run on all candidate BGP routes of the same prefix. –Then, if the best route changed, the RIB and/or FIB must be updated. –This process is done for ALL incoming BGP routes.

39 39 BGP Policy Control To decide what routes can and can ’ t go to various other routers, you can “ filter ” using: –“ distribute lists ” ( “ prefix filters ” ) - lists of routes –“ filter lists ” ( “ as-path filters ” ) - lists of regular expressions matching or denying ASs –“ route maps ” ( “ BGP Basic programs ” ) that allow you to match and change most BGP attributes

40 40 Applying AS Path Filtering 3847 6201 D A C B E 701 F 6202 G The following configuration could be used on router B to accept routes from AS6201 & 6202 and deny all others. ip as-path access-list 10 permit ^6201$ ip as-path access-list 10 permit ^6201_6202$ ip as-path access-list 10 deny.*

41 41 Misconfiguration of BGP The configuration errors of the routers that result in the unintended production or suppression of BGP routing announcements. Includes slips ( inadvertent errors) and mistakes (design errors) in human factors terminology. Emphasis on human operator error. 20-70% of system failures

42 42 Our Goal How frequently do these misconfigurations occur? What is their impact on global connectivity and routing load? Why do the misconfigurations occur? What can be done to reduce their frequency and impact?

43 43 Configuration Example Router bgp 200 Network Neighbor remoter-as 100 Neighbor remoter-as 400 Neighbor route-map RMAP out ! Route-map RMAP permit 10 Match ip-address 1 ! Access-list 1 deny

44 44 How frequently do these misconfigurations occur? 200-1200 prfixes, equivalent to 0.2-1% of the global table size, suffer from misconfiguration each day. Close to ¾ of the new route announcements per day are the result of misconifguration.

45 45 The impact Increase routing load by generating unnecessary BGP updates. Can disrupt connectivity, either partially or globally. Violate the intended policy of the AS.

46 46 Causes of Misconfiguration Origin Misconfiguration(unintentional insertion) Initialization bug, old config, redistribution, community, hijack, forgotten filter, incorrect summary, unknown config error, miscellaneous, unclassified Export Misconfiguration(an inadvertent export in violation of the exporter’s policy) prefix based config, old config, initialization bug, bad ACL or rout map, typo, forgotten filter, community, unknown config error, miscellaneous, unclassified

47 47 Resolution User Interface Design instead of CLI(comand line interfaces) safe defaults, the more serious the consequences of the error, consistency across versions, large edit distances btween correct and incorrect settings. High-level Languages and Checkingonnectivity, either partially or globally. Database Consistency and Registries. Protocol Extensions. S-BGP (Secure BGP )

Download ppt "1 Border Gateway Protocol (BGP). 2 Contents  Internet connectivity and BGP  connectivity services, AS relationships  BGP Basics  BGP sessions, BGP."

Similar presentations

Ads by Google