idnits 2.17.1 draft-ietf-grow-as-path-prepending-06.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? -- The draft header indicates that this document updates RFC7454, but the abstract doesn't seem to mention this, which it should. -- The draft header indicates that this document updates RFC8195, but the abstract doesn't seem to mention this, which it should. 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 (17 February 2022) is 796 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) ** 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 (==), 4 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 Updates: 7454, 8195 (if approved) D. Madory 5 Intended status: Best Current Practice Kentik 6 Expires: 21 August 2022 J. Tantsura 7 Microsoft 8 R. Raszuk 9 NTT Network Innovations 10 H. Li 11 HPE 12 J. Heitz 13 Cisco 14 G. Mishra 15 Verizon Inc. 16 17 February 2022 18 AS Path Prepending 19 draft-ietf-grow-as-path-prepending-06 21 Abstract 23 AS Path Prepending provides a tool to manipulate the BGP AS_Path 24 attribute through prepending multiple entries of an AS. AS Path 25 Prepending is used to deprioritize a route or alternate path. By 26 prepending the local ASN multiple times, ASs can make advertised AS 27 paths appear artificially longer. Excessive AS Path Prepending has 28 caused routing issues in the Internet. This document provides 29 guidance with the use of AS Path Prepending, including alternative 30 solutions, in order to avoid negatively affecting the Internet. 32 Status of This Memo 34 This Internet-Draft is submitted in full conformance with the 35 provisions of BCP 78 and BCP 79. 37 Internet-Drafts are working documents of the Internet Engineering 38 Task Force (IETF). Note that other groups may also distribute 39 working documents as Internet-Drafts. The list of current Internet- 40 Drafts is at https://datatracker.ietf.org/drafts/current/. 42 Internet-Drafts are draft documents valid for a maximum of six months 43 and may be updated, replaced, or obsoleted by other documents at any 44 time. It is inappropriate to use Internet-Drafts as reference 45 material or to cite them other than as "work in progress." 47 This Internet-Draft will expire on 21 August 2022. 49 Copyright Notice 51 Copyright (c) 2022 IETF Trust and the persons identified as the 52 document authors. All rights reserved. 54 This document is subject to BCP 78 and the IETF Trust's Legal 55 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 56 license-info) in effect on the date of publication of this document. 57 Please review these documents carefully, as they describe your rights 58 and restrictions with respect to this document. Code Components 59 extracted from this document must include Revised BSD License text as 60 described in Section 4.e of the Trust Legal Provisions and are 61 provided without warranty as described in the Revised BSD License. 63 Table of Contents 65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 66 1.1. Requirements Language . . . . . . . . . . . . . . . . . . 3 67 2. Use Cases . . . . . . . . . . . . . . . . . . . . . . . . . . 3 68 3. Problems . . . . . . . . . . . . . . . . . . . . . . . . . . 4 69 3.1. Cascading and ripple effects of prepending across the 70 Internet . . . . . . . . . . . . . . . . . . . . . . . . 4 71 3.2. Excessive Prepending . . . . . . . . . . . . . . . . . . 5 72 3.3. Prepending during a routing leak . . . . . . . . . . . . 6 73 3.4. Prepending to All . . . . . . . . . . . . . . . . . . . . 7 74 3.5. Memory . . . . . . . . . . . . . . . . . . . . . . . . . 7 75 3.6. Errant announcement . . . . . . . . . . . . . . . . . . . 8 76 4. Alternatives to AS Path Prepend . . . . . . . . . . . . . . . 8 77 5. Best Practices . . . . . . . . . . . . . . . . . . . . . . . 9 78 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 11 79 7. Security Considerations . . . . . . . . . . . . . . . . . . . 11 80 8. Acknowledgement . . . . . . . . . . . . . . . . . . . . . . . 11 81 9. Normative References . . . . . . . . . . . . . . . . . . . . 11 82 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 12 84 1. Introduction 86 The Border Gateway Protocol (BGP) [RFC4271] specifies the AS_PATH 87 attribute which enumerates ASs a route update has traversed. If the 88 UPDATE message is propagated over an external link, then the local AS 89 number is prepended to the AS_PATH attribute, and the NEXT_HOP 90 attribute is updated with an IP address of the router that should be 91 used as a next hop to the network. If the UPDATE message is 92 propagated over an internal link, then the AS_PATH attribute and the 93 NEXT_HOP attribute are passed unmodified. 95 A common practice among operators is to prepend multiple entries of 96 an AS (known as AS Path Prepending) in order to deprioritize a route 97 or a path. So far, this has not caused many problems. However, the 98 practice is increasing, with both IPv4 and IPv6, and there are now 99 inherent risks to the global Internet, especially with excessive AS 100 Path Prepending. Prepending is frequently employed in an excessive 101 manner such that it renders routes vulnerable to disruption or 102 misdirection. AS Path Prepending is discussed in Use of BGP Large 103 Communities [RFC8195]. This document provides additional and 104 specific guidance to operators on how to be good Internet citizens 105 with less risky use of AS Path Prepending. 107 1.1. Requirements Language 109 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 110 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 111 document are to be interpreted as described in RFC 2119 [RFC2119]. 113 2. Use Cases 115 There are various reasons that AS Path Prepending is in use today 116 including: 118 * Preferring one ISP over another ISP on the same ASBR or across 119 different ASBRs. 121 * Preferring one ASBR over another ASBR in the same site or between 122 sister sites. 124 * Utilize one path exclusively and another path solely as a backup. 126 * Signal to indicate that one path may have a different amount of 127 capacity than another where the lower capacity link still takes 128 traffic. 130 * Conditionally prefer one ASBR over another at the same site or 131 between sites for lowest latency path based on geographic 132 location. 134 * An ISP doesn't accept traffic engineering using BGP communities. 135 Prepending is the only option. 137 The following illustration, from Geoff Huston's Path Prepending in 138 BGP (https://labs.apnic.net/?p=1264), shows how AS Prepending is 139 typically used: 141 +---+ +---+ 142 +---| D |----| F | 143 | +---+ +---+ 144 +---+ +---+ | 145 | A |---| B | | 146 +---+ +---+ 2x<- | 147 | +---+ +---+ 148 +---| C |----| E | 149 +---+ +---+ 151 In the diagram above, A, B, C, D, E, and F all have a different AS. 152 B will normally prefer the path via C to send traffic to E, as this 153 represents the shorter AS path for B. If E were to prepend a further 154 two instances of its own AS number when advertising its routes to C, 155 then B will now see a different situation, where the AS Path via D 156 represents the shorter path. Through the use of selective prepending 157 E is able to alter the routing decision of B, even though B is not an 158 adjacent neighbour of E. The result is that traffic from A and B 159 will be passed via D and F to reach E, rather than via C. In this 160 way prepending implements action at a distance where the routing 161 decisions made by non-adjacent ASs can be influenced by selective AS 162 Path prepending. 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. Cascading and ripple effects of prepending across the Internet 171 Care should be taken in prepending, as prepending can cause ripple 172 effects with multiple AS's performing the same set of prepends in the 173 same direction, resulting in route leaks where the valid preferred 174 path becomes now de-preferred. 176 <-5x <-5x <-5x 177 +---+ +---+ +---+ +---+ 178 +---| D |----| F |----| H |----| J | 179 | +---+ +---+ +---+ +---+ 180 +---+ +---+ | | 181 | A |---| B | | | 182 +---+ +---+ 13x<-| | 183 | +---+ +---+ +---+ +---+ 184 +---| C |----| E |----| G |----| I | 185 +---+ +---+ +---+ +---+ 187 In the diagram above A, B, C, D, E, F G, H, I, and J are all part of 188 different ASes. B will normally prefer the path via D to send 189 traffic to J, as this represents the preferred path to B, due to E 190 prepending 13 instances of its own AS number when advertising routes 191 to C. ISP J decides to prepend 5 instances of its own AS when 192 advertising to H, and ISP H decides to do the same and prepends 5 193 instances of its own AS when advertising to F. ISP F decides as well 194 to prepend 5 instances of its own AS when advertising to D. B now 195 sees 19 AS hops for prefixes coming from D to get to J which should 196 be the preferred path compared to 18 AS hops coming from C which is 197 now preferred. We now have a route leak to I as B now sends all of 198 its traffic through I to reach J. This is the typical scenario where 199 route leaks occur where providers decide to de-prefer a path. 200 However as the same de-preference of a path gets cascaded in the same 201 direction, as a result, the path that should never be preferred as 202 its as-path is very high in this case 18 AS hops ends up being the 203 preferred path resulting in a route leak. Usage of BGP large 204 communities along with conditional prepending, along with care being 205 taken when prepending is performed between providers, can help 206 mitigate the adverse impacts of prepending. 208 3.2. Excessive Prepending 210 The risk of excessive use of AS Path Prepending can be illustrated 211 with real-world examples that have been anonymized using 212 documentation prefixes [RFC5737] and ASs [RFC5398] . Consider the 213 prefix 198.51.100.0/24 which is normally announced with an inordinate 214 amount of prepending. A recent analysis revealed that 215 198.51.100.0/24 is announced to the world along the following AS 216 path: 218 64496 64511 64511 64511 64511 64511 64511 64511 64511 64511 64511 219 64511 64511 64511 64511 64511 64511 64511 64511 64511 64511 64511 220 64511 64511 221 In this example, the origin AS64511 appears 23 consecutive times 222 before being passed on to a single upstream (AS64496), which passes 223 it on to the global Internet, prepended-to-all. An attacker, wanting 224 to intercept or manipulate traffic to this prefix, could enlist a 225 datacenter to allow announcements of the same prefix with a 226 fabricated AS path such as 999999 64496 64511. Here the fictional 227 AS999999 represents the shady datacenter. This malicious route would 228 be preferred due to the shortened AS path length and might go 229 unnoticed by the true origin, even if route-monitoring had been 230 implemented. Standard BGP route monitoring checks a route's origin 231 and upstream and both would be intact in this scenario. The length 232 of the prepending gives the attacker room to craft an AS path that 233 would appear plausible to the casual observer, comply with origin 234 validation mechanisms, and not be detected by off-the-shelf route 235 monitoring. 237 3.3. Prepending during a routing leak 239 In April 2010, a service provider experienced a routing leak. While 240 analyzing the leak something peculiar was noticed. When we ranked 241 the approximately 50,000 prefixes involved in the leak based on how 242 many ASs accepted the leaked routes, most of the impact was 243 constrained to Country A routes. However, two of the top five most- 244 propagated leaked routes (listed in the table below) were Country B 245 routes. 247 During the routing leak, nearly all of the ASs of the Internet 248 preferred the Country A leaked routes for 192.0.2.0/21 and 249 198.51.100.0/22 because, at the time, these two Country B prefixes 250 were being announced to the entire Internet along the following 251 excessively prepended AS path: 64496 64500 64511 64511 64511 64511 252 64511 64511. Virtually any illegitimate route would be preferred 253 over the legitimate route. In this case, the victim is all but 254 ensuring their victimhood. 256 There was only a single upstream seen in the prepending example from 257 above, so the prepending was achieving nothing except incurring risk. 258 You would think such mistakes would be relatively rare, especially 259 now, 10 years later. As it turns out, there is quite a lot of 260 prepending-to-all going on right now and during leaks, it doesn't go 261 well for those who make this mistake. While one can debate the 262 merits of prepending to a subset of multiple transit providers, it is 263 difficult to see the utility in prepending to every provider. In 264 this configuration, the prepending is no longer shaping route 265 propagation. It is simply incentivizing ASs to choose another origin 266 if one were to suddenly appear whether by mistake or otherwise. 268 3.4. Prepending to All 270 Based on analysis done in 2019, Excessive AS Path Prepending 271 (https://blog.apnic.net/2019/07/15/excessive-bgp-as-path-prepending- 272 is-a-self-inflicted-vulnerability/), out of approximately 750,000 273 routes in the IPv4 global routing table, nearly 60,000 BGP routes are 274 prepended to 95% or more of hundreds of BGP sources. About 8% of the 275 global routing table, or 1 out of every 12 BGP routes, is configured 276 with prepends to virtually the entire Internet. The 60,000 routes 277 include entities of every stripe: governments, financial 278 institutions, even important parts of Internet infrastructure. 280 Much of the worst propagation of leaked routes during big leak events 281 have been due to routes being prepended-to-all. The AS64505 leak of 282 April 2014 (>320,000 prefixes) was prepended-to-all. And the AS64506 283 leak of June 2015 (>260,000 prefixes) was also prepended-to-all. 284 Prepended-to-all prefixes are those seen as prepended by all (or 285 nearly all) of the ASs of the Internet. In this configuration, 286 prepending is no longer shaping route propagation but is simply 287 incentivizing ASs to choose another origin if one were to suddenly 288 appear whether by mistake or otherwise. The percentage of the IPv4 289 table that is prepended-to-all is growing at 0.5% per year. The IPv6 290 table is growing slower at 0.2% per year. The reasons for using 291 prepend-to-all appears to be due to 1) the AS forgetting to remove 292 the prepending for one of its transit providers when it is no longer 293 needed and 2) the AS attempting to de-prioritize traffic from transit 294 providers over settlement-free peers and 3) there are simply a lot of 295 errors in BGP routing. Consider the prepended AS path below: 297 64496 64501 64501 64510 64510 64501 64510 64501 64501 64510 64510 298 64501 64501 64510 300 The prepending here involves a mix of two distinct ASNs (64501 and 301 64510) with the last two digits transposed. 303 3.5. Memory 305 Long AS Paths cause an increase in memory usage by BGP speakers. A 306 concern about an AS Path longer than 255 is the extra complexity 307 required to process it, because it needs to be encoded in more than 308 one AS_SEQUENCE in the AS_PATH BGP path attribute. 310 3.6. Errant announcement 312 It is possible for an Internet-wide outage to occur because of a 313 single errant routing announcement. For example, AS64496 could 314 announce its one prefix with an extremely long AS path. Someone 315 could enter their ASN instead of the prepend count. 64496 modulo 256 316 = 240 prepends, and when a path lengths exceeded 255, routers could 317 crash. 319 4. Alternatives to AS Path Prepend 321 Various options, to provide path preference without needing to use AS 322 Path Prepend, include: 324 * Use predefined communities that are mapped to a particular 325 behavior when propagated. 327 * Announce more specific routes on the preferred path. 329 * The BGP Origin Code is an attribute that is used for path 330 selection and can be used as a high order tie-breaker. The three 331 origin codes are IGP, EGP and INCOMPLETE. When AS Paths are of 332 equivalent length, users could advertise paths, with IGP or EGP 333 origin, over the preferred path while the other ASBRs (which would 334 otherwise need to prepend N times) advertises with an INCOMPLETE 335 origin code. 337 * The Multi Exit Discriminator (MED) is an optional non-transitive 338 attribute that can be used to influence path preference instead of 339 using as-path. MED is non transitive so it cannot influence an AS 340 more then 1 AS hop away. 342 * Local-preference optional non-transitive attribute, above as-path 343 in BGP path selection, can be used to influence route preference 344 within the local operators AS administrative domain. Local- 345 preference can shield the operator domain from traffic shifts off 346 the preferred path to a de-preferred path caused by excess 347 prepending done by service providers across the Internet. If all 348 service providers across the Internet set local-preference inbound 349 conditionally with Large Community set on preferred paths, 350 essentially the impacts of route leaks as well as other routing 351 issues resulting from excess prepending can be mitigated. 353 <-5x <-5x <-5x 354 LP 110 +---+ +---+ +---+ +---+ 355 +---| D |----| F |----| H |----| J | 356 | +---+ +---+ +---+ +---+ 357 +---+ +---+ | | 358 | A |---| B | | | 359 +---+ +---+ 13x<-| | 360 | +---+ +---+ +---+ +---+ 361 +---| C |----| E |----| G |----| I | 362 +---+ +---+ +---+ +---+ 364 In the diagram above A, B, C, D, E, F G, H, I, J are all part of a 365 different AS. B will normally prefer the path via D to send traffic 366 to J, as this represents the preferred path to B, due to E prepending 367 13 instances of its own AS number when advertising routes to C. ISP 368 J decides to prepend 5 instances of its own AS when advertising to H, 369 and ISP H decides to do the same and prepends 5 instances of its own 370 AS when advertising to F. ISP F decides to also prepend 5 instances 371 of its own AS when advertising to D. B now sees 19 AS hops for 372 prefixes coming from D to get to J which should be the preferred path 373 compare to 18 AS hops coming from C which is now preferred. We now 374 have a route leak to I as B now sends all of its traffic through I to 375 reach J. Route leak on B can be prevented locally within the 376 operator domain by setting local-preference inbound, which is above 377 as-path length in the best path selection, to higher then default 100 378 to 110 inbound from D, thus shielding the operator B from being 379 influenced by the excessive prepend cascading ripple affect by F, H, 380 J. Note that A still sees the cascading ripple affect of excess 381 prepending, however A, or any service provider AS downstream of B, 382 ingressing B, will be shunted to D via local-preference and the route 383 leak is now mitigated for all downstream AS to the left of B that 384 prefer the path through B. 386 5. Best Practices 388 Many of the best practices, or lack thereof, can be illustrated from 389 the preceding examples. Here's a summary of the best current 390 practices when using AS Path Prepending: 392 * Network operators should ensure prepending is absolutely necessary 393 as many networks have excessive prepending. It is best to 394 innumerate what the routing policies are intended to achieve 395 before concluding that prepending is a solution 397 * The neighbor you are prepending may have an unconditional 398 preference for customer routes and prepending doesn't work. It's 399 helpful to check with neighbors to see if they will honor the 400 prepend to avoid wasting effort and potentially causing further 401 vulnerabilities. 403 * Use of local-preference inbound on preferred paths between service 404 providers to help mitigate the adverse affects of prepending 406 * There is no need to prepend more than 5 ASs. The following 407 diagram, from the previously referenced AS Path Prepending 408 analysis from 2019, shows that 90% of AS path lengths are 5 ASNs 409 or fewer in length. 411 +------------------------------------+ 412 90| | 413 | X | 414 80| X X | 415 | X X | 416 70| X X | 417 | X X | 418 60| X X | 419 | X X | 420 50| X X | 421 | X X | 422 40| X X | 423 | X X | 424 30| X X | 425 | X X | 426 20| X XX | 427 | XX XX | 428 10| XX XXXX | 429 |XX XXXXXXXXXXXXXXXXX| 430 +------------------------------------+ 431 5 10 15 432 AS Path Length in IPv4 434 X Axis = unique AS Paths in millions 436 * Don't prepend ASNs that you don't own. 438 * Prepending-to-all is a self-inflicted and needless risk that 439 serves little purpose. Those excessively prepending their routes 440 should consider this risk and adjust their routing configuration. 442 * The Internet is typically around 5 ASs deep with the largest 443 AS_PATH being 16-20 ASNs. Some have added 100 or more AS Path 444 Prepends and operators should therefore consider limiting the 445 maximum AS-path length being accepted through aggressive filter 446 policies. 448 6. IANA Considerations 450 7. Security Considerations 452 Long prepending may make a network more vulnernable to route 453 hijacking which will exist whenever there is a well connected peer 454 that is willing to forge their AS_PATH or allows announcements with a 455 fabricated AS path. 457 8. Acknowledgement 459 The authors would like to thank Greg Skinner, Randy Bush, Dave 460 Farmer, Nick Hilliard, Martijn Schmidt, Michael Still, Geoff Huston 461 and Jeffrey Haas for contributing to this document. 463 9. Normative References 465 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 466 Requirement Levels", BCP 14, RFC 2119, 467 DOI 10.17487/RFC2119, March 1997, 468 . 470 [RFC4271] Rekhter, Y., Ed., Li, T., Ed., and S. Hares, Ed., "A 471 Border Gateway Protocol 4 (BGP-4)", RFC 4271, 472 DOI 10.17487/RFC4271, January 2006, 473 . 475 [RFC5398] Huston, G., "Autonomous System (AS) Number Reservation for 476 Documentation Use", RFC 5398, DOI 10.17487/RFC5398, 477 December 2008, . 479 [RFC5737] Arkko, J., Cotton, M., and L. Vegoda, "IPv4 Address Blocks 480 Reserved for Documentation", RFC 5737, 481 DOI 10.17487/RFC5737, January 2010, 482 . 484 [RFC8195] Snijders, J., Heasley, J., and M. Schmidt, "Use of BGP 485 Large Communities", RFC 8195, DOI 10.17487/RFC8195, June 486 2017, . 488 Authors' Addresses 490 Mike McBride 491 Futurewei 492 Email: michael.mcbride@futurewei.com 494 Doug Madory 495 Kentik 496 Email: dmadory@kentik.com 498 Jeff Tantsura 499 Microsoft 500 Email: jefftant.ietf@gmail.com 502 Robert Raszuk 503 NTT Network Innovations 504 940 Stewart Dr 505 Sunnyvale, CA 94085 506 United States of America 507 Email: robert@raszuk.net 509 Hongwei Li 510 HPE 511 Email: flycoolman@gmail.com 513 Jakob Heitz 514 Cisco 515 170 West Tasman Drive 516 San Jose, CA 95134 517 United States of America 518 Email: jheitz@cisco.com 520 Gyan Mishra 521 Verizon Inc. 522 Email: gyan.s.mishra@verizon.com