↓ Skip to main content
  1. Network Articles/
  2. BGP Articles/

BGP Extended Community

Table of Contents

What an Extended Community is

An Extended Community (RFC 4360) is a kind of tag attached to routes. A COMMUNITY (RFC 1997) is just a list of 4-byte values whose meaning is agreed between operators. An Extended Community, by contrast, is 8 bytes long, and a “type” at the front decides the structure and meaning of the value.

ItemCOMMUNITYExtended Community
Type code816
CategoryOptional transitiveOptional transitive
Length of one4 bytes8 bytes
StructureValue only; the AS number goes in the upper 2 bytesType (Type / Sub-Type) + value
Crosses AS boundariesYes (stopped with values such as NO_EXPORT)Decided by the T bit of the type
Typical valuesOperator-defined, such as 65001:100Route Target, Route Origin (SoO), Color, Link Bandwidth

The best-known use is MPLS L3VPN (VPNv4). RFC 4364 specifies that both the Route Target, which says which VRFs a VPN route goes into, and the Site of Origin, which says which site it came from, are carried as Extended Communities (4.3.1, 7). Using VPNv4, this article confirms that these values are exchanged in the Extended Communities attribute, separate from COMMUNITY. How VPNs themselves work is covered in What Is MPLS VPN (L3VPN).

Format

The 8-byte Extended Community format and the Value structures

The value of the attribute (type code 16) is as many 8-byte Extended Communities as needed. Each one has three parts.

FieldLengthContent
Type high1 byteFrom the top: I (how IANA assigns the type), T (0 = transitive across ASes, 1 = non-transitive), and 6 bits for the structure of the Value
Type low (Sub-Type)1 byteThe use within that structure (Route Target = 0x02, Route Origin = 0x03, and so on)
Value6 bytesDivided according to the structure

There are four Value structures.

Type highStructureGlobal AdministratorLocal AdministratorSource
0x00 / 0x40Two-Octet AS-SpecificAS number (2 bytes)4 bytesRFC 4360 3.1
0x01 / 0x41IPv4-Address-SpecificIPv4 address (4 bytes)2 bytesRFC 4360 3.2
0x02 / 0x42Four-Octet AS-SpecificAS number (4 bytes)2 bytesRFC 5668
0x03 / 0x43Opaque(6 bytes defined per Sub-Type)RFC 4360 3.3

The value left of “/” is transitive (T bit 0) and the right is non-transitive (T bit 1). The Global Administrator identifies the organization that assigned the value (an AS number or an IPv4 address); the Local Administrator is a number chosen by that organization. An AS with a 2-byte AS number should use the Two-Octet AS-Specific form (RFC 5668 3).

Common types

Sub-Type values are in the IANA registry (organized by RFC 7153). These are the ones used in this article.

NameType high : Sub-TypeTransitiveMeaning
Route Target (RT)0x00 / 0x01 / 0x02 : 0x02YesRouters that may receive this route (RFC 4360 4). In VPNs it decides which VRFs import the route
Route Origin (Site of Origin, SoO)0x00 / 0x01 / 0x02 : 0x03YesRouters that injected this route into BGP (RFC 4360 5). In VPNs it identifies the site
Color0x03 : 0x0BYesColors a route (RFC 9012 4.3), for example for tunnel selection
Link Bandwidth0x40 : 0x04 (as used here)NoLink bandwidth, used to weight multipath. The value is bytes per second as a 4-byte floating-point number
Cost Community0x43 : 0x01NoCisco-specific (registered with IANA with an Internet-Draft reference). Adds a cost to best-path selection

The Internet-Draft that defines Link Bandwidth (draft-ietf-idr-link-bandwidth) allows either 0x00 or 0x40 as its Type. How RT and SoO are used in VPNs is covered in RT (Route Target) and MPLS VPN PE-CE routing with eBGP.

In VPNv4, RT and SoO are carried as Extended Communities

VPNv4 routes are carried with MP-BGP AFI 1 / SAFI 128 (RFC 4364 4.3.4, MP-BGP). The PE attaches values derived from the VRF configuration to those routes as Extended Communities.

ValueRouter and configurationType in the Extended Community
Route TargetThe PE’s VRF export route-targetSub-Type 0x02
Site of OriginThe PE’s site-of-origin on the PE-CE neighborSub-Type 0x03

The shape of a VPNv4 UPDATE (RD, VPN label, MP_REACH_NLRI) is covered in MPLS VPN MP-BGP.

Behavior rules (RFC 4360 6)

RuleDetails
May be used to control which routes are accepted or distributedImporting into VRFs by RT is this kind of use
Must not modify best-path selection in a way that leads to forwarding loops (MUST NOT)A constraint for types that affect selection, such as the Cost Community
A receiver may add or modify the attribute (MAY)Policies can handle it freely
AggregationWithout ATOMIC_AGGREGATE, the aggregate carries the union of the components’ Extended Communities (default)
Non-transitive ones should be removed before advertising across an AS boundary (SHOULD)They should not be removed across a confederation boundary (SHOULD NOT)
Can coexist with COMMUNITYEach is handled by RFC 1997 / RFC 4360

IOS XR does not send Extended Communities to eBGP peers by default. The neighbor’s address-family needs send-extended-community-ebgp (separate from send-community-ebgp for COMMUNITY). They are sent to iBGP peers by default.

Configuration on IOS XR

To attachConfiguration
Route Targetvrf <name> → address-family ipv4 unicast → list values under export route-target
Site of Originrouter bgp → vrf <name> → neighbor <CE> → address-family ipv4 unicast → site-of-origin <value>
Color / Link Bandwidth / CostDefine values with extcommunity-set opaque / bandwidth / cost, then set extcommunity <type> <set name> additive in a route-policy
Send to eBGPsend-extended-community-ebgp under the neighbor’s address-family
CheckCommand
VPNv4 table on the PEThe Extended community: line of show bgp vpnv4 unicast rd <RD> <prefix>
Route in the VRFshow bgp vrf <name> <prefix>
CEThe Extended community: / Community: lines of show bgp <prefix>

The actual configuration is shown with show configuration commit changes in each STEP.

Verification on real devices

Verified with five XRd 26.1.1 routers.

BGP Extended Community verification topology
  • CE1 (AS 65011) and CE2 (AS 65012) run eBGP with PE1 and PE2 of AS 65002 inside VRF CUST-A
  • PE1 - P1 - PE2 run OSPF and LDP. PE1 and PE2 run VPNv4 iBGP between their Loopback0 addresses; P1 has no BGP
  • VRF CUST-A uses RD 65002:1 (PE1) / 65002:2 (PE2) and RT 65002:100
  • CE1 advertises 192.168.1.0/24 and CE2 advertises 192.168.2.0/24. We follow which values are carried on CE1’s route over PE1 → PE2 (iBGP) and PE2 → CE2 (eBGP)
  • Every STEP checks reachability between CE1’s and CE2’s Loopback1 with ping (50 packets) and traceroute

P1 does not run BGP. VPN routes are carried only by the iBGP session between the PEs.

P1 show bgp summary (STEP 0)
RP/0/RP0/CPU0:P1#show bgp summary
Sun Sep 13 16:53:55.763 UTC
% BGP instance 'default' not active

Overview of the verification

STEPChangeWhat to check
0Initial state (RT 65002:100 on the VRF)The VPNv4 UPDATE has type 16 with the RT in 8 bytes. It is not sent to CE2
1CE1 attaches a COMMUNITY to its routeType 8 (4 bytes) and type 16 (8 bytes) appear in the same UPDATE
2Add IPv4-address and 4-byte-AS forms to PE1’s RT exportThree RTs in one attribute, with Type high 0x00 / 0x01 / 0x02
3SoO on PE1’s CE1 neighborSub-Type 0x03 is added
4PE1 attaches Color, Link Bandwidth and CostAll of them reach PE2 (iBGP inside the AS)
5send-extended-community-ebgp on PE2’s CE2 neighborOnly the transitive ones reach CE2; the non-transitive ones are dropped

ping from CE1’s Loopback1 to CE2’s Loopback1 was 100% (50/50) in both directions in every STEP from 0 to 5. Adding values does not change VPN forwarding.

STEP 0: Initial state (RT 65002:100 on the VRF)

PE1 attaches RT 65002:100 to CE1’s route and carries it in the Extended Communities attribute (type 16, 8 bytes) of the VPNv4 UPDATE. It is not sent to CE2.

PE1’s 192.168.1.0/24. The (received-only) path is the route as received from CE1, and it has no Extended community: line. The RT is attached by PE1 from the VRF configuration, not by CE1.

PE1 show bgp vpnv4 unicast rd 65002:1 192.168.1.0/24 (STEP 0)
RP/0/RP0/CPU0:PE1#show bgp vpnv4 unicast rd 65002:1 192.168.1.0/24
Sun Sep 13 16:53:04.684 UTC
BGP routing table entry for 192.168.1.0/24, Route Distinguisher: 65002:1
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                  5            5
    Local Label: 24003
Last Modified: Sep 13 16:42:23.023 for 00:10:41
Paths: (2 available, best #1)
  Advertised to peers (in unique update groups):
    10.0.0.2        
  Path #1: Received by speaker 0
  Advertised to peers (in unique update groups):
    10.0.0.2        
  65011
    10.11.1.11 from 10.11.1.11 (10.0.0.11)
      Origin IGP, metric 0, localpref 100, valid, external, best, group-best, import-candidate
      Received Path ID 0, Local Path ID 1, version 5
      Extended community: RT:65002:100 
  Path #2: Received by speaker 0
  Not advertised to any peer
  65011, (received-only)
    10.11.1.11 from 10.11.1.11 (10.0.0.11)
      Origin IGP, metric 0, localpref 100, valid, external
      Received Path ID 0, Local Path ID 0, version 0

The UPDATE PE1 sent to PE2 (No.38 in the PE1-P1 capture). The AFI 1 / SAFI 128 (VPNv4) route carries EXTENDED_COMMUNITIES (type code 16, length 8).

No.38 UPDATE (PE1 → PE2) tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 97
    Type: UPDATE Message (2)
<snip>
        Path Attribute - MP_REACH_NLRI
            Flags: 0x90, Optional, Extended-Length, Non-transitive, Complete
            Type Code: MP_REACH_NLRI (14)
            Length: 32
            Address family identifier (AFI): IPv4 (1)
            Subsequent address family identifier (SAFI): Labeled VPN Unicast (128)
<snip>
        Path Attribute - EXTENDED_COMMUNITIES
            Flags: 0xc0, Optional, Transitive, Complete
            Type Code: EXTENDED_COMMUNITIES (16)
            Length: 8
            Carried extended communities: (1 community)
                Route Target: 65002:100 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Target (0x02)
                    2-Octet AS: 65002
                    4-Octet AN: 100
Download the pcap of the packet in the tshark output above (No.38 UPDATE)

CE2’s route has no Extended community: line. PE2 → CE2 is eBGP, so it is not sent by default.

CE2 show bgp 192.168.1.0/24 (STEP 0)
RP/0/RP0/CPU0:CE2#show bgp 192.168.1.0/24
Sun Sep 13 16:55:29.336 UTC
BGP routing table entry for 192.168.1.0/24
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                  6            6
Last Modified: Sep 13 16:50:27.023 for 00:05:02
Paths: (1 available, best #1)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  65002 65011, (received & used)
    10.12.2.2 from 10.12.2.2 (10.0.0.2)
      Origin IGP, localpref 100, valid, external, best, group-best
      Received Path ID 0, Local Path ID 1, version 6
      Origin-AS validity: (disabled)

STEP 1: CE1 attaches a COMMUNITY to its route

The same UPDATE carries COMMUNITY (type 8, 4 bytes) and Extended Communities (type 16, 8 bytes) as separate attributes.

CE1 show configuration commit changes last 1 (STEP 1)
RP/0/RP0/CPU0:CE1#show configuration commit changes last 1
Sun Sep 13 16:56:33.080 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
route-policy TO-PE1
  set community (65011:100)
  pass
end-policy
!
end

A COMMUNITY is just 4 bytes of AS number and value, with no type. An Extended Community has a Type and a Sub-Type.

No.9 UPDATE (PE1 → PE2) tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 104
    Type: UPDATE Message (2)
<snip>
        Path Attribute - COMMUNITIES: 65011:100 
            Flags: 0xc0, Optional, Transitive, Complete
            Type Code: COMMUNITIES (8)
            Length: 4
            Communities: 65011:100 
                Community: 65011:100 
                    Community AS: 65011
                    Community value: 100
<snip>
        Path Attribute - EXTENDED_COMMUNITIES
            Flags: 0xc0, Optional, Transitive, Complete
            Type Code: EXTENDED_COMMUNITIES (16)
            Length: 8
            Carried extended communities: (1 community)
                Route Target: 65002:100 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Target (0x02)
                    2-Octet AS: 65002
                    4-Octet AN: 100
Download the pcap of the packet in the tshark output above (No.9 UPDATE)

PE2 → CE2 has only send-community-ebgp, so CE2 receives only the COMMUNITY.

CE2 show bgp 192.168.1.0/24 (STEP 1)
RP/0/RP0/CPU0:CE2#show bgp 192.168.1.0/24
Sun Sep 13 17:01:56.317 UTC
BGP routing table entry for 192.168.1.0/24
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                  7            7
Last Modified: Sep 13 16:56:35.023 for 00:05:21
Paths: (1 available, best #1)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  65002 65011, (received & used)
    10.12.2.2 from 10.12.2.2 (10.0.0.2)
      Origin IGP, localpref 100, valid, external, best, group-best
      Received Path ID 0, Local Path ID 1, version 7
      Community: 65011:100
      Origin-AS validity: (disabled)

STEP 2: Add IPv4-address and 4-byte-AS forms to PE1’s RT export

One attribute (24 bytes) carries three RTs, whose structures differ by Type high 0x00 / 0x01 / 0x02.

PE1 show configuration commit changes last 1 (STEP 2)
RP/0/RP0/CPU0:PE1#show configuration commit changes last 1
Sun Sep 13 17:03:01.490 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
vrf CUST-A
 address-family ipv4 unicast
  export route-target
   10.0.0.1:100
   4200000000:100
  !
 !
!
end

The 4-byte AS form has a 4-byte Global Administrator and a 2-byte Local Administrator; the 2-byte AS form is the other way round.

No.7 UPDATE (PE1 → PE2) tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 120
    Type: UPDATE Message (2)
<snip>
        Path Attribute - EXTENDED_COMMUNITIES
            Flags: 0xc0, Optional, Transitive, Complete
            Type Code: EXTENDED_COMMUNITIES (16)
            Length: 24
            Carried extended communities: (3 communities)
                Route Target: 64086.59904(4200000000):100 [Transitive 4-Octet AS-Specific]
                    Type: Transitive 4-Octet AS-Specific (0x02)
                    Subtype (AS4): Route Target (0x02)
                    4-Octet AS: 4200000000
                    2-Octet AN: 100
                Route Target: 10.0.0.1:100 [Transitive IPv4-Address-Specific]
                    Type: Transitive IPv4-Address-Specific (0x01)
                    Subtype (IPv4): Route Target (0x02)
                    IPv4 address: 10.0.0.1
                    2-Octet AN: 100
                Route Target: 65002:100 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Target (0x02)
                    2-Octet AS: 65002
                    4-Octet AN: 100
Download the pcap of the packet in the tshark output above (No.7 UPDATE)
PE2 show bgp vrf CUST-A 192.168.1.0/24 (STEP 2)
RP/0/RP0/CPU0:PE2#show bgp vrf CUST-A 192.168.1.0/24
Sun Sep 13 17:07:38.708 UTC
BGP routing table entry for 192.168.1.0/24, Route Distinguisher: 65002:2
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 16           16
Last Modified: Sep 13 17:03:03.023 for 00:04:35
Paths: (1 available, best #1)
  Advertised to CE peers (in unique update groups):
    10.12.2.12      
  Path #1: Received by speaker 0
  Advertised to CE peers (in unique update groups):
    10.12.2.12      
  65011, (received & used)
    10.0.0.1 (metric 3) from 10.0.0.1 (10.0.0.1)
      Received Label 24003 
      Origin IGP, metric 0, localpref 100, valid, internal, best, group-best, import-candidate, imported
      Received Path ID 0, Local Path ID 1, version 16
      Community: 65011:100
      Extended community: RT:65002:100 RT:10.0.0.1:100 RT:4200000000:100 
      Source AFI: VPNv4 Unicast, Source VRF: default, Source Route Distinguisher: 65002:1

STEP 3: SoO on PE1’s CE1 neighbor

The SoO is added to the same attribute (32 bytes) as Sub-Type 0x03 (Route Origin).

PE1 show configuration commit changes last 1 (STEP 3)
RP/0/RP0/CPU0:PE1#show configuration commit changes last 1
Sun Sep 13 17:09:32.616 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
router bgp 65002
 vrf CUST-A
  neighbor 10.11.1.11
   address-family ipv4 unicast
    site-of-origin 65011:1
   !
  !
 !
!
end
No.9 UPDATE (PE1 → PE2) tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 128
    Type: UPDATE Message (2)
<snip>
        Path Attribute - EXTENDED_COMMUNITIES
            Flags: 0xc0, Optional, Transitive, Complete
            Type Code: EXTENDED_COMMUNITIES (16)
            Length: 32
            Carried extended communities: (4 communities)
                Route Origin: 65011:1 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Origin (0x03)
                    2-Octet AS: 65011
                    4-Octet AN: 1
                Route Target: 64086.59904(4200000000):100 [Transitive 4-Octet AS-Specific]
                    Type: Transitive 4-Octet AS-Specific (0x02)
                    Subtype (AS4): Route Target (0x02)
                    4-Octet AS: 4200000000
                    2-Octet AN: 100
                Route Target: 10.0.0.1:100 [Transitive IPv4-Address-Specific]
                    Type: Transitive IPv4-Address-Specific (0x01)
                    Subtype (IPv4): Route Target (0x02)
                    IPv4 address: 10.0.0.1
                    2-Octet AN: 100
                Route Target: 65002:100 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Target (0x02)
                    2-Octet AS: 65002
                    4-Octet AN: 100
Download the pcap of the packet in the tshark output above (No.9 UPDATE)
PE2 show bgp vrf CUST-A 192.168.1.0/24 (STEP 3)
RP/0/RP0/CPU0:PE2#show bgp vrf CUST-A 192.168.1.0/24
Sun Sep 13 17:14:06.695 UTC
BGP routing table entry for 192.168.1.0/24, Route Distinguisher: 65002:2
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 18           18
Last Modified: Sep 13 17:09:36.023 for 00:04:30
Paths: (1 available, best #1)
  Advertised to CE peers (in unique update groups):
    10.12.2.12      
  Path #1: Received by speaker 0
  Advertised to CE peers (in unique update groups):
    10.12.2.12      
  65011, (received & used)
    10.0.0.1 (metric 3) from 10.0.0.1 (10.0.0.1)
      Received Label 24003 
      Origin IGP, metric 0, localpref 100, valid, internal, best, group-best, import-candidate, imported
      Received Path ID 0, Local Path ID 1, version 18
      Community: 65011:100
      Extended community: SoO:65011:1 RT:65002:100 RT:10.0.0.1:100 RT:4200000000:100 
      Source AFI: VPNv4 Unicast, Source VRF: default, Source Route Distinguisher: 65002:1

STEP 4: PE1 attaches Color, Link Bandwidth and Cost

Color (transitive) and Link Bandwidth and Cost (non-transitive) are added, making seven (56 bytes). This is iBGP inside the AS, so all of them reach PE2.

PE1 show configuration commit changes last 1 (STEP 4)
RP/0/RP0/CPU0:PE1#show configuration commit changes last 1
Sun Sep 13 17:16:00.499 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
extcommunity-set cost COST-CE1
  IGP:1:100
end-set
!
extcommunity-set opaque COLOR-CUST-A
  42
end-set
!
extcommunity-set bandwidth BW-CE1
  65002:1000
end-set
!
route-policy FROM-CE1
  set extcommunity color COLOR-CUST-A additive
  set extcommunity bandwidth BW-CE1 additive
  set extcommunity cost COST-CE1 additive
  pass
end-policy
!
end

Link Bandwidth (0x40) and Cost (0x43), whose T bit is 1, are not removed inside AS 65002. The Link Bandwidth value is 1000, in bytes per second as specified (tshark converts it and shows 0.008 Mbps).

No.5 UPDATE (PE1 → PE2) tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 152
    Type: UPDATE Message (2)
<snip>
        Path Attribute - EXTENDED_COMMUNITIES
            Flags: 0xc0, Optional, Transitive, Complete
            Type Code: EXTENDED_COMMUNITIES (16)
            Length: 56
            Carried extended communities: (7 communities)
                Route Origin: 65011:1 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Origin (0x03)
                    2-Octet AS: 65011
                    4-Octet AN: 1
                Color: 0x0000 0x0000 0x002a [Transitive Opaque]
                    Type: Transitive Opaque (0x03)
                    Subtype (Opaque): Color (0x0b)
                    Raw Value: 0x0000 0x0000 0x002a
                Cost Community: 100, POI: "Smallest IGP Metric" step (Evaluated after) [Non-Transitive Opaque]
                    Type: Non-Transitive Opaque (0x43)
                    Subtype (Non-transitive Opaque): Cost Community (0x01)
                    Point of insertion: "Smallest IGP Metric" step (129)
                    Community ID: 1
                    Cost: 100 (Evaluated after the original attribute value)
                Route Target: 64086.59904(4200000000):100 [Transitive 4-Octet AS-Specific]
                    Type: Transitive 4-Octet AS-Specific (0x02)
                    Subtype (AS4): Route Target (0x02)
                    4-Octet AS: 4200000000
                    2-Octet AN: 100
                Route Target: 10.0.0.1:100 [Transitive IPv4-Address-Specific]
                    Type: Transitive IPv4-Address-Specific (0x01)
                    Subtype (IPv4): Route Target (0x02)
                    IPv4 address: 10.0.0.1
                    2-Octet AN: 100
                Route Target: 65002:100 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Target (0x02)
                    2-Octet AS: 65002
                    4-Octet AN: 100
                Link Bandwidth: ASN 65002, 0.008 Mbps [Non-Transitive 2-Octet AS-Specific]
                    Type: Non-Transitive 2-Octet AS-Specific (0x40)
                    Subtype (Non-transitive AS2): Link Bandwidth (0x04)
                    2-Octet AS: 65002
                    Link bandwidth: 1000
Download the pcap of the packet in the tshark output above (No.5 UPDATE)
PE2 show bgp vrf CUST-A 192.168.1.0/24 (STEP 4)
RP/0/RP0/CPU0:PE2#show bgp vrf CUST-A 192.168.1.0/24
Sun Sep 13 17:20:35.196 UTC
BGP routing table entry for 192.168.1.0/24, Route Distinguisher: 65002:2
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                 20           20
Last Modified: Sep 13 17:16:02.023 for 00:04:33
Paths: (1 available, best #1)
  Advertised to CE peers (in unique update groups):
    10.12.2.12      
  Path #1: Received by speaker 0
  Advertised to CE peers (in unique update groups):
    10.12.2.12      
  65011, (received & used)
    10.0.0.1 (metric 3) from 10.0.0.1 (10.0.0.1)
      Received Label 24003 
      Origin IGP, metric 0, localpref 100, valid, internal, best, group-best, import-candidate, imported
      Received Path ID 0, Local Path ID 1, version 20
      Community: 65011:100
      Extended community: SoO:65011:1 Color:42 LB:65002:8 COST:129:1:100 RT:4200000000:100 RT:10.0.0.1:100 RT:65002:100 
                          (LB non-transitive AS:bytes/sec:65002:1000.000)
      Source AFI: VPNv4 Unicast, Source VRF: default, Source Route Distinguisher: 65002:1

CE2 still receives none of them.

CE2 show bgp 192.168.1.0/24 (STEP 4)
RP/0/RP0/CPU0:CE2#show bgp 192.168.1.0/24
Sun Sep 13 17:21:23.142 UTC
BGP routing table entry for 192.168.1.0/24
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                  7            7
Last Modified: Sep 13 16:56:35.023 for 00:24:48
Paths: (1 available, best #1)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  65002 65011, (received & used)
    10.12.2.2 from 10.12.2.2 (10.0.0.2)
      Origin IGP, localpref 100, valid, external, best, group-best
      Received Path ID 0, Local Path ID 1, version 7
      Community: 65011:100
      Origin-AS validity: (disabled)

STEP 5: send-extended-community-ebgp on PE2’s CE2 neighbor

Only the five transitive ones (SoO, Color and three RTs, 40 bytes) reach CE2; PE2 removes the non-transitive Link Bandwidth and Cost at the AS boundary.

PE2 show configuration commit changes last 1 (STEP 5)
RP/0/RP0/CPU0:PE2#show configuration commit changes last 1
Sun Sep 13 17:22:41.807 UTC
!! Building configuration...
!! IOS XR Configuration 26.1.1
router bgp 65002
 vrf CUST-A
  neighbor 10.12.2.12
   address-family ipv4 unicast
    send-extended-community-ebgp
   !
  !
 !
!
end

The UPDATE PE2 sent to CE2 (No.3 in the PE2-CE2 capture). Of the seven PE2 held in STEP 4, 0x40 and 0x43 are missing.

No.3 UPDATE (PE2 → CE2) tshark -V
Border Gateway Protocol - UPDATE Message
    Marker: ffffffffffffffffffffffffffffffff
    Length: 107
    Type: UPDATE Message (2)
<snip>
        Path Attribute - EXTENDED_COMMUNITIES
            Flags: 0xc0, Optional, Transitive, Complete
            Type Code: EXTENDED_COMMUNITIES (16)
            Length: 40
            Carried extended communities: (5 communities)
                Route Origin: 65011:1 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Origin (0x03)
                    2-Octet AS: 65011
                    4-Octet AN: 1
                Color: 0x0000 0x0000 0x002a [Transitive Opaque]
                    Type: Transitive Opaque (0x03)
                    Subtype (Opaque): Color (0x0b)
                    Raw Value: 0x0000 0x0000 0x002a
                Route Target: 64086.59904(4200000000):100 [Transitive 4-Octet AS-Specific]
                    Type: Transitive 4-Octet AS-Specific (0x02)
                    Subtype (AS4): Route Target (0x02)
                    4-Octet AS: 4200000000
                    2-Octet AN: 100
                Route Target: 10.0.0.1:100 [Transitive IPv4-Address-Specific]
                    Type: Transitive IPv4-Address-Specific (0x01)
                    Subtype (IPv4): Route Target (0x02)
                    IPv4 address: 10.0.0.1
                    2-Octet AN: 100
                Route Target: 65002:100 [Transitive 2-Octet AS-Specific]
                    Type: Transitive 2-Octet AS-Specific (0x00)
                    Subtype (AS2): Route Target (0x02)
                    2-Octet AS: 65002
                    4-Octet AN: 100
Download the pcap of the packet in the tshark output above (No.3 UPDATE)
CE2 show bgp 192.168.1.0/24 (STEP 5)
RP/0/RP0/CPU0:CE2#show bgp 192.168.1.0/24
Sun Sep 13 17:28:06.724 UTC
BGP routing table entry for 192.168.1.0/24
Versions:
  Process           bRIB/RIB   SendTblVer
  Speaker                  8            8
Last Modified: Sep 13 17:22:45.023 for 00:05:21
Paths: (1 available, best #1)
  Not advertised to any peer
  Path #1: Received by speaker 0
  Not advertised to any peer
  65002 65011, (received & used)
    10.12.2.2 from 10.12.2.2 (10.0.0.2)
      Origin IGP, localpref 100, valid, external, best, group-best
      Received Path ID 0, Local Path ID 1, version 8
      Community: 65011:100
      Extended community: SoO:65011:1 Color:42 RT:65002:100 RT:10.0.0.1:100 RT:4200000000:100 
      Origin-AS validity: (disabled)

Verification config and show output

Each STEP captures the following files from all five routers, one file per router. The verification config is the ..._run.txt (final state: STEP 5).

FileContent
..._show.txtshow version / show interface description / show route. PE: show bgp vpnv4 unicast / show bgp vpnv4 unicast rd <RD> <prefix> / show bgp vpnv4 unicast neighbors / show bgp vrf CUST-A / show bgp vrf CUST-A <prefix> / show vrf all detail / show route vrf CUST-A / show ospf neighbor / show mpls ldp neighbor brief / show mpls forwarding / show rpl route-policy / show rpl extcommunity-set / per-peer advertised-routes, routes, received routes. P1: show ospf neighbor / show mpls ldp neighbor brief / show mpls forwarding / show bgp summary. CE: show bgp / show bgp <prefix> / show bgp neighbors / the three per-peer commands
..._log.txtshow logging limited to that STEP (a logmsg marker at the start of each STEP, its time passed to show logging start)
..._run.txtshow running-config at that STEP (the verification config of that STEP)
..._ping.txtping (50 packets, timeout 1 s) and traceroute between CE1’s and CE2’s Loopback1 (CE1 and CE2 only)
..._trace.txtshow bgp trace neighbor / show bgp trace error
..._commit.cfgOnly the configuration actually committed in that STEP, for the routers that changed

STEP 0: Initial state (RT 65002:100 on the VRF)

Routershow outputsyslogrunning-configpingtracecommit
CE1showlogrunpingtrace-
PE1showlogrun-trace-
P1showlogrun-trace-
PE2showlogrun-trace-
CE2showlogrunpingtrace-

STEP 1: CE1 attaches a COMMUNITY to its route

Routershow outputsyslogrunning-configpingtracecommit
CE1showlogrunpingtracecfg
PE1showlogrun-trace-
P1showlogrun-trace-
PE2showlogrun-trace-
CE2showlogrunpingtrace-

STEP 2: Add IPv4-address and 4-byte-AS forms to PE1’s RT export

Routershow outputsyslogrunning-configpingtracecommit
CE1showlogrunpingtrace-
PE1showlogrun-tracecfg
P1showlogrun-trace-
PE2showlogrun-trace-
CE2showlogrunpingtrace-

STEP 3: SoO on PE1’s CE1 neighbor

Routershow outputsyslogrunning-configpingtracecommit
CE1showlogrunpingtrace-
PE1showlogrun-tracecfg
P1showlogrun-trace-
PE2showlogrun-trace-
CE2showlogrunpingtrace-

STEP 4: PE1 attaches Color, Link Bandwidth and Cost

Routershow outputsyslogrunning-configpingtracecommit
CE1showlogrunpingtrace-
PE1showlogrun-tracecfg
P1showlogrun-trace-
PE2showlogrun-trace-
CE2showlogrunpingtrace-

STEP 5: send-extended-community-ebgp on PE2’s CE2 neighbor (final state)

Routershow outputsyslogrunning-configpingtracecommit
CE1showlogrunpingtrace-
PE1showlogrun-trace-
P1showlogrun-trace-
PE2showlogrun-tracecfg
CE2showlogrunpingtrace-

Packet captures were taken per STEP on the CE1-PE1, PE1-P1 and PE2-CE2 links.

STEPCE1-PE1PE1-P1PE2-CE2
0pcappcappcap
1pcappcappcap
2pcappcappcap
3pcappcappcap
4pcappcappcap
5pcappcappcap

References

SourceTitleSummary
RFC 4360BGP Extended Communities AttributeThe 8-byte structure and types (2, 3), Route Target (4), Route Origin (5), behavior rules (6)
RFC 1997BGP Communities AttributeCOMMUNITY (type code 8, 4 bytes)
RFC 56684-Octet AS Specific BGP Extended CommunityFour-Octet AS-Specific structure
RFC 7153IANA Registries for BGP Extended CommunitiesType and Sub-Type registries
RFC 9012The BGP Tunnel Encapsulation AttributeColor Extended Community (4.3)
draft-ietf-idr-link-bandwidthBGP Link Bandwidth Extended CommunityLink Bandwidth (bytes per second, 4-byte IEEE 754 floating point)
RFC 4364BGP/MPLS IP Virtual Private Networks (VPNs)VPN-IPv4 AFI / SAFI (4.3.4); RT and SoO carried as Extended Communities (4.3.1, 7)
IANA BGP Extended CommunitiesBorder Gateway Protocol (BGP) Extended CommunitiesList of Types and Sub-Types

Related articles