Extended Communityとは
Extended Community(RFC 4360)は、経路に付けるタグの一種です。 COMMUNITY(RFC 1997)は4バイトの値を並べるだけで、値の意味は運用者どうしの取り決めです。 これに対してExtended Communityは8バイトで、先頭の「型」によって値の構造と意味が決まります。
| 項目 | COMMUNITY | Extended Community |
|---|---|---|
| Type code | 8 | 16 |
| 分類 | Optional transitive | Optional transitive |
| 1つの長さ | 4バイト | 8バイト |
| 構造 | 値だけ。上位2バイトにAS番号を入れる | 型(Type / Sub-Type)+ 値 |
| ASを越えるか | 越える(NO_EXPORTなどの値で止める) | 型のTビットで決まる |
| 代表的な値 | 運用者が決めた65001:100など | Route Target、Route Origin(SoO)、Color、Link Bandwidth |
いちばん知られた使い方は、MPLS L3VPN(VPNv4)です。 RFC 4364は、VPNの経路をどのVRFに入れるかを示すRoute Targetと、どのサイトから来たかを示すSite of Originを、どちらもExtended Communityで運ぶと定めています(4.3.1、7)。 この記事はVPNv4を題材に、それらの値がCOMMUNITYとは別のExtended Communityという属性の中でやりとりされていることを確かめます。 VPNの仕組みそのものはMPLS VPN(L3VPN)とはで解説しています。
フォーマット
属性(Type code 16)の値は、8バイトのExtended Communityを必要な数だけ並べたものです。1つの中身は次の3つです。
| フィールド | 長さ | 内容 |
|---|---|---|
| Type high | 1バイト | 上位ビットから I(IANAの割り当て方式の区分)、T(0 = ASを越える transitive、1 = 越えない non-transitive)、残り6ビットがValueの構造 |
| Type low(Sub-Type) | 1バイト | その構造の中での用途(Route Target = 0x02、Route Origin = 0x03 など) |
| Value | 6バイト | 構造ごとに分かれる |
Valueの構造は4種類あります。
| Type high | 構造 | Global Administrator | Local Administrator | 出典 |
|---|---|---|---|---|
| 0x00 / 0x40 | 2バイトAS固有 | AS番号(2バイト) | 4バイト | RFC 4360 3.1 |
| 0x01 / 0x41 | IPv4アドレス固有 | IPv4アドレス(4バイト) | 2バイト | RFC 4360 3.2 |
| 0x02 / 0x42 | 4バイトAS固有 | AS番号(4バイト) | 2バイト | RFC 5668 |
| 0x03 / 0x43 | Opaque | (Sub-Typeごとに6バイトを定義) | RFC 4360 3.3 |
「/」の左が transitive(Tビット0)、右が non-transitive(Tビット1)です。 Global Administratorは値を割り当てた組織(AS番号かIPv4アドレス)、Local Administratorはその組織が決める番号です。 2バイトのAS番号を持つASは、2バイトAS固有を使うべきとされています(RFC 5668 3)。
主な型
Sub-Typeの値はIANAのレジストリ(RFC 7153で整理)にあります。この記事で扱うものです。
| 名前 | Type high : Sub-Type | transitive | 意味 |
|---|---|---|---|
| Route Target(RT) | 0x00 / 0x01 / 0x02 : 0x02 | ○ | この経路を受け取ってよいルータ(RFC 4360 4)。VPNではVRFへの取り込みを決める |
| Route Origin(Site of Origin、SoO) | 0x00 / 0x01 / 0x02 : 0x03 | ○ | この経路をBGPに入れたルータ(RFC 4360 5)。VPNではサイトの識別に使う |
| Color | 0x03 : 0x0B | ○ | 経路に色を付ける(RFC 9012 4.3)。トンネルの選択などに使う |
| Link Bandwidth | 0x40 : 0x04(この記事の場合) | × | リンクの帯域。マルチパスの重み付けに使う。値はバイト/秒を4バイトの浮動小数点で表す |
| Cost Community | 0x43 : 0x01 | × | Cisco独自(IANAにはInternet-Draftとして登録)。ベストパス選択にコストを加える |
Link Bandwidthは、定義しているInternet-Draft(draft-ietf-idr-link-bandwidth)でTypeを0x00と0x40のどちらにもできます。 RTとSoOをVPNでどう使うかは、RT(Route Target)とMPLS VPNのPE-CEルーティング(eBGP)を参照してください。
VPNv4ではRTとSoOがExtended Communityに載る
VPNv4の経路は、MP-BGPのAFI 1 / SAFI 128で運ばれます(RFC 4364 4.3.4、MP-BGP)。 PEは、その経路にVRFの設定から決まる値をExtended Communityとして付けます。
| 値 | 付けるルータと設定 | Extended Communityでの型 |
|---|---|---|
| Route Target | PEのVRFのexport route-target | Sub-Type 0x02 |
| Site of Origin | PEのPE-CEネイバーのsite-of-origin | Sub-Type 0x03 |
VPNv4のUPDATEの形(RD・VPNラベル・MP_REACH_NLRI)は、MPLS VPNのMP-BGPで解説しています。
振る舞いの規則(RFC 4360 6)
| 規則 | 内容 |
|---|---|
| 受け取る経路・配る経路の制御に使ってよい | RTによるVRFへの取り込みはこの使い方 |
| ベストパス選択を転送ループにつながる形で変えてはならない(MUST NOT) | Cost Communityのように選択に関わる型を使うときの制約 |
| 受け取った側は属性を付けても書き換えてもよい(MAY) | ポリシーで自由に扱える |
| 集約 | ATOMIC_AGGREGATEが無ければ構成要素のExtended Communityの和集合を持つ(既定) |
| non-transitiveなものはAS境界を越える前に取り除くべき(SHOULD) | コンフェデレーション境界では取り除くべきでない(SHOULD NOT) |
| COMMUNITYと両方持てる | それぞれRFC 1997 / RFC 4360の規則で扱う |
IOS XRはeBGPのピアへ既定でExtended Communityを送りません。 ネイバーのaddress-familyにsend-extended-community-ebgpが必要です(COMMUNITYのsend-community-ebgpとは別)。iBGPには既定で送ります。
IOS XRでの設定
| 付けたいもの | 設定 |
|---|---|
| Route Target | vrf <名前> → address-family ipv4 unicast → export route-target に値を並べる |
| Site of Origin | router bgp → vrf <名前> → neighbor <CE> → address-family ipv4 unicast → site-of-origin <値> |
| Color / Link Bandwidth / Cost | extcommunity-set opaque / bandwidth / cost で値を定義し、route-policyでset extcommunity <型> <セット名> additive |
| eBGPへ送る | ネイバーのaddress-familyにsend-extended-community-ebgp |
| 確認 | コマンド |
|---|---|
| PEのVPNv4テーブル | show bgp vpnv4 unicast rd <RD> <プレフィックス>のExtended community:の行 |
| VRFに入った経路 | show bgp vrf <名前> <プレフィックス> |
| CE | show bgp <プレフィックス>のExtended community: / Community:の行 |
実際の設定は、各STEPのshow configuration commit changesで示します。
実機での検証
XRd 26.1.1のルータ5台で確認します。
- CE1(AS 65011)とCE2(AS 65012)が、AS 65002のPE1・PE2とVRF
CUST-Aの中でeBGPを張る - PE1 - P1 - PE2はOSPFとLDP。PE1とPE2はLo0同士でVPNv4のiBGPを張り、P1はBGPを持たない
- VRF
CUST-AはRD65002:1(PE1)/65002:2(PE2)、RT65002:100 - CE1は
192.168.1.0/24、CE2は192.168.2.0/24を広告する。CE1の経路にどの値が載るかを、PE1 → PE2(iBGP)とPE2 → CE2(eBGP)で追う - 疎通は毎STEP、CE1とCE2のLo1の間で
ping(50発)とtracerouteで確かめる
P1はBGPを動かしていません。VPNの経路はPE同士のiBGPだけで運ばれます。
RP/0/RP0/CPU0:P1#show bgp summary
Sun Sep 13 16:53:55.763 UTC
% BGP instance 'default' not active検証の全体像
| STEP | 操作 | 確かめること |
|---|---|---|
| 0 | 初期状態(VRFにRT 65002:100) | VPNv4のUPDATEにType 16があり、RTが8バイトで入っている。CE2へは送られない |
| 1 | CE1が経路にCOMMUNITYを付ける | 同じUPDATEにType 8(4バイト)とType 16(8バイト)が並ぶ |
| 2 | PE1のRT exportにIPv4アドレス形式と4バイトAS形式を足す | 1つの属性にRTが3つ。Type highが0x00 / 0x01 / 0x02 |
| 3 | PE1のCE1ネイバーにSoO | Sub-Type 0x03が増える |
| 4 | PE1でColor・Link Bandwidth・Costを付ける | PE2(AS内のiBGP)には全部載る |
| 5 | PE2のCE2ネイバーにsend-extended-community-ebgp | CE2にはtransitiveのものだけが届き、non-transitiveは落ちる |
CE1のLo1からCE2のLo1へのpingは、STEP 0〜5のすべてで両方向とも100%(50/50)でした。値を付け足してもVPNの転送は変わりません。
STEP 0:初期状態(VRFにRT 65002:100)
PE1がCE1の経路にRT 65002:100を付け、VPNv4のUPDATEのExtended Community(Type 16、8バイト)で運びます。CE2へは送られません。
PE1の192.168.1.0/24です。(received-only)はCE1から受け取ったままの経路で、Extended community:がありません。RTはCE1ではなくPE1がVRFの設定から付けています。
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 0PE1がPE2へ送ったUPDATE(PE1-P1間キャプチャーのNo.38)です。AFI 1 / SAFI 128(VPNv4)の経路に、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の経路にはExtended community:の行がありません。PE2 → CE2はeBGPなので、既定では送られません。
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が経路にCOMMUNITYを付ける
同じUPDATEに、COMMUNITY(Type 8、4バイト)とExtended Community(Type 16、8バイト)が別々の属性として並びます。
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
!
endCOMMUNITYはAS番号と値の4バイトだけで、型がありません。Extended CommunityはTypeと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にはsend-community-ebgpだけを入れているので、CE2には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:PE1のRT exportにIPv4アドレス形式と4バイトAS形式を足す
1つの属性(24バイト)にRTが3つ入り、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
!
!
!
end4バイトAS形式はGlobal Administratorが4バイトでLocal Administratorが2バイト、2バイトAS形式はその逆です。
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:PE1のCE1ネイバーにSoO
SoOはSub-Type 0x03(Route Origin)として、RTと同じ属性(32バイト)に加わります。
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でColor・Link Bandwidth・Costを付ける
Color(transitive)、Link BandwidthとCost(non-transitive)が加わり、7つ(56バイト)になります。AS内のiBGPなので、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
!
endTビットが1のLink Bandwidth(0x40)とCost(0x43)も、AS 65002の中では取り除かれません。
Link Bandwidthの値は1000で、単位は規定どおりバイト/秒です(tsharkは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にはまだ何も載っていません。
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:PE2のCE2ネイバーにsend-extended-community-ebgp
CE2にはtransitiveの5つ(SoO・Color・RT 3つ、40バイト)だけが届き、non-transitiveのLink BandwidthとCostはAS境界でPE2が取り除きます。
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
!
!
!
!
endPE2がCE2へ送ったUPDATE(PE2-CE2間キャプチャーのNo.3)です。STEP 4でPE2が持っていた7つのうち、0x40と0x43がありません。
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)検証Configおよびshow結果
各STEPで5台すべてから、次のファイルをルータごとに分けて取得しています。検証Configは..._run.txtです(最終状態はSTEP 5のもの)。
| ファイル | 内容 |
|---|---|
..._show.txt | show version / show interface description / show route。PE: show bgp vpnv4 unicast / show bgp vpnv4 unicast rd <RD> <プレフィックス> / show bgp vpnv4 unicast neighbors / show bgp vrf CUST-A / show bgp vrf CUST-A <プレフィックス> / 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 / ピアごとの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 <プレフィックス> / show bgp neighbors / ピアの3点セット |
..._log.txt | そのSTEPの範囲だけに絞ったshow logging。各STEPの開始時にlogmsgでマーカーを入れ、その時刻をshow logging startに指定して取得したもの |
..._run.txt | そのSTEP時点のshow running-config(=そのSTEPの検証Config) |
..._ping.txt | CE1とCE2のLo1同士のping(50発、timeout 1秒)とtraceroute(CE1・CE2のみ) |
..._trace.txt | show bgp trace neighbor / show bgp trace error |
..._commit.cfg | そのSTEPで実際にcommitした設定だけ。 設定を変えたルータの分のみ |
STEP 0:初期状態(VRFにRT 65002:100)
| ルータ | show出力 | 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が経路にCOMMUNITYを付ける
| ルータ | show出力 | 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:PE1のRT exportにIPv4アドレス形式と4バイトAS形式を足す
| ルータ | show出力 | 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:PE1のCE1ネイバーにSoO
| ルータ | show出力 | 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でColor・Link Bandwidth・Costを付ける
| ルータ | show出力 | 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:PE2のCE2ネイバーにsend-extended-community-ebgp(最終状態)
| ルータ | show出力 | 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 | - |
パケットキャプチャーはSTEPごとに、CE1-PE1間・PE1-P1間・PE2-CE2間で取得しています。
| 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 |
参考
| 資料 | タイトル | 概要 |
|---|---|---|
| RFC 4360 | BGP Extended Communities Attribute | 8バイトの構造と型(2・3)、Route Target(4)、Route Origin(5)、振る舞いの規則(6) |
| RFC 1997 | BGP Communities Attribute | COMMUNITY(Type code 8、4バイト) |
| RFC 5668 | 4-Octet AS Specific BGP Extended Community | 4バイトAS固有の構造 |
| RFC 7153 | IANA Registries for BGP Extended Communities | TypeとSub-Typeのレジストリ |
| RFC 9012 | The BGP Tunnel Encapsulation Attribute | Color Extended Community(4.3) |
| draft-ietf-idr-link-bandwidth | BGP Link Bandwidth Extended Community | Link Bandwidth(値はバイト/秒、IEEE 754の4バイト浮動小数点) |
| RFC 4364 | BGP/MPLS IP Virtual Private Networks (VPNs) | VPN-IPv4のAFI / SAFI(4.3.4)、RTとSoOをExtended Communityで運ぶ(4.3.1、7) |
| IANA BGP Extended Communities | Border Gateway Protocol (BGP) Extended Communities | Type / Sub-Typeの一覧 |
関連記事
- BGP(Border Gateway Protocol)
- BGPメッセージ
- BGPネイバーの状態遷移
- iBGPとeBGPの違い
- BGP next-hop-self
- BGPルートリフレクタ
- BGPパス属性とベストパス選択
- BGP ORIGIN属性
- BGP AS_PATH属性
- BGP NEXT_HOP属性
- BGP LOCAL_PREF属性
- BGP MED属性
- BGP WEIGHT属性
- BGP COMMUNITY属性
- BGP経路集約(aggregate-address)
- MP-BGP(マルチプロトコル拡張)
- BGP Extended Community(拡張コミュニティ)
- BGPマルチパス(maximum-paths)
- BGPの4バイトAS番号(RFC 6793)
- BGPのプライベートAS番号の除去(remove-private-AS)
- BGPのADD-PATH(RFC 7911)
- BGP PIC(Prefix Independent Convergence)
- BGP Best External(ベストでない外部経路の広告)