RFC 4384
BGP Communities for Data Collection
BGP Communities for Data Collection π¦
Okay bestie, this is RFC 4384, and it's a Best Current Practice (BCP 114) π It's from the Network Working Group and was written by D. Meyer in February 2006. The header doesn't list anything it obsoletes or updates, so it stands on its own β¨
Status of This Memo π
This document specifies an Internet Best Current Practices for the Internet Community, and requests discussion and suggestions for improvements. Distribution of this memo is unlimited πΈ
Copyright Notice π
Copyright (C) The Internet Society (2006).
Abstract π
BGP communities (RFC 1997) are how service providers tag stuff for lots of reasons, like marking customer routes, peer routes, and geographically originated routes πΊοΈ That tagging is usually how they control where routes get passed around, both inside their own network and out to their peers and customers.
With large-scale BGP data collection (plus the research that comes with it), it's become super clear that the info in these communities is essential for understanding the global routing system π This memo defines standard (outbound) communities and their encodings for export to BGP route collectors. Iconic. π₯
Table of Contents ποΈ
1. Introduction ....................................................2
2. Definitions .....................................................3
2.1. Peers and Peering ..........................................3
2.2. Customer Routes ............................................3
2.3. Peer Routes ................................................3
2.4. Internal Routes ............................................4
2.5. Internal More Specific Routes ..............................4
2.6. Special Purpose Routes .....................................4
2.7. Upstream Routes ............................................4
2.8. National Routes ............................................4
2.9. Regional Routes ............................................4
3. RFC 1997 Community Encoding and Values ..........................5
4. Community Values for BGP Data Collection ........................5
4.1. Extended Communities .......................................7
4.2. Four-Octet AS Specific Extended Communities ................9
5. Note on BGP UPDATE Packing ......................................9
6. Acknowledgements ................................................9
7. Security Considerations ........................................10
7.1. Total Path Attribute Length ...............................10
8. IANA Considerations ............................................10
9. References .....................................................11
9.1. Normative References ......................................11
9.2. Informative References ....................................11
1. Introduction πΈ
Okay so, BGP communities [RFC1997] are used by service providers for loads of things, like tagging customer, peer, and geographically originated routes π·οΈ That tagging is typically how they control how routes get redistributed inside their network and out to their customers and peers.
Communities also show up in a bunch of other places. Customers can use them to set attributes like LOCAL_PREF [RFC1771] by sending the right communities to their service provider π They're also used for signaling different kinds of Virtual Private Networks (VPNs) (e.g., Virtual Private LAN Service (VPLS) [VPLS]), and for carrying link bandwidth for traffic engineering applications [RFC4360]. Main character energy, honestly π
With large-scale BGP data collection [RV] [RIS] (and the research around it), it's become clear that the geographical and topological info, plus the relationship a provider has with the source of a route (e.g., transit, peer, or customer), carried in these communities is essential for a deeper understanding of the global routing system π§ This memo defines standard communities for export to BGP route collectors. These communities make up a big chunk of the info service providers carry as of this writing, so they could be useful for internal use by service providers too. However, that use is beyond the scope of this memo π
Finally, people working on BGP data analysis are encouraged to check with their data sources about which peers implement this scheme, because there's a huge amount of existing data and lots of legacy peerings π¦
The rest of this memo is organized like this. Section 2 gives the definitions of the terms used, plus the semantics of the communities used for BGP data collection. Section 3 defines the matching encodings for RFC 1997 [RFC1997] communities. Last but not least, Section 4 defines the encodings for use with extended communities [RFC4360] β¨
2. Definitions π§
In this section we define the terms we use and the categories of routes that may be tagged with communities. This tagging is often called coloring, and a route's "color" is its community value π¨ The categories here are loosely modeled on those described in [WANG] and [HUSTON].
2.1. Peers and Peering π€
Picture two network service providers, A and B. A and B are defined to be peers when (i) A and B exchange routes via BGP, and (ii) traffic exchange between A and B is settlement-free. This arrangement is also typically known as "peering" π Peers usually only exchange their own customer routes (see "Customer Routes" below), so they only exchange their own customer traffic. For a deeper dive into the business models around peers and peering, check out [HUSTON] π
2.2. Customer Routes πΌ
Customer routes are the routes heard from a customer via BGP that get propagated to peers and other customers. A customer can be an enterprise or another network service provider, so don't sleep on that π These routes are sometimes called client routes [HUSTON].
2.3. Peer Routes π«Ά
Peer routes are the routes heard from peers via BGP that don't get propagated to other peers. In particular, these routes only get propagated to the service provider's customers π
2.4. Internal Routes π
Internal routes are the routes a service provider originates and passes on to its peers and customers. These routes are frequently taken out of the address space allocated to a provider π
2.5. Internal More Specific Routes π
Internal more specific routes are frequently used for circuit load balancing and Interior Gateway Protocol (IGP) route reduction βοΈ They can also correspond to customer services that aren't visible outside the service provider's network. Internal more specific routes are not exported to any external peer, so they stay in the house π
2.6. Special Purpose Routes β
Special purpose routes are the routes that don't fit into any of the other classes described here. In cases where these routes need to be told apart, a service provider may color them with a unique value π Examples of special purpose routes include anycast routes and routes for overlay networks.
2.7. Upstream Routes β¬οΈ
Upstream routes are typically learned from an upstream service provider as part of a transit service contract with that upstream provider π¦
2.8. National Routes πΊπ³
These are route sets that are sourced from and/or received within a particular country πΊοΈ
2.9. Regional Routes π
Lots of global backbones run regional policy based on their deployed footprint and on strategic and business imperatives π Service providers often have settlement-free interconnections with an Autonomous System (AS) in one region, while that same AS is a customer in another region. This calls for regional routing, including community attributes set by the network in question so it's easy to tell regional routes apart π«§ For example, a service provider may treat a route set received from another provider in Europe differently than the same route set received in North America, because it's common practice to sell transit in one region while peering in the other. Wild, I know π
3. RFC 1997 Community Encoding and Values π
In this section we give the RFC 1997 [RFC1997] community values for the categories described above. RFC 1997 communities are encoded as BGP Type Code 8, and they're treated as 32-bit values ranging from 0x0000000 through 0xFFFFFFF. The values 0x0000000 through 0x0000FFFF and 0xFFFF0000 through 0xFFFFFFFF are reserved π
The best current practice among service providers is to use the high-order two octets for the provider's AS number, and the low-order two octets to represent the classification of the route, as shown below π§©
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| <AS> | <Value> |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
where <AS> is the 16-bit AS number. For example, the encoding 0x2A7C029A would represent AS 10876 with value 666 πβ¨
4. Community Values for BGP Data Collection β¨
okay so this is where the magic happens π«Ά we define the RFC 1997 community encoding for all the route types from earlier, so they can be used for BGP data collection. the idea is that a service provider's internal community values get converted into these standard ones before they go out to a route collector π
This memo follows the best current practice of using the basic format <AS>:<Value> π. Here's the table for the route categories:
Category Value
===============================================================
Reserved <AS>:0000000000000000
Customer Routes <AS>:0000000000000001
Peer Routes <AS>:0000000000000010
Internal Routes <AS>:0000000000000011
Internal More Specific Routes <AS>:0000000000000100
Special Purpose Routes <AS>:0000000000000101
Upstream Routes <AS>:0000000000000110
Reserved <AS>:0000000000000111-
<AS>:0000011111111111
National and Regional Routes <AS>:0000100000000000-
<AS>:1111111111111111
Encoded as <AS>:<R><X><CC>
Reserved National and Regional values <AS>:0100000000000000-
<AS>:1111111111111111
Okay so here's what each piece means π¦
<AS>is the 16-bit AS<R>is the 5-bit Region Identifier<X>is the 1-bit satellite link indication- X = 1 for satellite links, 0 otherwise
<CC>is the 10-bit ISO-3166-2 country code [ISO3166]
and <R> takes these values π
Africa (AF) 00001
Oceania (OC) 00010
Asia (AS) 00011
Antarctica (AQ) 00100
Europe (EU) 00101
Latin America/Caribbean Islands (LAC) 00110
North America (NA) 00111
Reserved 01000-11111
Here's the bit layout, so you can see how it all fits together π
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| <AS> | <R> |X| <CC> |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
For example, a national route over a terrestrial link in AS 10876 from the Fiji Islands would be encoded like this πΈ
<AS> = 10876 = 0x2A7C
<R> = 00010
<X> = 0
<CC> = Fiji Islands Country Code = 242 = 0011110010
In this case, the low-order 16 bits are 0001000011110010 = 0x10F2 π
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x2A7C | 0x10F2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Note that a configuration language might let you write this community as 10876:4338 (0x10F2 == 4338 decimal) π§
Finally, these categories are not meant to be mutually exclusive, so multiple communities can be attached where appropriate π
4.1. Extended Communities
okay so sometimes the values and encodings from Section 4 can clash with a service provider's existing community assignments π that's where Extended Communities [RFC4360] come in. They're a super convenient way to dodge those clashes π
The Extended Communities attribute is a transitive optional BGP attribute with the Type Code 16. It holds a set of extended communities in this format:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type high | Type low(*) | |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ Value |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
For BGP data collection, we encode the communities from Section 4 using the two-octet AS specific extended community type π¦ Its format looks like this:
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x00 | Sub-Type | Global Administrator |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Local Administrator |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
The two-octet AS specific extended community attribute puts the service provider's two-octet Autonomous System number (as assigned by a Regional Internet Registry, or RIR) in the Global Administrator field. The Local Administrator field can hold any information π
This memo assigns Sub-Type 0x0008 for BGP data collection. It also specifies that the <Value> field, as defined in Section 3.1, is carried in the low-order octets of the Local Administrator field. The two high-order octets of the Local Administrator field are reserved, and they are set to 0x00 when sending and ignored upon receipt π§
For example, the extended community encoding for 10876:4338 (a terrestrial national route in AS 10876 from the Fiji Islands) would be π
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x00 | 0x0008 | 0x2A7C |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x00 | 0x00 | 0x10F2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
4.2. Four-Octet AS Specific Extended Communities
The four-octet AS specific extended community is encoded like this π¦
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| 0x02 | 0x0008 | Global Administrator |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Global Administrator (cont.) | 0x10F2 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
In this case, the four-octet Global Administrator sub-field holds a four-octet Autonomous System number assigned by the IANA β¨
5. Note on BGP UPDATE Packing
okay real talk, data collection communities can make the attribute set of a specific route way more unique than it would be otherwise π That's because each route collects data specific to its path through one or more ASes. This can affect whether multiple routes can be grouped in the same BGP update message, and it may lead to increased use of bandwidth, router CPU cycles, and memory π
6. Acknowledgements π«Ά
The community encoding in this memo germinated from an interesting suggestion from Akira Kato at WIDE πΈ The idea was to use the collection community values to select paths that would result in (hopefully) more efficient access to various services. For example, with RFC 3258 [RFC3258] based DNS anycast service, BGP routers may see multiple paths to the same prefix. Some of those paths might come from the same origin with different paths, and others might come from a different region or country (with the same origin AS) π§
Joe Abley, Randy Bush, Sean Donelan, Xenofontas Dimitropoulos, Vijay Gill, John Heasley, Geoff Huston, Steve Huter, Michael Patton, Olivier Marce, Ryan McDowell, Rob Rockell, Rob Thomas, Pekka Savola, Patrick Verkaik, and Alex Zinin all made many insightful comments on early versions of this document π Henk Uijterwaal suggested the use of the ISO-3166-2 country codes π
7. Security Considerations π
okay this part is seriously important bestie π While this memo introduces no additional security considerations into the BGP protocol, the information in the communities defined here may in some cases reveal network structure that was not previously visible outside the provider's network. So care should be taken when exporting such communities to route collectors π₯ Finally, routes exported to a route collector should also be tagged with the NO_EXPORT community (0xFFFFFF01) π
7.1. Total Path Attribute Length
The communities in this memo are intended for use on egress to a route collector. So an operator may choose to overwrite its internal communities with the values specified here when exporting routes to a route collector π However, operators should in general ensure that the behavior of their BGP implementation is well-defined when adding an attribute causes a PDU to exceed 4096 octets π±
Here's why that matters. Since it is common practice to use community attributes to implement policy (among other functions, such as letting customers set attributes like LOCAL_PREF), the behavior of an implementation when the attribute space overflows is crucial π«£ Among other behaviors, an implementation might usurp the intended attribute data or otherwise cause indeterminate failures. These behaviors can result in unanticipated community attribute sets, and that can lead to unintended policy implications π
8. IANA Considerations π
This memo assigns a new Sub-Type for the AS specific extended community type in the First Come First Served extended transitive category. IANA has assigned Sub-Type 0x0008 as defined in Section 4.1 π
IANA has also created two registries for BGP Data Collection Communities, one for standard communities and one for extended communities. Both registries will start out populated with the values described in Section 4. IETF Consensus, as described in [RFC2434], usually through the Global Routing Operations Working Group (grow), is required for assigning new values in these registries (in particular, for <Value> or <R> in the table of values for the route categories in Section 4) π
9. References π
9.1. Normative References
[ISO3166] "ISO 3166 Maintenance agency (ISO 3166/MA)", Web Page: http://www.iso.org/iso/en/prods-services/iso3166ma/index.html, 2004.
[RFC1771] Rekhter, Y. and T. Li (Editors), "A Border Gateway Protocol (BGP-4)", RFC 1771, March 1995.
[RFC1997] Chandra, R. and P. Traina, "BGP Communities Attribute", RFC 1997, August 1996.
[RFC4360] Sangli, S., Tappan, D., and Y. Rekhter, "BGP Extended Communities Attribute", RFC 4360, January 2006.
9.2. Informative References
- [HUSTON] Huston, G., "Interconnection, Peering, and Settlements",
http://www.isoc.org/inet99/proceedings/1e/1e_1.htmπ - [RFC2434] Narten, T., and H. Alvestrand, "Guidelines for Writing an IANA Considerations Section in RFCs", BCP 26, RFC 2434, October 1998. π
- [RFC3258] Hardie, T., "Distributing Authoritative Name Servers via Shared Unicast Addresses", RFC 3258, April 2002. π§
- [RIS] "The RIPE Routing Information Service", Web Page:
http://www.ripe.net/ris, 2004. π¦ - [RV] Meyer, D., "The Routeviews Project", Web Page:
http://www.routeviews.org, 2002. πΈ - [VPLS] Kompella, K., et al., "Virtual Private LAN Service", Work in Progress, April 2005. π
- [WANG] Wang, F. and L. Gao, "Inferring and Characterizing Internet Routing Policies", ACM SIGCOMM Internet Measurement Conference 2003. π
Author's Address β¨
David Meyer
EMail: dmm@1-4-5.net π
Full Copyright Statement π
Copyright (C) The Internet Society (2006).
This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. π«Ά
This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. π
Intellectual Property π₯
The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document, or the extent to which any license under such rights might or might not be available. It also doesn't claim to have made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. π
Copies of IPR disclosures made to the IETF Secretariat, and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification, can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. ποΈ
The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. π
Acknowledgement π
Funding for the RFC Editor function is provided by the IETF Administrative Support Activity (IASA). π
π¦ where this page comes from
- ietf: rfc4384 2006-02
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms