Internet-Draft | BGP Community YANG | January 2024 |
Pels | Expires 12 July 2024 | [Page] |
This document provides a YANG module for describing BGP communities.¶
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.¶
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.¶
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."¶
This Internet-Draft will expire on 12 July 2024.¶
Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved.¶
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License.¶
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.¶
ISP operators use BGP communities[RFC1997][RFC4360][RFC8092] to add information to prefix announcements or to let customers influence routing behaviour inside the network of the ISP. Each ISP defines for itself which BGP communities to support and how the structure of these communities should be interpreted. This document provides a YANG[RFC7950] module for describing the structure and meaning of BGP communities, Extended BGP communities and Large BGP communities. ISP operators can use this to publish their community definitions in a well-defined format.¶
ISP operators may define various BGP communities that have local significance inside of their network. These communities could be used to add miscellaneous information to a prefix announcement. For example, a community "64501:1:528" may signify that AS64501 is originating a prefix from a point of presence in The Netherlands (ISO 3166-1 code 528). Alternatively, communities could be used to allow customers of an ISP to control routing behavior of their prefixes inside the ISP. For example, a community "64501:4:64498" attached to a prefix advertised to AS64501 by a customer may be interpreted by AS64501 to mean that this prefix must not be propagated to AS64498.¶
For both use cases it is necessary for the ISP to communicate the meaning of their locally defined communities to others. Currently this is typically done by publishing a list of communities on a web page, or as a remark inside an autnum object in the Internet Routing Registry. This makes it cumbersome to determine if and where an ISP publishes community information. The lack of a well-defined structure makes it hard to develop tools for parsing community information.¶
The purpose of the YANG model defined in this document is to provide a standardized format for publishing community definitions. These definitions help applications to interpret the structure and purpose of BGP communities. For example, looking glasses may use the published definitions to parse communities seen in BGP announcements and display their meaning. Another potential use case is in generating routing policy configurations based on community definitions published by an upstream ASN. This could be done automatically using external tooling to generate router configurations, or inside a router's command-line interface by importing the definitions and providing the CLI-user with available choices for manual configuration.¶
Note that this document only describes a model for the publishing format of community definitions. The publishing location and publishing mechanism used are outside the scope of this specification.¶
The following tree diagram provides an overview of the ietf-bgp-communities.yang data model.¶
The BGP Communities YANG Module contains the elements described in this section. The full contents of the module can be found in Appendix A.¶
A required value of type "uint32", containing the version number for the community set. This value wraps and should be compared using sequence space arithmetic.¶
An optional value of type "string", describing the publication point for the community set.¶
An optional value of type "string", providing information about the specified set of communities.¶
An optional value of type "string", describing a webpage where maintainer contact information may be found.¶
A list of objects defining contact information for the maintainer(s) of the community set. Each object contains the following elements.¶
A required value of type "string", containing the e-mail address of the contact.¶
An optional value of type "string", containing the name of the contact.¶
An optional value of type "string", describing the role of the contact.¶
An optional value of type "string", containing the organization of the contact.¶
An optional value of type "string", containing the organizational unit of the contact.¶
A list of objects defining Regular ([RFC1997]) BGP communities. Each object contains the following elements.¶
A required value of type "string", containing the name of this community. Names may be up to 255 characters long and MUST NOT contain spaces or tabs.¶
An optional value of type "string", providing a description of the community.¶
A required value of type "uint16", containing the Autonomous Sytem Number set in the Global Administrator part of this community.¶
A group of elements that describe the Local Administrator part of the community. This object contains the following elements.¶
An optional value of type "string", describing the format in which fields are encoded. Possible encodings are "decimal" for decimal numbers and "binary" for bit strings. If this leaf is not defined, the default "decimal" encoding is assumed.¶
A list of objects that together form the Local Administrator part of the community. The combined length values of all fields MUST not exceed the maximum length of the Local Administrator part of the community.¶
A required value of type "string", containing the name of the field. Names may be up to 255 characters long and MUST NOT contain spaces or tabs.¶
An optional value of type "uint8", containing the length of the field. If the expected field format (Section 5.6.4.1) is "decimal", this is a number of digits. In case the expected field format is "binary", this is a number of bits.¶
If this leaf is not defined, the length is assumed to be the maximum allowed length of the entire field list. In this case the field list MUST NOT contain more than one element.¶
A required value of type "string", containing a pattern used for matching the field's contents. Patterns are described as POSIX Extended Regular Expressions (see [IEEE.1003-2.1992], section 2.8.4).¶
An optional value of type "string", containing a description of the pattern. This description can be used to provide meaning to specific values for a field.¶
A list of objects defining Extended ([RFC4360]) BGP communities. Two-Octet and Four-Octet AS Specific communities are supported by this specification. Each object contains the following elements.¶
A required value of type "string", containing the name of this community. Names may be up to 255 characters long and MUST NOT contain spaces or tabs.¶
An optional value of type "string", providing a description of the community.¶
A required value of type "uint8", containing the high-order Type of the community.¶
A required value of type "uint8", containing the low-order Sub-Type of the community.¶
For Two-Octet AS Specific communities: A required value of type "uint16", containing the Autonomous Sytem Number set in the Global Administrator part of this community.¶
For Four-Octet AS Specific communities: A required value of type "uint32", containing the Autonomous Sytem Number set in the Global Administrator part of this community.¶
A group of elements that describe the Local Administrator part of the community. This object contains the following elements.¶
An optional value of type "string", describing the format in which fields are to be parsed (see Section 6.2). Possible encodings are "decimal" for decimal numbers and "binary" for strings of zeros and ones. If this leaf is not defined, the default "decimal" encoding is assumed.¶
A list of objects that together form the Local Administrator part of the community. The combined length values of all fields MUST not exceed the maximum length of the Local Administrator part of the community.¶
The supported leafs in this list are identical to those described in Section 5.6.4.2.¶
A list of objects defining Large ([RFC8092]) BGP communities. Each object contains the following elements.¶
A required value of type "string", containing the name of this community. Names may be up to 255 characters long and MUST NOT contain spaces or tabs.¶
An optional value of type "string", providing a description of the community.¶
A required value of type "uint32", containing the Autonomous Sytem Number set in the Global Administrator part of this community.¶
A group of elements that describe the Local Data Part 1 section of the community. This object contains the following elements.¶
An optional value of type "string", describing the format in which fields are encoded. Possible encodings are "decimal" for decimal numbers and "binary" for bit strings. If this leaf is not defined, the default "decimal" encoding is assumed.¶
A list of objects that together form the Local Data Part 1 section of the community. The combined length values of all fields MUST not exceed the maximum length of the "Local Data Part 1" section of the community.¶
The supported leafs in this list are identical to those described in Section 5.6.4.2.¶
A group of elements that describe the Local Data Part 2 section of the community. This object contains the following elements.¶
An optional value of type "string", describing the format in which fields are encoded. Possible encodings are "decimal" for decimal numbers and "binary" for bit strings. If this leaf is not defined, the default "decimal" encoding is assumed.¶
A list of objects that together form the Local Data Part 2 section of the community. The combined length values of all fields MUST not exceed the maximum length of the "Local Data Part 2" section of the community.¶
The supported leafs in this list are identical to those described in Section 5.6.4.2.¶
Operators SHOULD only publish BGP community definitions for networks they control. This may include communities where the Global Administrator field contains a private ASN, if this community has a local meaning inside the network of the publisher.¶
When publishing community definitions with overlapping field patterns these MUST be ordered from most to least specific, to ensure parsers can perform deterministic matching.¶
A published BGP community definition can be used by parsers to display information about a received community. If a received community matches multiple published community definitions, the first community in the published order takes precedence.¶
By default, communities are compared using the decimal representation of the fields. If "format" for a Local Administrator or Local Data Part is set to "binary", the fields in the received community are converted to strings of zeros and ones before comparison.¶
Applications that parse these community definitions SHOULD reject objects that do not comply with the rules described in this document. Furthermore, parsers SHOULD check that the sum of the specified Local Administrator or Local Data Part field lengths in each community definition does not exceed the local part size of the specified community type. For example: A Regular BGP community definition with format "decimal" containing a field of length 4 and a field of length 2 would be illegal, as the Local Administrator field has a maximum length of 65535 (5 digits).¶
This document registers the following XML namespace URN in the "IETF XML Registry", following the format defined in [RFC3688]:¶
TODO¶
This document registers the following YANG module in the "YANG Module Names" registry [RFC6020]:¶
TODO¶
This document registers the following entry in the "IETF YANG SID" registry [I-D.ietf-core-sid]:¶
TODO¶
The YANG module described in this document may be used to specify BGP community definitions in different encoding formats, such as XML, JSON or CBOR. Applications that parse these community definitions SHOULD reject objects that do not comply with the rules described in this document. Furthermore, parsers SHOULD check that the sum of the specified Local Administrator or Local Data Part field lengths in each community definition does not exceed the local part size of the specified community type.¶
This section contains the complete YANG module defined in this document.¶
This section shows example use cases for the YANG module defined in this document, using JSON[RFC7951] encoding.¶
A JSON definition for the example Large BGP community described in [RFC8195], section 4.1.1 looks as follows.¶
The author would like to thank Jeffrey Haas, Luuk Hendriks, Jasper den Hertog and Teun Vink for contributing ideas and feedback to this document.¶