簡介
本文描述如何對Cisco IOS® XR路由資訊庫(RIB)消息「%ROUTING-RIB-3-LABEL_ERR_ADD: Add local-label」進行故障排除。
消息描述
為了明確其原因和目的,使用了一個示例,並將它劃分為不同的組成部分:
RP/0/0/CPU0:Feb 17 11:46:25.663 : ipv4_rib[1148]: %ROUTING-RIB-3-LABEL_ERR_ADD : Add local-label 16111 (2) for table 0xe0000000, prefix 10.0.0.111/32, by proto isis client 17 isis node0_0_CPU0 - existing label 24005 added by proto-id 2 client 16
建立者 |
ipv4_rib |
類別 |
路由 |
群組 |
RIB |
嚴重性 |
3(錯誤條件) |
助記符 |
LABEL_ER_ADD |
Message-Text |
為表0xe0000000新增本地標籤16111(2),字首10.0.0.111/32,由proto isis client 17 isis node0_0_CPU0 — 由proto-id 2 client 16新增現有標籤24005 |
根據訊息詳細資訊流程,ipv4_rib在嘗試從通訊協定中間系統到中間系統(IS-IS)- rib使用者端17 — 為字首10.0.0.111/32新增本機標籤位址時產生錯16111。RIB資料24005中已經存在另一個協定rib客戶端16之前新增的相同字首的標籤。總而言之,兩個不同的協定在RIB資料庫中為相同字首新增了一個不同的local-label。這是一個錯誤條件,必須更正並解決標籤衝突。
了解消息來源
當多個通訊協定交換標籤時(例如同時使用邊界閘道通訊協定 — 貼標單點傳播(BGP-LU)和區段路由(SR)),可能會發生錯誤情況。
請考慮以下場景:在同一自治系統(AS)內的主機之間使用BGP-LU來通告所選字首和相關標籤。透過IS-IS得知的字首10.0.0.111/32具有由BGP分配的本地標籤,如下所示:
RP/0/0/CPU0:XRV4#show route 10.0.0.111/32 detail private
Routing entry for 10.0.0.111/32
Known via "isis core", distance 115, metric 30, type level-2
Installed Feb 17 10:56:08.900 for 00:34:45
Routing Descriptor Blocks
10.3.4.3, from 10.0.0.111, via GigabitEthernet0/0/0/0
Route metric is 30
Label: None
Tunnel ID: None
Binding Label: None
Extended communities count: 0
Path id:1 Path ref count:0
NHID:0x1(Ref:8)
Path flags: 0x0 ()
Private flags: 0x40 (rib_encap_id)
Route version is 0x17 (23)
Local Label: 0x5dc5 (24005)
IP Precedence: Not Set
QoS Group ID: Not Set
Flow-tag: Not Set
Fwd-class: Not Set
Route Priority: RIB_PRIORITY_NON_RECURSIVE_MEDIUM (7) SVD Type RIB_SVD_TYPE_LOCAL
Download Priority 1, Download Version 287
Client-id: 17
Route flags: 0x0 ()
Route Extended flags: 0x0 ()
Route private flags: 0x20 (priority_promotion)
Route head pointer: 0x1201f5bc
Local Label List
B 24005 (Client ID: 16, Distance: 200,)
No advertising protos.
可以從MPLS標籤表確認和驗24005分配的本地標籤協定的協定所有者:
RP/0/0/CPU0:XRV4#show mpls label table label 24005 detail private
Table Label Owner State Rewrite
----- ------- ------------------------------- ------ -------
0 24005 LDP(A) InUse Yes
BGP-VPNv4(A):bgp-default InUse No
(IPv4, vers:0, 'default':4U, 10.0.0.111/32)
當網路中啟用SR時,當IS-IS在RIB資料庫中新增自己的標籤時,就會觸發錯誤條件。這會導致標籤與來自BGP-LU的現有和以前分配的標籤衝突。在這個階段,進程ipv4_rib生成錯誤消息,並發出警報,表示嘗試從協定IS-IS - rib client 17 — 為字首10.0.0.111/32新增本地標籤16111,該字首已經有一個本地標籤24005,該本地標籤先前已由協定BGP - rib client 16新增:
RP/0/0/CPU0:Feb 17 11:46:25.663 : ipv4_rib[1148]: %ROUTING-RIB-3-LABEL_ERR_ADD : Add local-label 16111 (2) for table 0xe0000000, prefix 10.0.0.111/32, by proto isis client 17 isis node0_0_CPU0 - existing label 24005 added by proto-id 2 client 16
可從字首路由本地標籤清單詳細資訊中檢視和確認標籤衝突條件,如下所示:
RP/0/0/CPU0:XRV4#show route 10.0.0.111/32 detail private
Routing entry for 10.0.0.111/32
Known via "isis core", distance 115, metric 30, labeled SR, type level-2
Installed Feb 17 11:46:25.663 for 00:21:45
Routing Descriptor Blocks
10.3.4.3, from 10.0.0.111, via GigabitEthernet0/0/0/0
Route metric is 30
Label: 0x3eef (16111)
Tunnel ID: None
Binding Label: None
Extended communities count: 0
Path id:1 Path ref count:0
NHID:0x1(Ref:8)
Path flags: 0x0 ()
Private flags: 0x42 (has_vpn_data, rib_encap_id)
Route version is 0x1e (30)
Local Label: 0x3eef (16111)
IP Precedence: Not Set
QoS Group ID: Not Set
Flow-tag: Not Set
Fwd-class: Not Set
Route Priority: RIB_PRIORITY_NON_RECURSIVE_MEDIUM (7) SVD Type RIB_SVD_TYPE_LOCAL
Download Priority 1, Download Version 309
Client-id: 17
Route flags: 0x8800000 (ldp_sr_merge_request, label_sr)
Route Extended flags: 0x8 (ldp_sr_merge_request)
Route private flags: 0x20 (priority_promotion)
Route head pointer: 0x1201f5bc
Local Label List
i 16111 (Client ID: 17, Distance: 115,)
B 24005 (Client ID: 16, Distance: 200,)
No advertising protos.
標籤發生衝突時,BGP-LU和IS-IS相關輸出都會提供每個特定協定分配的本地標籤的附加詳細資訊。接下來的輸出將突出顯示每個協定有關字首和指定標籤的具體資訊。
在標籤衝突方案中,請注意字首和標籤詳細資訊,如協定BGP-LU所示:
RP/0/0/CPU0:XRV4#show bgp ipv4 labeled-unicast 10.0.0.111/32 detail
BGP routing table entry for 10.0.0.111/32
Versions:
Process bRIB/RIB SendTblVer
Speaker 69 69
Local Label: 24005 (no rewrite);
Flags: 0x01003001+0x00000200;
Last Modified: Feb 17 11:46:31.984 for 00:22:30
Paths: (1 available, best #1)
Not advertised to any peer
Path #1: Received by speaker 0
Flags: 0x4080000009060005, import: 0x20
Not advertised to any peer
Local
10.0.0.111 (metric 30) from 10.0.0.111 (10.0.0.111)
Received Label 3
Origin IGP, metric 0, localpref 100, valid, internal, best, group-best, labeled-unicast
Received Path ID 0, Local Path ID 0, version 69
Prefix SID Attribute Size: 10
Label Index: 111
RP/0/0/CPU0:XRV4#show bgp ipv4 labeled-unicast labels
<snip>
Network Next Hop Rcvd Label Local Label
*> 10.0.0.4/32 0.0.0.0 nolabel 3
*>i10.0.0.111/32 10.0.0.111 3 24005
Processed 2 prefixes, 2 paths
RP/0/0/CPU0:XRV4#show mpls label table label 24005 detail internal
Table Label Owner State Rewrite
----- ------- ------------------------------- ------ -------
0 24005 LDP(A) InUse Yes
BGP-VPNv4(A):bgp-default InUse No
(IPv4, vers:0, 'default':4U, 10.0.0.111/32)
在標籤衝突方案中,請注意字首和標籤詳細資訊,如協定IS-IS所示:
RP/0/0/CPU0:XRV4#show isis ipv4 route 10.0.0.111/32 detail
L2 10.0.0.111/32 [30/115] medium priority
via 10.3.4.3, GigabitEthernet0/0/0/0, XRV3, SRGB Base: 16000, Weight: 0
src XRV111.00-00, 10.0.0.111, prefix-SID index 111, R:0 N:1 P:0 E:0 V:0 L:0
RP/0/0/CPU0:XRV4#show isis segment-routing label 16111
IS-IS core IS Label Table
Label Prefix/Interface
---------- ----------------
16111 10.0.0.111/32
RP/0/0/CPU0:XRV4#show mpls label table label 16111 detail internal
Table Label Owner State Rewrite
----- ------- ------------------------------- ------ -------
0 16111 ISIS(A):core InUse No
(Lbl-blk SRGB, vers:0, (start_label=16000, size=8000)
協定和相關標籤現在均已程式設計,可以從MPLS轉發詳細資訊中觀察到:
RP/0/0/CPU0:XRV4#show mpls forwarding labels 24005 detail private
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24005 24004 10.0.0.111/32 Gi0/0/0/0 10.3.4.3 3055
Updated: Feb 17 11:46:25.703
Version: 217, Priority: 3
Label Stack (Top -> Bottom): { 24004 }
NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
MAC/Encaps: 14/18, MTU: 1500
Outgoing Interface: GigabitEthernet0/0/0/0 (ifhandle 0x00000040)
Packets Switched: 56
Traffic-Matrix Packets/Bytes Switched: 0/0
Traffic-Matrix Packets/Bytes Switched: 0/0
RP/0/0/CPU0:XRV4#show mpls forwarding labels 16111 detail private
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
16111 16111 SR Pfx (idx 111) Gi0/0/0/0 10.3.4.3 0
Updated: Feb 17 11:46:25.703
Version: 309, Priority: 15
Label Stack (Top -> Bottom): { 16111 }
NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
MAC/Encaps: 14/18, MTU: 1500
Outgoing Interface: GigabitEthernet0/0/0/0 (ifhandle 0x00000040)
Packets Switched: 0
Traffic-Matrix Packets/Bytes Switched: 0/0
Traffic-Matrix Packets/Bytes Switched: 0/0
但是,從字首10.0.0.111/32轉發詳細資訊中,您可以觀察到初始分配的24005簽仍在使用中,如下所示:
RP/0/0/CPU0:XRV4#show mpls forwarding prefix 10.0.0.111/32 detail private
Local Outgoing Prefix Outgoing Next Hop Bytes
Label Label or ID Interface Switched
------ ----------- ------------------ ------------ --------------- ------------
24005 24004 10.0.0.111/32 Gi0/0/0/0 10.3.4.3 3225
Updated: Feb 17 11:46:25.703
Version: 217, Priority: 3
Label Stack (Top -> Bottom): { 24004 }
NHID: 0x0, Encap-ID: N/A, Path idx: 0, Backup path idx: 0, Weight: 0
MAC/Encaps: 14/18, MTU: 1500
Outgoing Interface: GigabitEthernet0/0/0/0 (ifhandle 0x00000040)
Packets Switched: 59
Traffic-Matrix Packets/Bytes Switched: 0/0
RP/0/0/CPU0:XRV4#show cef 10.0.0.111/32 detail
10.0.0.111/32, version 217, labeled SR, internal 0x1000001 0x81 (ptr 0xa12dc0ec) [1], 0x0 (0xa12c1638), 0xa28 (0xa1527348)
Updated Feb 17 11:46:31.652
local adjacency 10.3.4.3
Prefix Len 32, traffic index 0, precedence n/a, priority 3
Extensions: context-label:16111
gateway array (0xa12264f0) reference count 9, flags 0x68, source lsd (5), 1 backups
[4 type 5 flags 0x8401 (0xa154153c) ext 0x0 (0x0)]
LW-LDI[type=5, refc=3, ptr=0xa12c1638, sh-ldi=0xa154153c]
gateway array update type-time 1 Feb 17 11:46:25.702
LDI Update time Feb 17 11:46:25.702
LW-LDI-TS Feb 17 11:46:25.702
via 10.3.4.3/32, GigabitEthernet0/0/0/0, 11 dependencies, weight 0, class 0 [flags 0x0]
path-idx 0 NHID 0x0 [0xa168816c 0x0]
next hop 10.3.4.3/32
local adjacency
local label 24005 labels imposed {24004}
Load distribution: 0 (refcount 4)
Hash OK Interface Address
0 Y GigabitEthernet0/0/0/0 10.3.4.3
在上述情況下,「%ROUTING-RIB-3-LABEL_ERR_ADD: Add local-label」(ROUTING-RIB-3-LABEL_ERR_ADD: Add local-label),可以通過配置BGP(SR-BGP)的分段路由並使用BGP字首SID來避免發生。
有關SR-BGP的詳細資訊,請參閱Cisco ASR 9000系列路由器的分段路由配置指南。下面是所需步驟的快速參考。
在所有節點上配置全域性段路由全域性塊(SRGB),它將自動啟用SR-BGP:
!
segment-routing
global-block 16000 23999
!
配置後,BGP將使用全域性SRGB進行標籤分配,如「show mpls label table detail」命令輸出所示:
!
! Note: If SR BGP was enabled after configuring BGP then you may need to process restart BGP for global SRGB to be picked up.
!
RP/0/0/CPU0:XRV111#show mpls label table detail
Table Label Owner State Rewrite
----- ------- ------------------------------- ------ -------
<snip>
0 16000 ISIS(A):core InUse No
BGP-VPNv4(A):bgp-default InUse No
(Lbl-blk SRGB, vers:0, (start_label=16000, size=8000)
<snip>
在發起路由的BGP節點上,通過路由策略配置BGP字首SID。下面是節點通告字首10.0.0.111/32的配置示例:
!
route-policy SID($SID)
set label-index $SID
end-policy
!
router bgp 65000
address-family ipv4 unicast
network 10.0.0.111/32 route-policy SID(111)
allocate-label all
!
有了SR-BGP後,將不再出現「ROUTING-RIB-3-LABEL_ERR_ADD: Add local-label」情況。如下所示,BGP將使用通過字首通告接收的BGP-Prefix SID索引作為從全域性SRGB分配本地標籤的提示。
RP/0/0/CPU0:XRV4#show route 10.0.0.111/32 detail private
Routing entry for 10.0.0.111/32
Known via "isis core", distance 115, metric 30, labeled SR, type level-2
Installed Feb 17 14:48:26.512 for 02:59:18
Routing Descriptor Blocks
10.3.4.3, from 10.0.0.111, via GigabitEthernet0/0/0/0
Route metric is 30
Label: 0x3eef (16111)
Tunnel ID: None
Binding Label: None
Extended communities count: 0
Path id:1 Path ref count:0
NHID:0x2(Ref:8)
Path flags: 0x0 ()
Private flags: 0x42 (has_vpn_data, rib_encap_id)
Route version is 0xd (13)
Local Label: 0x3eef (16111)
IP Precedence: Not Set
QoS Group ID: Not Set
Flow-tag: Not Set
Fwd-class: Not Set
Route Priority: RIB_PRIORITY_NON_RECURSIVE_MEDIUM (7) SVD Type RIB_SVD_TYPE_LOCAL
Download Priority 1, Download Version 438
Client-id: 19
Route flags: 0x9800000 (ldp_sr_merge_request, rib_precedence_over_ldp, label_sr)
Route Extended flags: 0x48 (ldp_sr_merge_request, rib_precedence_over_ldp)
Route private flags: 0x0 ()
Route head pointer: 0x1201f32c
Local Label List
i 16111 (Client ID: 19, Distance: 115,)
B 16111 (Client ID: 18, Distance: 200,)
No advertising protos.
結論
當兩個不同的協定在RIB資料庫中為相同字首新增不同的本地標籤時,觸發該消息,需要保留的一個重要方面是必須避免這種標籤衝突錯誤情況,並且必須瞭解並糾正其起源。
使用SR-BGP和BGP Prefix-SID可以避免此行為。
如需有用且有用的輸出,以便繼續分類並了解消息「%ROUTING-RIB-3-LABEL_ERR_ADD: Add local-label」,請參閱所示的命令清單:
show rib clients
show rib clients redistribution history all
show route <prefix> detail private
show isis ipv4 route <prefix> detail
show bgp ipv4 labeled-unicast <prefix> detail
show bgp ipv4 labeled-unicast labels
show cef <> detail
show mpls label table label <prefix> detail private
show mpls label table label <prefix> history
show mpls forwarding labels <prefix> detail private
show mpls forwarding prefix <prefix> detail private
show mpls lsd forwarding labels <prefix> detail
show mpls ldp forwarding detail
show isis segment-routing label table
show isis database verbose detail internal