简介
本文档介绍如何对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_ERROR_ADD |
消息文本 |
为表0xe0000000的前缀10.0.0.111/32添加local-label 16111(2),由proto isis client 17 isis node0_0_CPU0 — 由proto-id 2 client 16添加现有标签24005 |
16111根据消息详细信息过程,ipv4_rib在尝试从协议中间系统到中间系统(IS-IS)- rib客户端17为前缀10.0.0.111/32添加本地标签时,生成了一个错误。RIB数据24005中已经存在另一个协议rib客户端16以前添加的相同前缀的标签。总之,两个不同的协议在RIB数据库中为相同前缀添加了不同的本地标签。这是一个错误条件,必须更正并解决标签冲突。
了解消息来源
当多个协议交换标签时(例如同时使用边界网关协议 — 标记的单播(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客户端17 — 为前缀10.0.0.111/32添加本地标签16111,该前缀已经有一个先前由协议BGP - rib客户端16添加的本地标签24005:
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”可以通过配置BGP分段路由(SR-BGP)并使用BGP Prefix-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