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.
| Item | COMMUNITY | Extended Community |
|---|---|---|
| Type code | 8 | 16 |
| Category | Optional transitive | Optional transitive |
| Length of one | 4 bytes | 8 bytes |
| Structure | Value only; the AS number goes in the upper 2 bytes | Type (Type / Sub-Type) + value |
| Crosses AS boundaries | Yes (stopped with values such as NO_EXPORT) | Decided by the T bit of the type |
| Typical values | Operator-defined, such as 65001:100 | Route 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 value of the attribute (type code 16) is as many 8-byte Extended Communities as needed. Each one has three parts.
| Field | Length | Content |
|---|---|---|
| Type high | 1 byte | From 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 byte | The use within that structure (Route Target = 0x02, Route Origin = 0x03, and so on) |
| Value | 6 bytes | Divided according to the structure |
There are four Value structures.
| Type high | Structure | Global Administrator | Local Administrator | Source |
|---|---|---|---|---|
| 0x00 / 0x40 | Two-Octet AS-Specific | AS number (2 bytes) | 4 bytes | RFC 4360 3.1 |
| 0x01 / 0x41 | IPv4-Address-Specific | IPv4 address (4 bytes) | 2 bytes | RFC 4360 3.2 |
| 0x02 / 0x42 | Four-Octet AS-Specific | AS number (4 bytes) | 2 bytes | RFC 5668 |
| 0x03 / 0x43 | Opaque | (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.
| Name | Type high : Sub-Type | Transitive | Meaning |
|---|---|---|---|
| Route Target (RT) | 0x00 / 0x01 / 0x02 : 0x02 | Yes | Routers 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 : 0x03 | Yes | Routers that injected this route into BGP (RFC 4360 5). In VPNs it identifies the site |
| Color | 0x03 : 0x0B | Yes | Colors a route (RFC 9012 4.3), for example for tunnel selection |
| Link Bandwidth | 0x40 : 0x04 (as used here) | No | Link bandwidth, used to weight multipath. The value is bytes per second as a 4-byte floating-point number |
| Cost Community | 0x43 : 0x01 | No | Cisco-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.
| Value | Router and configuration | Type in the Extended Community |
|---|---|---|
| Route Target | The PE’s VRF export route-target | Sub-Type 0x02 |
| Site of Origin | The PE’s site-of-origin on the PE-CE neighbor | Sub-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)
| Rule | Details |
|---|---|
| May be used to control which routes are accepted or distributed | Importing 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 |
| Aggregation | Without 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 COMMUNITY | Each 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 attach | Configuration |
|---|---|
| Route Target | vrf <name> → address-family ipv4 unicast → list values under export route-target |
| Site of Origin | router bgp → vrf <name> → neighbor <CE> → address-family ipv4 unicast → site-of-origin <value> |
| Color / Link Bandwidth / Cost | Define values with extcommunity-set opaque / bandwidth / cost, then set extcommunity <type> <set name> additive in a route-policy |
| Send to eBGP | send-extended-community-ebgp under the neighbor’s address-family |
| Check | Command |
|---|---|
| VPNv4 table on the PE | The Extended community: line of show bgp vpnv4 unicast rd <RD> <prefix> |
| Route in the VRF | show bgp vrf <name> <prefix> |
| CE | The 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.
- 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-Auses RD65002:1(PE1) /65002:2(PE2) and RT65002:100 - CE1 advertises
192.168.1.0/24and CE2 advertises192.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) andtraceroute
P1 does not run BGP. VPN routes are carried only by the iBGP session between the PEs.
RP/0/RP0/CPU0:P1#show bgp summary
Sun Sep 13 16:53:55.763 UTC
% BGP instance 'default' not activeOverview of the verification
| STEP | Change | What to check |
|---|---|---|
| 0 | Initial 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 |
| 1 | CE1 attaches a COMMUNITY to its route | Type 8 (4 bytes) and type 16 (8 bytes) appear in the same UPDATE |
| 2 | Add IPv4-address and 4-byte-AS forms to PE1’s RT export | Three RTs in one attribute, with Type high 0x00 / 0x01 / 0x02 |
| 3 | SoO on PE1’s CE1 neighbor | Sub-Type 0x03 is added |
| 4 | PE1 attaches Color, Link Bandwidth and Cost | All of them reach PE2 (iBGP inside the AS) |
| 5 | send-extended-community-ebgp on PE2’s CE2 neighbor | Only 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.
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 0The 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).
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: 100CE2’s route has no Extended community: line. PE2 → CE2 is eBGP, so it is not sent by default.
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.
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
!
endA COMMUNITY is just 4 bytes of AS number and value, with no type. An Extended Community has a Type and a Sub-Type.
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: 100PE2 → CE2 has only send-community-ebgp, so CE2 receives only the COMMUNITY.
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.
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
!
!
!
endThe 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.
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: 100RP/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:1STEP 3: SoO on PE1’s CE1 neighbor
The SoO is added to the same attribute (32 bytes) as Sub-Type 0x03 (Route Origin).
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
!
!
!
!
endBorder 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: 100RP/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:1STEP 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.
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
!
endLink 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).
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: 1000RP/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:1CE2 still receives none of them.
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.
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
!
!
!
!
endThe 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.
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: 100RP/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).
| File | Content |
|---|---|
..._show.txt | show 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.txt | show logging limited to that STEP (a logmsg marker at the start of each STEP, its time passed to show logging start) |
..._run.txt | show running-config at that STEP (the verification config of that STEP) |
..._ping.txt | ping (50 packets, timeout 1 s) and traceroute between CE1’s and CE2’s Loopback1 (CE1 and CE2 only) |
..._trace.txt | show bgp trace neighbor / show bgp trace error |
..._commit.cfg | Only the configuration actually committed in that STEP, for the routers that changed |
STEP 0: Initial state (RT 65002:100 on the VRF)
| Router | show output | syslog | running-config | ping | trace | commit |
|---|---|---|---|---|---|---|
| CE1 | show | log | run | ping | trace | - |
| PE1 | show | log | run | - | trace | - |
| P1 | show | log | run | - | trace | - |
| PE2 | show | log | run | - | trace | - |
| CE2 | show | log | run | ping | trace | - |
STEP 1: CE1 attaches a COMMUNITY to its route
| Router | show output | syslog | running-config | ping | trace | commit |
|---|---|---|---|---|---|---|
| CE1 | show | log | run | ping | trace | cfg |
| PE1 | show | log | run | - | trace | - |
| P1 | show | log | run | - | trace | - |
| PE2 | show | log | run | - | trace | - |
| CE2 | show | log | run | ping | trace | - |
STEP 2: Add IPv4-address and 4-byte-AS forms to PE1’s RT export
| Router | show output | syslog | running-config | ping | trace | commit |
|---|---|---|---|---|---|---|
| CE1 | show | log | run | ping | trace | - |
| PE1 | show | log | run | - | trace | cfg |
| P1 | show | log | run | - | trace | - |
| PE2 | show | log | run | - | trace | - |
| CE2 | show | log | run | ping | trace | - |
STEP 3: SoO on PE1’s CE1 neighbor
| Router | show output | syslog | running-config | ping | trace | commit |
|---|---|---|---|---|---|---|
| CE1 | show | log | run | ping | trace | - |
| PE1 | show | log | run | - | trace | cfg |
| P1 | show | log | run | - | trace | - |
| PE2 | show | log | run | - | trace | - |
| CE2 | show | log | run | ping | trace | - |
STEP 4: PE1 attaches Color, Link Bandwidth and Cost
| Router | show output | syslog | running-config | ping | trace | commit |
|---|---|---|---|---|---|---|
| CE1 | show | log | run | ping | trace | - |
| PE1 | show | log | run | - | trace | cfg |
| P1 | show | log | run | - | trace | - |
| PE2 | show | log | run | - | trace | - |
| CE2 | show | log | run | ping | trace | - |
STEP 5: send-extended-community-ebgp on PE2’s CE2 neighbor (final state)
| Router | show output | syslog | running-config | ping | trace | commit |
|---|---|---|---|---|---|---|
| CE1 | show | log | run | ping | trace | - |
| PE1 | show | log | run | - | trace | - |
| P1 | show | log | run | - | trace | - |
| PE2 | show | log | run | - | trace | cfg |
| CE2 | show | log | run | ping | trace | - |
Packet captures were taken per STEP on the CE1-PE1, PE1-P1 and PE2-CE2 links.
| STEP | CE1-PE1 | PE1-P1 | PE2-CE2 |
|---|---|---|---|
| 0 | pcap | pcap | pcap |
| 1 | pcap | pcap | pcap |
| 2 | pcap | pcap | pcap |
| 3 | pcap | pcap | pcap |
| 4 | pcap | pcap | pcap |
| 5 | pcap | pcap | pcap |
References
| Source | Title | Summary |
|---|---|---|
| RFC 4360 | BGP Extended Communities Attribute | The 8-byte structure and types (2, 3), Route Target (4), Route Origin (5), behavior rules (6) |
| RFC 1997 | BGP Communities Attribute | COMMUNITY (type code 8, 4 bytes) |
| RFC 5668 | 4-Octet AS Specific BGP Extended Community | Four-Octet AS-Specific structure |
| RFC 7153 | IANA Registries for BGP Extended Communities | Type and Sub-Type registries |
| RFC 9012 | The BGP Tunnel Encapsulation Attribute | Color Extended Community (4.3) |
| draft-ietf-idr-link-bandwidth | BGP Link Bandwidth Extended Community | Link Bandwidth (bytes per second, 4-byte IEEE 754 floating point) |
| RFC 4364 | BGP/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 Communities | Border Gateway Protocol (BGP) Extended Communities | List of Types and Sub-Types |
Related articles
- BGP (Border Gateway Protocol)
- BGP Messages
- BGP Neighbor States
- iBGP vs. eBGP
- BGP next-hop-self
- BGP Route Reflector
- BGP Path Attributes and Best Path Selection
- BGP ORIGIN Attribute
- BGP AS_PATH Attribute
- BGP NEXT_HOP Attribute
- BGP LOCAL_PREF Attribute
- BGP MED Attribute
- BGP WEIGHT Attribute
- BGP COMMUNITY Attribute
- BGP Route Aggregation (aggregate-address)
- MP-BGP (Multiprotocol Extensions)
- BGP Extended Community
- BGP Multipath (maximum-paths)
- BGP Four-Octet AS Numbers (RFC 6793)
- Removing Private AS Numbers in BGP (remove-private-AS)
- BGP ADD-PATH (RFC 7911)
- BGP PIC (Prefix Independent Convergence)
- BGP Best External (advertising a non-best external route)