4バイトAS番号とは
AS番号はもともと2バイトで、0〜65535しかありませんでした。
RFC 4271のOPENメッセージもUPDATEのAS_PATHも、AS番号を2オクテットとして定義しています。
この空間が枯渇したため、AS番号を32ビットへ拡張したのがRFC 6793です(RFC 4893を廃止しています)。
使える範囲は0〜4294967295に広がりました。
拡張にあたって、BGPのメッセージ形式そのものは変えていません。
OPENのMy Autonomous Systemフィールドは2バイトのままで、4バイトAS番号はCapabilityとして別に伝えます。
2バイトしか扱えない古いルータと同じ網に混在できるようにするための設計です。
表記法(asplain / asdot / asdot+)
4バイトAS番号の書き方は3通りあります。
| 表記 | 例(4259905537) | 規則 |
|---|---|---|
| asplain | 4259905537 | 10進数をそのまま書く |
| asdot+ | 65001.1 | 上位16ビットと下位16ビットを.で区切る。65535以下も0.<番号>と書く |
| asdot | 65001.1 | 65536以上はasdot+と同じ。65535以下はasplainと同じに書く |
RFC 5396(Proposed Standard)はasplainを標準の表記としています。
The decimal value representation, or “asplain” is proposed as the textual notation to use for AS numbers.
IOS XRは入力としてasplainとasdotの両方を受け付けますが、運用コマンドの表示は常にasplainです。
IOSのbgp asnotation dotにあたる表示切替コマンドはIOS XRにありません。
asplainとasdot+の変換は65536で割るだけです。
上位 = asplain ÷ 65536 の商
下位 = asplain ÷ 65536 の余り
4259905537 ÷ 65536 = 65001 余り 1 -> 65001.1対応ルータ同士のやりとり
4バイトAS番号を扱えることは、OPENメッセージのCapabilityで伝えます。
| 項目 | 値 |
|---|---|
| Capability Code | 65 |
| Capability Length | 4 |
| Capability Value | 自分の4バイトAS番号 |
ここで問題になるのが、OPENのMy Autonomous Systemフィールドが2バイトのままだという点です。
自分のAS番号が65536以上だと、このフィールドに入りません。
そのため、AS_TRANS(23456)という予約番号を代わりに入れ、実際の番号はCapability 65で渡します。
This document reserves a two-octet AS number called “AS_TRANS”. AS_TRANS can be used to represent non-mappable four-octet AS numbers as two-octet AS numbers.
この23456は、両側が4バイトASに対応していても現れます。 OPENのフィールド幅の制約であって、相手が古いかどうかとは関係ありません。
両側が対応していれば、AS_PATHは1要素4オクテットで4バイトAS番号をそのまま運びます。
非対応ルータを跨ぐとき
経路の途中に2バイトしか扱えないルータがいると、AS_PATHだけでは本当の経路を伝えられません。
RFC 6793は、本当のAS番号を運ぶ別の属性を用意してこれを解決します。
| Type | 属性 | フラグ | 役割 |
|---|---|---|---|
| 17 | AS4_PATH | Optional transitive | 4バイトAS番号で符号化したAS_PATH |
| 18 | AS4_AGGREGATOR | Optional transitive | 4バイトAS番号を持つAGGREGATOR |
対応ルータが非対応ルータへ広告するときの動きは次のとおりです。
When communicating with an OLD BGP speaker, a NEW BGP speaker MUST send the AS path information in the AS_PATH attribute encoded with two-octet AS numbers.
AS_PATHは2オクテット符号化で送る。65536以上のASはAS_TRANS(23456)に置き換える- 本当のAS番号の並びは
AS4_PATHに入れて一緒に送る - 非対応ルータは
AS4_PATHを理解しないが、Optional transitiveなのでそのまま次へ渡す - 受け取った対応ルータが
AS_PATHとAS4_PATHを突き合わせ、本当のAS_PATHを復元する
AS_PATHとAS4_PATHを突き合わせるのは、復元できる最初のルータです。
経路の途中に非対応ルータが1台だけいる場合、その次のルータが復元します。
| 見るもの | 中身 |
|---|---|
非対応ルータへ送るAS_PATH | 23456 23456(4バイトASをAS_TRANSに置き換えた2オクテット符号化) |
同時に送るAS4_PATH | 4259971073 4259905537(本当の番号) |
受け取った対応ルータが復元するAS_PATH | 4259971073 4259905537 |
なお、非対応ルータと対向するには、そのルータ側のネイバー設定をremote-as 23456にする必要があります。
非対応ルータはCapability 65を使わないため、相手のAS番号はOPENのMy Autonomous Systemに入っている
AS_TRANSそのものとして見えるからです。
対応ルータ同士ではAS4_PATHを送ってはいけません。
The new attributes, AS4_PATH and AS4_AGGREGATOR, MUST NOT be carried in an UPDATE message between NEW BGP speakers.
プライベートAS番号
検証や組織内で自由に使える範囲はRFC 6996(BCP)が定めています。
| 空間 | 範囲 |
|---|---|
| 2バイト | 64512〜65534 |
| 4バイト | 4200000000〜4294967294 |
IOS XRでの設定
router bgpはasplainとasdotの両方を受け付けます。
router bgp 4259905537
address-family ipv4 unicast
!
neighbor 10.1.2.2
remote-as 4259971073
address-family ipv4 unicast| 項目 | 内容 |
|---|---|
router bgp <AS> | <1-65535>(2バイト)、<1-65535>.<下位>(asdot)、<65536-4294967295>(asplain)を受け付ける |
show bgp summary | local AS numberと各ネイバーのAS番号 |
show bgp <プレフィックス> | AS_PATH。4バイトASもそのまま並ぶ |
実機での検証
XRd 26.1.1のルータ4台で確認します。
- 4台とも別のASで、すべてeBGP。R3だけが2バイトAS(
65003)で、その両側を4バイトASが挟む - 4バイトAS番号はRFC 6996のプライベート範囲(
4200000000〜4294967294)から、asdotの上位が65001/65002/65004になる値を選んでいる - 各ルータはLo1(
192.168.<番号>.0/24)をBGPに載せる。観測対象は主にR1が出す192.168.1.0/24をR4がどう見るか
| ルータ | AS番号(asplain) | asdot | 4バイトAS |
|---|---|---|---|
| R1 | 4259905537 | 65001.1 | 対応 |
| R2 | 4259971073 | 65002.1 | 対応 |
| R3 | 65003 | 65003 | 対応(STEP 4でR2向けに抑止する) |
| R4 | 4260102145 | 65004.1 | 対応 |
各STEPの概要
| STEP | 操作 | 確認したこと | 結果 | 主な根拠 |
|---|---|---|---|---|
| 0 | 初期状態 | 4バイトAS同士でセッションが張れているか | 4台ともEstablished。R4はAS_PATH 65003 4259971073 4259905537で受信 | R4 show bgp / R2 show bgp neighbors |
| 1 | R1-R2のセッションをリセット | OPENの中身 | My ASは23456、実番号はCapability 65。AS_PATHは1要素4オクテット、AS4_PATHは無し | R1-R2のpcap |
| 2 | R1のremote-asをasdotで入れ直す | 表記の扱い | running-configはasdotのまま、運用表示はasplain。セッションは無瞬断 | R1 show running-config / show bgp summary |
| 3 | R1で192.168.0.0/16を集約 | AGGREGATORの長さ | 8オクテット(4バイトAS + IP)。AS4_AGGREGATORは無し | R1-R2のpcap |
| 4 | R3のR2向けで4バイトAS Capabilityを抑止 | 非対応ルータを跨ぐときの動き | AS_PATHが23456 23456、AS4_PATHに実番号。AGGREGATORは6オクテットになりAS4_AGGREGATORが付く | R2-R3のpcap / R3 show bgp |
| 5 | STEP 2〜4を戻す(最終状態) | 復旧 | 表示も属性も元に戻る | R4 show bgp |
STEP 0:初期状態
R1は4259905537、R2は4259971073、R4は4260102145と、いずれも65535を超えるAS番号です。
show bgp summaryはこれをasplainで表示します。
RP/0/RP0/CPU0:R1#show bgp summary
Thu Sep 10 13:14:05.054 UTC
BGP router identifier 10.0.0.1, local AS number 4259905537
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 6
BGP main routing table version 6
BGP NSR Initial initsync version 3 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
BGP is operating in STANDALONE mode.
Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer
Speaker 6 6 6 6 6 0
Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd
10.1.2.2 0 4259971073 9 7 6 0 0 00:03:36 3R4のBGPテーブルには、R1が出した192.168.1.0/24がAS_PATH 65003 4259971073 4259905537として届いています。
4バイトASも2バイトASも同じAS_PATHの中に並びます。
RP/0/RP0/CPU0:R4#show bgp
Thu Sep 10 13:17:20.326 UTC
<snip>
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.1.0/24 10.3.4.3 0 65003 4259971073 4259905537 i
*> 192.168.2.0/24 10.3.4.3 0 65003 4259971073 i
*> 192.168.3.0/24 10.3.4.3 0 0 65003 i
*> 192.168.4.0/24 0.0.0.0 0 32768 i
Processed 4 prefixes, 4 pathsCapabilityの合意結果はshow bgp neighborsで確認できます。
RP/0/RP0/CPU0:R2#show bgp neighbors
Thu Sep 10 13:15:09.432 UTC
<snip>
BGP neighbor is 10.1.2.1
Remote AS 4259905537, local AS 4259971073, external link
Description: eBGP to R1 (AS 4259905537)
Remote router ID 10.0.0.1
BGP state = Established, up for 00:04:41
<snip>
Neighbor capabilities:
Route refresh: advertised (old + new) and received (old + new)
4-byte AS: advertised and received
Address family IPv4 Unicast: advertised and receivedSTEP 1:OPENの中身を見る
R1でR1-R2のセッションをリセットし、OPENからやり直させます。
clear bgp 10.1.2.2R1が送ったOPENです。My ASは23456(AS_TRANS)で、実際のAS番号4259905537はCapability 65に入っています。
相手のR2も4バイトASに対応していますが、それとは関係なく23456が入ります。OPENのフィールドが2バイトだからです。
Border Gateway Protocol - OPEN Message
Marker: ffffffffffffffffffffffffffffffff
Length: 75
Type: OPEN Message (1)
<snip>
My AS: 23456 (AS_TRANS)
Hold Time: 180
BGP Identifier: 10.0.0.1
Optional Parameters Length: 46
Optional Parameters
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 6
Capability: Multiprotocol extensions capability
Type: Multiprotocol extensions capability (1)
Length: 4
AFI: IPv4 (1)
Reserved: 00
SAFI: Unicast (1)
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 2
Capability: Route Refresh Capability (Cisco)
Type: Route Refresh Capability (Cisco) (128)
Length: 0
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 2
Capability: Route refresh capability
Type: Route refresh capability (2)
Length: 0
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 6
Capability: Support for 4-octet AS number capability
Type: Support for 4-octet AS number capability (65)
Length: 4
AS Number: 4259905537続くUPDATEのAS_PATHです。ASが1つでLengthが6——セグメントヘッダー2オクテット+AS番号4オクテットで、
4オクテット符号化になっています。tsharkもAS4:と表示します。両側が対応しているのでAS4_PATHは付きません。
Border Gateway Protocol - UPDATE Message
Marker: ffffffffffffffffffffffffffffffff
Length: 60
Type: UPDATE Message (2)
<snip>
Path Attribute - AS_PATH: 4259905537
Flags: 0x40, Transitive, Well-known, Complete
Type Code: AS_PATH (2)
Length: 6
AS Path segment: 4259905537
Segment type: AS_SEQUENCE (2)
Segment length (number of ASN): 1
AS4: 4259905537R2が受け取った生の経路も、そのまま4バイトASです。
RP/0/RP0/CPU0:R2#show bgp neighbors 10.1.2.1 received routes
Thu Sep 10 13:21:36.034 UTC
BGP router identifier 10.0.0.2, local AS number 4259971073
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 8
BGP main routing table version 8
BGP NSR Initial initsync version 4 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.1.0/24 10.1.2.1 0 0 4259905537 i
Processed 1 prefixes, 1 pathsSTEP 2:asdotで入れて、asplainで見る
R1のネイバー設定を、同じAS番号のasdot表記(65002.1)で入れ直します。
router bgp 4259905537
neighbor 10.1.2.2
remote-as 65002.1running-configには入れたとおりasdotで残ります。
router bgp 4259905537
bgp router-id 10.0.0.1
address-family ipv4 unicast
network 192.168.1.0/24
!
neighbor 10.1.2.2
remote-as 65002.1
description eBGP to R2 (AS 4259971073)
address-family ipv4 unicast
send-community-ebgp
route-policy FROM-R2 in
route-policy TO-R2 out
soft-reconfiguration inbound always
!
!
!一方、show bgp summaryのAS番号はasplainのままです。値は同じなのでセッションは切れません。
RP/0/RP0/CPU0:R1#show bgp summary
Thu Sep 10 13:24:46.652 UTC
BGP router identifier 10.0.0.1, local AS number 4259905537
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 12
BGP main routing table version 12
BGP NSR Initial initsync version 3 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
BGP is operating in STANDALONE mode.
Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer
Speaker 12 12 12 12 12 0
Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd
10.1.2.2 0 4259971073 24 22 12 0 0 00:05:44 3STEP 3:集約するとAGGREGATORは8オクテットになる
R1で192.168.0.0/16に集約します。
router bgp 4259905537
address-family ipv4 unicast
aggregate-address 192.168.0.0/16 summary-onlyR1がR2へ広告するのは集約経路だけになります(summary-onlyのため個別経路は抑制されます)。
RP/0/RP0/CPU0:R1#show bgp neighbors 10.1.2.2 advertised-routes
Thu Sep 10 13:29:31.291 UTC
Network Next Hop From AS Path
192.168.0.0/16 10.1.2.1 Local Aggregate 4259905537i
Processed 1 prefixes, 1 pathsR2のテーブルにも192.168.0.0/16が入りました。
RP/0/RP0/CPU0:R2#show bgp
Thu Sep 10 13:30:33.175 UTC
<snip>
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.0.0/16 10.1.2.1 0 4259905537 i
*> 192.168.2.0/24 0.0.0.0 0 32768 i
*> 192.168.3.0/24 10.2.3.3 0 0 65003 i
*> 192.168.4.0/24 10.2.3.3 0 65003 4260102145 i
Processed 4 prefixes, 4 pathsこのUPDATEのAGGREGATORは8オクテットです(Lengthが8)。
4バイトAS番号4オクテット+IPアドレス4オクテットで、AS4_AGGREGATORは付きません。
Border Gateway Protocol - UPDATE Message
Marker: ffffffffffffffffffffffffffffffff
Length: 66
Type: UPDATE Message (2)
<snip>
Path Attribute - ATOMIC_AGGREGATE
Flags: 0x40, Transitive, Well-known, Complete
Type Code: ATOMIC_AGGREGATE (6)
Length: 0
Path Attribute - AGGREGATOR: AS: 4259905537 origin: 10.0.0.1
Flags: 0xc0, Optional, Transitive, Complete
Type Code: AGGREGATOR (7)
Length: 8
Aggregator AS: 4259905537
Aggregator origin: 10.0.0.1STEP 4:非対応ルータを跨がせる
R3のR2向けネイバーで、4バイトAS番号のCapabilityを抑止します。これでR2から見たR3は非対応ルータになります。
router bgp 65003
neighbor 10.2.3.2
capability suppress 4-byte-asこれだけではセッションが上がりません。 R3はR2のOPENにBad Peer ASを返します。
Border Gateway Protocol - NOTIFICATION Message
Marker: ffffffffffffffffffffffffffffffff
Length: 23
Type: NOTIFICATION Message (3)
Major error Code: OPEN Message Error (2)
Minor error Code (Open Message): Bad Peer AS (2)
Bad Peer AS: 0原因はR2が送ったOPENにあります。My ASは23456で、実番号4259971073はCapability 65に入っていますが、
Capabilityを使わないR3にとって相手のAS番号は23456 です。R3の設定はremote-as 4259971073なので一致しません。
Border Gateway Protocol - OPEN Message
Marker: ffffffffffffffffffffffffffffffff
Length: 75
Type: OPEN Message (1)
<snip>
My AS: 23456 (AS_TRANS)
Hold Time: 180
BGP Identifier: 10.0.0.2
Optional Parameters Length: 46
Optional Parameters
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 6
Capability: Multiprotocol extensions capability
Type: Multiprotocol extensions capability (1)
Length: 4
AFI: IPv4 (1)
Reserved: 00
SAFI: Unicast (1)
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 2
Capability: Route Refresh Capability (Cisco)
Type: Route Refresh Capability (Cisco) (128)
Length: 0
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 2
Capability: Route refresh capability
Type: Route refresh capability (2)
Length: 0
Optional Parameter: Capability
Parameter Type: Capability (2)
Parameter Length: 6
Capability: Support for 4-octet AS number capability
Type: Support for 4-octet AS number capability (65)
Length: 4
AS Number: 4259971073R3のネイバー設定をremote-as 23456に直すと上がります。
router bgp 65003
neighbor 10.2.3.2
remote-as 23456show bgp neighborsにCapability 4-byte-as suppress is configuredが出ます。
RP/0/RP0/CPU0:R3#show bgp neighbors
Thu Sep 10 13:39:48.625 UTC
<snip>
BGP neighbor is 10.2.3.2
Remote AS 23456, local AS 65003, external link
Description: eBGP to R2 (AS 4259971073)
Remote router ID 10.0.0.2
BGP state = Established, up for 00:04:14
Previous State: Idle
Last Received Message: KeepAlive
NSR State: None
Last read 00:00:12, Last read before reset 00:07:12
Hold time is 180, keepalive interval is 60 seconds
Configured hold time: 180, keepalive: 60, min acceptable hold time: 3
Last write 00:00:12, attempted 19, written 19
Second last write 00:01:12, attempted 19, written 19
Last write before reset 00:06:50, attempted 19, written 19
Second last write before reset 00:07:50, attempted 19, written 19
Last write pulse rcvd Sep 10 13:39:36.831 last full not set pulse count 69
Last write pulse rcvd before reset 00:06:50
Last insert into reset queue: Sep 10 13:35:00.278, removed at Sep 10 13:35:00.278
Socket not armed for io, armed for read, armed for write
Last write thread event before reset 00:06:50, second last 00:06:50
Last KA expiry before reset 00:06:50, second last 00:07:50
Last KA error before reset 00:00:00, KA not sent 00:00:00
Last KA start before reset 00:06:50, second last 00:07:50
Precedence: internet
Non-stop routing is enabled
Enforcing first AS is enabled
Multi-protocol capability received
Neighbor capabilities:
Route refresh: advertised (old + new) and received (old + new)
Address family IPv4 Unicast: advertised and received
Capability 4-byte-as suppress is configuredR2がR3へ送るUPDATEです。AS_PATHは23456 23456の2オクテット符号化(Lengthが6)で、
本当の番号はAS4_PATH(Type 17)に入っています。
AGGREGATORも6オクテットに縮み、実番号はAS4_AGGREGATOR(Type 18)が運びます。
Border Gateway Protocol - UPDATE Message
Marker: ffffffffffffffffffffffffffffffff
Length: 88
Type: UPDATE Message (2)
<snip>
Path Attribute - AS_PATH: 23456 23456
Flags: 0x40, Transitive, Well-known, Complete
Type Code: AS_PATH (2)
Length: 6
AS Path segment: 23456 23456
Segment type: AS_SEQUENCE (2)
Segment length (number of ASN): 2
AS2: 23456 (AS_TRANS)
AS2: 23456 (AS_TRANS)
Path Attribute - AS4_PATH: 4259971073 4259905537
Flags: 0xc0, Optional, Transitive, Complete
Type Code: AS4_PATH (17)
Length: 10
AS Path segment: 4259971073 4259905537
Segment type: AS_SEQUENCE (2)
Segment length (number of ASN): 2
AS4: 4259971073
AS4: 4259905537
Path Attribute - ATOMIC_AGGREGATE
Flags: 0x40, Transitive, Well-known, Complete
Type Code: ATOMIC_AGGREGATE (6)
Length: 0
Path Attribute - AGGREGATOR: AS: 23456 origin: 10.0.0.1
Flags: 0xc0, Optional, Transitive, Complete
Type Code: AGGREGATOR (7)
Length: 6
Aggregator AS: 23456
Aggregator origin: 10.0.0.1R3自身のshow bgpは、AS_PATHを実番号で表示します。AS_PATHとAS4_PATHを突き合わせて復元しているためです。
RP/0/RP0/CPU0:R3#show bgp
Thu Sep 10 13:39:47.743 UTC
<snip>
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.0.0/16 10.2.3.2 0 4259971073 4259905537 i
*> 192.168.2.0/24 10.2.3.2 0 0 4259971073 i
*> 192.168.3.0/24 0.0.0.0 0 32768 i
*> 192.168.4.0/24 10.3.4.4 0 0 4260102145 i
Processed 4 prefixes, 4 pathsそのためR3がR4へ送るUPDATEは、4オクテット符号化のAS_PATHだけになります(AS4_PATHは付きません)。
Border Gateway Protocol - UPDATE Message
Marker: ffffffffffffffffffffffffffffffff
Length: 74
Type: UPDATE Message (2)
<snip>
Path Attribute - AS_PATH: 65003 4259971073 4259905537
Flags: 0x40, Transitive, Well-known, Complete
Type Code: AS_PATH (2)
Length: 14
AS Path segment: 65003 4259971073 4259905537
Segment type: AS_SEQUENCE (2)
Segment length (number of ASN): 3
AS4: 65003
AS4: 4259971073
AS4: 4259905537R4から見たAS_PATHは、抑止する前と変わりません。
RP/0/RP0/CPU0:R4#show bgp
Thu Sep 10 13:40:53.981 UTC
<snip>
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.0.0/16 10.3.4.3 0 65003 4259971073 4259905537 i
*> 192.168.2.0/24 10.3.4.3 0 65003 4259971073 i
*> 192.168.3.0/24 10.3.4.3 0 0 65003 i
*> 192.168.4.0/24 0.0.0.0 0 32768 i
Processed 4 prefixes, 4 pathsIOS XRのcapability suppress 4-byte-asが抑えるのは、そのネイバーへCapability 65を広告することだけです。
受け取ったAS4_PATHは理解して復元するので、本物の旧実装のようにAS4_PATHをそのまま次へ素通しするわけではありません。
本物の旧実装であれば、R3はAS_PATHに65003 23456 23456を積んでAS4_PATHを素通しし、
復元するのはR4になります。
STEP 5:設定を戻す(最終状態)
R3のCapability抑止とremote-as、R1のasdot表記と集約をすべて元に戻します。
R3から見た相手のAS番号も4259971073に戻りました。
RP/0/RP0/CPU0:R3#show bgp summary
Thu Sep 10 13:44:22.297 UTC
BGP router identifier 10.0.0.3, local AS number 65003
BGP generic scan interval 60 secs
Non-stop routing is enabled
BGP table state: Active
Table ID: 0xe0000000 RD version: 18
BGP main routing table version 18
BGP NSR Initial initsync version 5 (Reached)
BGP NSR/ISSU Sync-Group versions 0/0
BGP scan interval 60 secs
BGP is operating in STANDALONE mode.
Process RcvTblVer bRIB/RIB LabelVer ImportVer SendTblVer StandbyVer
Speaker 18 18 18 18 18 0
Neighbor Spk AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down St/PfxRcd
10.2.3.2 0 4259971073 49 47 18 0 0 00:02:31 2
10.3.4.4 0 4260102145 35 44 18 0 0 00:31:54 1R4のテーブルもSTEP 0と同じ4経路に戻ります。
RP/0/RP0/CPU0:R4#show bgp
Thu Sep 10 13:45:27.397 UTC
<snip>
Status codes: s suppressed, d damped, h history, * valid, > best
i - internal, r RIB-failure, S stale, N Nexthop-discard
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 192.168.1.0/24 10.3.4.3 0 65003 4259971073 4259905537 i
*> 192.168.2.0/24 10.3.4.3 0 65003 4259971073 i
*> 192.168.3.0/24 10.3.4.3 0 0 65003 i
*> 192.168.4.0/24 0.0.0.0 0 32768 i
Processed 4 prefixes, 4 paths検証のまとめ
AS_TRANS(23456)は相手が対応しているかどうかと関係なくOPENに現れる。実番号はCapability 65が運ぶ(STEP 1)- 対応ルータ同士では
AS_PATHが4オクテット符号化になり、AS4_PATHは付かない(STEP 1・3) AGGREGATORは対応ルータ同士で8オクテット、非対応ルータ向けは6オクテット+AS4_AGGREGATOR(STEP 3・4)- 非対応ルータ側のネイバー設定は
remote-as 23456にする。そうしないとBad Peer ASでセッションが上がらない(STEP 4) - IOS XRはasdot入力を受け付けて
running-configにもそのまま残すが、運用表示はasplainに統一される(STEP 2)
検証Configおよびshow結果
各STEPで4台すべてから、次の3種類をルータごとに分けて取得しています。検証Configはこの..._run.txtです(最終状態はSTEP 5のもの)。
| ファイル | 内容 |
|---|---|
..._show.txt | show version / show interface description / show route / show route bgp / show bgp summary / show bgp / show bgp <プレフィックス>(4本) / show bgp neighbors / show bgp update-group / ピアごとのadvertised-routes・routes・received routes / show rpl route-policy |
..._log.txt | そのSTEPの範囲だけに絞ったshow logging。各STEPの開始時にlogmsgでマーカーを入れ、その時刻をshow logging startとendに指定して取得したもの |
..._run.txt | そのSTEP時点のshow running-config(=そのSTEPの検証Config) |
STEP 0:初期状態
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 1:R1-R2のセッションをリセット
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 2:R1のremote-asをasdotで入れ直す
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 3:R1で192.168.0.0/16を集約
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 4:R3のR2向けで4バイトAS Capabilityを抑止
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
STEP 5:STEP 2〜4を戻す(最終状態)
| ルータ | show出力 | syslog | running-config |
|---|---|---|---|
| R1 | show | log | run |
| R2 | show | log | run |
| R3 | show | log | run |
| R4 | show | log | run |
参考
| 資料 | タイトル | 概要 |
|---|---|---|
| RFC 6793 | BGP Support for Four-Octet Autonomous System (AS) Number Space | 4バイトAS番号。Capability 65、AS_TRANS、AS4_PATH(17)とAS4_AGGREGATOR(18)。RFC 4893を廃止 |
| RFC 5396 | Textual Representation of Autonomous System (AS) Numbers | asplain / asdot / asdot+の定義。asplainを標準の表記とする |
| RFC 6996 | Autonomous System (AS) Reservation for Private Use | プライベートAS番号の範囲。4バイトは4200000000〜4294967294 |
| RFC 4271 | A Border Gateway Protocol 4 (BGP-4) | OPENのMy Autonomous SystemとAS_PATHを2オクテットとして定義している元の仕様 |
関連記事
- 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)