Date created: Friday, May 10, 2024 5:50:08 PM. Last modified: Wednesday, December 11, 2024 11:21:11 AM

BGP Communities

Standard Communities

https://www.rfc-editor.org/rfc/rfc1997#

32-bit (4 byte) payload split into 2x 2-byte values, e.g. as-number:community-value.

The well-known communities all have an "AS Number" of 65535. For example, NO_EXPORT is 65535:65281.

 

Extended Communities

https://www.rfc-editor.org/rfc/rfc4360

64-bit (8 byte) payload split into 1-or-2-byte type + 7-or-6 byte value:

      Type Field:

         Two classes of Type Field are introduced: Regular type and
         Extended type.

         The size of Type Field for Regular types is 1 octet, and the
         size of the Type Field for Extended types is 2 octets.

         The value of the high-order octet of the Type Field determines
         if an extended community is a Regular type or an Extended type.
         The class of a type (Regular or Extended) is not encoded in the
         structure of the type itself.

The value field can stored a 2 byte ASN followed by a 4 byte ASN (123:11111), a 4 byte ASN followed by a 2 byte ASN (100000:123), or an IPv4 address followed by a 2 byte ASN (10.0.0.1:123).

https://www.iana.org/assignments/bgp-extended-communities/bgp-extended-communities.xhtml

 

Example 1:

https://www.rfc-editor.org/rfc/rfc5575#section-7

byte 1 == 0x80 (meaning "BGP Transitive Extended Community")

byte 2 == 0x06 (meaning "Flowspec traffic rate limit action")

Bytes 3-8 == Specific to the application (FlowSpec, e.g. traffic rate limit in Bytes per second)

 

Example 2:

https://www.rfc-editor.org/rfc/rfc7153.html#page-10

byte 1 == 0x00 (meaning "BGP Transitive Extended Community")

byte 2 == 0x02 (meaning "Route Target")

bytes 3-8 == Specific to the application (L3VPN, e.g. 4 byte ASN + 2 byte VPN ID)

 

Example 3:

byte 1 == 0x00 or 0x02 (use ASN), or 0x01 (use IPv4)

byte 2 == 0x03 (meaning "Route Origin" a.k.a SoO)

bytes 3-8 == Specific to the application (L3 VPN, e.g. 2B-ASN:4B-ASN or IPv4:2B-ASN)

https://www.rfc-editor.org/rfc/rfc4360

 

Large Communities

https://www.rfc-editor.org/rfc/rfc8092.html

96-bit (12 byte) payload split into 3x 4-byte values, e.g. local-as:remote-as:community-value.