idnits 2.17.1 draft-ietf-grow-as-path-prepending-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document doesn't use any RFC 2119 keywords, yet seems to have RFC 2119 boilerplate text. -- The document date (September 8, 2020) is 1326 days in the past. Is this intentional? Checking references for intended status: Best Current Practice ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '1' on line 398 -- Looks like a reference, but probably isn't: '2' on line 400 -- Looks like a reference, but probably isn't: '3' on line 403 ** Downref: Normative reference to an Informational RFC: RFC 5398 ** Downref: Normative reference to an Informational RFC: RFC 5737 ** Downref: Normative reference to an Informational RFC: RFC 8195 Summary: 3 errors (**), 0 flaws (~~), 2 warnings (==), 5 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group M. McBride 3 Internet-Draft Futurewei 4 Intended status: Best Current Practice D. Madory 5 Expires: March 12, 2021 Oracle 6 J. Tantsura 7 Apstra 8 R. Raszuk 9 Bloomberg LP 10 H. Li 11 HPE 12 September 8, 2020 14 AS Path Prepending 15 draft-ietf-grow-as-path-prepending-00 17 Abstract 19 AS Path Prepending provides a tool to manipulate the BGP AS_Path 20 attribute through prepending multiple entries of an AS. AS Path 21 Prepending is used to deprioritize a route or alternate path. By 22 prepending the local ASN multiple times, ASs can make advertised AS 23 paths appear artificially longer. Excessive AS Path Prepending has 24 caused routing issues in the internet. This document provides 25 guidance,to the internet community, with how best to utilize AS Path 26 Prepending in order to avoid negatively affecting the internet. 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at https://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on March 12, 2021. 45 Copyright Notice 47 Copyright (c) 2020 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (https://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 63 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 64 2. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 3 65 3. Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 4 66 3.1. Excessive Prepending . . . . . . . . . . . . . . . . . . 4 67 3.2. Prepending during a routing leak . . . . . . . . . . . . 5 68 3.3. Prepending to All . . . . . . . . . . . . . . . . . . . . 6 69 3.4. Memory . . . . . . . . . . . . . . . . . . . . . . . . . 6 70 3.5. Errant announcement . . . . . . . . . . . . . . . . . . . 7 71 4. Alternatives to AS Path Prepend . . . . . . . . . . . . . . . 7 72 5. Best Practices . . . . . . . . . . . . . . . . . . . . . . . 7 73 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 74 7. Security Considerations . . . . . . . . . . . . . . . . . . . 8 75 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 9 76 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 9 77 9.1. Normative References . . . . . . . . . . . . . . . . . . 9 78 9.2. URIs . . . . . . . . . . . . . . . . . . . . . . . . . . 9 79 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 9 81 1. Introduction 83 The Border Gateway Protocol (BGP) [RFC4271] specifies the AS_PATH 84 attribute which enumerates ASs a route update has traversed. If the 85 UPDATE message is propagated over an external link, then the local AS 86 number is prepended to the AS_PATH attribute, and the NEXT_HOP 87 attribute is updated with an IP address of the router that should be 88 used as a next hop to the network. If the UPDATE message is 89 propagated over an internal link, then the AS_PATH attribute and the 90 NEXT_HOP attribute are passed unmodified. 92 A common practice among operators is to prepend multiple entries of 93 an AS (known as AS Path Prepending) in order to deprioritize a route 94 or a path. This has worked well in practice but the practice is 95 increasing, with both IPv4 and IPv6, and there are inherit risks to 96 the global internet especially with excessive AS Path Prepending. 97 Prepending is frequently employed in an excessive manner such that it 98 renders routes vulnerable to disruption or misdirection. AS Path 99 Prepending is discussed in Use of BGP Large Communities [RFC8195] and 100 this document provides additional, and specific, guidance to 101 operators on how to be a good internet citizen with the proper use of 102 AS Path Prepending. 104 1.1. Requirements Language 106 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 107 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 108 document are to be interpreted as described in RFC 2119 [RFC2119]. 110 2. Use Cases 112 There are various reasons that AS Path Prepending is in use today 113 including: 115 o Preferring one ISP over another ISP on the same ASBR or across 116 different ASBRs 118 o Preferring one ASBR over another ASBR in the same site 120 o Utilize one path exclusively and another path solely as a backup 122 o Signal to indicate that one path may have a different amount of 123 capacity than another where the lower capacity link still takes 124 traffic 126 The following illustration, from Geoff Hustons Path Prepending in BGP 127 [1], shows how AS Prepending is typically used: 129 +---+ +---+ 130 +---| D |----| F | 131 | +---+ +---+ 132 +---+ +---+ | 133 | A |---| B | | 134 +---+ +---+ | 135 | +---+ +---+ 136 +---| C |----| E | 137 +---+ +---+ 139 B will normally prefer the path via C to send traffic to E, as this 140 represents the shorter AS path for B. If E were to prepend a further 141 two instances of its own AS number when advertising its routes to C, 142 then B will now see a different situation, where the AS Path via D 143 represents the shorter path. Through the use of selective prepending 144 E is able to alter the routing decision of B, even though B is not an 145 adjacent neighbour of E. The result is that traffic from A and B 146 will be passed via D and F to reach E, rather than via C. In this 147 way prepending implements action at a distance where the routing 148 decisions made by non-adjacent ASs can be influenced by selective AS 149 Path prepending. 151 In August 2020 a large ISP had a network outage that affected their 152 customers and other ISPs. One major problem was that the ISP wasn't 153 withdrawing BGP routes, the stale routes were continuing to be 154 announced as legitimate by the down ISP. This caused blackholing of 155 traffic even when customers had backup ISPs. What could customers do 156 in this situation? They could change local preference to help send 157 traffic to the backup ISP. They could send more specifics to the 158 backup ISP. They could also use AS Path Prepend by prepending the 159 same amount to both primary and backup ISPs before failure. 160 Customers could then, during a failure, remove one prepend to the 161 backup ISP to make it more preferred over the down ISP. This is one, 162 of several, scenarios where using AS Path Prepend can be beneficial. 164 3. Problems 166 Since it is so commonly used, what is the problem with the excessive 167 use of AS Path Prepending? Here are a few examples: 169 3.1. Excessive Prepending 171 The risk of excessive use of AS Path Prepending can be illustrated 172 with real-world examples that have been anonymized using documention 173 prefixes [RFC5737] and ASs [RFC5398] . Consider the prefix 174 198.51.100.0/24 which is normally announced with an inordinate amount 175 of prepending. A recent analysis revealed that 198.51.100.0/24 is 176 announced to the world along the following AS path: 178 64496 64511 64511 64511 64511 64511 64511 64511 64511 64511 64511 179 64511 64511 64511 64511 64511 64511 64511 64511 64511 64511 64511 180 64511 64511 182 In this example, the origin AS64511 appears 23 consecutive times 183 before being passed on to a single upstream (AS64496), which passes 184 it on to the global internet, prepended-to-all. An attacker, wanting 185 to intercept or manipulate traffic to this prefix, could enlist a 186 datacenter to allow announcements of the same prefix with a 187 fabricated AS path such as 999999 64496 64511. Here the fictional 188 AS999999 represents the shady datacenter. This malicious route would 189 be preferred due to the shortened AS path length and might go 190 unnoticed by the true origin, even if route-monitoring had been 191 implemented. Standard BGP route monitoring checks a route's origin 192 and upstream and both would be intact in this scenario. The length 193 of the prepending gives the attacker room to craft an AS path that 194 would appear plausible to the casual observer, comply with origin 195 validation mechanisms, and not be detected by off-the-shelf route 196 monitoring. 198 3.2. Prepending during a routing leak 200 In April 2010, a service provider experienced a routing leak. While 201 analyzing the leak something peculiar was noticed. When we ranked 202 the approximately 50,000 prefixes involved in the leak based on how 203 many ASs accepted the leaked routes, most of the impact was 204 constrained to Country A routes. However, two of the top five most- 205 propagated leaked routes (listed in the table below) were Country B 206 routes. 208 During the routing leak, nearly all of the ASs of the internet 209 preferred the Country A leaked routes for 192.0.2.0/21 and 210 198.51.100.0/22 because, at the time, these two Country B prefixes 211 were being announced to the entire internet along the following 212 excessively prepended AS path: 64496 64500 64511 64511 64511 64511 213 64511 64511. Virtually any illegitimate route would be preferred 214 over the legitimate route. In this case, the victim is all but 215 ensuring their victimhood. 217 There was only a single upstream seen in the prepending example from 218 above, so the prepending was achieving nothing except incurring risk. 219 You would think such mistakes would be relatively rare, especially 220 now, 10 years later. As it turns out, there is quite a lot of 221 prepending-to-all going on right now and during leaks, it doesn't go 222 well for those who make this mistake. While one can debate the 223 merits of prepending to a subset of multiple transit providers, it is 224 difficult to see the utility in prepending to every provider. In 225 this configuration, the prepending is no longer shaping route 226 propagation. It is simply incentivizing ASs to choose another origin 227 if one were to suddenly appear whether by mistake or otherwise. 229 3.3. Prepending to All 231 Based on analysis done in 2019, Excessive AS Path Prepending [2], out 232 of approximately 750,000 routes in the IPv4 global routing table, 233 nearly 60,000 BGP routes are prepended to 95% or more of hundreds of 234 BGP sources. About 8% of the global routing table, or 1 out of every 235 12 BGP routes, is configured with prepends to virtually the entire 236 internet. The 60,000 routes include entities of every stripe: 237 governments, financial institutions, even important parts of internet 238 infrastructure. 240 Much of the worst propagation of leaked routes during big leak events 241 have been due to routes being prepended-to-all. AS64505 leak of 242 April 2014 (>320,000 prefixes) was prepended-to-all. And the AS64506 243 leak of June 2015 (>260,000 prefixes) was also prepended-to-all. 244 Prepended-to-all prefixes are those seen as prepended by all (or 245 nearly all) of the ASs of the internet. In this configuration, 246 prepending is no longer shaping route propagation but is simply 247 incentivizing ASs to choose another origin if one were to suddenly 248 appear whether by mistake or otherwise. The percentage of the IPv4 249 table that is prepended-to-all is growing at 0.5% per year. The IPv6 250 table is growing slower at 0.2% per year. The reasons for using 251 prepend-to-all appears to be due to 1) the AS forgetting to remove 252 the prepending for one of its transit providers when it is no longer 253 needed and 2) the AS attempting to de-prioritize traffic from transit 254 providers over settlement-free peers and 3) there are simply a lot of 255 errors in BGP routing. Consider the prepended AS path below: 257 64496 64501 64501 64510 64510 64501 64510 64501 64501 64510 64510 258 64501 64501 64510 260 The prepending here involves a mix of two distinct ASNs (64501 and 261 64510) with the last two digits transposed. 263 3.4. Memory 265 BGP attribute sets are shared among stored routes, ie, if two stored 266 routes have the same attribute sets, the attribute set is stored only 267 once. AS Paths are shared among attribute sets so that if two stored 268 attribute sets have the same AS Path, then the AS Path is stored only 269 once. Storing them in the control plane is not a big problem. 270 However, AS Paths can be sent in Netflow which is generated in the 271 forwarding plane. AS Paths are not stored in expensive fast memory 272 on the forwarding plane, but still, using memory on the forwarding 273 plane has greater impact than on the control plane. An AS Path 274 consists of AS_SEQUENCE (and other elements). An AS_SEQUENCE can 275 contain a maximum of 255 ASNs. If the AS Path is longer, then 276 multiple AS_SEQUENCE's are required. The code to parse them and 277 create them is not often exercised and is a potential for bugs in 278 fresh code. The older implementations have these bugs well and truly 279 shaken out of them. Some BGP implementations have had memory 280 corruption/fragmentation problems with long AS Paths. 282 3.5. Errant announcement 284 There was an Internet-wide outage caused by a single errant routing 285 announcement. In this incident, AS64496 announced its one prefix 286 with an extremely long AS path. Someone entered their ASN instead of 287 the prepend count 64496 modulo 256 = 252 prepends and when a path 288 lengths exceeded 255, routers crashed 290 4. Alternatives to AS Path Prepend 292 There are various options to provide path preference without needing 293 to use AS Path Prepend: 295 o Use predefined communities that are mapped to a particular 296 behavior when propagated. 298 o Announce more specific routes on the preferred path. 300 o The BGP Origin Code is an attribute that is used for path 301 selection. The three origin codes are IGP, EGP and Incomplete. 302 We could advertise paths with IGP or EGP origin over the preferred 303 path while the other ASBRs (which would otherwise prepend N times) 304 advertises with an INCOMPLETE origin code. 306 5. Best Practices 308 Many of the best practices, or lack thereof, can be illustrated from 309 the preceeding examples. Here's a summary of the best current 310 practices of using AS Path Prepending: 312 o Network operators should ensure prepending is absolutely 313 necessary. Many of your networks have excessive prepending 315 o There is no need to prepend more than 5 ASs. The following 316 diagram shows that, according to Excessive AS Path Prepending [3], 317 90% of AS path lengths are 5 ASNs or fewer in length. 319 +------------------------------------+ 320 90| | 321 | X | 322 80| X X | 323 | X X | 324 70| X X | 325 | X X | 326 60| X X | 327 | X X | 328 50| X X | 329 | X X | 330 40| X X | 331 | X X | 332 30| X X | 333 | X X | 334 20| X XX | 335 | XX XX | 336 10| XX XXXX | 337 |XX XXXXXXXXXXXXXXXXX| 338 +------------------------------------+ 339 5 10 15 340 AS Path Length in IPv4 342 X Axis = unique AS Paths in millions 344 o Don't prepend ASNs that you don't own. 346 o Prepending-to-all is a self-inflicted and needless risk that 347 serves little purpose. Those excessively prepending their routes 348 should consider this risk and adjust their routing configuration. 350 o It is not typical to see more than 20 ASs in a AS_PATH in the 351 Internet today even with the use of AS_Path prepend. The Internet 352 is typically around 5 ASs deep with the largest AS_PATH being 353 16-20 ASNs. Some have added 100 or more AS Path Prepends and 354 operators should therefore consider limiting the maximum AS-path 355 length being accepted 357 6. IANA Considerations 359 7. Security Considerations 361 There are no security issues introduced by this draft. 363 8. Acknowledgement 365 The authors would like to thank Greg Skinner, Randy Bush, Dave 366 Farmer, Nick Hilliard, Martijn Schmidt, Jakob Heitz, Michael Still 367 and Geoff Huston for contributing to this document. 369 9. References 371 9.1. Normative References 373 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 374 Requirement Levels", BCP 14, RFC 2119, 375 DOI 10.17487/RFC2119, March 1997, 376 . 378 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 379 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 380 DOI 10.17487/RFC4271, January 2006, 381 . 383 [RFC5398] Huston, G., "Autonomous System (AS) Number Reservation for 384 Documentation Use", RFC 5398, DOI 10.17487/RFC5398, 385 December 2008, . 387 [RFC5737] Arkko, J., Cotton, M., and L. Vegoda, "IPv4 Address Blocks 388 Reserved for Documentation", RFC 5737, 389 DOI 10.17487/RFC5737, January 2010, 390 . 392 [RFC8195] Snijders, J., Heasley, J., and M. Schmidt, "Use of BGP 393 Large Communities", RFC 8195, DOI 10.17487/RFC8195, June 394 2017, . 396 9.2. URIs 398 [1] https://labs.apnic.net/?p=1264 400 [2] https://blogs.oracle.com/internetintelligence/excessive-as-path- 401 prepending-is-a-self-inflicted-vulnerability 403 [3] https://blogs.oracle.com/internetintelligence/excessive-as-path- 404 prepending-is-a-self-inflicted-vulnerability 406 Authors' Addresses 407 Mike McBride 408 Futurewei 410 Email: michael.mcbride@futurewei.com 412 Doug Madory 413 Oracle 415 Email: douglas.madory@oracle.com 417 Jeff Tantsura 418 Apstra 420 Email: jefftant.ietf@gmail.com 422 Robert Raszuk 423 Bloomberg LP 425 Email: robert@raszuk.net 427 Hongwei Li 428 HPE 430 Email: flycoolman@gmail.com