配置MPLS OAM保护倒换功能
应用环境
在对网络可靠性要求较高的情况下,通过预留保护通道,可以在主Tunnel发生缺陷时快速恢复数据传输。
VRP的MPLS OAM支持对与TE隧道绑定的LSP进行保护倒换,包括RSVP-TE LSP、静态CR-LSP和静态LSP。
保护倒换有两种触发条件:信令倒换、手工倒换。
信令倒换是指由于所检测的LSP故障自动触发的倒换。
手工倒换是指通过命令行触发的倒换。
信令倒换和手工倒换会下发具有不同优先级的倒换请求,只有当新的倒换请求优先级高于当前存在的倒换请求时,新的倒换请求才会生效。
按照优先级从高到低的顺序,各种倒换请求依次是:
Force Switch(强制倒换):具有最高优先级。当存在强制倒换请求时,即使满足回切条件,流量也不会倒换回主LSP。
Signal Failure:由于所检测的LSP故障自动触发的倒换。
Manual Switch(手工倒换)
WTR:等待WTR超时后将流量回切到主LSP。这种状态下,如果手工下发倒换命令,将立即执行倒换。
配置思路
在配置MPLS OAM保护倒换功能时,采用如下的配置思路:
在入节点至出节点间建立两条TE隧道,构成保护组。
建立一条从出节点至入节点的TE隧道,作为反向通道,向入节点通告故障。
在入节点配置OAM参数,并启动OAM功能。
在出节点配置OAM参数,使用OAM自动协议功能。
配置注意事项
为完成此配置例,需准备如下的数据:
各路由器的接口IP地址、各隧道接口名、隧道ID。
发送的检测报文类型。
隧道保护组参数,包括倒换延迟时间、回切模式、回切等待时间。
反向通道的占用方式等参数。
说明
如果反向通道是静态LSP或者静态CR-LSP,则反向通道必须采用独占方式。
如果反向LSP是动态的,且反向通道采用共享方式,则使用static-lsp egress或static-cr-lsp egress命令创建前向LSP时,必须指定参数lsrid ingress-lsr-id tunnel-id tunnel-id。
组网需求
在下图所示的MPLS网络中,RouterA存在一条去往RouterC的TE隧道。
要求配置MPLS OAM保护倒换功能,采用1:1保护模式,当主Tunnel发生故障时,流量切换到备用Tunnel。
配置MPLS OAM保护倒换功能组网图
适用产品和版本
路由器可以使用任意一款NE产品,版本为VRP5.30及后续版本。
配置步骤
步骤 1 配置各接口IP地址和路由协议
按照上图配置各接口的IP地址和掩码,包括各Loopback接口。
在所有路由器上配置OSPF协议,发布各自Loopback接口的主机路由,具体配置过程略。
配置完成后,各LSR可以互相Ping通对方的LSR-ID,在各LSR上执行display ip routing-table命令可以看到到达各LSR-ID的路由表项。
以RouterA的显示为例:
[RouterA] display ip routing-table
Routing Tables: Public
Destinations : 19 Routes : 21
Destination/Mask Proto Pre Cost NextHop Interface
1.1.1.1/32 Direct 0 0 127.0.0.1 InLoopBack0
2.2.2.2/32 OSPF 10 2 10.1.2.2 Pos2/0/0
3.3.3.3/32 OSPF 10 3 10.1.1.2 Pos1/0/0
OSPF 10 3 10.1.2.2 Pos2/0/0
OSPF 10 3 10.1.5.2 Pos3/0/0
4.4.4.4/32 OSPF 10 2 10.1.1.2 Pos1/0/0
5.5.5.5/32 OSPF 10 2 10.1.5.2 Pos3/0/0
10.1.1.0/24 Direct 0 0 10.1.1.1 Pos1/0/0
10.1.1.1/32 Direct 0 0 127.0.0.1 InLoopBack0
10.1.1.2/32 Direct 0 0 10.1.1.2 Pos1/0/0
10.1.2.0/24 Direct 0 0 10.1.2.1 Pos2/0/0
10.1.2.1/32 Direct 0 0 127.0.0.1 InLoopBack0
10.1.2.2/32 Direct 0 0 10.1.2.2 Pos2/0/0
10.1.3.0/24 OSPF 10 2 10.1.2.2 Pos2/0/0
10.1.4.0/24 OSPF 10 2 10.1.1.2 Pos1/0/0
10.1.5.0/24 Direct 0 0 10.1.5.1 Pos3/0/0
10.1.5.1/32 Direct 0 0 127.0.0.1 InLoopBack0
10.1.5.2/32 Direct 0 0 10.1.5.2 Pos3/0/0
10.1.6.0/24 OSPF 10 2 10.1.5.2 Pos3/0/0
127.0.0.0/8 Direct 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 127.0.0.1 InLoopBack0
步骤 2 配置MPLS及MPLS TE隧道
# 在RouterA上配置主隧道Tunnel2/0/0、备用隧道Tunnel3/0/0,在RouterC上配置反向隧道Tunnel1/0/0。
TE隧道的配置过程略。
配置完成后,在RouterA和RouterC上执行display mpls te tunnel命令可以看到建立的TE隧道。
以RouterA上的显示为例。
[RouterA] display mpls te tunnel
LSP-Id Destination In/Out-If
1.1.1.1:1 3.3.3.3 -/Pos2/0/0
1.1.1.1:0 3.3.3.3 -/Pos3/0/0
3.3.3.3:0 1.1.1.1 Pos1/0/0/-
步骤 3 配置保护组
# 在RouterA上配置Tunnel2/0/0作为主隧道,倒换延迟为1秒,采用可回切模式,回切时间为10分钟。
[RouterA] interface tunnel 2/0/0
[RouterA-Tunnel2/0/0] mpls te protection tunnel 300 holdoff 10 mode revertive wtr 20
[RouterA-Tunnel2/0/0] mpls te commit
[RouterA-Tunnel2/0/0] quit
在RouterA上执行display mpls te protection tunnel all命令,可以看到主隧道和备用隧道都处于non-defect状态,当前是主隧道转发流量。
[RouterA] display mpls te protection tunnel all
No. Work-tunnel status /id Protect-tunnel status /id Switch-Result
------------------------------------------------------------------------
1 non-defect /200 non-defect /300 work-tunnel
步骤 4 配置MPLS OAM功能
# 在入节点RouterA上配置MPLS OAM功能。 [RouterA] mpls [RouterA-mpls] mpls oam [RouterA-mpls] quit [RouterA] mpls oam ingress tunnel2/0/0 type ffd frequency 100 [RouterA] mpls oam ingress enable all # 在出节点RouterC上配置MPLS OAM功能。 [RouterC] mpls [RouterC-mpls] mpls oam [RouterC-mpls] quit [RouterC] mpls oam egress lsr-id 1.1.1.1 tunnel-id 100 auto-protocol backward-lsp tunnel 2/0/0 private bdi-frequency per-second
出节点配置自动协议后,当出节点收到第一个正确的检测报文后,自动启动OAM功能。
配置完成后,在入节点RouterA和出节点RouterC上查看LSP的MPLS OAM参数及状态信息。可以看到入节点和出节点都处于正常检测状态,没有故障。
以RouterC的显示为例。
[RouterC] display mpls oam egress all verbose
-------------------------------------------------------------------------
Verbose information about the 1th oam at the egress
-------------------------------------------------------------------------
lsp basic information: oam basic information:
----------------------------------- -----------------------------------
Lsp name : -- Oam-Index : 256
Lsp signal status : Up Oam select board : 1
Lsp establish type : Rsvp lsp Enable-state : --
Lsp incoming Label : 3 Auto-protocol : Enable
Lsp ingress lsr-id : 1.1.1.1 Auto-overtime (s) : 300
Lsp tnl-id/lsp-id : 100/1 Ttsi/lsr-id : 1.1.1.1
Lsp Incoming-int Pos2/0/0 Ttsi/tunnel-id : 100
oam detect information: oam backward information:
------------------------------------ ----------------------------------
Type : FFD Tunnel name : Tunnel1/0/0
Frequency : 100 ms Share attribute : Private
Detect-state : Start Lsp signal status : Up
Defect-state : Non-defect Bdi-frequency : Per-second
Available state : Available
Unavailable time (s): 0
-------------------------------------------------------------------------
Total Oam Num: 1
Total Start Oam Num: 1
Total Defect Oam Num: 0
Total Unavaliable Oam Num: 0
验证结果
# 对RouterB的POS2/0/0接口执行shutdown命令,模拟链路故障。
[RouterB] interface pos 2/0/0
[RouterB-Pos2/0/0] shutdown
# 在RouterC上执行display mpls oam egress all verbose命令,可以看到RouterC发现了这个故障,进入In-defect状态。
[RouterC] display mpls oam egress all verbose
-------------------------------------------------------------------------
Verbose information about the 1th oam at the egress
-------------------------------------------------------------------------
lsp basic information: oam basic information:
------------------------------------ ----------------------------------
Lsp name : -- Oam-Index : 256
Lsp signal status : Down Oam select board : --
Lsp establish type : -- Enable-state : --
Lsp incoming Label : -- Auto-protocol : Enable
Lsp ingress lsr-id : 1.1.1.1 Auto-overtime (s) : 300
Lsp tnl-id/lsp-id : 100/-- Ttsi/lsr-id : 1.1.1.1
Lsp Incoming-int -- Ttsi/tunnel-id : 100
oam detect information: oam backward information:
----------------------------------- ----------------------------------
Type : -- Tunnel name : Tunnel1/0/0
Frequency : -- Share attribute : Private
Detect-state : Stop Lsp signal status : Up
Defect-type : dEgressDown Bdi-frequency : Per-second
Available state : Available
Unavailable time (s): 0
-------------------------------------------------------------------------
Total Oam Num: 1
Total Start Oam Num: 0
Total Defect Oam Num: 1
Total Unavaliable Oam Num: 0
# 在RouterA上执行命令display mpls te protection tunnel all,可以看到主隧道处于in defect状态,数据流已切换到备用隧道上。
[RouterA] display mpls te protection tunnel all
----------------------------------------------------------
No. Work-tunnel status /id Protect-tunnel status /id Switch-Result
---------------------------------------------------------
1 in defect /200 non-defect /300 protect-tunnel





