本檔案介紹使用BGP訊號傳送的虛擬私人LAN服務(VPLS)的邊界閘道通訊協定(BGP)型自動探索。自動發現是提供商邊緣(PE)瞭解哪些遠端PE屬於給定VPLS域的一種方法。信令是PE瞭解給定遠端PE對於給定VPLS域預期的偽線標籤的一種方法。
請參閱以下Internet工程任務組文檔:
本檔案將重點介紹RFC 4761。透過RFC 4761,BGP更新的BGP網路層連線能力資訊(NLRI)會保留自動探查和訊號傳送的資訊。當遠端PE路由器收到此BGP更新時,它們擁有為VPLS設定全網狀偽線所需的所有資訊。BGP自動探索和BGP訊號傳送使用相同的BGP位址系列。
命令列介面(CLI)和輸出來自Cisco IOS®軟體。Cisco IOS-XR軟體和Cisco NX-OS軟體的配置和功能非常相似。
VPLS由一組點對多點形式的偽線(PW)組成。直到現在,LDP還被用來發出PE路由器之間的偽線訊號。因此,目標LDP會話發出訊號指示在一對PE路由器之間使用哪個標籤進行偽線。您可以手動配置參與一個VPLS域的一組PE路由器,也可以使用BGP自動發現配置。為了執行此自動發現,BGP通告哪個PE是VPLS域的成員。然而,即使在BGP自動發現的情況下,LDP也用來向多協定標籤交換(MPLS)虛擬電路(VC)標籤和偽線ID發出訊號。
現在可以使用BGP在PE路由器之間傳送偽線訊號。
當在一對路由器之間設定一條偽線時,其它路由器不需要與此偽線相關的資訊。例如,此類資訊是要使用的VC標籤。
使用LDP作為建立偽線的信令協定,該資訊只由一對路由器接收,因為LDP以點對點方式執行信令。
使用BGP作為建立偽線的訊號通訊協定,資訊將由所有其他路由器接收,因為內部BGP(iBGP)以點對多點方式執行訊號傳送。iBGP要求全網狀,因此一台路由器向所有其他iBGP路由器傳送iBGP更新。這也可以使用路由反射器完成。
使用iBGP作為信令協定,有兩種方法可傳送更新:
本檔案將說明如何使用BGP來傳送偽線訊號;請注意,BGP也同時用於自動探索。
由於這是VPLS,因此在核心層仍然需要逐跳信令協定,以便將標籤的資料包從PE傳送到PE路由器。核心中的此傳輸功能仍然必須由LDP或MPLS流量工程來完成。
BGP需要傳送必要資訊,以便按照VPLS所需的點對多點方式設定偽線。此信令資訊包括:
PE路由器端點標識由作為更新的BGP傳送方的PE路由器確定。
與第2層虛擬私人網路(L2VPN)VPLS相關的BGP更新由AFI/SAFI 25/65識別。此位址系列在BGP傳送OPEN訊息時交涉。
NLRI(也稱為字首)包含有關VPLS標識和MPLS標籤塊的資訊。其編碼的總長度為19個位元組:
+------------------------------------+
| Length (2 octets) |
+------------------------------------+
| Route Distinguisher (8 octets) |
+------------------------------------+
| VE ID (2 octets) |
+------------------------------------+
| VE Block Offset (2 octets) |
+------------------------------------+
| VE Block Size (2 octets) |
+------------------------------------+
| Label Base (3 octets) |
+------------------------------------+
路由區分器(RD)與VPLS的身份相關。
虛擬擴展(VE)ID、VE塊偏移量、VE塊大小和標籤庫(LB)與通告的標籤塊相關,如下一節所述。
封裝資訊也附加到首碼,並編碼為BGP更新的延伸社群「Layer2 Info Extended Community」。值為0x800A,編碼為:
+------------------------------------+
| Extended community type (2 octets) |
+------------------------------------+
| Encaps Type (1 octet) |
+------------------------------------+
| Control Flags (1 octet) |
+------------------------------------+
| Layer-2 MTU (2 octet) |
+------------------------------------+
| Reserved (2 octets) |
+------------------------------------+
VPLS的Encaps Type為19。
控制標誌(位向量)的編碼方式如下:
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
| MBZ |C|S| (MBZ = MUST Be Zero)
+-+-+-+-+-+-+-+-+
名稱 | 價值 | 含義 |
思 | 1 | 將VPLS資料包傳送到此PE時,必須存在控制字。 |
0 | 將VPLS資料包傳送到此PE時,必須不存在控制字。 | |
S | 1 | 將VPLS資料包傳送到此PE時,必須使用順序幀傳輸。 |
0 | 將VPLS資料包傳送到此PE時,不得使用幀順序傳輸。 |
也有連線到BGP更新的路由目標(RT)。與MPLS L3VPN一樣,RT控制從L2VPN匯入和匯出。
VPLS BGP自動發現字首是/96字首,而VPLS BGP信令字首是/136字首。以下是每個選項的示例:
PE2#show bgp l2vpn vpls all
BGP table version is 264, local router ID is 10.100.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:100
*>i 1:100:VEID-1001:Blk-150/136
10.100.1.1 0 100 0 ?
*> 1:100:10.100.1.2/96
0.0.0.0 32768 ?
PE2#show bgp l2vpn vpls rd 1:100 ve-id 1001 block-offset 150
BGP routing table entry for 1:100:VEID-1001:Blk-150/136, version 262
Paths: (1 available, best #1, table L2VPN-VPLS-BGP-Table)
Not advertised to any peer
Refresh Epoch 1
Local
10.100.1.1 (metric 21) from 10.100.1.4 (10.100.1.4)
Origin incomplete, metric 0, localpref 100, valid, internal, best
AGI version(0), VE Block Size(50) Label Base(10105)
Extended Community: RT:1:100 RT:32:64 L2VPN L2:0x0:MTU-1500
Originator: 10.100.1.1, Cluster list: 10.100.1.4
rx pathid: 0, tx pathid: 0x0
PE2#show bgp l2vpn vpls rd 1:100 10.100.1.2
BGP routing table entry for 1:100:10.100.1.2/96, version 43
Paths: (1 available, best #1, table L2VPN-VPLS-BGP-Table)
Not advertised to any peer
Refresh Epoch 1
Local
0.0.0.0 from 0.0.0.0 (10.100.1.2)
Origin incomplete, localpref 100, weight 32768, valid, sourced, local,
best, AGI version(0)
Extended Community: RT:1:100 L2VPN AGI:1:100
rx pathid: 0, tx pathid: 0x0
以下是Cisco IOS軟體組態範例:
!
l2vpn vfi context one
vpn id 100
autodiscovery bgp signaling bgp <<< "signaling ldp" would be RFC 4762
ve id 1001
ve range 50
route-target export 32:64
route-target import 32:64
mpls label range 10000 20000
!
bridge-domain 1
member Ethernet0/0 service-instance 100
member vfi one
!
l2 router-id 10.100.1.1
!
interface Ethernet0/0
no ip address
service instance 100 ethernet
!
!
router bgp 1
bgp log-neighbor-changes
neighbor 10.100.1.4 remote-as 1
neighbor 10.100.1.4 update-source Loopback0
!
address-family l2vpn vpls
neighbor 10.100.1.4 activate
neighbor 10.100.1.4 send-community extended
neighbor 10.100.1.4 suppress-signaling-protocol ldp
exit-address-family
一個PE路由器必須至少通告一個標籤塊。標籤塊是一組MPLS標籤的連續集合,由遠端PE路由器用於選擇一個遠端VC標籤。遠端標籤用於本地和遠端PE路由器之間的PW。(PE路由器可以通告多個標籤塊,如後面部分所述。)
必須在每個PE上配置VE-ID。標識VPLS域中的PE路由器。
VE Block Size(VBS)是標籤塊的大小,其預設值為10。如果配置了「ve range」,則為10。「ve range」可以配置為[11 -100]。
標籤庫(LB)是PE路由器可以保留用於此VPLS域的一組自由標籤的第一個標籤值。
VE Block Offset(VBO)是PE路由器必須建立多個標籤塊時使用的偏移值。VBO使用以下公式計算:VBO = RND(VE-ID/VBS)* VBS
以下是計算範例:
向遠端PE路由器通告的標籤塊為{LB, LB + 1, ?,LB + VBS - 1}。標籤塊由LB和VBS定義;塊以LB開始,以(LB + VBS - 1)結束。
每個PE路由器可以根據需要建立多個標籤塊。路由器必須確保它是一組連續的自由標籤。
router bgp 1
l2vpn vfi context one
vpn id 100
autodiscovery bgp signaling bgp
ve id 1001
ve range 50
route-target export 32:64
route-target import 32:64
mpls label range 10000 20000
以下是組態值的說明:
您可以使用show mpls label range命令檢查標籤範圍:
PE1#show mpls label range
Downstream Generic label region: Min/Max label: 10000/20000
有一個按平台的預設標籤範圍,您可以使用mpls label range命令更改該範圍。
您可以使用show mpls forwarding-table命令檢查標籤轉發資訊庫(LFIB)中一個標籤塊的實際使用標籤。
PE1#show mpls forwarding-table
Local Outgoing Prefix Bytes Label Outgoing Next Hop Label
Label or Tunnel Id Switched interface
10000 No Label lbl-blk-id(1:0) 0 drop
10001 No Label lbl-blk-id(1:1) 0 drop
10002 No Label lbl-blk-id(1:2) 0 drop
?
10048 No Label lbl-blk-id(1:48) 0 drop
10049 No Label lbl-blk-id(1:49) 0 drop
10050 Pop Label 10.100.1.4/32 0 Et1/0 10.1.1.4
在本例中,本地路由器PE1為標籤塊保留了50個本地標籤。「lbl-blk-id(1:0)」表示塊id為1,塊例項為0,標識塊的第一個標籤。此塊的最後一個標籤為10049標籤。
LFIB中的「傳出」介面為「drop」,只要沒有為該本地標籤設定PW。如果設定了PW,則「Outgoing」介面為「none point2point」。
配置「service internal」時,還可以使用show mpls infrastructure lfd block-database summary命令檢查分配的標籤塊。
PE1#show mpls infrastructure lfd block-database summary
Block-DB entry for block-id : 0x1
Block-size : 50, App-Key type : AToM PWID, Labels : 10000 - 10049
LB為10000。在此示例中,標籤塊是從LB到(LB + VBS - 1)或從10000到(10000 + 50 - 1)= 10049。
您可以使用show bgp l2vpn vpls rd 1:100命令檢查通告的字首:
PE1#show bgp l2vpn vpls rd 1:100
BGP table version is 3, local router ID is 10.100.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:100
*> 1:100:VEID-1001:Blk-1000/136
0.0.0.0 32768 ?
要詳細檢視此字首,請使用show bgp l2vpn vpls rd 1:100 ve-id 1001 block-offset 1000命令。請注意,需要指定VE-ID和標籤塊,可以在NLRI(Blk-1000)中找到。
PE1#show bgp l2vpn vpls rd 1:100 ve-id 1001 block-offset 1000
BGP routing table entry for 1:100:VEID-1001:Blk-1000/136, version 3
Paths: (1 available, best #1, table L2VPN-VPLS-BGP-Table)
Advertised to update-groups:
1
Refresh Epoch 1
Local
0.0.0.0 from 0.0.0.0 (10.100.1.1)
Origin incomplete, localpref 100, weight 32768, valid, sourced, local, best
AGI version(0), VE Block Size(50) Label Base(10000)
Extended Community: RT:1:100 RT:32:64 L2VPN L2:0x0:MTU-1500
rx pathid: 0, tx pathid: 0x0
NLRI顯示RD為1:100,VE-ID為1001,VBO為1000,VBS為50,LB為10000。
Layer2 Info Extended Community儲存以下資訊:
RT延伸社群保留以下資訊:
當本地PE路由器通告L2VPN VPLS字首/標籤塊時,每個遠端PE路由器必須嘗試從該範圍選擇一個標籤,以便用作遠端VC標籤。
假定PE1是採用以前配置的本地PE,並且PE2是採用以下配置的遠端PE:
l2vpn vfi context one
vpn id 100
autodiscovery bgp signaling bgp
ve id 1002
ve range 50
!
mpls label range 3000 60000
PE2收到來自PE1的此BGP更新:
PE2#show bgp l2vpn vpls rd 1:100 ve-id 1001 block-offset 1000
BGP routing table entry for 1:100:VEID-1001:Blk-1000/136, version 5
Paths: (1 available, best #1, table L2VPN-VPLS-BGP-Table)
Not advertised to any peer
Refresh Epoch 2
Local
10.100.1.1 (metric 21) from 10.100.1.4 (10.100.1.4)
Origin incomplete, metric 0, localpref 100, valid, internal, best
AGI version(0), VE Block Size(50) Label Base(10000)
Extended Community: RT:1:100 RT:32:64 L2VPN L2:0x0:MTU-1500
Originator: 10.100.1.1, Cluster list: 10.100.1.4
rx pathid: 0, tx pathid: 0x0
PE2需要找到一個標籤,它可用作通向PE1的PW的遠端VC標籤。
PE2必須首先確定VBO是否在其配置範圍內。PE2使用計算VBO <= VE-ID < VBO + VBS對照由PE1通告的範圍檢查其VE-ID。在這種情況下,1000 <= 1002 < 1000 + 50,因此PE2成功。
然後PE2需要選擇一個遠端VC標籤。將遠端PE使用的解複用器(VC)標籤計算為(LB + VE-ID - VBO)。
從前面的字首中,LB為10000,VBO為1000。VE-ID是PE2中的VE-ID,是1002。因此,PE2挑選標籤(LB + VE-ID - VBO)=(10000 + 1002 - 1000)= 10002。
使用show l2vpn vfi name one命令以驗證這點:
PE2#show l2vpn vfi name one
Legend: RT=Route-target, S=Split-horizon, Y=Yes, N=No
VFI name: one, state: up, type: multipoint, signaling: BGP
VPN ID: 100, VE-ID: 1002, VE-SIZE: 50
RD: 1:100, RT: 1:100
Bridge-Domain 100 attachment circuits:
Pseudo-port interface: pseudowire100001
Interface Peer Address VE-ID Local Label Remote Label S
pseudowire100002 10.100.1.1 1001 3101 10002 Y
然後PE2將其字首傳送到PE1:
PE1#show bgp l2vpn vpls rd 1:100 ve-id 1002 block-offset 1000
BGP routing table entry for 1:100:VEID-1002:Blk-1000/136, version 4
Paths: (1 available, best #1, table L2VPN-VPLS-BGP-Table)
Not advertised to any peer
Refresh Epoch 1
Local
10.100.1.2 (metric 21) from 10.100.1.4 (10.100.1.4)
Origin incomplete, metric 0, localpref 100, valid, internal, best
AGI version(0), VE Block Size(50) Label Base(3100)
Extended Community: RT:1:100 L2VPN L2:0x0:MTU-1500
Originator: 10.100.1.2, Cluster list: 10.100.1.4
rx pathid: 0, tx pathid: 0x0
PE1現在是遠端PE,需要找到一個標籤,它可用作面向PE2的PW的遠端VC標籤。
PE1必須首先確定VBO是否在其配置範圍內。PE1使用計算VBO <= VE-ID < VBO + VBS對照由PE2通告的範圍檢查其VE-ID。在這種情況下,1000 <= 1001 < 1000 + 50,因此PE1成功。
然後PE1需要選擇一個遠端VC標籤。將遠端PE使用的解複用器(VC)標籤計算為(LB + VE-ID - VBO)。
從前面的字首中,LB為3100,VBO為1000。VE-ID是PE1中的VE-ID,是1001。因此,PE1挑選標籤(LB + VE-ID - VBO)=(3100 + 1001 - 1000)= 3101。
使用show l2vpn vfi name one命令以驗證這點:
PE1#show l2vpn vfi name one
Legend: RT=Route-target, S=Split-horizon, Y=Yes, N=No
VFI name: one, state: up, type: multipoint, signaling: BGP
VPN ID: 100, VE-ID: 1001, VE-SIZE: 50
RD: 1:100, RT: 1:100, 32:64
Bridge-Domain 1 attachment circuits:
Pseudo-port interface: pseudowire100001
Interface Peer Address VE-ID Local Label Remote Label S
pseudowire100002 10.100.1.2 1002 10002 3101 Y
PE1#show mpls l2transport vc detail
Local interface: VFI one vfi up
Interworking type is Ethernet
Destination address: 10.100.1.2, VC ID: 100, VC status: up
Output interface: Et1/0, imposed label stack {17 3101}
Preferred path: not configured
Default path: active
Next hop: 10.1.1.4
Create time: 02:06:08, last status change time: 02:06:08
Last label FSM state change time: 02:06:08
Signaling protocol: BGP
Status TLV support (local/remote) : Not Applicable
LDP route watch : Not Applicable
Label/status state machine : established, LruRru
Last local dataplane status rcvd: No fault
Last BFD dataplane status rcvd: Not Applicable
Last BFD peer monitor status rcvd: Not Applicable
Last local AC circuit status rcvd: No fault
Last local AC circuit status sent: No fault
Last local PW i/f circ status rcvd: No fault
Last local LDP TLV status sent: Not Applicable
Last remote LDP TLV status rcvd: Not Applicable
Last remote LDP ADJ status rcvd: Not Applicable
MPLS VC labels: local 10002, remote 3101
Group ID: local 0, remote 0
MTU: local 1500, remote 1500
Control Word: Off
Dataplane:
SSM segment/switch IDs: 8195/4097 (used), PWID: 3
VC statistics:
transit packet totals: receive 0, send 0
transit byte totals: receive 0, send 0
transit packet drops: receive 0, seq error 0, send 0
PE1#show mpls infrastructure lfd block-database id 1
Block-DB entry for block-id : 0x1
Block-size : 50, App-Key type : AToM PWID
App-Key entries:
l2ckt(1) 10000
l2ckt(2) 10001
l2ckt(3) 10002
l2ckt(4) 10003
l2ckt(5) 10004
l2ckt(6) 10005
l2ckt(7) 10006
l2ckt(8) 10007
l2ckt(9) 10008
l2ckt(10) 10009
l2ckt(11) 10010
l2ckt(12) 10011
l2ckt(13) 10012
l2ckt(14) 10013
l2ckt(15) 10014
l2ckt(16) 10015
l2ckt(17) 10016
l2ckt(18) 10017
l2ckt(19) 10018
l2ckt(20) 10019
l2ckt(21) 10020
l2ckt(22) 10021
l2ckt(23) 10022
l2ckt(24) 10023
l2ckt(25) 10024
l2ckt(26) 10025
l2ckt(27) 10026
l2ckt(28) 10027
l2ckt(29) 10028
l2ckt(30) 10029
l2ckt(31) 10030
l2ckt(32) 10031
l2ckt(33) 10032
l2ckt(34) 10033
l2ckt(35) 10034
l2ckt(36) 10035
l2ckt(37) 10036
l2ckt(38) 10037
l2ckt(39) 10038
l2ckt(40) 10039
l2ckt(41) 10040
l2ckt(42) 10041
l2ckt(43) 10042
l2ckt(44) 10043
l2ckt(45) 10044
l2ckt(46) 10045
l2ckt(47) 10046
l2ckt(48) 10047
l2ckt(49) 10048
l2ckt(50) 10049
PE1#show l2vpn atom vc destination 10.100.1.2
Service
Interface Dest Address VC ID Type Name Status
--------- --------------- ---------- ------ ------------------------ ----------
pw100002 10.100.1.2 100 vfi one UP
PE1#show l2vpn atom vc destination 10.100.1.2 detail
pseudowire100002 is up, VC status is up PW type: Ethernet
Create time: 02:11:13, last status change time: 02:11:13
Last label FSM state change time: 02:11:13
Destination address: 10.100.1.2 VC ID: 100
Output interface: Et1/0, imposed label stack {17 3101}
Preferred path: not configured
Default path: active
Next hop: 10.1.1.4
Member of vfi service one
Bridge-Domain id: 1
Service id: 0xe7000001
Signaling protocol: BGP
Local VE ID: 1001, Remote VE ID: 1002
Status TLV support (local/remote) : Not Applicable
LDP route watch : Not Applicable
Label/status state machine : established, LruRru
Local dataplane status received : No fault
BFD dataplane status received : Not Applicable
BFD peer monitor status received : Not Applicable
Status received from access circuit : No fault
Status sent to access circuit : No fault
Status received from pseudowire i/f : No fault
Status sent to network peer : Not Applicable
Status received from network peer : Not Applicable
Adjacency status of remote peer : Not Applicable
Bindings
Parameter Local Remote
------------ ------------------------------ ------------------------------
Label 10002 3101
Group ID 0 0
Interface
MTU 1500 1500
Control word off off
PW type Ethernet Ethernet
VCCV CV type 0x32 0x32
LSPV [2], BFD/Raw [5] LSPV [2], BFD/Raw [5]
BFD/Raw + sig [6] BFD/Raw + sig [6]
VCCV CC type 0x07 0x07
CW [1], RA [2], TTL [3] CW [1], RA [2], TTL [3]
Status TLV disabled N/A
Dataplane:
SSM segment/switch IDs: 8195/4097 (used), PWID: 3
Rx Counters
0 input transit packets, 0 bytes
0 drops, 0 seq err
Tx Counters
0 output transit packets, 0 bytes
0 drops
PE1#show l2vpn signaling rib rd 1:100
+- Origin of entry (i=iBGP/e=eBGP)
| +- Provisioned (Yes/No)?
| | +- Stale entry (Yes/No)?
| | |
v v v
O P S RD VE-ID VBO VBS LB Next-Hop
-+-+-+-----------------+-------+-------+-------+---------+-----------------+
i Y N 1:100 1002 1000 50 3100 10.100.1.2
PE1#show l2vpn signaling rib rd 1:100 detail
Route 1:100:1002 (epoch:0) from iBGP peer 10.100.1.2
Provisioned (Y) Stale (N)
Route-Target: 1:100
NLRI [FF000001]
VE-ID:1002 VBO:1000 VBS:50 LB:3100
MTU: 1500 Control Word: off
RIB Filter [27000002]
RD: 1:100
VE-ID: 1001, VBO: 1000, VBS: 50 LB: 10000
Forwarder [58000001] VFI one
PE1#show l2vpn atom pwid
AToM Pseudowire IDs: In use: 50, In holddown: 0
Label Peer-Address VCID PWID In-Use FirstUse ResuedAt FreedAt
------ --------------- ---------- ---------- ------ -------- -------- --------
10000 0.0.0.0 0 1 Yes 00:00:15 Never Never
10001 0.0.0.0 0 2 Yes 00:00:15 Never Never
10002 10.100.1.2 100 3 Yes 00:00:15 Never Never
10003 0.0.0.0 0 4 Yes 00:00:15 Never Never
10004 0.0.0.0 0 5 Yes 00:00:15 Never Never
PE1#show l2vpn atom summary
Destination address: 10.100.1.2, total number of vc: 1
0 unknown, 1 up, 0 down, 0 admin down, 0 recovering, 0 standby, 0 hotstandby
1 active vc on MPLS interface Et1/0
一個PE可能需要為一個虛擬轉發例項(VFI)通告多個標籤塊。
如果遠端PE的VE-ID不在本地PE通告的範圍內,則遠端PE無法為PW選擇遠端標籤。此計算(如前所述)為VBO <= VE-ID < VBO + VBS。
如果此檢查失敗,則遠端PE的VE-ID超出範圍。遠端PE忽略從本地PE接收的字首。當本地PE收到遠端PE通告的字首時,本地PE發現遠端PE超出範圍。本地PE需要確定該遠端PE路由器使用哪個遠端標籤。本地PE還會向遠端PE傳送新的本地標籤塊的第二字首,遠端PE應該能夠使用該字首來選擇遠端標籤。
以下為上一示例;PE1仍有:
l2vpn vfi context one
vpn id 100
autodiscovery bgp signaling bgp
ve id 1001
ve range 50
route-target export 32:64
route-target import 32:64
!
mpls label range 10000 20000
PE2現在的VE-ID為1002,並且此配置:
l2vpn vfi context one
vpn id 100
autodiscovery bgp signaling bgp
ve id 10002
ve range 50
!
mpls label range 3000 60000
PE1和PE2都以這些初始標籤塊開頭。
PE1#show bgp l2vpn vpls rd 1:100
BGP table version is 2, local router ID is 10.100.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:100
*> 1:100:VEID-1001:Blk-1000/136
0.0.0.0 32768 ?
PE2#show bgp l2vpn vpls rd 1:100
BGP table version is 3, local router ID is 10.100.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:100
*> 1:100:VEID-10002:Blk-10000/136
0.0.0.0 32768 ?
使用debug bgp l2vpn vpls updates命令檢視PE1和PE2交換,然後使用show bgp l2vpn vpls rd 1:100命令檢視詳細資訊。
PE1#
%BGP-5-ADJCHANGE: neighbor 10.100.1.4 Up
BGP(9): update formatted for 1:100:VEID-1001:Blk-1000:VBS-50:LB-10000/136 VE ID
1001 VE Block Offset 1000 VE Block Size 50 Label Base 10000 /136
BGP(9): (base) 10.100.1.4 send UPDATE (format) 1:100:VEID-1001:Blk-1000:VBS-50:
LB-10000/136, next 10.100.1.1, metric 0, path Local, extended community RT:1:100
RT:32:64 L2VPN L2:0x0:MTU-1500
BGP(9): 10.100.1.4 rcvd UPDATE w/ attr: nexthop 10.100.1.2, origin ?,
localpref 100, metric 0, originator 10.100.1.2, clusterlist 10.100.1.4, extended
community RT:1:100 L2VPN L2:0x0:MTU-1500
BGP(9): 10.100.1.4 rcvd 1:100:VEID-10002:Blk-10000:VBS-50:LB-3000/136
BGP(9): bump net 1:100:VEID-10002:Blk-10000:VBS-50:LB-3000/136, non bpath added
BGP(9): nettable_walker called for 1:100:VEID-10002:Blk-10000:VBS-50:LB-3000/136
BGP(9): best path[0] 1:100:VEID-10002:Blk-10000:VBS-50:LB-3000/136 source
10.100.1.1 nh 10.100.1.2 vpls-id: L2VPN L2:0x0:MTU-1500
BGP(9): add XC RIB route 1:100:VEID-10002:Blk-10000:VBS-50:LB-3000/136 masklen 136
L2VPN L2:0x0:MTU-1500 pathcount: 1 [0] LDP source:10.100.1.1 nexthop:10.100.1.2
RT:1:100
BGP(9): bump net 1:100:VEID-1001:Blk-10000:VBS-50:LB-10053/136, non bpath added
BGP(9): nlri update add VBS 50 LB 10053
BGP(9): nlri update add export extcomm count 4
BGPSSA ssacount is 0
BGP(9): update formatted for 1:100:VEID-10002:Blk-10000:VBS-50:LB-3000/136 VE ID
10002 VE Block Offset 10000 VE Block Size 50 Label Base 3000 /136
BGP(9): nettable_walker called for 1:100:VEID-1001:Blk-10000:VBS-50:LB-10053/136
BGP(9): nettable_walker 1:100:VEID-1001:Blk-10000:VBS-50:LB-10053/136 route sourced
locally
BGP(9): update formatted for 1:100:VEID-1001:Blk-10000:VBS-50:LB-10053/136 VE ID
1001 VE Block Offset 10000 VE Block Size 50 Label Base 10053 /136
BGP(9): (base) 10.100.1.4 send UPDATE (format) 1:100:VEID-1001:Blk-10000:VBS-50:
LB-10053/136, next 10.100.1.1, metric 0, path Local, extended community RT:1:100
RT:32:64 L2VPN L2:0x0:MTU-1500 L2VPN L2:0x0:MTU-1500
BGP(9): 10.100.1.4 rcvd UPDATE w/ attr: nexthop 10.100.1.2, origin ?, localpref 100,
metric 0, originator 10.100.1.2, clusterlist 10.100.1.4, extended community
RT:1:100 L2VPN L2:0x0:MTU-1500
BGP(9): 10.100.1.4 rcvd 1:100:VEID-10002:Blk-1000:VBS-50:LB-3053/136
BGP(9): bump net 1:100:VEID-10002:Blk-1000:VBS-50:LB-3053/136, non bpath added
BGP(9): nettable_walker called for 1:100:VEID-10002:Blk-1000:VBS-50:LB-3053/136
BGP(9): best path[0] 1:100:VEID-10002:Blk-1000:VBS-50:LB-3053/136 source 10.100.1.1
nh 10.100.1.2 vpls-id: L2VPN L2:0x0:MTU-1500
BGP(9): add XC RIB route 1:100:VEID-10002:Blk-1000:VBS-50:LB-3053/136 masklen 136
L2VPN L2:0x0:MTU-1500 pathcount: 1 [0] LDP source:10.100.1.1 nexthop:10.100.1.2
RT:1:100
BGP(9): update formatted for 1:100:VEID-10002:Blk-1000:VBS-50:LB-3053/136 VE ID
10002 VE Block Offset 1000 VE Block Size 50 Label Base 3053 /136
BGPSSA ssacount is 0
PE1#show bgp l2vpn vpls rd 1:100
BGP table version is 5, local router ID is 10.100.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:100
*> 1:100:VEID-1001:Blk-1000/136
0.0.0.0 32768 ?
*> 1:100:VEID-1001:Blk-10000/136
0.0.0.0 32768 ?
*>i 1:100:VEID-10002:Blk-1000/136
10.100.1.2 0 100 0 ?
*>i 1:100:VEID-10002:Blk-10000/136
10.100.1.2 0 100 0 ?
PE2#show bgp l2vpn vpls rd 1:100
BGP table version is 6, local router ID is 10.100.1.2
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
Route Distinguisher: 1:100
*>i 1:100:VEID-1001:Blk-1000/136
10.100.1.1 0 100 0 ?
*>i 1:100:VEID-1001:Blk-10000/136
10.100.1.1 0 100 0 ?
*> 1:100:VEID-10002:Blk-1000/136
0.0.0.0 32768 ?
*> 1:100:VEID-10002:Blk-10000/136
0.0.0.0 32768 ?
PE1和PE2現在相互通告了兩個標籤塊。
PE1首先向PE2通告初始BGP更新:
BGP(9): update formatted for 1:100:VEID-1001:Blk-1000:VBS-50:LB-10000/136 VE ID
1001 VE Block Offset 1000 VE Block Size 50 Label Base 10000 /136
BGP(9): (base) 10.100.1.4 send UPDATE (format) 1:100:VEID-1001:Blk-1000:VBS-50:
LB-10000/136, next 10.100.1.1, metric 0, path Local, extended community
RT:1:100 RT:32:64 L2VPN L2:0x0:MTU-1500
此更新根據PE1上的配置設定NLRI。
然後PE1收到來自PE2的初始BGP更新。
BGP(9): 10.100.1.4 rcvd UPDATE w/ attr: nexthop 10.100.1.2, origin ?, localpref
100, metric 0, originator 10.100.1.2, clusterlist 10.100.1.4, extended
community RT:1:100 L2VPN L2:0x0:MTU-1500
BGP(9): 10.100.1.4 rcvd 1:100:VEID-10002:Blk-10000:VBS-50:LB-3000/136
PE2使用值VE-ID 10002、VBO = 10000、VBS = 50、LB = 3000通告初始字首。
PE1注意到PE2超出範圍,因為PE1開始時,標籤塊為LB至(LB + VBS - 1)或10000至(10000 + 50 - 1)= 10049。
PE1必須確定VBO是否在其配置範圍內。因此,需要根據PE1通告的範圍檢查PE2的VE-ID。計算是VBO <= VE-ID < VBO + VBS。在本例中,1000 <= 10002 < 1000 + 50,這不是真的。因此,PE1需要傳送一個新的標籤塊來容納PE2的超出範圍的VE-ID。為了響應PE2的初始更新,PE1將格式化並向PE2傳送一個新的附加BGP更新。PE1現在使用新的VBO 10000。
BGP(9): update formatted for 1:100:VEID-1001:Blk-10000:VBS-50:LB-10053/136
VE ID 1001 VE Block Offset 10000 VE Block Size 50 Label Base 10053 /136
BGP(9): (base) 10.100.1.4 send UPDATE (format) 1:100:VEID-1001:Blk-10000:
VBS-50:LB-10053/136, next 10.100.1.1, metric 0, path Local, extended
community RT:1:100 RT:32:64 L2VPN L2:0x0:MTU-1500 L2VPN L2:0x0:MTU-1500
對於PE1,VBO為10000,VBS為50,LB為10053。檢查PE2是否為VBO <= VE-ID < VBO + VBS。在本例中,10000 <= 10002 < 10000 + 50,這是正確的。PE2可以從來自PE1的新標籤塊[10053 - 10102]中選擇一個遠端標籤。也就是說,PE1為了適應PE2而新增了一個新標籤塊,並傳送了兩條BGP更新消息。
相反的方向也是如此。PE2收到來自PE1的初始BGP更新。此更新具有以下值:VE-ID 1001,VBO = 1000,VBS = 50,LB = 10000。
PE2注意到PE1的VE-ID與PE2的初始更新不符。PE1?s檢查是VBO <= VE-ID < VBO + VBS或10000 <= 1001 < 10000 + 50。作為響應,PE2將傳送第二個BGP更新,並傳送一個新的標籤塊[3053 - 3102],該塊可容納PE1的VE-ID 1001,因為PE1s檢查是VBO <= VE-ID < VBO + VBS或100<= 10 01 < 1000 + 50。
BGP(9): 10.100.1.4 rcvd UPDATE w/ attr: nexthop 10.100.1.2, origin ?,
localpref 100, metric 0, originator 10.100.1.2, clusterlist 10.100.1.4,
extended community RT:1:100 L2VPN L2:0x0:MTU-1500
BGP(9): 10.100.1.4 rcvd 1:100:VEID-10002:Blk-1000:VBS-50:LB-3053/136
以下是PE1產生的兩個字首的詳細資訊:
PE1#show bgp l2vpn vpls rd 1:100 ve-id 1001 block-offset 1000
BGP routing table entry for 1:100:VEID-1001:Blk-1000/136, version 2
Paths: (1 available, best #1, table L2VPN-VPLS-BGP-Table)
Not advertised to any peer
Refresh Epoch 1
Local
0.0.0.0 from 0.0.0.0 (10.100.1.1)
Origin incomplete, localpref 100, weight 32768, valid, sourced, local, best
AGI version(0), VE Block Size(50) Label Base(10000)
Extended Community: RT:1:100 RT:32:64 L2VPN L2:0x0:MTU-1500
rx pathid: 0, tx pathid: 0x0
PE1#show bgp l2vpn vpls rd 1:100 ve-id 1001 block-offset 10000
BGP routing table entry for 1:100:VEID-1001:Blk-10000/136, version 4
Paths: (1 available, best #1, table L2VPN-VPLS-BGP-Table)
Not advertised to any peer
Refresh Epoch 1
Local
0.0.0.0 from 0.0.0.0 (10.100.1.1)
Origin incomplete, localpref 100, weight 32768, valid, sourced, local, best
AGI version(0), VE Block Size(50) Label Base(10053)
Extended Community: RT:1:100 RT:32:64 L2VPN L2:0x0:MTU-1500
L2VPN L2:0x0:MTU-1500
rx pathid: 0, tx pathid: 0x0
這裡,兩個PE路由器具有不連續的數字方案,這會導致每個PE傳送兩個BGP更新。如果有許多PE路由器採用不連續的數量方案,則BGP更新的數量會迅速增長。
www.cisco.com說:「例如,VE-ID編號序列(如1、2、3或501、502、503)是良好的,因為VE-ID是連續的。編號方案(如100、200、300)是不好的,因為它是不連續的。」
1、2、3或501、502、503的第一個示例是連續數字,因此每個PE路由器只需要傳送一個L2VPN VPLS字首。在第三個示例(100、200、300)中,每個PE必須傳送多個L2VPN VPLS字首。對於非連續數字,如果足夠大的VE範圍,將保持要通告的字首數量較低。但是,保留(浪費)標籤的數量仍然較大。
如果BGP路由反射器(RR)執行的軟體不瞭解RFC 4761,但確實支援RFC 4762,則RR上需要特殊的BGP neighbor x.x.x.x prefix-length-size 2組態命令,如此一來它就可以反映RFC 4761使用的BGP更新。
字首通常以1位元組的長度傳送。Cisco IOS軟體實施了「draft-ietf-l2vpn-signaling-08」草案,該草案後來成為RFC 6074。當時選擇的長度欄位為1個位元組,以位為單位表示長度。
RFC 6074第2層虛擬專用網路(L2VPN)中的調配、自動發現和信令指定BGP自動發現的NLRI編碼長度應為2個位元組。2位元組表示可變長度字首後跟多少位元組的字首。
RFC 6074「BGP-AD和VPLS-BGP互通性」的第7節說明:
「BGP-AD和VPLS-BGP [RFC4761]使用相同的AFI/SAFI。若要使BGP-AD和VPLS-BGP共存,必須使用NLRI長度作為解多工器。
BGP-AD NLRI的NLRI長度為12個位元組,僅包含8個位元組的RD和4個位元組的VSI-ID。VPLS-BGP [RFC4761]使用17位元組NLRI長度。因此,BGP-AD的實現必須忽略大於12位元組的NLRI。
如果RR上沒有neighbor x.x.x.x prefix-length-size 2命令,則BGP鄰居不會啟動,而RR將長度欄位解釋為1個位元組。此通知顯示在RR:
%BGP-3-NOTIFICATION: sent to neighbor 10.100.1.2 3/10 (illegal network) 1 bytes FF
%BGP-4-MSGDUMP: unsupported or mal-formatted message received from 10.100.1.2:
FFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFF 005E 0200 0000 4780 0E1C 0019 4104 0A64
0102 0000 1100 0000 0100 0000 6427 1227 1000 3200 BB80 4001 0102 4002 0080 0404
*Feb 15 12:14:11.561: %BGP_SESSION-5-ADJCHANGE: neighbor 10.100.1.2 L2VPN Vpls
topology base removed from session BGP Notification sent
*Feb 15 12:14:11.561: %BGP_SESSION-5-ADJCHANGE: neighbor 10.100.1.2 IPv4 Unicast
topology base removed from session BGP Notification sent
此通知出現在PE路由器上:
%BGP-3-NOTIFICATION: received from neighbor 10.100.1.4 3/10 (illegal network)
1 bytes FD
發生這種情況的原因是,在Cisco IOS軟體中的BGP自動發現的原始實現中,長度欄位為1位元組。
如果您將neighbor x.x.x.x prefix-length-size 2命令放在RR上,則不會顯示通知。
router bgp 1
neighbor 10.100.1.2 remote-as 1
neighbor 10.100.1.2 update-source Loopback0
!
address-family l2vpn vpls
neighbor 10.100.1.2 activate
neighbor 10.100.1.2 send-community extended
neighbor 10.100.1.2 prefix-length-size 2
neighbor 10.100.1.2 route-reflector-client