零丢包技术专题
Copyright © 2025 新华三技术有限公司 版权所有,保留一切权利。
非经本公司书面许可,任何单位和个人不得擅自摘抄、复制本文档内容的部分或全部,并不得以任何形式传播。
除新华三技术有限公司的商标外,本手册中出现的其它公司的商标、产品标识及商品名称,由各自权利人拥有。
本文中的内容为通用性技术信息,某些信息可能不适用于您所购买的产品。
2.3.3 重启单板零丢包配置举例(聚合组成员端位于多个单板上)
3.4.2 IGP/BGP协议的FRR支持多主一备、多主多备、一主多备吗?
3.4.4 IS-IS Remote LFA快速重路由配置举例
4.1.3 EVPN VPWS多归属配置举例(多归属PE单点故障场景)
4.2.3 EVPN VPWS的FRR功能配置举例(主备PW和Bypass PW一起配置)
5.1.3 SR-MPLS TE Policy热备份功能实现零丢包配置举例
5.2.3 SR-MPLS组网的 IS-IS TI-LFA FRR配置举例
6.1.3 SRv6 IS-IS TI-LFA FRR+防微环配置举例
在网络通信中发生的丢包会影响数据传输的完整性和准确性,常见的丢包原因有网络拥塞、传输设备故障、网络延迟、链路故障等。零丢包技术通过多种手段来实现对网络传输质量的保障,确保数据在网络中的高可靠性和完整性。
随着互联网的快速发展,越来越多的应用对网络的稳定性和可靠性有了更高的要求,尤其是一些对数据传输精度要求较高的领域,如金融交易、医疗影像传输、远程教育等。在这些领域,丢包会对数据的完整性和准确性造成严重影响,因此零丢包技术对于网络的稳定性和可靠性具有重要意义。
为了实现零丢包,网络设备和协议的开发商不断进行创新和技术改进,如通过提高设备处理能力、发展流量控制、拥塞控制、链路备份、路由备份、SRv6尾节点保护技术等。在一些对网络可靠传输要求极高的场景中,零丢包技术发挥着越来越重要的作用。
零丢包的技术优点如下:
· 减少流量转发故障,提高网络可靠性。
· 支持多层面、多方式的零丢包技术,满足不同网络环境的零丢包需求。
零丢包技术的典型组网如下:
零丢包技术 |
典型组网 |
· GR · NSR · 等价路由 · 快速重路由FRR |
|
在设备之间的多条链路上配置二层动态链路聚合组或者三层动态链路聚合组,并且聚合链路两端都开启聚合流量重定向功能,可以实现聚合链路上流量的不中断。
在聚合链路两端都开启了聚合流量重定向功能后,当手工关闭聚合组内某选中端口或重启聚合组内某选中端口所在的slot、或者动态聚合组的某个链路发生故障时,系统可以将该端口上的流量重定向到其他选中端口上,从而实现聚合链路上流量的不中断。其中,已知单播报文可以实现零丢包,非已知单播报文不保证不丢包。
图1 未配置聚合流量重定向功能时发生链路故障
图2 配置聚合流量重定向功能时发生链路故障
必须在聚合链路两端都开启聚合流量重定向功能才能实现聚合链路上流量的不中断。部分设备缺省已开启设备全局和所有聚合接口的聚合流量重定向功能,请以设备的实际情况为准。
如果同时开启聚合流量重定向功能和生成树功能,在重启slot时会出现少量的丢包,因此不建议同时开启上述两个功能。
当聚合接口配置为聚合边缘接口后,聚合流量重定向功能将不能正常使用。
只有动态聚合组支持聚合流量重定向功能。
建议优先选择开启聚合接口的聚合流量重定向功能。开启全局的聚合流量重定向功能时,如果有连接其它厂商设备的聚合接口,可能影响该聚合组的正常通信。
在执行link-aggregation lacp traffic-redirect-notification enable命令后,设备会在LACP报文末尾添加一个私有字段。由于对端设备无法验证此私有字段,可能导致LACP报文验证交互失败,进而导致聚合成员端口无法成为选中端口。为了避免发生此问题,当H3C设备与第三方设备对接时,设备需要关闭聚合流量重定向功能。
聚合流量重定向功能的关键命令为:
· link-aggregation lacp traffic-redirect-notification enable(系统视图/二层聚合接口视图/三层聚合接口视图)
在系统视图下执行本命令,会开启设备所有聚合组的聚合流量重定向功能;在聚合接口视图下的配置只对当前聚合组有效。
在设备之间的多条链路上配置二层动态链路聚合组,并且聚合链路两端都开启聚合流量重定向功能,当聚合组的某个链路故障时,系统可以将该端口上的流量重定向到其他选中端口上,可以实现聚合链路上流量的不中断。
图3 二层动态聚合配置组网图
(1) 配置VLAN接口(略)。
(2) Device A配置二层动态聚合和聚合流量重定向功能。
# 创建二层聚合接口1,并配置该接口为动态聚合模式,配置聚合流量重定向功能。
[DeviceA] interface bridge-aggregation 1
[DeviceA-Bridge-Aggregation1] link-aggregation mode dynamic
[DeviceA-Bridge-Aggregation1] link-aggregation lacp traffic-redirect-notification enable
[DeviceA-Bridge-Aggregation1] quit
# 分别将端口HundredGigE1/0/1至HundredGigE1/0/3加入到聚合组1中。
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] port link-aggregation group 1
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] port link-aggregation group 1
[DeviceA-HundredGigE1/0/2] quit
[DeviceA] interface hundredgige 1/0/3
[DeviceA-HundredGigE1/0/3] port link-aggregation group 1
[DeviceA-HundredGigE1/0/3] quit
# 配置二层聚合接口1为Trunk端口,并允许VLAN 10和20的报文通过。
[DeviceA] interface bridge-aggregation 1
[DeviceA-Bridge-Aggregation1] port link-type trunk
[DeviceA-Bridge-Aggregation1] port trunk permit vlan 10 20
[DeviceA-Bridge-Aggregation1] quit
(3) 配置Device B
Device B的配置与Device A相似,配置过程略。
(4) 配置VLAN接口和IP地址。
如果网络中仅存在二层设备,则不需要此步骤。
如果网络中存在三层设备,并且需要二层聚合接口转发流量,则需要修改二层聚合接口的缺省VLAN,并且配置缺省VLAN接口的IP地址。三层报文从聚合链路转发时,会在聚合链路上进行负载分担。
# 配置VLAN接口,并将二层聚合接口加入VLAN
[DeviceA] interface bridge-aggregation 1
[DeviceA-Bridge-Aggregation1] port trunk pvid vlan 100
[DeviceA-Bridge-Aggregation1] quit
[DeviceA] vlan 100
[DeviceA-vlan100] quit
[DeviceA] interface vlan-interface 100
[DeviceA-Vlan-interface200] ip-address 2.2.2.2 24
# 配置路由。
在Device A和Device B设备上配置路由,具体过程略。
¡ 如果配置静态路由,则需要指定路由的出接口为二层聚合接口所在的VLAN接口。
¡ 如果配置动态路由,则需配置设备建立邻居关系的接口为二层聚合接口所在的VLAN接口。
配置完成后,Device A和Device B之间的二三层报文会从聚合接口转发,报文会在聚合链路的多个成员链路上进行负载分担。
(1) 查看配置信息。
# 查看Device A上所有聚合组的详细信息。
[DeviceA] display link-aggregation verbose
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Port Status: S -- Selected, U -- Unselected, I -- Individual
Port: A -- Auto port, M -- Management port, R -- Reference port
Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation,
D -- Synchronization, E -- Collecting, F -- Distributing,
G -- Defaulted, H -- Expired
Aggregate Interface: Bridge-Aggregation1
Creation Mode: Manual
Aggregation Mode: Dynamic
Loadsharing Type: Shar
Management VLANs: None
System ID: 0x8000, 000f-e267-6c6a
Local:
Port Status Priority Index Oper-Key Flag
HGE1/0/1(R) S 32768 11 1 {ACDEF}
HGE1/0/2 S 32768 12 1 {ACDEF}
HGE1/0/3 S 32768 13 1 {ACDEF}
Remote:
Actor Priority Index Oper-Key SystemID Flag
HGE1/0/1 32768 81 1 0x8000, 000f-e267-57ad {ACDEF}
HGE1/0/2 32768 82 1 0x8000, 000f-e267-57ad {ACDEF}
HGE1/0/3 32768 83 1 0x8000, 000f-e267-57ad {ACDEF}
以上信息表明,聚合组1为负载分担类型的二层动态聚合组,包含有三个选中端口。
(1) 聚合组的一个接口故障时(3切2),流量切换零丢包。
# 接口HGE1/0/1故障后,显示接口的报文接收速率统计信息,流量切换到其他接口上。
<DeviceA> display counters rate inbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
BAGG1 1 8445651 -- --
HGE1/0/1 0 0 -- --
HGE1/0/2 1 4222825 -- --
HGE1/0/3 1 4222826 -- --
Overflow: More than 14 digits.
--: Not supported.
# 接口HGE1/0/1恢复后,显示接口的报文接收速率统计信息,流量切回HGE1/0/1。
<DeviceA> display counters rate inbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
BAGG1 1 84445651 -- --
HGE1/0/1 1 28148550 -- --
HGE1/0/2 1 28148551 -- --
HGE1/0/3 1 28148550 -- --
Overflow: More than 14 digits.
--: Not supported.
(2) 聚合组仅有一个接口正常工作、其他接口故障时(3切1),流量切换零丢包。
# 接口HGE1/0/1、HGE1/0/2故障后,显示接口的报文接收速率统计信息,流量切换到HGE1/0/3接口上,该过程零丢包。
<DeviceA> display counters rate inbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
BAGG1 1 1327644 -- --
HGE1/0/1 0 0 -- --
HGE1/0/2 0 0 -- --
HGE1/0/3 1 1327644 -- --
Overflow: More than 14 digits.
--: Not supported.
# HGE1/0/1、HGE1/0/2恢复后,显示接口的报文接收速率统计信息,流量切回HGE1/0/1、和HGE1/0/2,该过程零丢包。
<DeviceA> display counters rate inbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
BAGG1 1 1327644 -- --
HGE1/0/1 1 442548 -- --
HGE1/0/2 1 442546 -- --
HGE1/0/3 1 442550 -- --
Overflow: More than 14 digits.
--: Not supported.
此场景可以实现二层聚合零丢包。三个接口组成二层聚合接口,任意一个或两个接口故障后,流量会切换到剩余的接口上,实现零丢包。
在设备之间的多条链路上配置三层动态链路聚合组,并且聚合链路两端都开启聚合流量重定向功能,当聚合组的某个链路故障时,系统可以将该端口上的流量重定向到其他选中端口上,可以实现聚合链路上流量的不中断。
图4 三层动态聚合配置组网图
(1) 在Device A配置三层动态聚合和聚合流量重定向功能。
# 创建三层聚合接口1,配置该接口为动态聚合模式,并为其配置IP地址和子网掩码。
<DeviceA> system-view
[DeviceA] interface route-aggregation 1
[DeviceA-Route-Aggregation1] link-aggregation mode dynamic
[DeviceA-Route-Aggregation1] link-aggregation lacp traffic-redirect-notification enable
[DeviceA-Route-Aggregation1] ip address 192.168.1.1 24
[DeviceA-Route-Aggregation1] quit
# 分别将接口HundredGigE1/0/1至HundredGigE1/0/3加入到聚合组1中。
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] port link-aggregation group 1
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] port link-aggregation group 1
[DeviceA-HundredGigE1/0/2] quit
[DeviceA] interface hundredgige 1/0/3
[DeviceA-HundredGigE1/0/3] port link-aggregation group 1
[DeviceA-HundredGigE1/0/3] quit
(2) 配置Device B
Device B的配置与Device A相似,配置过程略。
(3) 为三层聚合接口配置IP地址(略)。
(4) 如果组网中还存在其他设备,则需要在各设备上配置接口、IP地址和路由协议,从而实现三层互通。
¡ 对于静态路由协议,在Device A上配置时,需要指定路由的出接口为Device B的三层聚合接口地址。
¡ 对于动态路由协议,需要使用三层聚合接口地址建立邻居关系。
配置完成后,Device A和Device B之间的三层报文会从聚合接口转发,报文会在三层聚合链路的多个成员链路上进行负载分担。
# 查看Device A上所有聚合组的详细信息。
[DeviceA] display link-aggregation verbose
Loadsharing Type: Shar -- Loadsharing, NonS -- Non-Loadsharing
Port Status: S -- Selected, U -- Unselected, I -- Individual
Port: A -- Auto port, M -- Management port, R -- Reference port
Flags: A -- LACP_Activity, B -- LACP_Timeout, C -- Aggregation,
D -- Synchronization, E -- Collecting, F -- Distributing,
G -- Defaulted, H -- Expired
Aggregate Interface: Route-Aggregation1
Creation Mode: Manual
Aggregation Mode: Dynamic
Loadsharing Type: Shar
Management VLANs: None
System ID: 0x8000, 000f-e267-6c6a
Local:
Port Status Priority Index Oper-Key Flag
HGE1/0/1(R) S 32768 11 1 {ACDEF}
HGE1/0/2 S 32768 12 1 {ACDEF}
HGE1/0/3 S 32768 13 1 {ACDEF}
Remote:
Actor Priority Index Oper-Key SystemID Flag
HGE1/0/1 32768 81 1 0x8000, 000f-e267-57ad {ACDEF}
HGE1/0/2 32768 82 1 0x8000, 000f-e267-57ad {ACDEF}
HGE1/0/3 32768 83 1 0x8000, 000f-e267-57ad {ACDEF}
以上信息表明,聚合组1为负载分担类型的三层动态聚合组,包含有三个选中端口。
# 接口HGE1/0/1故障后,显示接口的报文接收速率统计信息,流量切换到其他接口上。
<DeviceA> display counters rate inbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 1 1206646 -- --
HGE1/0/3 1 1206978 -- --
RAGG1 1 2413624 -- --
Overflow: More than 14 digits.
--: Not supported.
# 恢复HGE1/0/1后,显示接口的报文接收速率统计信息,流量切回HGE1/0/1。
<DeviceA> display counters rate inbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 1 804541 -- --
HGE1/0/2 1 804542 -- --
HGE1/0/3 1 804541 -- --
RAGG1 1 2413624 -- --
Overflow: More than 14 digits.
--: Not supported.
# 接口HGE1/0/1、HGE1/0/2故障后,显示接口的报文接收速率统计信息,流量切换到HGE1/0/3接口上,该过程零丢包。
<DeviceA> display counters rate inbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 1 0 -- --
HGE1/0/3 1 2413624 -- --
RAGG1 1 2413624 -- --
Overflow: More than 14 digits.
--: Not supported.
# 恢复HGE1/0/1、HGE1/0/2后,显示接口的报文接收速率统计信息,流量切回HGE1/0/1和HGE1/0/2,该过程零丢包。
<DeviceA> display counters rate inbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 1 804541 -- --
HGE1/0/2 1 804542 -- --
HGE1/0/3 1 804541 -- --
RAGG1 1 2413624 -- --
Overflow: More than 14 digits.
--: Not supported.
此场景可以实现三层聚合零丢包。三个接口组成三层聚合接口,任意一个或两个接口故障后,流量会切换到剩余的接口上,实现零丢包。
当两台设备之间存在多条链路,并且多条链路分别位于Device B的多个单板上。为了防止Device B设备因重启单板或单板故障导致的链路故障,可以把Device A和Device B的多条链路配置在同一个动态聚合组中,并且该动态聚合组开启聚合流量重定向功能。
如果重启Device B的某个单板,Device A发送给该单板的流量会切换到其他单板上,切换过程零丢包。
图5 重启单板零丢包配置组网图(聚合组成员端位于多个单板上)
用户可以根据实际情况配置二层动态聚合或三层动态聚合,将位于不同接口板的接口加入到同一个动态聚合组,并且配置聚合流量重定向功能,具体配置过程请参考二层动态聚合、三层动态聚合零丢包配置举例。
GR(Graceful Restart,平滑重启)是一种在协议重启或主备倒换时保证转发业务不中断的机制。目前支持GR的协议有RIP、RIPng、OSPF、OSPFv3、IS-IS、BGP、LDP等。在配置时,主备进程需要运行在不同的主控板或IRF成员设备上。
以OSPF为例,未配置GR特性时,如果协议重启后或进行主备倒换,设备会重新和邻居路由器重新建立OSPF邻居关系、同步所有的路由数据、并重新进行路由计算,这样会导致网络震荡和路由转发中断。应用了GR特性之后,当设备在协议重启或主备倒换期间周边设备能维持邻居关系不变,并保持路由稳定、FIB表不变化,在设备重启后能协助设备进行路由信息同步,在尽量短的时间内使得本设备的路由信息恢复到重启前的状态,那么就可以保持网络拓扑稳定,不引起网络路由震荡、实现报文零丢包。
GR有两个角色:
· GR Restarter:发生协议重启或主备倒换,且具有GR能力的设备。
· GR Helper:和GR Restarter具有邻居关系,协助完成GR流程的设备。GR Helper也具有GR能力。
设备既可以作为GR Restarter,又可以作为GR Helper,角色由该设备在GR过程中的作用决定。
图6 GR工作机制
具体的工作流程如下:
(1) 在设备和邻居设备上都开启GR功能。
(2) GR Restarter进行协议重启或主备倒换,并通知GR Helper。
(3) 在GR期间,GR Restarter保持RIB(Routing Information Base,路由信息库)和FIB(Forwarding Information Base,转发信息库)表项,仍然按照原有的转发表项转发报文;GR Helper保持和GR Restarter的邻居关系不变。
(4) GR Restarter在协议重启或主备倒换完成后,重新与GR Helper建立邻居关系,并和GR Helper交互路由相关信息,以便GR Restarter恢复路由信息。
(5) GR Restarter在完成GR流程后,会主动通知GR Helper;或当定时器超时后,GR Restarter和GR Helper退出GR流程。
(6) 设备恢复到GR之前的状态,继续进行路由表项的学习和维护。
GR功能的关键命令为:
· graceful-restart(RIP视图)
· graceful-restart(RIPng视图)
· graceful-restart(OSPF视图)
· graceful-restart(OSPFv3视图)
· graceful-restart(IS-IS视图)
· graceful-restart(BGP实例视图)
在协议视图下执行本命令,会开启指定协议的GR功能。
配置进行GR的GR Restarter设备和协助完成GR流程的GR Helper,可以保证GR Restarter在进行协议重启或主备倒换的时候零丢包。
· 在如下组网中,Device A、Device B和Device C既属于同一自治系统,也属于同一OSPF域,通过OSPF协议实现网络互连,并提供GR机制。
· Device A作为非IETF标准GR Restarter,Device B和Device C作为GR Helper并且通过GR机制与Device A保持带外同步。
图7 OSPF GR配置组网图
(1) 配置各接口的IP地址和OSPF基本功能(略)。
(2) 配置OSPF GR
# 配置Device A作为非IETF标准GR Restarter,即使能OSPF进程100的本地链路信令能力、OSPF带外同步能力和非IETF标准GR能力。
<DeviceA> system-view
[DeviceA] ospf 100
[DeviceA-ospf-100] enable link-local-signaling
[DeviceA-ospf-100] enable out-of-band-resynchronization
[DeviceA-ospf-100] graceful-restart
[DeviceA-ospf-100] quit
# 配置Device B作为非IETF标准GR Helper,并且使能OSPF进程100的本地链路信令能力和OSPF带外同步能力。
<DeviceB> system-view
[DeviceB] ospf 100
[DeviceB-ospf-100] graceful-restart helper enable
[DeviceB-ospf-100] enable link-local-signaling
[DeviceB-ospf-100] enable out-of-band-resynchronization
# 配置Device C作为非IETF标准GR Helper,并且使能OSPF进程100的本地链路信令能力和OSPF带外同步能力。
<DeviceC> system-view
[DeviceC] ospf 100
[DeviceC-ospf-100] graceful-restart helper enable
[DeviceC-ospf-100] enable link-local-signaling
[DeviceC-ospf-100] enable out-of-band-resynchronization
# 打开Device A的OSPF平滑启动事件调试信息开关。在Device A上以GR方式重启OSPF进程。
<DeviceA> debugging ospf event graceful-restart
<DeviceA> terminal monitor
<DeviceA> terminal logging level 7
<DeviceA> reset ospf 100 process graceful-restart
Reset OSPF process? [Y/N]:y
%Oct 21 15:29:28:727 2019 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.2(HundredGigE1/0/1) from Full to Down.
%Oct 21 15:29:28:729 2019 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.3(HundredGigE1/0/1) from Full to Down.
*Oct 21 15:29:28:735 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 nonstandard GR Started for OSPF Router
*Oct 21 15:29:28:735 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 created GR wait timer,timeout interval is 40(s).
*Oct 21 15:29:28:735 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 created GR Interval timer,timeout interval is 120(s).
*Oct 21 15:29:28:758 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 created OOB Progress timer for neighbor 192.1.1.3.
*Oct 21 15:29:28:766 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 created OOB Progress timer for neighbor 192.1.1.2.
%Oct 21 15:29:29:902 2019 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.2(HundredGigE1/0/1) from Loading to Full.
*Oct 21 15:29:29:902 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 deleted OOB Progress timer for neighbor 192.1.1.2.
%Oct 21 15:29:30:897 2019 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.3(HundredGigE1/0/1) from Loading to Full.
*Oct 21 15:29:30:897 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 deleted OOB Progress timer for neighbor 192.1.1.3.
*Oct 21 15:29:30:911 2019 DeviceA OSPF/7/DEBUG:
OSPF GR: Process 100 Exit Restart,Reason : DR or BDR change,for neighbor : 192.1.1.3.
*Oct 21 15:29:30:911 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 deleted GR Interval timer.
*Oct 21 15:29:30:912 2019 DeviceA OSPF/7/DEBUG:
OSPF 100 deleted GR wait timer.
%Oct 21 15:29:30:920 2019 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.2(HundredGigE1/0/1) from Full to Down.
%Oct 21 15:29:30:921 2019 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.3(HundredGigE1/0/1) from Full to Down.
%Oct 21 15:29:33:815 2019 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.3(HundredGigE1/0/1) from Loading to Full.
%Oct 21 15:29:35:578 2019 DeviceA OSPF/5/OSPF_NBR_CHG: OSPF 100 Neighbor 192.1.1.2(HundredGigE1/0/1) from Loading to Full.
从上面的信息可以看出Device A完成了GR。
配置进行GR的GR Restarter设备和协助完成GR流程的GR Helper,可以保证GR Restarter在进行协议重启或主备倒换的时候零丢包。
图8 IS-IS GR配置组网图
(1) 配置各接口的IP地址和IS-IS基本功能(略)。
(2) 配置IS-IS GR。
# 使能Device A的IS-IS协议的GR能力。
<DeviceA> system-view
[DeviceA] isis 1
[DeviceA-isis-1] graceful-restart
[DeviceA-isis-1] quit
[DeviceA] quit
# 重启Device A的IS-IS进程。
<DeviceA> reset isis all 1 graceful-restart
Reset IS-IS process? [Y/N]:y
# 查看Device A上IS-IS协议的GR状态。
<DeviceA> display isis graceful-restart status
Restart information for IS-IS(1)
--------------------------------
Restart status: COMPLETE
Restart phase: Finish
Restart t1: 3, count 10; Restart t2: 60; Restart t3: 300
SA Bit: supported
Level-1 restart information
---------------------------
Total number of interfaces: 1
Number of waiting LSPs: 0
Level-2 restart information
---------------------------
Total number of interfaces: 1
Number of waiting LSPs: 0
如2. 图9所示,所有交换机均运行BGP协议,Device A和Device B之间建立EBGP连接,Device B和Device C之间建立IBGP连接。现要求实现即便Device B发生主备倒换,也不会影响Device A和Device C之间正在进行的数据传输。
图9 BGP GR配置组网图
(1) Device A的配置
# 配置各接口的IP地址(略)。
# 配置Device A与Device B的EBGP连接。
<DeviceA> system-view
[DeviceA] bgp 65008
[DeviceA-bgp-default] router-id 1.1.1.1
[DeviceA-bgp-default] peer 200.1.1.1 as-number 65009
# 使能BGP GR功能。
[DeviceA-bgp-default] graceful-restart
# 将8.0.0.0/8网段路由通告到BGP路由表中。
[DeviceA-bgp-default] address-family ipv4
[DeviceA-bgp-default-ipv4] network 8.0.0.0
# 使能与Device B交换BGP IPv4单播路由的能力。
[DeviceA-bgp-default-ipv4] peer 200.1.1.1 enable
(2) Device B的配置
# 配置各接口的IP地址(略)。
# 配置Device B与Device A的EBGP连接。
<DeviceB> system-view
[DeviceB] bgp 65009
[DeviceB-bgp-default] router-id 2.2.2.2
[DeviceB-bgp-default] peer 200.1.1.2 as-number 65008
# 配置Device B与Device C的IBGP连接。
[DeviceB-bgp-default] peer 9.1.1.2 as-number 65009
# 使能BGP GR功能。
[DeviceB-bgp-default] graceful-restart
# 将200.1.1.0/24和9.1.1.0/24网段路由通告到BGP路由表中。
[DeviceB-bgp-default] address-family ipv4
[DeviceB-bgp-default-ipv4] network 200.1.1.0 24
[DeviceB-bgp-default-ipv4] network 9.1.1.0 24
# 使能与Device A、Device C交换BGP IPv4单播路由的能力。
[DeviceB-bgp-default-ipv4] peer 200.1.1.2 enable
[DeviceB-bgp-default-ipv4] peer 9.1.1.2 enable
(3) Device C的配置
# 配置各接口的IP地址(略)。
# 配置Device C与Device B的IBGP连接。
<DeviceC> system-view
[DeviceC] bgp 65009
[DeviceC-bgp-default] router-id 3.3.3.3
[DeviceC-bgp-default] peer 9.1.1.1 as-number 65009
# 使能BGP GR功能。
[DeviceC-bgp-default] graceful-restart
# 使能与Device B交换BGP IPv4单播路由的能力。
[DeviceC-bgp-default] address-family ipv4
[DeviceC-bgp-default-ipv4] peer 9.1.1.1 enable
在Device A上ping Device C,同时在Device B上触发主备倒换,可以发现在整个倒换过程中Device A都可以ping通Device C。
NSR(Nonstop Routing,不间断路由):是一种通过在路由协议主备进程之间备份路由相关的信息,使得路由协议的主进程中断、或主备倒换时,备份进程能够无缝地接管主进程的工作,从而保证转发不会中断的技术。在配置时,主备进程需要运行在不同的主控板或IRF成员设备上。
目前支持NSR功能的有RIB路由管理,以及RIP、RIPng、OSPF、OSPFv3、IS-IS、BGP、LDP等路由协议。
表1 NSR与GR的区别:
特性 |
优点 |
缺点 |
GR(Graceful Restart,平滑重启) |
系统正常运行时,GR对系统的负担较小 |
邻居设备也需要配置GR功能 故障恢复时,需要较长时间恢复数据 当多个节点同时故障时,GR功能将失效 GR对于配置本功能的设备要求高: · 对于分布式设备,配置GR功能的路由协议主进程和备进程运行在不同的主控板上,因此要运行GR功能,必须至少有两个主控板 · 对于集中式IRF设备,配置GR功能的路由协议的主进程和备进程运行在不同的IRF成员设备上,因此要运行GR功能,必须进行IRF堆叠且IRF必须至少有两个成员设备 |
NSR(Nonstop Routing,不间断路由) |
对邻居设备要求低:邻居节点无需支持NSR、无需感知路由信息的变化,当协议进程异常重启或主备倒换的过程中,不需要邻居节点的帮助。 故障影响范围较小:节点故障时,备用进程可以无缝接管主进程的工作,不影响其他设备 当多个节点同时故障时,系统仍能在可控范围内运行 |
系统正常运行时,NSR需要在主备进程之间备份路由相关信息,对系统的负担较大 NSR对于配置本功能的设备要求高: · 对于分布式设备,配置NSR功能的路由协议主进程和备进程运行在不同的主控板上,因此要运行NSR功能,必须至少有两个主控板 · 对于集中式IRF设备,配置NSR功能的路由协议的主进程和备进程运行在不同的IRF成员设备上,因此要运行NSR功能,必须进行IRF堆叠且IRF必须至少有两个成员设备 |
如果在设备上配置了同一个路由协议的NSR和GR功能,则二者的关系如下:
· NSR功能优先级高于GR功能,即路由协议主进程中断时优先通过NSR确保转发不中断,设备不会作为GR Restarter启动GR流程。
· 通过GR方式重启路由协议进程后,在GR Helper协助GR Restarter恢复重启前状态时,如果GR Helper发生了主备进程倒换,则即使GR Helper上配置了NSR,也不能保证GR过程的成功。
以分布式设备为例,NSR主要包括如下三个过程:
(1) 配置NSR之后,主用主控板将路由信息和转发信息批量备份到备用主控板上。此过程中,NSR无法进行主备倒换。
(2) 主用主控板的路由信息和转发信息批量备份过程结束后,系统进入实时同步状态。路由协议的任何改变都将实时从主用主控板同步到备用主控板上。在该阶段,若主用主控板发生故障,系统可立刻进行主备倒换。
(3) 系统处于实时同步状态时,若主用主控板发生故障,备用主控板会感知到主用主控板故障,并倒换为主用主控板,接口板会将报文上送至新的主控板。由于倒换时间足够短,路由协议在主备切换的过程中不会和邻居节点断开连接,流量零丢包。
在Device S上配置NSR,要求对Device S进行主备倒换时,Device A和Device B到Device S的邻居没有中断,Device A到Device B的流量没有中断。
配置NSR功能的路由协议主进程和备进程运行在不同的主控板上或不同的IRF成员设备上,则对于Device S:
· 如果Device S是分布式设备,则必须至少有两个主控板。
· 如果Device S是集中式IRF设备,则Device S必须进行IRF堆叠且IRF必须至少有两个成员设备。
图10 OSPF NSR配置组网图
(1) 配置各设备接口的IP地址和OSPF协议。
请按照上面组网图配置各接口的IP地址和子网掩码,具体配置过程略。
配置OSPF NSR之前,则需要配置各交换机之间采用OSPF协议进行互连,确保Device S、Device A和Device B之间能够在网络层互通,并且各交换机之间能够借助OSPF协议实现动态路由更新。具体配置过程略。
(2) 配置OSPF NSR
# 使能Device S的OSPF NSR功能。
<DeviceS> system-view
[DeviceS] ospf 100
[DeviceS-ospf-100] non-stop-routing
[DeviceS-ospf-100] quit
# Device S进行主备倒换。
[DeviceS] placement reoptimize
Predicted changes to the placement
Predicted changes to the placement
Program Current location New location
---------------------------------------------------------------------
staticroute 0/0 0/0
rib 0/0 0/0
rib6 0/0 0/0
staticroute6 0/0 0/0
ospf 0/0 1/0
Continue? [y/n]:y
Re-optimization of the placement start. You will be notified on completion.
Re-optimization of the placement complete. Use 'display placement' to view the new placement.
# 查看Device A上OSPF协议的邻居和路由。
<DeviceA> display ospf peer
OSPF Process 1 with Router ID 2.2.2.1
Neighbor Brief Information
Area: 0.0.0.0
Router ID Address Pri Dead-Time State Interface
3.3.3.1 12.12.12.2 1 37 Full/BDR Vlan100
<DeviceA> display ospf routing
OSPF Process 1 with Router ID 2.2.2.1
Routing Table
Topology base (MTID 0)
Routing for network
Destination Cost Type NextHop AdvRouter Area
44.44.44.44/32 2 Stub 12.12.12.2 4.4.4.1 0.0.0.0
14.14.14.0/24 2 Transit 12.12.12.2 4.4.4.1 0.0.0.0
22.22.22.22/32 0 Stub 22.22.22.22 2.2.2.1 0.0.0.0
12.12.12.0/24 1 Transit 12.12.12.1 2.2.2.1 0.0.0.0
Total nets: 4
Intra area: 4 Inter area: 0 ASE: 0 NSSA: 0
# 查看Device B上OSPF协议的邻居和路由。
<DeviceB> display ospf peer
OSPF Process 1 with Router ID 4.4.4.1
Neighbor Brief Information
Area: 0.0.0.0
Router ID Address Pri Dead-Time State Interface
3.3.3.1 14.14.14.2 1 39 Full/BDR Vlan200
<DeviceB> display ospf routing
OSPF Process 1 with Router ID 4.4.4.1
Routing Table
Topology base (MTID 0)
Routing for network
Destination Cost Type NextHop AdvRouter Area
44.44.44.44/32 0 Stub 44.44.44.44 4.4.4.1 0.0.0.0
14.14.14.0/24 1 Transit 14.14.14.1 4.4.4.1 0.0.0.0
22.22.22.22/32 2 Stub 14.14.14.2 2.2.2.1 0.0.0.0
12.12.12.0/24 2 Transit 14.14.14.2 2.2.2.1 0.0.0.0
Total nets: 4
Intra area: 4 Inter area: 0 ASE: 0 NSSA: 0
通过上面信息可以看出在Device S发生主备倒换的时候,Device A和Device B的邻居和路由信息保持不变,从Device A到Device B的流量转发没有受到主备倒换的影响。
在主备倒换主用主控板故障情况下,此场景可以实现IS-IS协议路由和邻居信息保持不变,实现零丢包。
在Device S上配置NSR,要求对Device S进行主备倒换时,Device A和Device B到Device S的邻居没有中断,Device A到Device B的流量没有中断。
配置NSR功能的路由协议主进程和备进程运行在不同的主控板上或不同的IRF成员设备上,则对于Device S:
· 如果Device S是分布式设备,则必须至少有两个主控板。
· 如果Device S是集中式IRF设备,则Device S必须进行IRF堆叠且IRF必须至少有两个成员设备。
图11 IS-IS NSR配置组网图
(1) 配置各设备接口的IP地址和IS-IS协议。
请按照上面组网图配置各接口的IP地址和子网掩码,具体配置过程略。
配置IS-IS NSR之前,则需要配置各交换机之间采用IS-IS协议进行互连,确保Device S、Device A和Device B之间能够在网络层互通,并且各交换机之间能够借助IS-IS协议实现动态路由更新。具体配置过程略。
(2) 配置IS-IS NSR
# 使能Device S的IS-IS NSR功能。
<DeviceS> system-view
[DeviceS] isis 1
[DeviceS-isis-1] non-stop-routing
[DeviceS-isis-1] quit
# Device S进行主备倒换。
[DeviceS] placement reoptimize
Predicted changes to the placement
Program Current location New location
---------------------------------------------------------------------
staticroute 0/0 0/0
rib 0/0 0/0
rib6 0/0 0/0
staticroute6 0/0 0/0
isis 0/0 1/0
Continue? [y/n]:y
Re-optimization of the placement start. You will be notified on completion.
Re-optimization of the placement complete. Use 'display placement' to view the new placement.
# 查看Device A上IS-IS协议的邻居和路由。
<DeviceA> display isis peer
Peer information for IS-IS(1)
----------------------------
System ID: 0000.0000.0001
Interface: HGE1/0/1 Circuit Id: 0000.0000.0001.01
State: Up HoldTime: 23s Type: L1(L1L2) PRI: 64
System ID: 0000.0000.0001
Interface: HGE1/0/1 Circuit Id: 0000.0000.0001.01
State: Up HoldTime: 28s Type: L2(L1L2) PRI: 64
<DeviceA> display isis route
Route information for IS-IS(1)
-----------------------------
Level-1 IPv4 Forwarding Table
-----------------------------
IPv4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------------
12.12.12.0/24 10 NULL HGE1/0/1 Direct D/L/-
22.22.22.22/32 10 NULL Loop0 Direct D/-/-
14.14.14.0/32 10 NULL HGE1/0/1 12.12.12.2 R/L/-
44.44.44.44/32 10 NULL HGE1/0/1 12.12.12.2 R/L/-
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
Level-2 IPv4 Forwarding Table
-----------------------------
IPv4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------------
12.12.12.0/24 10 NULL HGE1/0/1 Direct D/L/-
22.22.22.22/32 10 NULL Loop0 Direct D/-/-
14.14.14.0/32 10 NULL
44.44.44.44/32 10 NULL
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
# 查看Device B上IS-IS协议的邻居和路由。
<DeviceB> display isis peer
Peer information for IS-IS(1)
----------------------------
System ID: 0000.0000.0001
Interface: HGE1/0/1 Circuit Id: 0000.0000.0001.01
State: Up HoldTime: 23s Type: L1(L1L2) PRI: 64
System ID: 0000.0000.0001
Interface: HGE1/0/1 Circuit Id: 0000.0000.0001.01
State: Up HoldTime: 28s Type: L2(L1L2) PRI: 64
<DeviceB> display isis route
Route information for IS-IS(1)
-----------------------------
Level-1 IPv4 Forwarding Table
-----------------------------
IPv4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------------
14.14.14.0/24 10 NULL HGE1/0/1 Direct D/L/-
44.44.44.44/32 10 NULL Loop0 Direct D/-/-
12.12.12.0/32 10 NULL HGE1/0/1 14.14.14.4 R/L/-
22.22.22.22/32 10 NULL HGE1/0/1 14.14.14.4 R/L/-
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
Level-2 IPv4 Forwarding Table
-----------------------------
IPv4 Destination IntCost ExtCost ExitInterface NextHop Flags
-------------------------------------------------------------------------------
14.14.14.0/24 10 NULL HGE1/0/1 Direct D/L/-
44.44.44.44/32 10 NULL Loop0 Direct D/-/-
12.12.12.0/32 10 NULL
22.22.22.22/32 10 NULL
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
通过上面信息可以看出Device A和Device B的邻居和路由信息保持不变,即NSR特性使周边设备无法感知Device S的主备倒换。
在主备倒换主用主控板故障情况下,此场景可以实现IS-IS协议路由和邻居信息保持不变,实现零丢包。
当网络故障导致路由的下一跳不可达时,设备的路由管理和路由协议会重新进行路由优选,直到选择出最优路由继续转发报文,该过程会导致报文转发中断。
通过配置等价路由,可以实现多个下一跳链路互相备份,将下一跳故障带来的影响降到最低。如果是报文出接口故障,则可以实现零丢包。报文在等价路由的多个下一跳上进行负载分担,目前支持负载分担的路由协议包括静态路由/IPv6静态路由、RIP/RIPng、OSPF/OSPFv3、IS-IS/IPv6 IS-IS和BGP/IPv6 BGP。
对于同一协议的路由,如果存在多条目的地址和开销值都相同的最优路由,则这些路由构成等价路由,报文在等价路由的多个下一跳上进行负载分担。进行负载分担的多个下一跳互相进行路径备份,当其中一条或多条路径失效时,流量会在剩下的路径上重新分配。
对于失效的下一跳路径:
· 如果失效的原因是报文的出接口down,报文会直接从其他出接口转发出去,在此过程中实现零丢包。如下图所示,本端接口down之后,报文迅速切换到其他路径上,实现零丢包。
· 如果失效的原因是中间链路故障或者下一跳接口故障,则可能会出现少量丢包,如果同时配置BFD等方式检测下一跳链路,则可以实现故障的快速检测,进而实现流量零丢包。
图12 本端接口down、报文切换到其他路径上,报文零丢包
本功能无关键命令,在配置时组网中存在到达同一目的地址的多个下一跳即可。
在ECMP组网中,报文是根据源IP、目的IP和协议号等信息生成哈希值,进行负载均衡转发的。当本端的接口故障,或者执行shutdown操作时,ECMP路径中就会有路径的下一跳变成不可达状态。此时,设备不需要从对端获得不可达的信息,而是直接通知路由表和转发表,将失效下一跳的流量切换到其他下一跳上。这样可以确保网络故障处理的完整性,从而提高设备的稳定性和可靠性。
例如,在Device A和Device B之间存在两条等价静态路由,要求实现通过Device B到达目的地址为1.2.3.4/24的报文在两条等价路由进行负载分担。当某个链路故障时,流量可以迅速切换到另一个链路。
图13 等价路由负载分担配置举例组网图
(1) 配置设备各接口的IP地址。
(2) 配置等价静态路由。
# 在Device A上配置静态路由。
<DeviceA> system-view
[DeviceA] ip route-static 1.2.3.4 24 10.1.1.2 bfd echo-packet
[DeviceA] ip route-static 1.2.3.4 24 20.1.1.2 bfd echo-packet
[DeviceA] quit
配置完成后,执行命令可以看到流量在两条链路上进行负载分担。
# 显示接口的报文接收速率统计信息。
<DeviceA> display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 2 1174779 -- --
HGE1/0/2 2 1174779 -- --
Overflow: More than 14 digits.
--: Not supported.
(1) 接口HGE1/0/2故障后,流量切换到HGE1/0/1上进行转发,此过程中不发生丢包。
# 显示接口的报文接收速率统计信息。
<DeviceA> display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 4 2349621 -- --
HGE1/0/2 0 0 -- --
Overflow: More than 14 digits.
--: Not supported.
(2) 恢复接口HGE1/0/2后,流量重新在接口HGE1/0/1、HGE1/0/2上进行负载分担,此过程中不发生丢包。
# 显示接口的报文接收速率统计信息。
<DeviceA> display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 2 1174642 -- --
HGE1/0/2 2 1174642 -- --
Overflow: More than 14 digits.
--: Not supported.
(1) 为接口HGE1/0/1和接口HGE1/0/2分别创建128个子接口和不同网段的IP地址,并且在DeviceA和DeviceB之间配置动态路由协议,配置流量在子接口上进行负载分担。
(2) shutdown其中一个物理接口的所有子接口,流量切换到另一个物理接口的所有子接口上进行负载分担,在此过程中不发生丢包。恢复这些被shutdown的子接口后,流量切换到这些接口上进行负载分担,在此过程中不发生丢包。
(1) 为接口HGE1/0/1和接口HGE1/0/2分别创建128个子接口和不同网段的IP地址,并且在DeviceA和DeviceB之间配置动态路由协议,配置流量在子接口上进行负载分担。
(2) 分别shutdown两个物理接口的一半子接口,流量切换到剩余可用的子接口上进行负载分担,在此过程中不发生丢包。恢复这些被shutdown的子接口后,流量切换到这些接口上进行负载分担,在此过程中不发生丢包。
(1) 为接口HGE1/0/1和接口HGE1/0/2分别创建128个子接口和不同网段的IP地址,并且在DeviceA和DeviceB之间配置动态路由协议,配置流量在子接口上进行负载分担。
(2) shutdown其中一个主接口,子接口上的流量会切换到另一个物理接口及子接口上进行负载分担,在此过程中,流量发生毫秒级丢包。恢复主接口后,流量切换到该主接口下的子接口上进行负载分担,在该过程中不发生丢包。
除shutdown以太网主接口会导致子接口上的流量毫秒级短暂丢包外,其他场景可以实现等价路由本端接口shutdown时零丢包。网络故障时,只要等价路由组中存在一个或多个可用的转发路径,则故障链路上的流量会切换到剩余可用路径上。
当链路或者网络节点故障后,经过故障链路或节点的报文会被丢弃,数据流量将会被中断。路由协议感知到故障后,需要重新进行路由优选,例如,IS-IS故障恢复需要经历“故障感知、LSP更新、LSP泛洪、路由计算和下发FIB”这几个过程才能让流量切换到新的链路上。对于实时性较高的业务,可以配置快速重路由功能,将低优先级路由作为备份路由下发给转发表。当设备检测到主路由故障时,会立刻使用备份路由指导报文转发,从而避免流量中断。如果设备检测故障足够及时,则可以实现报文的零丢包。建议使用BFD检测主用路由的下一跳,这样检测链路故障的速度更快,网络可靠性更高。
图14 快速重路由
用户可以配置指定路由协议的快速重路由功能,也可以配置路由不同协议间的快速重路由功能,同时配置时,指定协议的快速重路由功能优先生效。快速重路由的工作机制如下:
(1) 协议自动选择或者用户手动置路由的主用和备用下一跳:协议自动选择、或者用户手工设置路由的主用和备份下一跳,具体实现的方式以协议的实际情况为准。
¡ 如果只有一个最优路由,则可以继续进行下一步骤。
¡ 如果有多条优先级和开销值都相同的等价路由,则快速重路由功能无法为这些等价路由设置备份路由。
(2) 路由优选:路由不同协议间的快速重路由功能会优选RIB中的路由,路由协议的快速重路由功能会先优选自己协议的路由,再将最优路由下发给RIB继续优选。
(3) RIB下发路由给转发表:如果RIB判断某个路由是最优路由,并且该路由有备份下一跳,则路由的主用和备用下一跳都会下发给转发表,主用下一跳指导报文转发,备用下一跳暂不生效。
(4) 主备下一跳切换:设备检测到主用下一跳故障时,立即使用备用下一跳指导报文转发。
(5) 路由重新收敛:设备根据变化后的网络拓扑进行路由优选,选择新的最优路由指导报文转发。
快速重路由中的主用路由需要相同目的地址的备用下一跳,如下情况无法形成快速重路由保护:
· 路由不同协议间的快速重路由功能没有从RIB中找到备用下一跳。
· 路由协议的快速重路由功能没有从协议的路由表中找到备用下一跳。
· 存在多个等价的下一跳的等价路由。
路由不同协议间的快速重路由功能可以为RIB(Routing Information Base,路由信息库)中的路由设置备份下一跳。对于目的地址相同的多条路由,最优路由的下一跳作为主用下一跳,次优路由的下一跳作为备用下一跳,最优路由和次优路由的协议不同。
用户可以为静态路由指定备用出接口和下一跳,也可以配置设备自动查找静态路由的次优下一跳作为备用下一跳。
RIP/RIPng协议的快速重路由功能可以为路由自动查找RIP/RIPng的次优下一跳作为备用下一跳。
OSPFv3/IPv6 IS-IS协议的快速重路由功能可以使用如下方式设置备份下一跳:
· LFA(Loop Free Alternate,拓扑无关无环路备份)算法自动查找:LFA利用现有的SPF算法将所有计算、备份都在本地完成,计算过程相对简单,不需要对OSPF/ISIS协议进行扩展。
· 通过路由策略手工指定:为符合过滤条件的路由指定备份下一跳。
LFA算法以可提供备份链路的邻居为根节点,利用SPF(Shortest Path First)算法计算出到目的节点的最短距离。然后,按照LFA不等式计算出一组开销最小且无环的备份链路。LFA不等式:Distance_opt(N,D) < Distance_opt(N,S) + Distance_opt(S,D)。
例如下图所示,DeviceA为流量转发的源节点,DeviceB为流量转发的目的节点,DeviceD为可提供备份链路的邻居,LFA算法的计算步骤为:
(1) 选取可以提供备份链路的邻居节点DeviceD,即备份下一跳的节点。
(2) 利用SPF算法计算出备份链路节DeviceD到流量目的节点DeviceB的最短路径距离d。
(3) 计算备份链路节点DeviceD到流量源节点DeviceA之间的最短路径距离c。
(4) 计算流量源节点DeviceA到流量目的节点DeviceB直接的最短路径距离a+b。
(5) 如果d<a+b+c,则该链路可以作为快速重路由的备份链路。如果d≥a+b+c,则选路失败。
(6) 如果有多个选路成功的备份链路,则选择开销值最小的备份链路。
图15 LFA算法示意图
IS-IS/OSPF协议的快速重路由功能可以使用如下方式设置备份下一跳:
· 使用LFA算法自动查找备份下一跳。
· 通过路由策略手工指定备份下一跳。
· 使用Remote LFA自动查找备份下一跳。
和OSPFv3/IPv6 IS-IS协议不同,IS-IS/OSPF协议支持使用Remote LFA自动查找备份下一跳。LFA算法只在本地节点选择备用路径,对于某些大型组网,特别是环形组网,无法计算出备份路径,不能满足可靠性要求。Remote LFA算法则会在整个网络中根据保护路径计算PQ节点,并在源节点和PQ节点之间建立LDP隧道形成备份下一跳保护,当保护链路发生故障时,流量自动切换到隧道备份路径,从而提高网络可靠性。
Remote LFA主要涉及以下概念:
· P空间:以保护链路(避免出现故障的链路)源端为根节点建立SPF树,所有从根节点不经过保护链路可达的节点集合称为P空间。
· 扩展P空间:以保护链路源端的所有邻居为根节点分别建立SPF树,所有从根节点不经过保护链路可达的节点集合称为扩展P空间。
· Q空间:以保护链路末端为根节点建立反向SPF树,所有从根节点不经过保护链路可达的节点集合称为Q空间。
· PQ节点:PQ节点是指既在扩展P空间又在Q空间的节点。在Remote LFA中,PQ节点会作为保护隧道的目的端。
如图16所示,链路中间的数字表示cost值。假设流量路径为PE 1->P 1->P 2->PE 2,为避免P 1、P 2之间的链路故障导致流量丢失,Remote LFA会计算出PQ节点P 4,并在P 1和PQ节点之间建立LDP隧道。当P 1检测到P 1、P 2之间的链路故障时,将报文封装为MPLS报文转发给P 4,P 4收到该报文后,去掉MPLS标签,重新查找IP路由表,将报文转发给下一跳,并最终到达目的地PE 2,实现了快速保护,避免流量丢失。
在图16中,PQ节点的计算过程为:
· 分别计算以所有P 1的邻居(不包括通过保护链路的邻居)为根的SPF树,每棵SPF树中从根节点不经过P 1->P 2链路可达的节点为P空间,所有邻居的P空间集合得到扩展P空间{PE 1,P 1,P 3,P 4}。
· 计算以P 2为根节点的反向SPF树,得到Q空间{PE 2,P 4}。
· 通过扩展P空间和Q空间得到既在扩展P空间又在Q空间的节点,即PQ节点{P 4}。
图16 Remote LFA典型组网图
BGP协议的快速重路由功能可以使用如下方式设置备份下一跳:
· BGP自动选择备份路由:只要从不同BGP对等体学习到了到达同一目的网络的路由,且这些路由不等价,就会生成主备两条路由。
· 通过路由策略手工指定:为符合过滤条件的路由指定备份下一跳。
对于IGP/BGP协议,目前不支持多主多备、一主多备,即快速重路由功能不支持为路由设置多个备份下一跳。只有一个备份下一跳会和主用下一跳一起下发给FIB转发表。如果组网中存在多条低优先级链路,则只有优先级最高的备用链路下一跳才会成为FRR的备用下一跳。
除OSPF和IPv4 IS-IS协议外,其他协议不支持多主一备。
对于OSPF和IPv4 IS-IS协议,部分设备支持多主一备,支持为等价路由通过LFA算法选取共享的备份下一跳信息,具体配置方法为:
· 执行fast-reroute(IS-IS IPv4单播地址族视图/IS-IS IPv4单播拓扑视图)命令配置IS-IS支持快速重路由功能时,指定ecmp-shared参数。
· 执行fast-reroute(OSPF视图/OSPF IPv4单播拓扑视图)命令配置OSPF快速重路由功能时,指定ecmp-shared参数。
配置完成后,如果设备中存在等价路由和次优路由,LFA算法会将次优路由设置为备份路由。
配置快速重路由功能的主要命令如下:
· inter-protocol fast-reroute(RIB IPv4地址族视图/RIB IPv6地址族视图)命令用来开启RIB IPv4/IPv6地址族的不同协议间快速重路由功能。
· ip route-static fast-reroute auto(系统视图)命令用来配置静态路由自动快速重路由功能。
· fast-reroute(RIP视图)命令用来配置RIP快速重路由功能。
· fast-reroute(RIPng视图)命令用来配置RIPng快速重路由功能。
· fast-reroute(OSPF视图/OSPF IPv4单播拓扑视图)命令用来配置OSPF快速重路由功能。
· fast-reroute(OSPFv3视图)命令用来配置OSPFv3快速重路由功能。
· fast-reroute(IS-IS IPv4单播地址族视图/IS-IS IPv4单播拓扑视图/IS-IS IPv6单播地址族视图)命令用来配置IS-IS支持快速重路由功能。
· pic(BGP IPv4单播地址族视图、BGP-VPN IPv4单播地址族视图、BGP IPv6单播地址族视图、BGP-VPN IPv6单播地址族视图)命令用来开启当前地址族的BGP快速重路由功能。
· fast-reroute route-policy(BGP IPv4单播地址族视图、BGP-VPN IPv4单播地址族视图、BGP IPv6单播地址族视图、BGP-VPN IPv6单播地址族视图)命令用来在当前BGP地址族视图下指定快速重路由引用的路由策略,并且在引用的路由策略中,通过apply [ ipv6 ] fast-reroute backup-nexthop命令指定备份下一跳的地址。
如2. 图17所示,Device A、Device B、Device C和Device D属于同一IS-IS区域,通过IS-IS协议实现网络互连,且配置MPLS LDP功能。当DeviceA和Device B之间的链路Link A出现故障时,链路Link B上存在环路,流量无法通过Device C转发到目的节点Device B。通过部署Remote LFA FRR消除环路,同时使流量可以快速切换到链路Link B。
图17 IS-IS Remote LFA快速重路由配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
HGE1/0/1 |
12.12.12.1/24 |
Device B |
HGE1/0/1 |
12.12.12.2/24 |
|
HGE1/0/2 |
13.13.13.1/24 |
|
HGE1/0/2 |
15.15.15.1/24 |
|
Loop1 |
1.1.1.1/32 |
|
Loop1 |
2.2.2.2/32 |
Device C |
HGE1/0/1 |
13.13.13.2/24 |
Device D |
HGE1/0/1 |
15.15.15.2/24 |
|
HGE1/0/2 |
14.14.14.1/24 |
|
HGE1/0/2 |
14.14.14.2/24 |
|
Loop1 |
3.3.3.3/32 |
|
Loop1 |
4.4.4.4/32 |
按照组网图配置各接口的IP地址。
(1) 配置IS-IS协议实现网络层互通,并开启MPLS LDP功能
# 配置Device A。
<DeviceA> system-view
[DeviceA] mpls lsr-id 1.1.1.1
[DeviceA] mpls ldp
[DeviceA-ldp] accept target-hello all
[DeviceA-ldp] quit
[DeviceA] isis 1
[DeviceA-isis-1] network-entity 00.0000.0000.0001.00
[DeviceA-isis-1] quit
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] isis enable 1
[DeviceA-HundredGigE1/0/1] isis cost 10
[DeviceA-HundredGigE1/0/1] mpls enable
[DeviceA-HundredGigE1/0/1] mpls ldp enable
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] isis enable 1
[DeviceA-HundredGigE1/0/2] isis cost 20
[DeviceA-HundredGigE1/0/2] mpls enable
[DeviceA-HundredGigE1/0/2] mpls ldp enable
[DeviceA-HundredGigE1/0/2] quit
[DeviceA] interface loopback 1
[DeviceA-LoopBack1] isis enable 1
[DeviceA-LoopBack1] quit
# 配置Device B。
<DeviceB> system-view
[DeviceB] mpls lsr-id 2.2.2.2
[DeviceB] mpls ldp
[DeviceB-ldp] accept target-hello all
[DeviceB-ldp] quit
[DeviceB] isis 1
[DeviceB-isis-1] network-entity 00.0000.0000.0002.00
[DeviceB-isis-1] quit
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] isis enable 1
[DeviceB-HundredGigE1/0/1] isis cost 10
[DeviceB-HundredGigE1/0/1] mpls enable
[DeviceB-HundredGigE1/0/1] mpls ldp enable
[DeviceB-HundredGigE1/0/1] quit
[DeviceB] interface hundredgige 1/0/2
[DeviceB-HundredGigE1/0/2] isis enable 1
[DeviceB-HundredGigE1/0/2] isis cost 20
[DeviceB-HundredGigE1/0/2] mpls enable
[DeviceB-HundredGigE1/0/2] mpls ldp enable
[DeviceB-HundredGigE1/0/2] quit
[DeviceB] interface loopback 1
[DeviceB-LoopBack1] isis enable 1
[DeviceB-LoopBack1] quit
# 配置Device C。
<DeviceC> system-view
[DeviceC] mpls lsr-id 3.3.3.3
[DeviceC] mpls ldp
[DeviceC-ldp] accept target-hello all
[DeviceC-ldp] quit
[DeviceC] isis 1
[DeviceC-isis-1] network-entity 00.0000.0000.0003.00
[DeviceC-isis-1] quit
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] isis enable 1
[DeviceC-HundredGigE1/0/1] isis cost 20
[DeviceC-HundredGigE1/0/1] mpls enable
[DeviceC-HundredGigE1/0/1] mpls ldp enable
[DeviceC-HundredGigE1/0/1] quit
[DeviceC] interface hundredgige 1/0/2
[DeviceC-HundredGigE1/0/2] isis enable 1
[DeviceC-HundredGigE1/0/2] isis cost 20
[DeviceC-HundredGigE1/0/2] mpls enable
[DeviceC-HundredGigE1/0/2] mpls ldp enable
[DeviceC-HundredGigE1/0/2] quit
[DeviceC] interface loopback 1
[DeviceC-LoopBack1] isis enable 1
[DeviceC-LoopBack1] quit
# 配置Device D。
<DeviceD> system-view
[DeviceD] mpls lsr-id 4.4.4.4
[DeviceD] mpls ldp
[DeviceD-ldp] accept target-hello all
[DeviceD-ldp] quit
[DeviceD] isis 1
[DeviceD-isis-1] network-entity 00.0000.0000.0004.00
[DeviceD-isis-1] quit
[DeviceD] interface hundredgige 1/0/1
[DeviceD-HundredGigE1/0/1] isis enable 1
[DeviceD-HundredGigE1/0/1] isis cost 20
[DeviceD-HundredGigE1/0/1] mpls enable
[DeviceD-HundredGigE1/0/1] mpls ldp enable
[DeviceD-HundredGigE1/0/1] quit
[DeviceD] interface hundredgige 1/0/2
[DeviceD-HundredGigE1/0/2] isis enable 1
[DeviceD-HundredGigE1/0/2] isis cost 20
[DeviceD-HundredGigE1/0/2] mpls enable
[DeviceD-HundredGigE1/0/2] mpls ldp enable
[DeviceD-HundredGigE1/0/2] quit
[DeviceD] interface loopback 1
[DeviceD-LoopBack1] isis enable 1
[DeviceD-LoopBack1] quit
(2) 配置IS-IS Remote LFA FRR
# 配置Device A。
[DeviceA] isis 1
[DeviceA-isis-1] address-family ipv4
[DeviceA-isis-1-ipv4] fast-reroute lfa
[DeviceA-isis-1-ipv4] fast-reroute remote-lfa tunnel ldp
[DeviceA-isis-1-ipv4] quit
[DeviceA-isis-1] quit
(1) 查看配置
# 在Device A上查看2.2.2.2/32路由,可以看到备份下一跳信息。
[DeviceA] display isis route ipv4 2.2.2.2 32 verbose
Route information for IS-IS(1)
------------------------------
Level-1 IPv4 Forwarding Table
-----------------------------
IPv4 Dest : 2.2.2.2/32 Int. Cost : 10 Ext. Cost : NULL
Admin Tag : - Src Count : 1 Flag : R/L/-
InLabel : 4294967295 InLabel Flag: -/-/-/-/-/-
NextHop : Interface : ExitIndex :
12.12.12.2 HGE1/0/1 0x00000002
Nib ID : 0x14000008 OutLabel : 4294967295 OutLabelFlag: -
LabelSrc : N/A Delay Flag : N/A
Remote-LFA:
Interface : HGE1/0/2
BkNextHop : 13.13.13.2 LsIndex : 0x01000002
Tunnel destination address: 4.4.4.4
Backup label: {1149}
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
InLabel flags: R-Readvertisement, N-Node SID, P-no PHP
E-Explicit null, V-Value, L-Local
OutLabelFlags: E-Explicit null, I-Implicit null, N-Nomal, P-SR label prefer
Level-2 IPv4 Forwarding Table
-----------------------------
IPv4 Dest : 2.2.2.2/32 Int. Cost : 10 Ext. Cost : NULL
Admin Tag : - Src Count : 3 Flag : -/-/-
InLabel : 4294967295 InLabel Flag: -/-/-/-/-/-
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
InLabel flags: R-Readvertisement, N-Node SID, P-no PHP
E-Explicit null, V-Value, L-Local
OutLabelFlags: E-Explicit null, I-Implicit null, N-Nomal, P-SR label prefer
(2) 流量切换
# 查看主用下一跳的流量。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 6 3905728 -- --
HGE1/0/2 0 0 -- --
Overflow: More than 14 digits.
--: Not supported.
# 主用出接口HGE1/0/1故障,流量切换到备用出接口HGE1/0/2,在此过程中零丢包。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 6 3905728 -- --
Overflow: More than 14 digits.
--: Not supported.
# 恢复主用出接口HGE1/0/1,流量切换回HGE1/0/1,在此过程中零丢包。
此场景IS-IS主用下一跳的零丢包。主用下一跳发送故障时,流量迅速切换到备用下一跳。
如图18所示,Device A和Device D之间存在两条链路。为了实现链路故障时的流量零丢包,可以配置低优先级的链路A作为备用,链路B正常时,Device A和Device D之间的流量通过链路B转发;链路B出现故障时,流量可以快速切换到链路A上。
图18 配置BGP快速重路由组网图
(1) 配置各接口的IP地址、OSPF(略)。
(2) 在AS 200内配置OSPF,发布接口地址所在网段的路由(包括Loopback接口),确保Device B、Device C和Device D之间路由可达(略)。
(3) 配置BGP连接
# 配置Device A分别与Device B和Device C建立EBGP会话,并配置通过BGP发布路由1.1.1.1/32。
<DeviceA> system-view
[DeviceA] bgp 100
[DeviceA-bgp-default] router-id 1.1.1.1
[DeviceA-bgp-default] peer 10.1.1.2 as-number 200
[DeviceA-bgp-default] peer 30.1.1.3 as-number 200
[DeviceA-bgp-default] address-family ipv4 unicast
[DeviceA-bgp-default-ipv4] peer 10.1.1.2 enable
[DeviceA-bgp-default-ipv4] peer 30.1.1.3 enable
[DeviceA-bgp-default-ipv4] network 1.1.1.1 32
# 配置Device B与Device A建立EBGP会话,与Device D建立IBGP会话。
<DeviceB> system-view
[DeviceB] bgp 200
[DeviceB-bgp-default] router-id 2.2.2.2
[DeviceB-bgp-default] peer 10.1.1.1 as-number 100
[DeviceB-bgp-default] peer 4.4.4.4 as-number 200
[DeviceB-bgp-default] peer 4.4.4.4 connect-interface loopback 0
[DeviceB-bgp-default] address-family ipv4 unicast
[DeviceB-bgp-default-ipv4] peer 10.1.1.1 enable
[DeviceB-bgp-default-ipv4] peer 4.4.4.4 enable
[DeviceB-bgp-default-ipv4] peer 4.4.4.4 next-hop-local
[DeviceB-bgp-default-ipv4] quit
[DeviceB-bgp-default] quit
# 配置Device C与Device A建立EBGP会话,与Device D建立IBGP会话。
<DeviceC> system-view
[DeviceC] bgp 200
[DeviceC-bgp-default] router-id 3.3.3.3
[DeviceC-bgp-default] peer 30.1.1.1 as-number 100
[DeviceC-bgp-default] peer 4.4.4.4 as-number 200
[DeviceC-bgp-default] peer 4.4.4.4 connect-interface loopback 0
[DeviceC-bgp-default] address-family ipv4 unicast
[DeviceC-bgp-default-ipv4] peer 30.1.1.1 enable
[DeviceC-bgp-default-ipv4] peer 4.4.4.4 enable
[DeviceC-bgp-default-ipv4] peer 4.4.4.4 next-hop-local
[DeviceC-bgp-default-ipv4] quit
[DeviceC-bgp-default] quit
# 配置Device D分别与Device B和Device C建立IBGP会话,并配置BGP发布路由4.4.4.4/32。
<DeviceD> system-view
[DeviceD] bgp 200
[DeviceD-bgp-default] router-id 4.4.4.4
[DeviceD-bgp-default] peer 2.2.2.2 as-number 200
[DeviceD-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[DeviceD-bgp-default] peer 3.3.3.3 as-number 200
[DeviceD-bgp-default] peer 3.3.3.3 connect-interface loopback 0
[DeviceD-bgp-default] address-family ipv4 unicast
[DeviceD-bgp-default-ipv4] peer 2.2.2.2 enable
[DeviceD-bgp-default-ipv4] peer 3.3.3.3 enable
[DeviceD-bgp-default-ipv4] network 4.4.4.4 32
(4) 修改路由的首选值,使得Device A和Device D之间的流量优先通过链路B转发
# 在Device A上配置从Device B接收到的路由的首选值为100。
[DeviceA-bgp-default-ipv4] peer 10.1.1.2 preferred-value 100
[DeviceA-bgp-default-ipv4] quit
[DeviceA-bgp-default] quit
# 在Device D上配置从Device B接收到的路由的首选值为100。
[DeviceD-bgp-default-ipv4] peer 2.2.2.2 preferred-value 100
[DeviceD-bgp-default-ipv4] quit
[DeviceD-bgp-default] quit
(5) 配置BGP快速重路由
# 配置Device A:配置通过Echo方式的BFD会话检测主路由的下一跳是否可达,并配置BFD echo报文的源IP地址为11.1.1.1;创建路由策略frr,为路由4.4.4.4/32指定备份下一跳的地址为30.1.1.3(对等体Device C的地址);在BGP IPv4单播地址族下应用该路由策略。
[DeviceA] bfd echo-source-ip 11.1.1.1
[DeviceA] ip prefix-list abc index 10 permit 4.4.4.4 32
[DeviceA] route-policy frr permit node 10
[DeviceA-route-policy] if-match ip address prefix-list abc
[DeviceA-route-policy] apply fast-reroute backup-nexthop 30.1.1.3
[DeviceA-route-policy] quit
[DeviceA] bgp 100
[DeviceA-bgp-default] primary-path-detect bfd echo
[DeviceA-bgp-default] address-family ipv4 unicast
[DeviceA-bgp-default-ipv4] fast-reroute route-policy frr
[DeviceA-bgp-default-ipv4] quit
[witchA-bgp-default] quit
# 配置Device D:配置通过Echo方式的BFD会话检测主路由的下一跳是否可达,并配置BFD echo报文的源IP地址为44.1.1.1;创建路由策略frr,为路由1.1.1.1/32指定备份下一跳的地址为3.3.3.3(对等体Device C的地址);在BGP IPv4单播地址族下应用该路由策略。
[DeviceD] bfd echo-source-ip 44.1.1.1
[DeviceD] ip prefix-list abc index 10 permit 1.1.1.1 32
[DeviceD] route-policy frr permit node 10
[DeviceD-route-policy] if-match ip address prefix-list abc
[witchD-route-policy] apply fast-reroute backup-nexthop 3.3.3.3
[DeviceD-route-policy] quit
[DeviceD] bgp 200
[DeviceD-bgp-default] primary-path-detect bfd echo
[DeviceD-bgp-default] address-family ipv4 unicast
[DeviceD-bgp-default-ipv4] fast-reroute route-policy frr
[DeviceD-bgp-default-ipv4] quit
[DeviceD-bgp-default] quit
(1) 查看配置
# 在Device A上查看4.4.4.4/32路由,可以看到备份下一跳信息。
[DeviceA] display ip routing-table 4.4.4.4 32 verbose
Summary count : 1
Destination: 4.4.4.4/32
Protocol: BGP Process ID: 0
SubProtID: 0x2 Age: 00h01m52s
Cost: 0 Preference: 255
IpPre: N/A QosLocalID: N/A
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 200
NibID: 0x15000003 LastAs: 200
AttrID: 0x5 Neighbor: 10.1.1.2
Flags: 0x10060 OrigNextHop: 10.1.1.2
Label: NULL RealNextHop: 10.1.1.2
BkLabel: NULL BkNextHop: 30.1.1.3
SRLabel: NULL Interface: HundredGigE1/0/1
BkSRLabel: NULL BkInterface: HundredGigE1/0/2
Tunnel ID: Invalid IPInterface: HundredGigE1/0/1
BkTunnel ID: Invalid BKIPInterface: N/A
InLabel: NULL ColorInterface: N/A
SIDIndex: NULL BKColorInterface: N/A
FtnIndex: 0x0 TunnelInterface: N/A
TrafficIndex: N/A BKTunnelInterface: N/A
Connector: N/A PathID: 0x0
SRTunnelID: Invalid
SID Type: N/A NID: Invalid
FlushNID: Invalid BkNID: Invalid
BkFlushNID: Invalid StatFlags: 0x0
Exp: N/A
VpnPeerId: N/A Dscp: N/A
SID: N/A OrigLinkID: 0x0
BkSID: N/A RealLinkID: 0x0
CommBlockLen: 0
# 在Device D上查看1.1.1.1/32路由,可以看到备份下一跳信息。
[DeviceD] display ip routing-table 1.1.1.1 32 verbose
Summary count : 1
Destination: 1.1.1.1/32
Protocol: BGP Process ID: 0
SubProtID: 0x1 Age: 00h00m36s
Cost: 0 Preference: 255
IpPre: N/A QosLocalID: N/A
Tag: 0 State: Active Adv
OrigTblID: 0x0 OrigVrf: default-vrf
TableID: 0x2 OrigAs: 100
NibID: 0x15000003 LastAs: 100
AttrID: 0x1 Neighbor: 2.2.2.2
Flags: 0x10060 OrigNextHop: 2.2.2.2
Label: NULL RealNextHop: 20.1.1.2
BkLabel: NULL BkNextHop: 40.1.1.3
SRLabel: NULL Interface: HundredGigE1/0/1
BkSRLabel: NULL BkInterface: HundredGigE1/0/2
Tunnel ID: Invalid IPInterface: HundredGigE1/0/1
BkTunnel ID: Invalid BKIPInterface: N/A
InLabel: NULL ColorInterface: N/A
SIDIndex: NULL BKColorInterface: N/A
FtnIndex: 0x0 TunnelInterface: N/A
TrafficIndex: N/A BKTunnelInterface: N/A
Connector: N/A PathID: 0x0
SRTunnelID: Invalid
SID Type: N/A NID: Invalid
FlushNID: Invalid BkNID: Invalid
BkFlushNID: Invalid StatFlags: 0x0
Exp: N/A
VpnPeerId: N/A Dscp: N/A
SID: N/A OrigLinkID: 0x0
BkSID: N/A RealLinkID: 0x0
CommBlockLen: 0
(2) 流量切换。
正常情况下,DeviceA设备发往目的地址4.4.4.4/32的流量从接口HGE1/0/1发送出去。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 6 3906302 -- --
HGE1/0/2 0 0 -- --
Overflow: More than 14 digits.
--: Not supported.
当Device A的主用出接口HGE1/0/1发生故障时,流量迅速切换到备用接口HGE1/0/2,在此过程中流量零丢包。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 6 3906626 -- --
Overflow: More than 14 digits.
--: Not supported.
当当Device A的主用出接口HGE1/0/1恢复时,流量切换回HGE1/0/1,在此过程中流量零丢包。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 6 3906152 -- --
HGE1/0/2 0 0 -- --
Overflow: More than 14 digits.
--: Not supported.
在EVPN VPWS组网环境中,可以通过配置多归属站点和FRR功能,实现零丢包。
当一个站点通过不同的以太网链路连接到多台PE时,这些链路就构成了一个ES(Ethernet Segment,以太网段),并以一个相同的ESI(ES Identifier)标识其属于同一个ES。连接的多台PE组成冗余备份组,可以避免PE单点故障对网络造成影响,从而提高网络的可靠性。目前仅支持双归属。
EVPN VPWS组网场景支持的冗余备份模式包括:单活冗余模式和多活冗余模式。
· 在单活冗余模式下,站点连接到的两个PE仅一台转发流量,PE 1和PE 2上的两条PW为主备关系,实现当主PW出现故障后,将流量立即切换到备份PW,使流量转发得以继续。
· 在多活冗余模式下,两条PW等价负载分担转发数据报文。当其中一条PW故障时,流量立刻切换到另一条PW。
配置单活冗余或者多活冗余模式时,需要在PE设备AC侧的物理接口与PW侧的物理接口(用于建立EVPN PW的接口)配置EAA和Track联动的CLI监控策略,使这两个接口联动,可以确保PW侧的Underlay网络断开时,将AC侧的接口置于Down状态,使CE 1到CE 2的流量通过PE 2转发,提高网络可靠性。
配置EVPN VPWS多归属站点功能的关键命令如下:
· evpn redundancy-mode(接口视图)命令配置接口的冗余备份模式,若需两条EVPN PW间形成主备关系,则使用单活冗余模式;若需EVPN PW间形成等价负载分担,则使用多活冗余模式。
用户网络有两个站点,分别为CE 1和CE 2。CE 1多归属于PE 1和PE 2,CE 2为PE 3下的单归属设备。CE 1和CE 2希望通过在骨干网上建立的EVPN PW,实现站点1与站点2互联。
CE 1连接的多台PE组成冗余备份组,冗余备份模式为多活冗余模式,可以避免PE单点故障对网络造成影响,从而提高网络的可靠性。
图21 EVPN VPWS多归属配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
PE 1 |
Loop0 |
192.1.1.1/32 |
CE 1 |
HGE1/0/1 |
100.1.1.1/24 |
|
HGE1/0/1 |
- |
CE 2 |
HGE1/0/1 |
100.1.1.2/24 |
|
HGE1/0/2 |
10.1.1.1/24 |
PE 3 |
Loop0 |
192.3.3.3/32 |
|
HGE1/0/3 |
10.1.3.1/24 |
|
HGE1/0/1 |
- |
PE 2 |
Loop0 |
192.2.2.2/32 |
|
HGE1/0/2 |
10.1.1.2/24 |
|
HGE1/0/1 |
- |
|
HGE1/0/3 |
10.1.2.2/24 |
|
HGE1/0/2 |
10.1.2.1/24 |
|
|
|
|
HGE1/0/3 |
10.1.3.2/24 |
|
|
|
(1) 配置CE 1
# 创建三层聚合接口1,采用静态聚合模式,并为其配置IP地址和子网掩码。
<CE1> system-view
[CE1] interface route-aggregation 1
[CE1-Route-Aggregation1] ip address 100.1.1.1 24
[CE1-Route-Aggregation1] quit
# 将接口HundredGigE1/0/1至HundredGigE1/0/2加入到聚合组1中。
[CE1] interface hundredgige 1/0/1
[CE1-HundredGigE1/0/1] port link-aggregation group 1
[CE1-HundredGigE1/0/1] quit
[CE1] interface hundredgige 1/0/2
[CE1-HundredGigE1/0/2] port link-aggregation group 1
[CE1-HundredGigE1/0/2] quit
(2) 配置PE 1
# 配置LSR ID。
<PE1> system-view
[PE1] interface loopback 0
[PE1-LoopBack0] ip address 192.1.1.1 32
[PE1-LoopBack0] quit
[PE1] mpls lsr-id 192.1.1.1
# 开启L2VPN功能。
[PE1] l2vpn enable
# 全局使能LDP。
[PE1] mpls ldp
[PE1-ldp] quit
# 配置连接PE3的接口HundredGigE1/0/2,在此接口上使能LDP。
[PE1] interface hundredgige 1/0/2
[PE1-HundredGigE1/0/2] ip address 10.1.1.1 24
[PE1-HundredGigE1/0/2] mpls enable
[PE1-HundredGigE1/0/2] mpls ldp enable
[PE1-HundredGigE1/0/2] quit
# 在PE 1上运行OSPF,用于建立LSP。
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 192.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# 在PE 1,PE2和PE 3之间建立IBGP连接,并配置通过BGP发布路由信息。
[PE1] bgp 100
[PE1-bgp-default] peer 192.2.2.2 as-number 100
[PE1-bgp-default] peer 192.2.2.2 connect-interface loopback 0
[PE1-bgp-default] peer 192.3.3.3 as-number 100
[PE1-bgp-default] peer 192.3.3.3 connect-interface loopback 0
[PE1-bgp-default] address-family l2vpn evpn
[PE1-bgp-default-evpn] peer 192.2.2.2 enable
[PE1-bgp-default-evpn] peer 192.3.3.3 enable
[PE1-bgp-default-evpn] peer 192.2.2.2 advertise encap-type mpls
[PE1-bgp-default-evpn] peer 192.3.3.3 advertise encap-type mpls
[PE1-bgp-default-evpn] quit
[PE1-bgp-default] quit
# 在接入站点的接口HundredGigE1/0/1下配置ESI值和接口的冗余备份模式。
[PE1] interface hundredgige 1/0/1
[PE1-HundredGigE1/0/1] esi 1.1.1.1.1
[PE1-HundredGigE1/0/1] evpn redundancy-mode all-active
[PE1-HundredGigE1/0/1] quit
# 创建交叉连接组vpna和交叉连接组EVPN实例,并指定EVPN采用MPLS封装,同时配置交叉连接组EVPN实例的RD与RT。
[PE1] xconnect-group vpna
[PE1-xcg-vpna] evpn encapsulation mpls
[PE1-xcg-vpna-evpn-mpls] route-distinguisher 1:1
[PE1-xcg-vpna-evpn-mpls] vpn-target 1:1 export-extcommunity
[PE1-xcg-vpna-evpn-mpls] vpn-target 1:1 import-extcommunity
[PE1-xcg-vpna-evpn-mpls] quit
# 创建交叉连接pw1,将接口HundredGigE1/0/1与此交叉连接关联,并在交叉连接内创建EVPN PW,以实现AC和EVPN PW关联。
[PE1] xconnect-group vpna
[PE1-xcg-vpna] connection pw1
[PE1-xcg-vpna-pw1] ac interface hundredgige 1/0/1
[PE1-xcg-vpna-pw1-HundredGigE1/0/1] quit
[PE1-xcg-vpna-pw1] evpn local-service-id 1 remote-service-id 2
[PE1-xcg-vpna-pw1] quit
[PE1-xcg-vpna] quit
# 配置Track项监控接口HundredGigE1/0/2的状态。
[PE1] track 1 interface hundredgige 1/0/2
[PE1-track-1] quit
# 配置Tcl监控策略,当HundredGigE1/0/2状态变为Down后,PE1能自动感知,并将HundredGigE1/0/1接口shutdown。
[PE1] rtm cli-policy policy1
[PE1-rtm-policy1] event track 1 state negative
[PE1-rtm-policy1] action 0 cli system-view
[PE1-rtm-policy1] action 1 cli interface HundredGigE1/0/1
[PE1-rtm-policy1] action 2 cli shutdown
[PE1-rtm-policy1] user-role network-admin
[PE1-rtm-policy1] commit
[PE1-rtm-policy1] quit
(3) 配置PE 2
# 配置LSR ID。
<PE2> system-view
[PE2] interface loopback 0
[PE2-LoopBack0] ip address 192.2.2.2 32
[PE2-LoopBack0] quit
[PE2] mpls lsr-id 192.2.2.2
# 开启L2VPN功能。
[PE2] l2vpn enable
# 全局使能LDP。
[PE2] mpls ldp
[PE2-ldp] quit
# 配置连接PE 3的接口HundredGigE1/0/2,在此接口上使能LDP。
[PE2] interface hundredgige 1/0/2
[PE2-HundredGigE1/0/2] ip address 10.1.2.1 24
[PE2-HundredGigE1/0/2] mpls enable
[PE2-HundredGigE1/0/2] mpls ldp enable
[PE2-HundredGigE1/0/2] quit
# 在PE2上运行OSPF,用于建立LSP。
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 192.2.2.2 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# 在PE 1,PE2和PE 3之间建立IBGP连接,并配置通过BGP发布路由信息。
[PE2] bgp 100
[PE2-bgp-default] peer 192.1.1.1 as-number 100
[PE2-bgp-default] peer 192.1.1.1 connect-interface loopback 0
[PE2-bgp-default] peer 192.3.3.3 as-number 100
[PE2-bgp-default] peer 192.3.3.3 connect-interface loopback 0
[PE2-bgp-default] address-family l2vpn evpn
[PE2-bgp-default-evpn] peer 192.1.1.1 enable
[PE2-bgp-default-evpn] peer 192.3.3.3 enable
[PE2-bgp-default-evpn] peer 192.1.1.1 advertise encap-type mpls
[PE2-bgp-default-evpn] peer 192.3.3.3 advertise encap-type mpls
[PE2-bgp-default-evpn] quit
[PE2-bgp-default] quit
# 在接入站点的接口HundredGigE1/0/1下配置ESI值和接口的冗余备份模式。
[PE2] interface hundredgige 1/0/1
[PE2-HundredGigE1/0/1] esi 1.1.1.1.1
[PE2-HundredGigE1/0/1] evpn redundancy-mode all-active
[PE2-HundredGigE1/0/1] quit
# 创建交叉连接组vpna和交叉连接组EVPN实例,并指定EVPN采用MPLS封装,同时配置交叉连接组EVPN实例的RD与RT。
[PE2] xconnect-group vpna
[PE2-xcg-vpna] evpn encapsulation mpls
[PE2-xcg-vpna-evpn-mpls] route-distinguisher 1:1
[PE2-xcg-vpna-evpn-mpls] vpn-target 1:1 export-extcommunity
[PE2-xcg-vpna-evpn-mpls] vpn-target 1:1 import-extcommunity
[PE2-xcg-vpna-evpn-mpls] quit
# 创建交叉连接pw1,将接口HundredGigE1/0/1与此交叉连接关联,并在交叉连接内创建EVPN PW,以实现AC和EVPN PW关联。
[PE2] xconnect-group vpna
[PE2-xcg-vpna] connection pw1
[PE2-xcg-vpna-pw1] ac interface hundredgige 1/0/1
[PE2-xcg-vpna-pw1-HundredGigE1/0/1] quit
[PE2-xcg-vpna-pw1] evpn local-service-id 1 remote-service-id 2
[PE2-xcg-vpna-pw1] quit
[PE2-xcg-vpna] quit
# 配置Track项监控接口HundredGigE1/0/2的状态。
[PE2] track 1 interface HundredGigE1/0/2
[PE2-track-1] quit
# 配置Tcl监控策略,当HundredGigE1/0/2状态变为Down后,PE2能自动感知,并将HundredGigE1/0/1接口shutdown。
[PE2] rtm cli-policy policy1
[PE2-rtm-policy1] event track 1 state negative
[PE2-rtm-policy1] action 0 cli system-view
[PE2-rtm-policy1] action 1 cli interface HundredGigE1/0/1
[PE2-rtm-policy1] action 2 cli shutdown
[PE2-rtm-policy1] user-role network-admin
[PE2-rtm-policy1] commit
[PE2-rtm-policy1] quit
(4) 配置PE 3
# 配置LSR ID。
<PE3> system-view
[PE3] interface loopback 0
[PE3-LoopBack0] ip address 192.3.3.3 32
[PE3-LoopBack0] quit
[PE3] mpls lsr-id 192.3.3.3
# 开启L2VPN功能。
[PE3] l2vpn enable
# 全局使能LDP。
[PE3] mpls ldp
[PE3-ldp] quit
# 配置连接PE1和PE2的接口HundredGigE1/0/2和HundredGigE1/0/3,并在这两个接口上使能LDP。
[PE3] interface hundredgige 1/0/2
[PE3-HundredGigE1/0/2] ip address 10.1.1.2 24
[PE3-HundredGigE1/0/2] mpls enable
[PE3-HundredGigE1/0/2] mpls ldp enable
[PE3-HundredGigE1/0/2] quit
[PE3] interface hundredgige 1/0/3
[PE3-HundredGigE1/0/3] ip address 10.1.2.2 24
[PE3-HundredGigE1/0/3] mpls enable
[PE3-HundredGigE1/0/3] mpls ldp enable
[PE3-HundredGigE1/0/3] quit
# 在PE 3上运行OSPF,用于建立LSP。
[PE3] ospf
[PE3-ospf-1] area 0
[PE3-ospf-1-area-0.0.0.0] network 192.3.3.3 0.0.0.0
[PE3-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] quit
[PE3-ospf-1] quit
# 在PE 1,PE2和PE 3之间建立IBGP连接,并配置通过BGP发布路由信息。
[PE3] bgp 100
[PE3-bgp-default] peer 192.1.1.1 as-number 100
[PE3-bgp-default] peer 192.1.1.1 connect-interface loopback 0
[PE3-bgp-default] peer 192.2.2.2 as-number 100
[PE3-bgp-default] peer 192.2.2.2 connect-interface loopback 0
[PE3-bgp-default] address-family l2vpn evpn
[PE3-bgp-default-evpn] peer 192.1.1.1 enable
[PE3-bgp-default-evpn] peer 192.2.2.2 enable
[PE3-bgp-default-evpn] peer 192.1.1.1 advertise encap-type mpls
[PE3-bgp-default-evpn] peer 192.2.2.2 advertise encap-type mpls
[PE3-bgp-default-evpn] quit
[PE3-bgp-default] quit
# 创建交叉连接组vpna和交叉连接组EVPN实例,并指定EVPN采用MPLS封装,同时配置交叉连接组EVPN实例的RD与RT。
[PE3] xconnect-group vpna
[PE3-xcg-vpna] evpn encapsulation mpls
[PE3-xcg-vpna-evpn-mpls] route-distinguisher 1:1
[PE3-xcg-vpna-evpn-mpls] vpn-target 1:1 export-extcommunity
[PE3-xcg-vpna-evpn-mpls] vpn-target 1:1 import-extcommunity
[PE3-xcg-vpna-evpn-mpls] quit
# 创建交叉连接pw1,将接口HundredGigE1/0/1与此交叉连接关联,并在交叉连接内创建EVPN PW,以实现AC和EVPN PW关联。
[PE3] xconnect-group vpna
[PE3-xcg-vpna] connection pw1
[PE3-xcg-vpna-pw1] ac interface hundredgige 1/0/1
[PE3-xcg-vpna-pw1-HundredGigE1/0/1] quit
[PE3-xcg-vpna-pw1] evpn local-service-id 2 remote-service-id 1
[PE3-xcg-vpna-pw1] quit
[PE3-xcg-vpna] quit
(5) 配置CE 2
<CE2> system-view
[CE2] interface HundredGigE1/0/1
[CE2-HundredGigE1/0/1] ip address 100.1.1.2 24
[CE2-HundredGigE1/0/1] quit
(1) 查看配置。
# 在PE 1上查看PW信息,可以看到建立EVPN PW。
<PE1> display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY - ac-bypass
PBY - pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.3.3.3 2 710263/710265 EVPN M 0 Up
# 在PE 1上查看交叉连接的EVPN信息。
<PE1> display evpn xconnect-group
Flags: P - Primary, B - Backup, C - Control word
Xconnect group name: vpna
Connection name: 1
ESI : 0001.0001.0001.0001.0001
Local service ID : 1
Remote service ID : 2
Control word : Disabled
In label : 710263
Local MTU : 1500
AC State : Up
PW type : VLAN
Nexthop ESI Out label Flags MTU state
192.3.3.3 0000.0000.0000.0000.0000 710265 P 1500 Up
192.2.2.2 0001.0001.0001.0001.0001 710124 P 1500 Up
# 在PE 1上查看本地ES信息。
<PE1> display evpn es local
Redundancy mode: A - All-active, S - Single-active
Xconnect-group name : vpna
ESI Tag ID DF address Mode State ESI label
0001.0001.0001.0001.0001 - 192.1.1.1 A Up -
# 在PE 1上查看远端ES信息。
<PE1> display evpn es remote
Control Flags: P - Primary, B - Backup, C - Control word
Xconnect group name : vpna
ESI : 0001.0001.0001.0001.0001
Ethernet segment routes :
192.2.2.2
A-D per ES routes :
Peer IP Remote Redundancy mode
192.2.2.2 All-active
A-D per EVI routes :
Tag ID Peer IP Control Flags
1 192.2.2.2 P
# 在PE 2上也可以看到EVPN PW信息。
<PE2> display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY - ac-bypass
PBY - pw-bypass
Total number of PWs: 1
1 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.3.3.3 2 710124/710265 EVPN M 1 Up
# 在PE 3上也可以看到EVPN PW信息。
<PE3> display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY - ac-bypass
PBY - pw-bypass
Total number of PWs: 2
2 up, 0 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
192.1.1.1 1 710265/710263 EVPN E 0 Up
192.2.2.2 1 710265/710124 EVPN E 0 Up
(2) 流量切换。
# CE 1与CE 2之间能够ping通,多归属站点的冗余备份模式为多活冗余模式,流量在两个PW上进行负载分担。
[CE1] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 2 1206646 -- --
HGE1/0/2 2 1206978 -- --
Overflow: More than 14 digits.
--: Not supported.
# 当其中一条PW故障时,流量切换到另一条PW上,在此过程中流量零丢包。
[CE1] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 4 2413624 -- --
Overflow: More than 14 digits.
--: Not supported.
当PW故障消除后,流量继续在两条PW上进行负载分担,流量恢复的过程中零丢包。
[CE1] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 2 1206646 -- --
HGE1/0/2 2 1205964 -- --
Overflow: More than 14 digits.
--: Not supported.
EVPN VPWS的FRR功能用于减小AC链路故障或PW链路故障对网络造成的影响,提升网络的可靠性和稳定性,适用于EVPN VPWS单归属和多归属组网。
EVPN VPWS的FRR功能包括Bypass PW和主备PW功能。在实际配置时,需要先配置Bypass PW,再配置主备PW功能。目前EVPN VPWS的FRR功能仅支持一主一备。
EVPN VPWS多归属站点组网中,当多归属站点AC故障时,AC所连接的PE会向其它PE通告本地不可达信息。在收到本地不可达信息前,远端PE仍会将流量转发给该PE,导致报文被丢弃。在冗余备份组PE间建立Bypass PW临时转发流量,可以避免丢包。
如图22所示,PE 2侧的AC链路故障时,PE 2会向PE 1及PE 3通告本地不可达信息,使流量不再通过PE 1与PE 2之间的PW转发,在此期间PE 1发送给PE 2的数据报文无法转发到CE 2,会被丢弃。EVPN VPWS通过Bypass PW功能解决该问题。在冗余备份组成员PE间建立Bypass PW。当AC链路故障时,PE 2通过Bypass PW临时将流量到转发到PE 3,再由PE 3转发到CE 2,从而减少丢包。
图22 Bypass PW功能原理图
在PE之间建立主备两条PW。主PW负责转发流量,备份PW为主PW提供备份。当主PW出现故障时,流量切换到备份PW,以保证流量转发不会中断。
如图23所示,CE 1单归属接入PE 1,PE 1通过RR 1和RR 2连接至PE 2,RR在PE间反射路由时修改下一跳属性并重新分配MPLS标签。RR上配置路由策略修改路由属性,PE 1根据RR反射路由中的路由属性,只会选择RR 1或RR 2其中一条最优路径与PE 2建立PW。为了提高网络可靠性,可在PE 1上配置主备PW功能,实现PE 1通过RR 1、RR 2分别与PE 2创建一主一备两条PW,其中最优路径为主PW,从而减小PE 1与RR 1或RR 2间链路故障对整个网络的影响。PE 1从多条BGP EVPN路由中选择最优路由的原则请参见“三层技术-IP路由配置指导”中的“BGP”。
图23 主备PW功能原理图
配置EVPN VPWS的FRR功能的关键命令如下:
· evpn multihoming vpws-frr local(系统视图)命令用来开启全局EVPN VPWS的Bypass PW功能。
· evpn frr local(交叉连接组EVPN实例视图)命令用来开启或关闭指定EVPN实例的Bypass PW功能。
· evpn vpws-frr remote(系统视图)命令用来全局开启EVPN VPWS的主备PW功能。
· evpn frr remote(交叉连接组EVPN实例视图)命令用来开启或关闭指定EVPN实例的主备PW功能。
如图24所示,分别在CE1和PE1、PE2之间建立主备两条PW。主PW负责转发流量,备份PW为主PW提供备份。当主PW出现故障时,流量切换到备份PW,以保证流量转发不会中断。
PE 1、PE 2和PE 3为服务提供商边缘设备,均属于AS 100。RR 1和RR 2在PE间反射BGP路由。PE 1、PE 2和PE 3上均运行EVPN VPWS功能,PE 1和PE 2上运行Bypass PW和主备PW功能,提升网络可靠性。CE 1和CE 2通过骨干网实现二层互通。具体需求如下:
· PE 1与PE 2之间建立Bypass PW,并通过LDP建立承载该PW的公网隧道;
· RR 1和RR 2向PE 1和PE 2反射路由时修改下一跳属性并重新分配MPLS标签;
· RR 1和RR 2配置路由策略修改路由属性用于选路;
· PE 1、PE 2分别通过RR 1和RR 2两条路径与PE 3建立一主一备两条EVPN PW;
· AS内部使用OSPF作为IGP。
图24 EVPN VPWS的FRR功能
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
PE 1 |
Loop0 |
1.1.1.1/32 |
PE 3 |
Loop0 |
3.3.3.3/32 |
|
HGE1/0/1 |
- |
|
HGE1/0/1 |
- |
|
HGE1/0/2 |
10.1.1.1/24 |
|
HGE1/0/2 |
10.1.6.3/24 |
|
HGE1/0/3 |
10.1.2.1/24 |
|
HGE1/0/3 |
10.1.7.3/24 |
|
HGE1/0/4 |
10.1.3.1/24 |
RR 1 |
Loop0 |
4.4.4.4/32 |
PE 2 |
Loop0 |
2.2.2.2/32 |
|
HGE1/0/1 |
10.1.1.4/24 |
|
HGE1/0/1 |
- |
|
HGE1/0/2 |
10.1.6.4/24 |
|
HGE1/0/2 |
10.1.4.2/24 |
|
HGE1/0/4 |
10.1.5.4/24 |
|
HGE1/0/3 |
10.1.2.2/24 |
RR 2 |
Loop0 |
5.5.5.5/32 |
|
HGE1/0/4 |
10.1.5.2/24 |
|
HGE1/0/1 |
10.1.4.5/24 |
CE 1 |
RAGG1 |
100.1.1.1/24 |
|
HGE1/0/2 |
10.1.7.5/24 |
CE 2 |
HGE1/0/1 |
100.1.1.2/24 |
|
HGE1/0/4 |
10.1.3.5/24 |
(1) 配置CE 1
# 创建三层聚合接口1,采用静态聚合模式,并为其配置IP地址和子网掩码。
<CE1> system-view
[CE1] interface route-aggregation 1
[CE1-Route-Aggregation1] ip address 100.1.1.1 24
[CE1-Route-Aggregation1] quit
# 将接口HundredGigE1/0/1至HundredGigE1/0/2加入到聚合组1中。
[CE1] interface hundredgige 1/0/1
[CE1-HundredGigE1/0/1] port link-aggregation group 1
[CE1-HundredGigE1/0/1] quit
[CE1] interface hundredgige 1/0/2
[CE1-HundredGigE1/0/2] port link-aggregation group 1
[CE1-HundredGigE1/0/2] quit
(2) 配置PE 1
# 配置LSR ID。
<PE1> system-view
[PE1] interface loopback 0
[PE1-LoopBack0] ip address 1.1.1.1 32
[PE1-LoopBack0] quit
[PE1] mpls lsr-id 1.1.1.1
# 开启L2VPN功能。
[PE1] l2vpn enable
# 全局使能LDP。
[PE1] mpls ldp
[PE1-ldp] quit
# 全局开启EVPN VPWS的Bypass PW功能。
[PE1] evpn multihoming vpws-frr local
# 配置连接RR 1的接口HundredGigE1/0/2,在此接口上使能LDP。
[PE1] interface hundredgige 1/0/2
[PE1-HundredGigE1/0/2] ip address 10.1.1.1 24
[PE1-HundredGigE1/0/2] mpls enable
[PE1-HundredGigE1/0/2] mpls ldp enable
[PE1-HundredGigE1/0/2] quit
# 配置连接PE 2的接口HundredGigE1/0/3,在此接口上使能LDP,用于创建Bypass PW。
[PE1] interface hundredgige 1/0/3
[PE1-HundredGigE1/0/3] ip address 10.1.2.1 24
[PE1-HundredGigE1/0/3] mpls enable
[PE1-HundredGigE1/0/3] mpls ldp enable
[PE1-HundredGigE1/0/3] quit
# 配置连接RR 2的接口HundredGigE1/0/4,在此接口上使能LDP。
[PE1] interface hundredgige 1/0/4
[PE1-HundredGigE1/0/4] ip address 10.1.3.1 24
[PE1-HundredGigE1/0/4] mpls enable
[PE1-HundredGigE1/0/4] mpls ldp enable
[PE1-HundredGigE1/0/4] quit
# 在PE 1上运行OSPF,以确保各台设备间的路由可达。
[PE1] ospf
[PE1-ospf-1] area 0
[PE1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.255
[PE1-ospf-1-area-0.0.0.0] network 1.1.1.1 0.0.0.0
[PE1-ospf-1-area-0.0.0.0] quit
[PE1-ospf-1] quit
# 配置PE 1与RR 1、RR 2建立IBGP连接,并配置通过BGP发布EVPN路由信息。
[PE1] bgp 100
[PE1-bgp-default] peer 4.4.4.4 as-number 100
[PE1-bgp-default] peer 4.4.4.4 connect-interface loopback 0
[PE1-bgp-default] peer 5.5.5.5 as-number 100
[PE1-bgp-default] peer 5.5.5.5 connect-interface loopback 0
[PE1-bgp-default] address-family l2vpn evpn
[PE1-bgp-default-evpn] peer 4.4.4.4 enable
[PE1-bgp-default-evpn] peer 5.5.5.5 enable
[PE1-bgp-default-evpn] peer 4.4.4.4 advertise encap-type mpls
[PE1-bgp-default-evpn] peer 5.5.5.5 advertise encap-type mpls
[PE1-bgp-default-evpn] quit
[PE1-bgp-default] quit
# 在接入站点的接口HundredGigE1/0/1下配置ESI值和接口的冗余备份模式。
[PE1] interface hundredgige 1/0/2
[PE1-HundredGigE1/0/1] esi 1.1.1.1.1
[PE1-HundredGigE1/0/1] evpn redundancy-mode all-active
[PE1-HundredGigE1/0/1] quit
# 创建交叉连接组vpna和交叉连接组EVPN实例,并指定EVPN采用MPLS封装,同时配置交叉连接组EVPN实例的RD与RT。
[PE1] xconnect-group vpna
[PE1-xcg-vpna] evpn encapsulation mpls
[PE1-xcg-vpna-evpn-mpls] route-distinguisher 1:1
[PE1-xcg-vpna-evpn-mpls] vpn-target 1:1 export-extcommunity
[PE1-xcg-vpna-evpn-mpls] vpn-target 1:1 import-extcommunity
[PE1-xcg-vpna-evpn-mpls] quit
# 创建交叉连接pw1,将接口HundredGigE1/0/1与此交叉连接关联,并在交叉连接内创建EVPN PW,以实现AC和EVPN PW关联。
[PE1] xconnect-group vpna
[PE1-xcg-vpna] connection pw1
[PE1-xcg-vpna-pw1] ac interface hundredgige 1/0/1
[PE1-xcg-vpna-pw1-HundredGigE1/0/1] quit
[PE1-xcg-vpna-pw1] evpn local-service-id 1 remote-service-id 2
[PE1-xcg-vpna-pw1] quit
[PE1-xcg-vpna] quit
# 全局开启EVPN VPWS的主备PW功能,用于PE 1与PE 3间建立主备两条PW。
[PE1] evpn vpws-frr remote
(3) 配置PE 2
# 配置LSR ID。
<PE2> system-view
[PE2] interface loopback 0
[PE2-LoopBack0] ip address 2.2.2.2 32
[PE2-LoopBack0] quit
[PE2] mpls lsr-id 2.2.2.2
# 开启L2VPN功能。
[PE2] l2vpn enable
# 全局使能LDP。
[PE2] mpls ldp
[PE2-ldp] quit
# 全局开启EVPN VPWS的Bypass PW功能。
[PE2] evpn multihoming vpws-frr local
# 配置连接RR 2的接口HundredGigE1/0/2,在此接口上使能LDP。
[PE2] interface hundredgige 1/0/2
[PE2-HundredGigE1/0/2] ip address 10.1.4.2 24
[PE2-HundredGigE1/0/2] mpls enable
[PE2-HundredGigE1/0/2] mpls ldp enable
[PE2-HundredGigE1/0/2] quit
# 配置连接PE 1的接口HundredGigE1/0/3,在此接口上使能LDP,用于创建Bypass PW。
[PE2] interface hundredgige 1/0/3
[PE2-HundredGigE1/0/3] ip address 10.1.2.2 24
[PE2-HundredGigE1/0/3] mpls enable
[PE2-HundredGigE1/0/3] mpls ldp enable
[PE2-HundredGigE1/0/3] quit
# 配置连接RR 1的接口HundredGigE1/0/4,在此接口上使能LDP。
[PE2] interface hundredgige 1/0/4
[PE2-HundredGigE1/0/4] ip address 10.1.5.2 24
[PE2-HundredGigE1/0/4] mpls enable
[PE2-HundredGigE1/0/4] mpls ldp enable
[PE2-HundredGigE1/0/4] quit
# 在PE 2上运行OSPF,以确保各台设备之间路由可达。
[PE2] ospf
[PE2-ospf-1] area 0
[PE2-ospf-1-area-0.0.0.0] network 10.1.2.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 10.1.4.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 10.1.5.0 0.0.0.255
[PE2-ospf-1-area-0.0.0.0] network 2.2.2.2 0.0.0.0
[PE2-ospf-1-area-0.0.0.0] quit
[PE2-ospf-1] quit
# 配置PE 2与RR 1、RR 2建立IBGP连接,并配置通过BGP发布EVPN路由信息。
[PE2] bgp 100
[PE2-bgp-default] peer 4.4.4.4 as-number 100
[PE2-bgp-default] peer 4.4.4.4 connect-interface loopback 0
[PE2-bgp-default] peer 5.5.5.5 as-number 100
[PE2-bgp-default] peer 5.5.5.5 connect-interface loopback 0
[PE2-bgp-default] address-family l2vpn evpn
[PE2-bgp-default-evpn] peer 4.4.4.4 enable
[PE2-bgp-default-evpn] peer 5.5.5.5 enable
[PE2-bgp-default-evpn] peer 4.4.4.4 advertise encap-type mpls
[PE2-bgp-default-evpn] peer 5.5.5.5 advertise encap-type mpls
[PE2-bgp-default-evpn] quit
[PE2-bgp-default] quit
# 在接入站点的接口HundredGigE1/0/1下配置ESI值和接口的冗余备份模式。
[PE2] interface hundredgige 1/0/1
[PE2-HundredGigE1/0/1] esi 1.1.1.1.1
[PE2-HundredGigE1/0/1] evpn redundancy-mode all-active
[PE2-HundredGigE1/0/1] quit
# 创建交叉连接组vpna和交叉连接组EVPN实例,并指定EVPN采用MPLS封装,同时配置交叉连接组EVPN实例的RD与RT。
[PE2] xconnect-group vpna
[PE2-xcg-vpna] evpn encapsulation mpls
[PE2-xcg-vpna-evpn-mpls] route-distinguisher 1:1
[PE2-xcg-vpna-evpn-mpls] vpn-target 1:1 export-extcommunity
[PE2-xcg-vpna-evpn-mpls] vpn-target 1:1 import-extcommunity
[PE2-xcg-vpna-evpn-mpls] quit
# 创建交叉连接pw1,将接口HundredGigE1/0/1与此交叉连接关联,并在交叉连接内创建EVPN PW,以实现AC和EVPN PW关联。
[PE2] xconnect-group vpna
[PE2-xcg-vpna] connection pw1
[PE2-xcg-vpna-pw1] ac interface hundredgige 1/0/1
[PE2-xcg-vpna-pw1-HundredGigE1/0/1] quit
[PE2-xcg-vpna-pw1] evpn local-service-id 1 remote-service-id 2
[PE2-xcg-vpna-pw1] quit
[PE2-xcg-vpna] quit
# 全局开启EVPN VPWS的主备PW功能,用于PE 2与PE 3间建立主备两条PW。
[PE2] evpn vpws-frr remote
(4) 配置RR 1
# 配置LSR ID。
<RR1> system-view
[RR1] interface loopback 0
[RR1-LoopBack0] ip address 4.4.4.4 32
[RR1-LoopBack0] quit
[RR1] mpls lsr-id 4.4.4.4
# 开启L2VPN功能。
[RR1] l2vpn enable
# 全局使能LDP。
[RR1] mpls ldp
[RR1-ldp] quit
# 配置连接PE 1的接口HundredGigE1/0/1,在此接口上使能LDP。
[RR1] interface hundredgige 1/0/1
[RR1-HundredGigE1/0/1] ip address 10.1.1.4 24
[RR1-HundredGigE1/0/1] mpls enable
[RR1-HundredGigE1/0/1] mpls ldp enable
[RR1-HundredGigE1/0/1] quit
# 配置连接PE 2的接口HundredGigE1/0/4,在此接口上使能LDP。
[RR1] interface hundredgige 1/0/4
[RR1-HundredGigE1/0/4] ip address 10.1.5.4 24
[RR1-HundredGigE1/0/4] mpls enable
[RR1-HundredGigE1/0/4] mpls ldp enable
[RR1-HundredGigE1/0/4] quit
# 配置连接PE 3的接口HundredGigE1/0/2,在此接口上使能LDP。
[RR1] interface hundredgige 1/0/2
[RR1-HundredGigE1/0/2] ip address 10.1.6.4 24
[RR1-HundredGigE1/0/2] mpls enable
[RR1-HundredGigE1/0/2] mpls ldp enable
[RR1-HundredGigE1/0/2] quit
# 在RR 1上运行OSPF,以确保各台设备间的路由可达。
[RR1] ospf
[RR1-ospf-1] area 0
[RR1-ospf-1-area-0.0.0.0] network 10.1.1.0 0.0.0.255
[RR1-ospf-1-area-0.0.0.0] network 10.1.5.0 0.0.0.255
[RR1-ospf-1-area-0.0.0.0] network 10.1.6.0 0.0.0.255
[RR1-ospf-1-area-0.0.0.0] network 4.4.4.4 0.0.0.0
[RR1-ospf-1-area-0.0.0.0] quit
[RR1-ospf-1] quit
# 创建路由策略,修改路由的开销值。
[RR1] route-policy policy1 permit node 10
[RR1-route-policy-policy1-10] if-match route-type bgp-evpn-ad
[RR1-route-policy-policy1-10] apply cost 200
[RR1-route-policy-policy1-10] quit
[RR1] route-policy policy2 permit node 20
[RR1-route-policy-policy2-10] if-match route-type bgp-evpn-ad
[RR1-route-policy-policy2-10] apply cost 500
[RR1-route-policy-policy2-10] quit
# 配置RR 1与PE 1、PE 2、PE 3建立IBGP连接。
[RR1] bgp 100
[RR1-bgp-default] peer 1.1.1.1 as-number 100
[RR1-bgp-default] peer 2.2.2.2 as-number 100
[RR1-bgp-default] peer 3.3.3.3 as-number 100
[RR1-bgp-default] peer 1.1.1.1 connect-interface loopback 0
[RR1-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[RR1-bgp-default] peer 3.3.3.3 connect-interface loopback 0
# 配置BGP发布EVPN路由,并关闭BGP EVPN路由的VPN-Target过滤功能。
[RR1-bgp-default] address-family l2vpn evpn
[RR1-bgp-default-evpn] peer 1.1.1.1 enable
[RR1-bgp-default-evpn] peer 2.2.2.2 enable
[RR1-bgp-default-evpn] peer 3.3.3.3 enable
[RR1-bgp-default-evpn] peer 1.1.1.1 advertise encap-type mpls
[RR1-bgp-default-evpn] peer 2.2.2.2 advertise encap-type mpls
[RR1-bgp-default-evpn] peer 3.3.3.3 advertise encap-type mpls
[RR1-bgp-default-evpn] undo policy vpn-target
# 配置RR 1为路由反射器。
[RR1-bgp-default-evpn] peer 1.1.1.1 reflect-client
[RR1-bgp-default-evpn] peer 2.2.2.2 reflect-client
[RR1-bgp-default-evpn] peer 3.3.3.3 reflect-client
# 配置允许RR 1反射路由时修改路由属性。
[RR1-bgp-default-evpn] reflect change-path-attribute
# 配置RR 1向PE 1和PE 2反射路由时修改下一跳属性。
[RR1-bgp-default-evpn] peer 1.1.1.1 next-hop-local
[RR1-bgp-default-evpn] peer 2.2.2.2 next-hop-local
# 将PE 1和PE 2加入就近反射组中,使RR 1在PE 1和PE 2间反射路由时,不修改下一跳属性。
[RR1-bgp-default-evpn] peer 1.1.1.1 reflect-nearby-group
[RR1-bgp-default-evpn] peer 2.2.2.2 reflect-nearby-group
# 对向IBGP对等体1.1.1.1发布的路由应用路由策略policy1。
[RR1-bgp-default-evpn] peer 1.1.1.1 route-policy policy1 export
# 对向IBGP对等体2.2.2.2发布的路由应用路由策略policy2。
[RR1-bgp-default-evpn] peer 2.2.2.2 route-policy policy2 export
[RR1-bgp-default-evpn] quit
[RR1-bgp-default] quit
(5) 配置RR 2
# 配置LSR ID。
<RR2> system-view
[RR2] interface loopback 0
[RR2-LoopBack0] ip address 5.5.5.5 32
[RR2-LoopBack0] quit
[RR2] mpls lsr-id 5.5.5.5
# 开启L2VPN功能。
[RR2] l2vpn enable
# 全局使能LDP。
[RR2] mpls ldp
[RR2-ldp] quit
# 配置连接PE 1的接口HundredGigE1/0/4,在此接口上使能LDP。
[RR2] interface hundredgige 1/0/4
[RR2-HundredGigE1/0/4] ip address 10.1.3.5 24
[RR2-HundredGigE1/0/4] mpls enable
[RR2-HundredGigE1/0/4] mpls ldp enable
[RR2-HundredGigE1/0/4] quit
# 配置连接PE 2的接口HundredGigE1/0/1,在此接口上使能LDP。
[RR2] interface hundredgige 1/0/1
[RR2-HundredGigE1/0/1] ip address 10.1.4.5 24
[RR2-HundredGigE1/0/1] mpls enable
[RR2-HundredGigE1/0/1] mpls ldp enable
[RR2-HundredGigE1/0/1] quit
# 配置连接PE 3的接口HundredGigE1/0/2,在此接口上使能LDP。
[RR2] interface hundredgige 1/0/2
[RR2-HundredGigE1/0/2] ip address 10.1.7.5 24
[RR2-HundredGigE1/0/2] mpls enable
[RR2-HundredGigE1/0/2] mpls ldp enable
[RR2-HundredGigE1/0/2] quit
# 在RR 2上运行OSPF,以确保各台设备间的路由可达。
[RR2] ospf
[RR2-ospf-1] area 0
[RR2-ospf-1-area-0.0.0.0] network 10.1.3.0 0.0.0.255
[RR2-ospf-1-area-0.0.0.0] network 10.1.4.0 0.0.0.255
[RR2-ospf-1-area-0.0.0.0] network 10.1.7.0 0.0.0.255
[RR2-ospf-1-area-0.0.0.0] network 5.5.5.5 0.0.0.0
[RR2-ospf-1-area-0.0.0.0] quit
[RR2-ospf-1] quit
# 创建路由策略,修改路由的开销值。
[RR2] route-policy policy1 permit node 10
[RR2-route-policy-policy1-10] if-match route-type bgp-evpn-ad
[RR2-route-policy-policy1-10] apply cost 200
[RR2-route-policy-policy1-10] quit
[RR2] route-policy policy2 permit node 20
[RR2-route-policy-policy2-10] if-match route-type bgp-evpn-ad
[RR2-route-policy-policy2-10] apply cost 500
[RR2-route-policy-policy2-10] quit
# 配置RR 2与PE 1、PE 2、PE 3建立IBGP连接。
[RR2] bgp 100
[RR2-bgp-default] peer 1.1.1.1 as-number 100
[RR2-bgp-default] peer 2.2.2.2 as-number 100
[RR2-bgp-default] peer 3.3.3.3 as-number 100
[RR2-bgp-default] peer 1.1.1.1 connect-interface loopback 0
[RR2-bgp-default] peer 2.2.2.2 connect-interface loopback 0
[RR2-bgp-default] peer 3.3.3.3 connect-interface loopback 0
# 配置BGP发布EVPN路由,并关闭BGP EVPN路由的VPN-Target过滤功能。
[RR2-bgp-default] address-family l2vpn evpn
[RR2-bgp-default-evpn] peer 1.1.1.1 enable
[RR2-bgp-default-evpn] peer 2.2.2.2 enable
[RR2-bgp-default-evpn] peer 3.3.3.3 enable
[RR2-bgp-default-evpn] peer 1.1.1.1 advertise encap-type mpls
[RR2-bgp-default-evpn] peer 2.2.2.2 advertise encap-type mpls
[RR2-bgp-default-evpn] peer 3.3.3.3 advertise encap-type mpls
[RR2-bgp-default-evpn] undo policy vpn-target
# 配置RR 2为路由反射器。
[RR2-bgp-default-evpn] peer 1.1.1.1 reflect-client
[RR2-bgp-default-evpn] peer 2.2.2.2 reflect-client
[RR2-bgp-default-evpn] peer 3.3.3.3 reflect-client
# 配置允许RR 2反射路由时修改路由属性。
[RR2-bgp-default-evpn] reflect change-path-attribute
# 配置RR 2向PE 1和PE 2反射路由时修改下一跳属性。
[RR2-bgp-default-evpn] peer 1.1.1.1 next-hop-local
[RR2-bgp-default-evpn] peer 2.2.2.2 next-hop-local
# 将PE 1和PE 2加入就近反射组中,使RR 2在PE 1和PE 2间反射路由时,不修改下一跳属性。
[RR2-bgp-default-evpn] peer 1.1.1.1 reflect-nearby-group
[RR2-bgp-default-evpn] peer 2.2.2.2 reflect-nearby-group
# 对向IBGP对等体1.1.1.1发布的路由应用路由策略policy1。
[RR2-bgp-default-evpn] peer 1.1.1.1 route-policy policy1 export
# 对向IBGP对等体2.2.2.2发布的路由应用路由策略policy2。
[RR2-bgp-default-evpn] peer 2.2.2.2 route-policy policy2 export
[RR2-bgp-default-evpn] quit
[RR2-bgp-default] quit
(6) 配置PE 3
# 配置LSR ID。
<PE3> system-view
[PE3] interface loopback 0
[PE3-LoopBack0] ip address 3.3.3.3 32
[PE3-LoopBack0] quit
[PE3] mpls lsr-id 3.3.3.3
# 开启L2VPN功能。
[PE3] l2vpn enable
# 全局使能LDP。
[PE3] mpls ldp
[PE3-ldp] quit
# 全局开启EVPN VPWS的Bypass PW功能。
[PE3] evpn multihoming vpws-frr local
# 配置连接RR 1的接口HundredGigE1/0/2,在此接口上使能LDP。
[PE3] interface hundredgige 1/0/2
[PE3-HundredGigE1/0/2] ip address 10.1.6.3 24
[PE3-HundredGigE1/0/2] mpls enable
[PE3-HundredGigE1/0/2] mpls ldp enable
[PE3-HundredGigE1/0/2] quit
# 配置连接RR 2的接口HundredGigE1/0/3,在此接口上使能LDP。
[PE3] interface hundredgige 1/0/3
[PE3-HundredGigE1/0/3] ip address 10.1.7.3 24
[PE3-HundredGigE1/0/3] mpls enable
[PE3-HundredGigE1/0/3] mpls ldp enable
[PE3-HundredGigE1/0/3] quit
# 在PE 1上运行OSPF,用于建立LSP和BGP邻居。
[PE3] ospf
[PE3-ospf-1] area 0
[PE3-ospf-1-area-0.0.0.0] network 10.1.6.0 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] network 10.1.7.0 0.0.0.255
[PE3-ospf-1-area-0.0.0.0] network 3.3.3.3 0.0.0.0
[PE3-ospf-1-area-0.0.0.0] quit
[PE3-ospf-1] quit
# 配置PE 3与RR 1、RR 2建立IBGP连接,并配置通过BGP发布EVPN路由信息。
[PE3] bgp 100
[PE3-bgp-default] peer 4.4.4.4 as-number 100
[PE3-bgp-default] peer 4.4.4.4 connect-interface loopback 0
[PE3-bgp-default] peer 5.5.5.5 as-number 100
[PE3-bgp-default] peer 5.5.5.5 connect-interface loopback 0
[PE3-bgp-default] address-family l2vpn evpn
[PE3-bgp-default-evpn] peer 4.4.4.4 enable
[PE3-bgp-default-evpn] peer 5.5.5.5 enable
[PE3-bgp-default-evpn] peer 4.4.4.4 advertise encap-type mpls
[PE3-bgp-default-evpn] peer 5.5.5.5 advertise encap-type mpls
[PE3-bgp-default-evpn] quit
[PE3-bgp-default] quit
# 创建交叉连接组vpna和交叉连接组EVPN实例,并指定EVPN采用MPLS封装,同时配置交叉连接组EVPN实例的RD与RT。
[PE3] xconnect-group vpna
[PE3-xcg-vpna] evpn encapsulation mpls
[PE3-xcg-vpna-evpn-mpls] route-distinguisher 1:1
[PE3-xcg-vpna-evpn-mpls] vpn-target 1:1 export-extcommunity
[PE3-xcg-vpna-evpn-mpls] vpn-target 1:1 import-extcommunity
[PE3-xcg-vpna-evpn-mpls] quit
# 创建交叉连接pw1,将接口HundredGigE1/0/1与此交叉连接关联,并在交叉连接内创建EVPN PW,以实现AC和EVPN PW关联。
[PE3] xconnect-group vpna
[PE3-xcg-vpna] connection pw1
[PE3-xcg-vpna-pw1] ac interface gigabitethernet1/0/1
[PE3-xcg-vpna-pw1-HundredGigE1/0/1] quit
[PE3-xcg-vpna-pw1] evpn local-service-id 2 remote-service-id 1
[PE3-xcg-vpna-pw1] quit
[PE3-xcg-vpna] quit
(7) 配置CE 2
<CE2> system-view
[CE2] interface hundredgige 1/0/1
[CE2-HundredGigE1/0/1] ip address 100.1.1.2 24
[CE2-HundredGigE1/0/1] quit
(1) 查看PW信息。
# 在PE 1上查看PW信息,可以看到PE 1与PE 3建立了一主一备两条PW,PE 1与PE 2间建立了Bypass PW。
<PE1> display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY - ac-bypass
PBY - pw-bypass
Total number of PWs: 3
1 up, 2 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
4.4.4.4 2 1151/1403 EVPN M 0 Up
5.5.5.5 2 1151/1275 EVPN B 0 Blocked
2.2.2.2 1 1151/1151 EVPN ABY 1 Blocked
# 在PE 2上查看PW信息,可以看到PE 2与PE 3建立了一主一备两条PW,PE 1与PE 2间建立了Bypass PW。
<PE2> display l2vpn pw
Flags: M - main, B - backup, E - ecmp, BY - bypass, H - hub link, S - spoke link
N - no split horizon, A - administration, ABY - ac-bypass
PBY - pw-bypass
Total number of PWs: 3
1 up, 2 blocked, 0 down, 0 defect, 0 idle, 0 duplicate
Xconnect-group Name: vpna
Peer PWID/RmtSite/SrvID In/Out Label Proto Flag Link ID State
5.5.5.5 2 1152/1404 EVPN M 0 Up
4.4.4.4 2 1152/1276 EVPN B 0 Blocked
1.1.1.1 1 1152/1152 EVPN ABY 1 Blocked
(2) 验证站点间互通。
# CE 1和CE 2之间能够ping通。
(3) 流量切换
# 主用PW未发生故障时,CE1发送给CE2的流量从连接PW1的出接口HGE1/0/1发送出去。
[CE1] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 4 2413624 -- --
HGE1/0/2 0 -- --
Overflow: More than 14 digits.
--: Not supported.
# 当其中一条PW故障时,流量切换到备用PW上,在此过程中流量零丢包。
[CE1] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 4 2413624 -- --
Overflow: More than 14 digits.
--: Not supported.
当SR-MPLS TE Policy中存在多条有效候选路径时,设备通过优先级最大的候选路径转发报文。如果该候选路径发生故障,则SR-MPLS TE Policy需要重新选择有效候选路径转发报文。由于选择新的有效候选路径会耗费一些时间,所以在切换转发路径的过程中会造成丢包,影响业务流量转发。
SR-MPLS TE Policy的热备份功能可以解决上述问题。SR-MPLS TE Policy热备份功能可以在存在多条有效候选路径时,将优先级最高的路径作为主路径、次优先级的路径作为备份路径。当主路径故障时,流量立刻切换到备份路径上转发出去,从而实现零丢包。
SR-MPLS TE Policy的热备份是指通过备份候选路径对主候选路径进行保护。如果一个SR-MPLS TE Policy下存在多条候选路径,则优先级最高的有效候选路径作为主路径,优先级次高的有效候选路径作为备份路径。如图25所示,如果主路径下所有SID列表对应的转发路径都发生故障,则将流量立即切换到备份候选路径转发,以减少对业务的影响。
图25 SR-MPLS TE Policy热备份示意图
SR-MPLS TE Policy热备份功能和SR-MPLS TE Policy与SBFD联动配合使用时,SBFD可以同时检测SR-MPLS TE Policy中优先级最高和次高的两条候选路径里的所有SID列表对应的转发路径。如果优先级最高的候选路径里所有SID列表对应的转发路径都发生故障,则将流量切换到备份路径。当流量切换到备份路径后,会再次重新计算主备路径。原备份路径将作为主路径,并重新选择一个有效的候选路径作为新的备份路径。当主备路径同时故障时,SR-MPLS TE Policy将重新计算主备路径。
开启SR-MPLS TE Policy的热备份功能的关键命令如下:
· sr-policy backup hot-standby enable(SR-TE视图)命令用来开启所有SR-MPLS TE Policy的热备份功能。
· backup hot-standby(SR-MPLS TE Policy视图)命令用来配置SR-MPLS TE Policy的热备份功能。
SR-TE视图和SR-MPLS TE Policy视图下均可以配置SR-MPLS TE Policy的热备份功能。SR-TE视图的配置对所有SR-MPLS TE Policy都有效,而SR-MPLS TE Policy视图的配置只对当前SR-MPLS TE Policy有效。对于一个SR-MPLS TE Policy来说,优先采用该SR-MPLS TE Policy内的配置,只有该SR-MPLS TE Policy内未进行配置时,才采用SR-TE视图的配置。
通过在IGP网络中部署SR-MPLS TE Policy,其中Device A->Device D为优先级最大的候选路径,Device A->Device B->Device C->Device D是备份候选路径。通过部署SR-MPLS TE Policy的热备份功能,可以在主路径故障的时候,流量迅速切换到备份路径,从而实现主路径流量的零丢包。
图26 SR-MPLS TE Policy热备份功能组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
Loop1 |
1.1.1.1/32 |
Device B |
Loop1 |
2.2.2.2/32 |
|
HGE1/0/1 |
12.0.0.1/24 |
|
HGE1/0/1 |
12.0.0.2/24 |
|
HGE1/0/2 |
14.0.0.1/24 |
|
HGE1/0/2 |
23.0.0.2/24 |
Device C |
Loop1 |
3.3.3.3/32 |
Device D |
Loop1 |
4.4.4.4/32 |
|
HGE1/0/1 |
34.0.0.3/24 |
|
HGE1/0/1 |
34.0.0.4/24 |
|
HGE1/0/2 |
23.0.0.3/24 |
|
HGE1/0/2 |
14.0.0.4/24 |
(1) 配置各接口的IP地址和子网掩码,具体配置过程略
(2) 配置Device A
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceA> system-view
[DeviceA] isis 1
[DeviceA-isis-1] network-entity 00.0000.0000.0001.00
[DeviceA-isis-1] cost-style wide
[DeviceA-isis-1] is-level level-2
[DeviceA-isis-1] no-stop-routing
[DeviceA-isis-1] quit
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] isis enable 1
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] isis enable 1
[DeviceA-HundredGigE1/0/2] quit
[DeviceA] interface loopback 1
[DeviceA-LoopBack1] isis enable 1
[DeviceA-LoopBack1] quit
# 配置节点的MPLS LSR ID、开启MPLS能力和MPLS TE能力。
[DeviceA] mpls lsr-id 1.1.1.1
[DeviceA] mpls te
[DeviceA-te] quit
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] mpls enable
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] mpls enable
[DeviceA-HundredGigE1/0/2] quit
# 配置IS-IS SR的SRGB,同时在IS-IS IPv4单播地址族视图下开启SR-MPLS功能。
[DeviceA] isis 1
[DeviceA-isis-1] segment-routing global-block 16000 16999
[DeviceA-isis-1] address-family ipv4
[DeviceA-isis-1-ipv4] segment-routing mpls
[DeviceA-isis-1-ipv4] quit
[DeviceA-isis-1] quit
# 配置前缀SID索引。
[DeviceA] interface loopback 1
[DeviceA-LoopBack1] isis prefix-sid index 10
[DeviceA-LoopBack1] quit
# 配置SID列表。
[DeviceA] segment-routing
[DeviceA-segment-routing] local-block 90000 99999
[DeviceA-segment-routing] global-block 16000 25999
[DeviceA-segment-routing] traffic-engineering
[DeviceA-sr-te] segment-list s1
[DeviceA-sr-te-sl-s1] index 10 mpls label 16020
[DeviceA-sr-te-sl-s1] index 20 mpls label 17030
[DeviceA-sr-te-sl-s1] index 30 mpls label 18040
[DeviceA-sr-te-sl-s1] quit
[DeviceA-sr-te] segment-list s2
[DeviceA-sr-te-sl-s2] index 10 mpls label 16040
[DeviceA-sr-te-sl-s2] quit
# 创建SR-MPLS TE Policy,并配置SR-MPLS TE Policy属性。
[DeviceA-sr-te] policy p1
[DeviceA-sr-te-policy-p1] binding-sid mpls 90000
[DeviceA-sr-te-policy-p1] color 10 end-point ipv4 4.4.4.4
[DeviceA-sr-te-policy-p1] backup hot-standby enable
# 配置SR-MPLS TE Policy的候选路径,并引用SID列表。
[DeviceA-sr-te-policy-p1] candidate-paths
[DeviceA-sr-te-policy-p1-path] preference 10
[DeviceA-sr-te-policy-p1-path-pref-10] explicit segment-list s1
[DeviceA-sr-te-policy-p1-path-pref-10] quit
[DeviceA-sr-te-policy-p1-path] preference 20
[DeviceA-sr-te-policy-p1-path-pref-20] explicit segment-list s2
[DeviceA-sr-te-policy-p1-path-pref-20] quit
[DeviceA-sr-te-policy-p1-path] quit
[DeviceA-sr-te-policy-p1] quit
[DeviceA-sr-te] quit
[DeviceA-segment-routing] quit
#配置缺省路由路由将流量引入到SR-MPLS TE Policy。
[Device B] ip route-static 0.0.0.0 0 sr-policy p1
(3) 配置Device B
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceB> system-view
[DeviceB] isis 1
[DeviceB-isis-1] network-entity 00.0000.0000.0002.00
[DeviceB-isis-1] cost-style wide
[DeviceB-isis-1] is-level level-2
[DeviceB-isis-1] quit
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] isis enable 1
[DeviceB-HundredGigE1/0/1] quit
[DeviceB] interface hundredgige 1/0/2
[DeviceB-HundredGigE1/0/2] isis enable 1
[DeviceB-HundredGigE1/0/2] quit
[DeviceB] interface loopback 1
[DeviceB-LoopBack1] isis enable 1
[DeviceB-LoopBack1] quit
# 配置节点的MPLS LSR ID、开启MPLS能力和MPLS TE能力。
[DeviceB] mpls lsr-id 2.2.2.2
[DeviceB] mpls te
[DeviceB-te] quit
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] mpls enable
[DeviceB-HundredGigE1/0/1] quit
[DeviceB] interface hundredgige 1/0/2
[DeviceB-HundredGigE1/0/2] mpls enable
[DeviceB-HundredGigE1/0/2] quit
# 配置IS-IS SR的SRGB,同时在IS-IS IPv4单播地址族视图下开启SR-MPLS功能。
[DeviceB] isis 1
[DeviceB-isis-1] segment-routing global-block 17000 17999
[DeviceB-isis-1] address-family ipv4
[DeviceB-isis-1-ipv4] segment-routing mpls
[DeviceB-isis-1-ipv4] quit
[DeviceB-isis-1] quit
# 配置前缀SID索引。
[DeviceB] interface loopback 1
[DeviceB-LoopBack1] isis prefix-sid index 20
[DeviceB-LoopBack1] quit
(4) 配置Device C
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceC> system-view
[DeviceC] isis 1
[DeviceC-isis-1] network-entity 00.0000.0000.0003.00
[DeviceC-isis-1] cost-style wide
[DeviceC-isis-1] is-level level-2
[DeviceC-isis-1] quit
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] isis enable 1
[DeviceC-HundredGigE1/0/1] quit
[DeviceC] interface hundredgige 1/0/2
[DeviceC-HundredGigE1/0/2] isis enable 1
[DeviceC-HundredGigE1/0/2] quit
[DeviceC] interface loopback 1
[DeviceC-LoopBack1] isis enable 1
[DeviceC-LoopBack1] quit
# 配置节点的MPLS LSR ID、开启MPLS能力和MPLS TE能力。
[DeviceC] mpls lsr-id 3.3.3.3
[DeviceC] mpls te
[DeviceC-te] quit
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] mpls enable
[DeviceC-HundredGigE1/0/1] quit
[DeviceC] interface hundredgige 1/0/2
[DeviceC-HundredGigE1/0/2] mpls enable
[DeviceC-HundredGigE1/0/2] quit
# 配置IS-IS SR的SRGB,同时在IS-IS IPv4单播地址族视图下开启SR-MPLS功能。
[DeviceC] isis 1
[DeviceC-isis-1] segment-routing global-block 18000 18999
[DeviceC-isis-1] address-family ipv4
[DeviceC-isis-1-ipv4] segment-routing mpls
[DeviceC-isis-1-ipv4] quit
[DeviceC-isis-1] quit
# 配置前缀SID索引。
[DeviceC] interface loopback 1
[DeviceC-LoopBack1] isis prefix-sid index 30
[DeviceC-LoopBack1] quit
(5) 配置Device D
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceD> system-view
[DeviceD] isis 1
[DeviceD-isis-1] network-entity 00.0000.0000.0004.00
[DeviceD-isis-1] cost-style wide
[DeviceD-isis-1] is-level level-2
[DeviceD-isis-1] quit
[DeviceD] interface hundredgige 1/0/1
[DeviceD-HundredGigE1/0/1] isis enable 1
[DeviceD-HundredGigE1/0/1] quit
[DeviceD] interface hundredgige 1/0/2
[DeviceD-HundredGigE1/0/2] isis enable 1
[DeviceD-HundredGigE1/0/2] quit
[DeviceD] interface loopback 1
[DeviceD-LoopBack1] isis enable 1
[DeviceD-LoopBack1] quit
# 配置节点的MPLS LSR ID、开启MPLS能力和MPLS TE能力。
[DeviceD] mpls lsr-id 4.4.4.4
[DeviceD] mpls te
[DeviceD-te] quit
[DeviceD] interface hundredgige 1/0/1
[DeviceD-HundredGigE1/0/1] mpls enable
[DeviceD-HundredGigE1/0/1] quit
[DeviceD] interface hundredgige 1/0/2
[DeviceD-HundredGigE1/0/2] mpls enable
[DeviceD-HundredGigE1/0/2] quit
# 配置IS-IS SR的SRGB,同时在IS-IS IPv4单播地址族视图下开启SR-MPLS功能。
[DeviceD] isis 1
[DeviceD-isis-1] segment-routing global-block 19000 19999
[DeviceD-isis-1] address-family ipv4
[DeviceD-isis-1-ipv4] segment-routing mpls
[DeviceD-isis-1-ipv4] quit
[DeviceD-isis-1] quit
# 配置前缀SID索引。
[DeviceD] interface loopback 1
[DeviceD-LoopBack1] isis prefix-sid index 40
[DeviceD-LoopBack1] quit
(1) 查看配置
# 查看SR-MPLS TE Policy处于激活状态。
[DeviceA] display segment-routing te policy
Name/ID: p1/0
Color: 10
End-point: 4.4.4.4
Name from BGP:
Name from PCE:
BSID:
Mode: Explicit Type: Type_1 Request state: Succeeded
Current BSID: 90000 Explicit BSID: 90000 Dynamic BSID: -
Reference counts: 4
Flags: A/BS/NC
Status: Up
AdminStatus: Up
Forwarding status: Active
Up time: 2023-09-12 00:05:39
Down time: 2023-09-12 00:00:23
Hot-standby: Enabled
Statistics: Disabled
Statistics by service class: Disabled
Source-address: <none>
SBFD: Disabled
BFD Echo: Disabled
Drop-upon-invalid: Disabled
BFD trigger path-down: Disabled
PolicyNID: 23068673
Service-class: -
PCE delegation: Not configured
PCE delegate report-only: Not configured
Reoptimization: Not configured
Candidate paths state: Configured
Candidate paths statistics:
CLI paths: 2 BGP paths: 0
PCEP paths: 0 ODN paths: 0
Candidate paths:
Preference : 10
CPathName:
ProtoOrigin: CLI Discriminator: 10
Instance ID: 0 Node address: 0.0.0.0
Originator: 0, 0.0.0.0
Optimal: N Flags: V/B
Dynamic: Not configured
PCEP: Not configured
Explicit SID list:
ID: 1 Name: s1
Weight: 1 Nid: 22020098
State: Up State(-): -
Candidate paths:
Preference : 20
CPathName:
ProtoOrigin: CLI Discriminator: 20
Instance ID: 0 Node address: 0.0.0.0
Originator: 0, 0.0.0.0
Optimal: Y Flags: V/A
Dynamic: Not configured
PCEP: Not configured
Explicit SID list:
ID: 2 Name: s2
Weight: 1 Nid: 22020099
State: Up State(-): -
# 查看MPLS标签转发路径信息。可以看到SR-MPLS TE Policy对应的转发路径信息,和备用转发路径信息,其中出接口HGE1/0/2的路径为主用路径,出接口HGE1/0/1的路径为备用路径。
[Device A] display mpls lsp
FEC Proto In/Out Label Out Inter/NHLFE/LSINDEX
12.0.0.2 Local -/- HGE1/0/1
14.0.0.4 Local -/- HGE1/0/2
1.1.1.1/32 ISIS 16010/- -
2.2.2.2/32 ISIS 16020/3 HGE1/0/1
2.2.2.2/32 ISIS -/3 HGE1/0/1
3.3.3.3/32 ISIS 16030/17030 HGE1/0/1
3.3.3.3/32 ISIS -/17030 HGE1/0/1
3.3.3.3/32 ISIS 16030/19030 HGE1/0/2
3.3.3.3/32 ISIS -/19030 HGE1/0/2
4.4.4.4/32 ISIS 16040/3 HGE1/0/2
4.4.4.4/32 ISIS -/3 HGE1/0/2
4.4.4.4/32/20971521 SRPolicy -/3 HGE1/0/2
4.4.4.4/32/20971523 SRPolicy -/17030 HGE1/0/1
18040
22020098 SRPolicy -/- LSINDEX20971523
22020099 SRPolicy -/- LSINDEX20971521
4.4.4.4/10 SRPolicy 90000/- NHLFE22020099
Backup 90000/- NHLFE22020098
(2) 切换路径
# 查看Device A的HGE1/0/2对应的以太网接口出方向流量。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 6 3905795 -- --
Overflow: More than 14 digits.
--: Not supported.
# 主用路径的出接口HGE1/0/2故障后,流量迅速切换到HGE1/0/1接口。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 6 3906456 -- --
HGE1/0/2 0 0 -- --
Overflow: More than 14 digits.
--: Not supported.
(3) 流量回切
当HGE1/0/2恢复正常时,流量切换回HGE1/0/2,在此过程中流量不丢包。
此场景可以实现SR-MPLS TE Policy存在多条有效候选路径场景下的零丢包。当主用路径故障时,流量会切换到备用路径上,实现零丢包。
TI-LFA FRR(Topology-Independent Loop-free Alternate Fast Reroute,拓扑无关无环备份快速重路由)用来为Segment Routing隧道提供链路及节点的保护。当某处链路或节点故障时,流量会快速切换到备份路径,继续转发。从而最大程度上避免流量的丢失。目前TI-LFA FRR功能仅支持一主一备。
基于Segment Routing的TI-LFA FRR技术有如下优势:
· 满足IP FRR快速收敛的基本要求。
· 原则上,对流量的保护不受组网环境的限制。
· 算法复杂度适中。
· 选择收敛后的路径作为备份路由转发路径,相比其他FRR技术,转发过程中设备不会有正在收敛的中间态。
TI-LFA FRR主要涉及以下概念:
· P空间:以保护链路源端为根节点建立SPF(Shortest Path First,最短路径优先)树,所有从根节点不经过保护链路可达的节点集合称为P空间。P空间内的节点被称为P节点。
· 扩展P空间:以保护链路源端的所有邻居为根节点分别建立SPF树,所有从根节点不经过保护链路可达的节点集合称为扩展P空间。P空间在扩展P空间范围内。
· Q空间:以目的节点为根节点建立反向SPF树,所有从根节点不经过保护链路可达的节点集合称为Q空间。Q空间内的节点被称为Q节点。
TI-LFA流量保护分为以下两种类型:
· 链路保护:当需要保护的对象是经过特定链路的流量时,流量保护类型为链路保护。
· 节点保护:当需要保护的对象是经过特定设备的流量时,流量保护类型为节点保护。
节点保护优先级高于链路保护。
如图27所示,PE 1为源节点,P 1节点为故障节点,PE 2为目的节点,链路中间的数字表示cost值。假设流量路径为:PE 1->P 1->PE 2,为避免P 1节点故障导致流量丢失,TI-LFA会计算出扩展P空间、Q空间、P 1故障收敛后的SPF树、Repair List和备份出接口,最终生成备份转发表项。
图27 TI-LFA典型组网图
TI-LFA计算备份路径步骤如下:
(1) 计算扩展P空间:至少存在一个邻居节点到P节点的路径不经过故障链路的集合,即P 2。
(2) 计算Q空间:Q节点到目的节点不经过故障链路的集合,即PE 2和P 4。
(3) 计算收敛后的SPF树:计算P 1故障收敛后的SPF树,即P 1故障后的最优转发路径。SPF树为PE 1->P 2->P 4->PE 2。
(4) 计算Repair List:Repair List是一个约束路径,当P空间和Q空间没有交集时,用来指示如何到达最近的Q节点,Repair List由“P节点的标签+P节点到最近的Q节点路径上的邻接标签”组成。在图27中,Repair List为P 2的节点标签16030,加上P 2到P 3的邻接标签2168,以及P 3到P 4的邻接标签2178。
(5) 计算备份出接口:PE 1到P 1链路故障后的下一跳出接口,即PE 1连接P 2的接口。
TI-LFA备份路径计算完成之后,如果主路径发生故障,就可以根据备份路径进行转发,避免流量丢失。
如图28所示,P 2为P节点,P 4和PE 2为Q节点。主下一跳P 1故障时,触发FRR切换到备路径,详细过程如下:
(1) PE 1为报文封装标签栈,包括Repair List和目的节点标签。最外层封装P节点(P 2)的节点标签=P节点的SRGB起始值+P节点前缀SID索引值=16030,然后封装P节点到最近的Q节点的标签,分别为2168和2178,目的节点标签=Q节点的SRGB起始值+目的节点(PE 2)的前缀SID索引值=16010。
(2) P 2收到报文后,根据最外层标签查找标签转发表,弹出2168标签,将报文转发给P 3。
(3) P 3收到报文后,根据最外层标签查找标签转发表,弹出2178标签,将报文转发给P 4。
(4) P 4收到报文后,根据最外层标签查找标签转发表,出标签为16010,下一跳为PE 2。于是将最外层标签替换成16010,报文转发给PE 2,如此按照最短路径的方式将报文转发到目的节点PE 2。
图28 TI-LFA FRR备份路径转发流程图
如图29所示,当Device B故障时,到Device C的流量将切换到TI-LFA计算的备份路径转发。在此之前,需要备份路径上各个设备完成收敛,才能转发流量。在Device A收敛完成后,流量将沿着备份路径转发,此时如果Device D和Device F还没有收敛,仍按照收敛前的路径转发流量,则Device A到Device F之间形成环路,直到Device D和Device F收敛完成。
Device B故障以后,首先流量切换到TI-LFA计算的备份路径,然后Device A延迟一段时间收敛,等待Device D和Device F收敛完成以后,Device A开始收敛,收敛完成以后,流量再通过TI-LFA计算的备份路径转发,从而避免发生环路。
如图30所示,Device B和Device C之间的链路故障恢复前,数据流量沿着备份路径转发。当Device B和Device C之间的链路故障恢复后,如果Device A先于Device B收敛,则Device A会将流量转发给Device B,但是Device B没有收敛,仍旧沿着备份路径转发,这样Device A和Device B之间就会形成环路。
Device A在故障回切以后,会自动计算一条最优路径达到Device C,并按照该路径转发流量,即Device A在转发时为报文添加端到端路径信息(例如Device B到Device C的邻接标签),这样Device B收到报文后,根据报文的路径信息将报文转发给Device C,避免环路的产生。
经过SR防微环延迟时间后,Device B节点完成收敛,Device A去除额外添加的路径信息,按正常转发的方式将报文转发到Device C。
开启ISIS、OSPF的TI-LFA快速重路由功能的关键命令为:
· fast-reroute ti-lfa(IS-IS IPv4单播地址族视图/OSPF视图)命令用来开启TI-LFA快速重路由功能。
配置TI-LFA快速重路由功能前,需要执行以下命令:
· segment-routing mpls(IS-IS IPv4单播地址族视图/OSPF视图)命令用来开启基于MPLS的SR功能。
· fast-reroute lfa(IS-IS IPv4单播地址族视图/OSPF视图)命令用来开启LFA快速重路由功能,否则TI-LFA快速重路由功能不生效。
配置FRR正切防微环功能的关键命令为:
· fast-reroute microloop-avoidance enable(IS-IS IPv4单播地址族视图/OSPF视图)命令用来开启FRR正切防微环功能。
配置SR防微环功能的关键命令为:
· segment-routing microloop-avoidance enable(IS-IS IPv4单播地址族视图/OSPF视图)命令用来开启SR防微环功能。
Device A和Device B之间存在两条转发链路,IS-IS协议会自动计算出最优链路作为主用,TI-LFA自动计算快速重路由的备用转发路径,同时部署SR防微环功能消除环路,实现Link A故障时的零丢包。
· 设备Device A、Device B、Device C和Device D运行IS-IS实现互通。
· Device A、Device B、Device C和Device D配置IS-IS SR功能。
· 当设备Device A和Device C之间链路Link A故障,链路Link B上存在环路,流量无法通过Device D转发到目的节点Device C。通过部署TI-LFA FRR消除环路,同时使流量可以快速切换到链路Link B。
图31 SR-MPLS和SRv6组网的 IS-IS TI-LFA FRR组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
Loop1 |
1.1.1.1/32 |
Device B |
Loop1 |
2.2.2.2/32 |
|
HGE1/0/1 |
12.12.12.1/24 |
|
HGE1/0/1 |
12.12.12.2/24 |
|
HGE1/0/2 |
14.14.14.1/24 |
|
HGE1/0/2 |
23.23.23.1/24 |
Device C |
Loop1 |
3.3.3.3/24 |
Device D |
Loop1 |
4.4.4.4/24 |
|
HGE1/0/1 |
34.34.34.1/24 |
|
HGE1/0/1 |
34.34.34.2/24 |
|
HGE1/0/2 |
23.23.23.2/24 |
|
HGE1/0/2 |
14.14.14.2/24 |
(1) 请按照图31配置各接口的IP地址和子网掩码,具体配置过程略
(2) 配置Device A
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceA> system-view
[DeviceA] isis 1
[DeviceA-isis-1] network-entity 00.0000.0000.0001.00
[DeviceA-isis-1] cost-style wide
[DeviceA-isis-1] address-family ipv4
[DeviceA-isis-1-ipv4] quit
[DeviceA-isis-1] quit
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] isis enable 1
[DeviceA-HundredGigE1/0/1] isis cost 10
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] isis enable 1
[DeviceA-HundredGigE1/0/2] isis cost 10
[DeviceA-HundredGigE1/0/2] quit
[DeviceA] interface loopback 1
[DeviceA-LoopBack1] isis enable 1
[DeviceA-LoopBack1] quit
# 配置MPLS TE。
[DeviceA] mpls lsr-id 1.1.1.1
[DeviceA] mpls te
[DeviceA-te] quit
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] mpls enable
[DeviceA-HundredGigE1/0/1] mpls te enable
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] mpls enable
[DeviceA-HundredGigE1/0/2] mpls te enable
[DeviceA-HundredGigE1/0/2] quit
# 开启IS-IS SR功能,并开启邻接标签分配功能。
[DeviceA] isis 1
[DeviceA-isis-1] address-family ipv4
[DeviceA-isis-1-ipv4] segment-routing mpls
[DeviceA-isis-1-ipv4] segment-routing adjacency enable
[DeviceA-isis-1-ipv4] quit
[DeviceA-isis-1] quit
# 配置Device A的前缀SID索引。
[DeviceA] interface loopback 1
[DeviceA-LoopBack1] isis prefix-sid index 10
[DeviceA-LoopBack1] quit
# 配置IS-IS TI-LFA FRR。
[DeviceA] isis 1
[DeviceA-isis-1] address-family ipv4
[DeviceA-isis-1-ipv4] fast-reroute lfa
[DeviceA-isis-1-ipv4] fast-reroute ti-lfa
[DeviceA-isis-1-ipv4] fast-reroute microloop-avoidance enable
[DeviceA-isis-1-ipv4] segment-routing microloop-avoidance enable
[DeviceA-isis-1-ipv4] quit
[DeviceA-isis-1] quit
(3) 配置Device B
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceB> system-view
[DeviceB] isis 1
[DeviceB-isis-1] network-entity 00.0000.0000.0002.00
[DeviceB-isis-1] cost-style wide
[DeviceB-isis-1] address-family ipv4
[DeviceB-isis-1-ipv4] quit
[DeviceB-isis-1] quit
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] isis enable 1
[DeviceB-HundredGigE1/0/1] isis cost 10
[DeviceB-HundredGigE1/0/1] quit
[DeviceB] interface hundredgige 1/0/2
[DeviceB-HundredGigE1/0/2] isis enable 1
[DeviceB-HundredGigE1/0/2] isis cost 10
[DeviceB-HundredGigE1/0/2] quit
[DeviceB] interface loopback 1
[DeviceB-LoopBack1] isis enable 1
[DeviceB-LoopBack1] quit
# 配置MPLS TE。
[DeviceB] mpls lsr-id 2.2.2.2
[DeviceB] mpls te
[DeviceB-te] quit
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] mpls enable
[DeviceB-HundredGigE1/0/1] mpls te enable
[DeviceB-HundredGigE1/0/1] quit
[DeviceB] interface hundredgige 1/0/2
[DeviceB-HundredGigE1/0/2] mpls enable
[DeviceB-HundredGigE1/0/2] mpls te enable
[DeviceB-HundredGigE1/0/2] quit
# 开启IS-IS SR功能,并开启邻接标签分配功能。
[DeviceB] isis 1
[DeviceB-isis-1] address-family ipv4
[DeviceB-isis-1-ipv4] segment-routing mpls
[DeviceB-isis-1-ipv4] segment-routing adjacency enable
[DeviceB-isis-1-ipv4] quit
[DeviceB-isis-1] quit
# 配置Device B的前缀SID索引。
[DeviceB] interface loopback 1
[DeviceB-LoopBack1] isis prefix-sid index 20
[DeviceB-LoopBack1] quit
# 配置IS-IS TI-LFA FRR。
[DeviceB] isis 1
[DeviceB-isis-1] address-family ipv4
[DeviceB-isis-1-ipv4] fast-reroute lfa
[DeviceB-isis-1-ipv4] fast-reroute ti-lfa
[DeviceB-isis-1-ipv4] fast-reroute microloop-avoidance enable
[DeviceB-isis-1-ipv4] segment-routing microloop-avoidance enable
[DeviceB-isis-1-ipv4] quit
[DeviceB-isis-1] quit
(4) 配置Device C
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceC> system-view
[DeviceC] isis 1
[DeviceC-isis-1] network-entity 00.0000.0000.0003.00
[DeviceC-isis-1] cost-style wide
[DeviceC-isis-1] address-family ipv4
[DeviceC-isis-1-ipv4] quit
[DeviceC-isis-1] quit
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] isis enable 1
[DeviceC-HundredGigE1/0/1] isis cost 100
[DeviceC-HundredGigE1/0/1] quit
[DeviceC] interface hundredgige 1/0/2
[DeviceC-HundredGigE1/0/2] isis enable 1
[DeviceC-HundredGigE1/0/2] isis cost 10
[DeviceC-HundredGigE1/0/2] quit
[DeviceC] interface loopback 1
[DeviceC-LoopBack1] isis enable 1
[DeviceC-LoopBack1] quit
# 配置MPLS TE。
[DeviceC] mpls lsr-id 3.3.3.3
[DeviceC] mpls te
[DeviceC-te] quit
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] mpls enable
[DeviceC-HundredGigE1/0/1] mpls te enable
[DeviceC-HundredGigE1/0/1] quit
[DeviceC] interface hundredgige 1/0/2
[DeviceC-HundredGigE1/0/2] mpls enable
[DeviceC-HundredGigE1/0/2] mpls te enable
[DeviceC-HundredGigE1/0/2] quit
# 开启IS-IS SR功能,并开启邻接标签分配功能。
[DeviceC] isis 1
[DeviceC-isis-1] address-family ipv4
[DeviceC-isis-1-ipv4] segment-routing mpls
[DeviceC-isis-1-ipv4] segment-routing adjacency enable
[DeviceC-isis-1-ipv4] quit
[DeviceC-isis-1] quit
# 配置Device C的前缀SID索引。
[DeviceC] interface loopback 1
[DeviceC-LoopBack1] isis prefix-sid index 30
[DeviceC-LoopBack1] quit
# 配置IS-IS TI-LFA FRR。
[DeviceC] isis 1
[DeviceC-isis-1] address-family ipv4
[DeviceC-isis-1-ipv4] fast-reroute lfa
[DeviceC-isis-1-ipv4] fast-reroute ti-lfa
[DeviceC-isis-1-ipv4] fast-reroute microloop-avoidance enable
[DeviceC-isis-1-ipv4] segment-routing microloop-avoidance enable
[DeviceC-isis-1-ipv4] quit
[DeviceC-isis-1] quit
(5) 配置Device D
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceD> system-view
[DeviceD] isis 1
[DeviceD-isis-1] network-entity 00.0000.0000.0004.00
[DeviceD-isis-1] cost-style wide
[DeviceD-isis-1] address-family ipv4
[DeviceD-isis-1-ipv4] quit
[DeviceD-isis-1] quit
[DeviceD] interface hundredgige 1/0/1
[DeviceD-HundredGigE1/0/1] isis enable 1
[DeviceD-HundredGigE1/0/1] isis cost 100
[DeviceD-HundredGigE1/0/1] quit
[DeviceD] interface hundredgige 1/0/2
[DeviceD-HundredGigE1/0/2] isis enable 1
[DeviceD-HundredGigE1/0/2] isis cost 10
[DeviceD-HundredGigE1/0/2] quit
[DeviceD] interface loopback 1
[DeviceD-LoopBack1] isis enable 1
[DeviceD-LoopBack1] quit
# 配置MPLS TE。
[DeviceD] mpls lsr-id 4.4.4.4
[DeviceD] mpls te
[DeviceD-te] quit
[DeviceD] interface hundredgige 1/0/1
[DeviceD-HundredGigE1/0/1] mpls enable
[DeviceD-HundredGigE1/0/1] mpls te enable
[DeviceD-HundredGigE1/0/1] quit
[DeviceD] interface hundredgige 1/0/2
[DeviceD-HundredGigE1/0/2] mpls enable
[DeviceD-HundredGigE1/0/2] mpls te enable
[DeviceD-HundredGigE1/0/2] quit
# 开启IS-IS SR功能,并开启邻接标签分配功能。
[DeviceD] isis 1
[DeviceD-isis-1] address-family ipv4
[DeviceD-isis-1-ipv4] segment-routing mpls
[DeviceD-isis-1-ipv4] segment-routing adjacency enable
[DeviceD-isis-1-ipv4] quit
[DeviceD-isis-1] quit
# 配置Device D的前缀SID索引。
[DeviceD] interface loopback 1
[DeviceD-LoopBack1] isis prefix-sid index 40
[DeviceD-LoopBack1] quit
# 配置IS-IS TI-LFA FRR。
[DeviceD] isis 1
[DeviceD-isis-1] address-family ipv4
[DeviceD-isis-1-ipv4] fast-reroute lfa
[DeviceD-isis-1-ipv4] fast-reroute ti-lfa
[DeviceD-isis-1-ipv4] fast-reroute microloop-avoidance enable
[DeviceD-isis-1-ipv4] segment-routing microloop-avoidance enable
[DeviceD-isis-1-ipv4] quit
[DeviceD-isis-1] quit
(1) 查看配置
# 在Device A上查看3.3.3.3/32路由,可以看到TI-LFA备份下一跳为Device D的接口IP地址。
[DeviceA] display isis route ipv4 3.3.3.3 32 verbose level-1 1
Route information for IS-IS(1)
-----------------------------
Level-1 IPv4 Forwarding Table
-----------------------------
IPv4 Dest : 3.3.3.3/32 Int. Cost : 10 Ext. Cost : NULL
Admin Tag : - Src Count : 1 Flag : R/L/-
InLabel : 16020 InLabel Flag: -/N/-/-/-/-
NextHop : Interface : ExitIndex :
12.12.12.2 HGE1/0/1 0x00000103
Nib ID : 0x14000005 OutLabel : 16020 OutLabelFlag: I
LabelSrc : SR
TI-LFA:
Interface : HGE1/0/2
BkNextHop : 14.14.14.2 LsIndex : 0x00000002
Backup label stack(top->bottom): {16030, 2175}
Route label: 16020
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
InLabel flags: R-Readvertisement, N-Node SID, P-no PHP
E-Explicit null, V-Value, L-Local
OutLabelFlags: E-Explicit null, I-Implicit null, N-Normal, P-SR label prefer
(2) 流量切换
# Link A链路正常时,流量从Link A转发出去。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 12 8444864 -- --
HGE1/0/2 0 -- --
Overflow: More than 14 digits.
--: Not supported.
# 关闭Device A在Link A链路上的出接口HGE1/0/1,流量迅速切换到备用链路Link B,在此过程中流量不丢包。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 11 8446391 -- --
Overflow: More than 14 digits.
--: Not supported.
# 如果设备上存在大量IPv4路由,则流量从主用链路Link A切换到Link B零丢包,当流量从Link B切换回Link A时会出现毫秒级丢包。
TI-LFA FRR(Topology-Independent Loop-free Alternate Fast Reroute,拓扑无关无环备份快速重路由)能为Segment Routing隧道提供链路及节点的保护。当某处链路或节点故障时,流量会快速切换到备份路径继续转发,从而最大程度上避免流量的丢失。目前TI-LFA FRR功能仅支持一主一备。
如图32所示,数据报文需要从节点A发往节点F。当节点B和节点E之间发生故障后,节点B将数据报文转发给节点C。由于节点C和节点D之间开销是100,且节点C上路由还未收敛,因此节点C认为到达节点F的最优路径的下一跳是节点B。节点C将数据报文重新转回到节点B,形成环路。
图32 TI-LFA应用场景示意图
在SRv6网络中部署TI-LFA,可以解决上述问题。如图33所示,当节点B和节点E之间发生故障后,节点B启用TI-LFA计算的备份路径,为报文指定显式路径B->C->D->E,保证报文可以沿着备份路径转发。
图33 TI-LFA转发示意图
TI-LFA FRR主要涉及以下概念:
· P空间:以保护链路源端为根节点建立SPF(Shortest Path First,最短路径优先)树,所有从根节点不经过保护链路可达的节点集合称为P空间。P空间内的节点被称为P节点。
· 扩展P空间:以保护链路源端的所有邻居为根节点分别建立SPF树,所有从根节点不经过保护链路可达的节点集合称为扩展P空间。P空间在扩展P空间范围内。
· Q空间:以目的节点为根节点建立反向SPF树,所有从根节点不经过保护链路可达的节点集合称为Q空间。Q空间内的节点被称为Q节点。
如(5)图34所示,PE 1为源节点,P 1节点为故障节点,PE 2为目的节点,链路中间的数字表示cost值。假设流量路径为:PE 1->P 1->PE 2,为避免P 1节点故障导致流量丢失,TI-LFA会计算出扩展P空间、Q空间、P 1故障收敛后的SPF树、Repair List和备份出接口,最终生成备份转发表项。
TI-LFA计算备份路径步骤如下:
(1) 计算扩展P空间:至少存在一个邻居节点到P节点的路径不经过故障链路的集合,即P 2。
(2) 计算Q空间:Q节点到目的节点不经过故障链路的集合,即PE 2和P 4。
(3) 计算收敛后的SPF树:计算P 1故障收敛后的SPF树,即P 1故障后的最优转发路径。SPF树为PE 1->P 2->P 4->PE 2。
(4) 计算Repair List:Repair List是一个约束路径,当P空间和Q空间没有交集时,用来指示如何到达Q节点,Repair List由“P节点的SRv6 SID+P节点到最近的Q节点路径上的SRv6 SID”组成。当P节点和源节点直连时,则Repair List中不需要添加P节点的SRv6 SID。如(5)图34所示,Repair List为P 2和P 3间链路的End.X SID C、P 3和P 4间链路的End.X SID D。
(5) 计算备份出接口:PE 1到P 1链路故障后的下一跳出接口。
图34 TI-LFA典型组网图
TI-LFA备份路径计算完成之后,如果主路径发生故障,就可以根据备份路径进行转发,避免流量丢失。
如(4)图35所示,P 2为P节点,P 4和PE 2为Q节点。主下一跳P 1故障时,触发FRR切换到备路径,详细过程如下:
(1) PE 1根据报文的目的IPv6地址查找IPv6路由表进行转发,下一跳为P 2,同时包含Repair List信息。PE 1根据Repair List构造报文并转发给P 2:
¡ 封装SRH头。封装的SID列表信息为Segment List [0]=D、Segment List [1]=C,即按照节点由远及近的顺序进行排列。
¡ 封装IPv6头。IPv6头中的源地址为源节点PE 1地址A,目的地址为SL指示的地址,即SL为1时表示SRH中Segment List [1]对应的地址C。
(2) P 2收到报文后,检查SRH头中的SL值,并将SL值减1,同时查找Segment List [0]对应的地址,即P 3和P 4间链路的End.X SID D,并使用该End.X SID D替换IPv6头中的目的地址。P 2根据End.X SID C获取出接口和下一跳信息,将封装后的报文转发给P 3。
(3) P 3收到报文后,检查SRH头中的SL值,发现SL=0,对报文进行解封装,并根据End.X SID D获取出接口和下一跳信息,将解封装后的报文转发给P 4。
(4) P 4收到报文后,根据报文的目的IP地址查找IP路由表进行转发,将报文转发给目的节点PE 2。
图35 TI-LFA FRR备份路径转发流程图
如图36所示,当Device B故障时,到Device C的流量将切换到TI-LFA计算的备份路径转发。Device A收敛后,到Device C的流量将沿着收敛后路径转发。此时,如果Device D和Device F还没有收敛,仍按照收敛前的路径转发流量,则Device A到Device F之间形成环路。
通过FRR正切防微环功能和SR防微环功能可以解决上述问题。在Device A上开启该功能后,可以使Device A延迟一段时间收敛,在此期间使用SR防微环功能计算的路径转发流量。等待Device D和Device F收敛完成后,Device A再开始收敛。Device A收敛完成后,到Device C的流量沿将着收敛后路径转发,从而避免发生环路。
如图37所示,Device B和Device C之间的链路故障恢复前,数据流量沿着备份路径转发。当Device B和Device C之间的链路故障恢复后,如果Device A先于Device B收敛,则Device A会将流量转发给Device B,但是Device B没有收敛,仍旧沿着备份路径转发,这样Device A和Device B之间就会形成环路。
通过SR防微环功能可以解决上述问题。Device A在故障回切以后,会自动计算一条最优路径到达Device C,并按照该路径转发流量,即Device A在转发时为报文添加端到端路径信息(例如Device B到Device C的SRv6 SID),这样Device B收到报文后,根据报文中SRH里的路径信息将报文转发给Device C,避免环路的产生。
经过SR防微环延迟时间后,Device B节点完成收敛,Device A去除额外添加的路径信息,按正常方式将报文转发到Device C。
开启IPv6 IS-IS、OSPFv3的TI-LFA快速重路由功能的关键命令为:
· fast-reroute ti-lfa(IS-IS IPv6单播地址族视图/OSPFv3视图)命令用来开启TI-LFA快速重路由功能。
配置TI-LFA快速重路由功能前,需要执行以下命令:
· fast-reroute lfa(IS-IS IPv6单播地址族视图/OSPFv3视图)命令用来开启LFA快速重路由功能,否则TI-LFA快速重路由功能不生效。
配置FRR正切防微环功能的关键命令为:
· fast-reroute microloop-avoidance enable(IS-IS IPv6单播地址族视图/OSPFv3视图)命令用来开启FRR正切防微环功能。
配置SR防微环功能的关键命令为:
· segment-routing microloop-avoidance enable(IS-IS IPv6单播地址族视图/OSPFv3视图)命令用来开启SR防微环功能。
Device A和Device C之间存在两条转发链路,IS-IS协议会自动计算出最优链路作为主用,TI-LFA自动计算快速重路由的备用转发路径,同时部署SR防微环功能消除环路,实现Link A故障时的零丢包。配置思路如下:
· 设备Device A、Device B、Device C和Device D运行IPv6 IS-IS实现互通。
· Device A、Device B、Device C和Device D配置IS-IS SRv6功能。
· 当设备Device A和Device C之间链路Link A故障,链路Link B上存在环路,流量无法通过Device D转发到目的节点Device C。通过部署TI-LFA FRR消除环路,同时使流量可以快速切换到链路Link B。
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
Device A |
Loop1 |
1::1/128 |
Device B |
Loop1 |
2::2/128 |
|
HGE1/0/1 |
2000:1::1/64 |
|
HGE1/0/1 |
2000:1::2/64 |
|
HGE1/0/2 |
2000:4::1/64 |
|
HGE1/0/2 |
2000:2::2/64 |
Device C |
Loop1 |
3::3/128 |
Device D |
Loop1 |
4::4/128 |
|
HGE1/0/1 |
2000:3::3/64 |
|
HGE1/0/1 |
2000:3::4/64 |
|
HGE1/0/2 |
2000:2::3/64 |
|
HGE1/0/2 |
2000:4::4/64 |
(1) 请按照图38配置各接口的IP地址和子网掩码,具体配置过程略
(2) 配置Device A
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceA> system-view
[DeviceA] isis 1
[DeviceA-isis-1] network-entity 00.0000.0000.0001.00
[DeviceA-isis-1] cost-style wide
[DeviceA-isis-1] address-family ipv6
[DeviceA-isis-1-ipv6] quit
[DeviceA-isis-1] quit
[DeviceA] interface hundredgige 1/0/1
[DeviceA-HundredGigE1/0/1] isis ipv6 enable 1
[DeviceA-HundredGigE1/0/1] isis cost 10
[DeviceA-HundredGigE1/0/1] quit
[DeviceA] interface hundredgige 1/0/2
[DeviceA-HundredGigE1/0/2] isis ipv6 enable 1
[DeviceA-HundredGigE1/0/2] isis cost 10
[DeviceA-HundredGigE1/0/2] quit
[DeviceA] interface loopback 1
[DeviceA-LoopBack1] isis ipv6 enable 1
[DeviceA-LoopBack1] quit
# 开启SRv6功能,并配置Locator段。
[DeviceA] segment-routing ipv6
[DeviceA-segment-routing-ipv6] locator aaa ipv6-prefix 11:: 64 static 32
[DeviceA-segment-routing-ipv6-locator-aaa] quit
[DeviceA-segment-routing-ipv6] quit
# 配置IS-IS TI-LFA FRR。
[DeviceA] isis 1
[DeviceA-isis-1] address-family ipv6
[DeviceA-isis-1-ipv6] fast-reroute lfa
[DeviceA-isis-1-ipv6] fast-reroute ti-lfa
# 配置FRR正切防微环功能。
[DeviceA-isis-1-ipv6] fast-reroute microloop-avoidance enable
# 配置SR防微环功能。
[DeviceA-isis-1-ipv6] segment-routing microloop-avoidance enable
[DeviceA-isis-1-ipv6] quit
[DeviceA-isis-1] quit
# 配置引用Locator段。
[DeviceA] isis 1
[DeviceA-isis-1] address-family ipv6
[DeviceA-isis-1-ipv6] segment-routing ipv6 locator aaa
[DeviceA-isis-1-ipv6] quit
[DeviceA-isis-1] quit
(3) 配置Device B
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceB> system-view
[DeviceB] isis 1
[DeviceB-isis-1] network-entity 00.0000.0000.0002.00
[DeviceB-isis-1] cost-style wide
[DeviceB-isis-1] address-family ipv6
[DeviceB-isis-1-ipv6] quit
[DeviceB-isis-1] quit
[DeviceB] interface hundredgige 1/0/1
[DeviceB-HundredGigE1/0/1] isis ipv6 enable 1
[DeviceB-HundredGigE1/0/1] isis cost 10
[DeviceB-HundredGigE1/0/1] quit
[DeviceB] interface hundredgige 1/0/2
[DeviceB-HundredGigE1/0/2] isis ipv6 enable 1
[DeviceB-HundredGigE1/0/2] isis cost 10
[DeviceB-HundredGigE1/0/2] quit
[DeviceB] interface loopback 1
[DeviceB-LoopBack1] isis ipv6 enable 1
[DeviceB-LoopBack1] quit
# 开启SRv6功能,并配置Locator段。
[DeviceB] segment-routing ipv6
[DeviceB-segment-routing-ipv6] locator bbb ipv6-prefix 22:: 64 static 32
[DeviceB-segment-routing-ipv6-locator-bbb] quit
[DeviceB-segment-routing-ipv6] quit
# 配置IS-IS TI-LFA FRR。
[DeviceB] isis 1
[DeviceB-isis-1] address-family ipv6
[DeviceB-isis-1-ipv6] fast-reroute lfa
[DeviceB-isis-1-ipv6] fast-reroute ti-lfa
# 配置引用Locator段。
[DeviceB-isis-1-ipv6] segment-routing ipv6 locator bbb
[DeviceB-isis-1-ipv6] quit
[DeviceB-isis-1] quit
(4) 配置Device C
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceC> system-view
[DeviceC] isis 1
[DeviceC-isis-1] network-entity 00.0000.0000.0003.00
[DeviceC-isis-1] cost-style wide
[DeviceC-isis-1] address-family ipv6
[DeviceC-isis-1-ipv6] quit
[DeviceC-isis-1] quit
[DeviceC] interface hundredgige 1/0/1
[DeviceC-HundredGigE1/0/1] isis ipv6 enable 1
[DeviceC-HundredGigE1/0/1] isis cost 100
[DeviceC-HundredGigE1/0/1] quit
[DeviceC] interface hundredgige 1/0/2
[DeviceC-HundredGigE1/0/2] isis ipv6 enable 1
[DeviceC-HundredGigE1/0/2] isis cost 10
[DeviceC-HundredGigE1/0/2] quit
[DeviceC] interface loopback 1
[DeviceC-LoopBack1] isis ipv6 enable 1
[DeviceC-LoopBack1] quit
# 开启SRv6功能,并配置Locator段。
[DeviceC] segment-routing ipv6
[DeviceC-segment-routing-ipv6] locator ccc ipv6-prefix 33:: 64 static 32
[DeviceC-segment-routing-ipv6-locator-ccc] quit
[DeviceC-segment-routing-ipv6] quit
# 配置IS-IS TI-LFA FRR。
[DeviceC] isis 1
[DeviceC-isis-1] address-family ipv6
[DeviceC-isis-1-ipv6] fast-reroute lfa
[DeviceC-isis-1-ipv6] fast-reroute ti-lfa
# 配置引用Locator段。
[DeviceC-isis-1-ipv6] segment-routing ipv6 locator ccc
[DeviceC-isis-1-ipv6] quit
[DeviceC-isis-1] quit
(5) 配置Device D
# 配置IS-IS协议实现网络层互通,开销值类型为wide。
<DeviceD> system-view
[DeviceD] isis 1
[DeviceD-isis-1] network-entity 00.0000.0000.0004.00
[DeviceD-isis-1] cost-style wide
[DeviceD-isis-1] address-family ipv6
[DeviceD-isis-1-ipv6] quit
[DeviceD-isis-1] quit
[DeviceD] interface hundredgige 1/0/1
[DeviceD-HundredGigE1/0/1] isis ipv6 enable 1
[DeviceD-HundredGigE1/0/1] isis cost 100
[DeviceD-HundredGigE1/0/1] quit
[DeviceD] interface hundredgige 1/0/2
[DeviceD-HundredGigE1/0/2] isis ipv6 enable 1
[DeviceD-HundredGigE1/0/2] isis cost 10
[DeviceD-HundredGigE1/0/2] quit
[DeviceD] interface loopback 1
[DeviceD-LoopBack1] isis ipv6 enable 1
[DeviceD-LoopBack1] quit
# 开启SRv6功能,并配置Locator段。
[DeviceD] segment-routing ipv6
[DeviceD-segment-routing-ipv6] locator ddd ipv6-prefix 44:: 64 static 32
[DeviceD-segment-routing-ipv6-locator-ddd] quit
[DeviceD-segment-routing-ipv6] quit
# 配置IS-IS TI-LFA FRR。
[DeviceD] isis 1
[DeviceD-isis-1] address-family ipv6
[DeviceD-isis-1-ipv6] fast-reroute lfa
[DeviceD-isis-1-ipv6] fast-reroute ti-lfa
# 配置引用Locator段。
[DeviceD-isis-1-ipv6] segment-routing ipv6 locator ddd
[DeviceD-isis-1-ipv6] quit
[DeviceD-isis-1] quit
(1) 查看配置
# 在Device A上查看3::3/128路由,可以看到TI-LFA备份下一跳信息。
[DeviceA] display isis route ipv6 3::3 128 verbose
Route information for IS-IS(1)
------------------------------
Level-1 IPv6 forwarding table
-----------------------------
IPv6 dest : 3::3/128
Flag : R/L/- Cost : 20
Admin tag : - Src count : 2
Nexthop : FE80::4449:7CFF:FEE0:206
Interface : HGE1/0/1
TI-LFA:
Interface : HGE1/0/2
BkNextHop : FE80::4449:91FF:FE42:407
LsIndex : 0x80000001
Backup label stack(top->bottom): {44::1:0:1}
Nib ID : 0x24000006
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
(2) 流量切换(只配置SR防微环功能、无其他路由)
只配置SR防微环功能、组网中无其他路由的情况下,可以实现正切回切零丢包。
# Link A链路正常时,IPv6流量从Link A转发出去。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 11 8447434 -- --
HGE1/0/2 0 -- --
Overflow: More than 14 digits.
--: Not supported.
# 关闭Device A在Link A链路上的出接口HGE1/0/1,流量迅速切换到备用链路Link B,在此过程中流量不丢包。
[DeviceA] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 12 8445450 -- --
Overflow: More than 14 digits.
--: Not supported.
(3) 流量切换(只配置SR防微环功能、有其他路由)
只配置SR防微环功能、组网中有其他路由的情况下,可以实现正切零丢包,回切丢包毫秒级。
(4) 流量切换(配置SR防微环和FRR正切防微环功能、有其他路由)
配置SR防微环和FRR正切防微环功能、有其他路由的情况下,可以实现正切和回切毫秒级丢包。
在IP L3VPN over SRv6/EVPN L3VPN over SRv6/EVPN VPLS over SRv6/EVPN VPWS over SRv6/公网IP over SRv6组网中,当公网隧道为SRv6 TE Policy隧道时,SRv6 TE Policy的尾节点发生故障,会导致报文转发失败,所以需要为SRv6 TE Policy的尾节点提供保护。
SRv6 TE Policy尾节点保护仅适用于双归属的网络场景,要求尾节点和对尾节点进行保护的节点上具有相同的转发表项。
EVPN VPLS over SRv6/EVPN VPWS over SRv6双归属单活组网不支持SRv6 TE Policy尾节点保护功能。
如1. 图39所示,在PE 1与PE 3之间部署SRv6 TE Policy,PE 3是SRv6 TE Policy的尾节点,为了增强可靠性,PE 4为PE 3提供保护。
图39 SRv6 TE Policy尾节点保护示意图
在SRv6 TE Policy尾节点保护场景中,End.M SID用于保护指定的Locator,即保护指定Locator段内的SRv6 SID。如果远端设备发布的SRv6 SID在指定Locator段的范围内,则使用End.M SID对该SRv6 SID(称为远端SRv6 SID)进行保护。在不同组网环境中,End.M SID对应的转发动作不同:
(1) IP/EVPN L3VPN/公网IP over SRv6 TE Policy尾节点保护场景:End.M SID对应的转发动作为剥掉外层IPv6报文头,获取到内层报文信息,查找远端SRv6 SID。根据查找到的远端SRv6 SID查询远端SRv6 SID与VPN实例/公网实例的映射表,找到对应VPN实例/公网实例。在PE 4上对应VPN实例/公网实例的路由表中查表转发。
(2) EVPN VPWS over SRv6 TE Policy尾节点保护场景:End.M SID对应的转发动作为剥掉外层IPv6报文头,获取到内层报文信息,查找远端SRv6 SID。根据查找到的远端SRv6 SID查询远端SRv6 SID与交叉连接的映射表,找到对应交叉连接。在PE 4上根据该交叉连接关联的AC转发报文。远端SRv6 SID类型仅支持End.DX2 SID。
(3) EVPN VPLS over SRv6 TE Policy尾节点保护场景:End.M SID对应的转发动作为剥掉外层IPv6报文头,获取到内层报文信息,查找远端SRv6 SID。根据查找到的远端SRv6 SID查询远端SRv6 SID与VSI的映射表,找到对应VSI。在PE 4上对应VSI内查找MAC地址表转发。远端SRv6 SID类型仅支持End.DT2U SID。
如1. 图39所示,PE 4从PE 3收到BGP路由后,如果BGP路由中的SRv6 SID在PE 4上End.M SID保护的Locator范围内,则该SRv6 SID为远端SRv6 SID,同时在PE 4上生成远端SRv6 SID与VPN实例/公网实例/交叉连接/VSI的映射表。
当PE 3故障时,PE 4与PE 3之间邻居中断,会导致PE 4从PE 3收到的BGP路由删除,进而导致远端SRv6 SID与VPN实例/公网实例/交叉连接/VSI的映射表被删除,造成丢包。为了避免上述情况,可以在PE 4上延迟删除远端SRv6 SID与VPN实例/公网实例/交叉连接/VSI的映射表,在PE 1感知到PE 3故障计算出新的转发路径前,保证流量通过PE 4转发,避免丢包。
IP L3VPN/EVPN L3VPN/EVPN VPWS/EVPN VPLS/公网IP over SRv6 TE Policy尾节点保护场景的路由发布过程类似,以IP L3VPN over SRv6 TE Policy尾节点保护场景为例进行介绍。
如1. 图39所示,P 1上FRR路径的生成过程为:
(1) PE 4通过IS-ISv6路由向邻居P 1发布End.M SID和被保护的Locator,同时PE 4上生成End.M SID的Local SID表。
(2) P 1收到携带End.M SID的路由后,生成到达指定Locator的FRR路由信息,动作为压入End.M SID。该FRR路由对应的转发路径为Mirror FRR路径。
如1. 图39所示,PE 4上远端SRv6 SID与VPN实例的映射表生成过程为:
(3) PE 3收到CE 2发布的私网路由之后,封装成VPNv4路由发送给PE 4,路由携带SRv6 SID、RT、RD信息。
(4) PE 4从PE 3收到VPNv4路由后,获取到该VPN实例对应的SRv6 SID。PE 4使用该SRv6 SID和End.M SID保护的Locator段进行最长匹配。如果匹配上,则该SRv6 SID为远端SRv6 SID,在PE 4上生成远端SRv6 SID与VPN实例的映射表。
IP L3VPN/EVPN L3VPN/EVPN VPWS/EVPN VPLS/公网IP over SRv6 TE Policy尾节点保护场景的报文转发过程类似,以IP L3VPN over SRv6 TE Policy尾节点保护场景为例进行介绍。
图40 SRv6 TE Policy尾节点保护转发示意图
如图40所示,正常情况下,流量经过路径CE 1-PE 1-P 1-PE 3-CE 2转发。当尾节点PE 3故障时,报文转发过程为:
(1) P 1上感知到下一跳PE 3不可达,切换为FRR路径。P 1为报文封装IPv6报文头,其目的地址为End.M SID,然后转发给PE 4。
(2) PE 4解析到End.M SID,查询Local SID表,发现End.M SID对应指令为剥掉外层IPv6报文头,获取到内层报文信息,查找远端SRv6 SID。根据查找到的远端SRv6 SID查询远端SRv6 SID与VPN实例的映射表,找到对应VPN实例1。然后,在PE 4上查询该VPN实例1的路由表将流量转发给CE 2。
开启SRv6 TE Policy尾节点保护功能的关键命令为:
· opcode opcode end-m mirror-locator ipv6-address prefix-length(SRv6 Locator视图)命令用来配置End.M SID,指定被保护的Locator段。
· fast-reroute mirror enable(IS-IS IPv6单播地址族视图/OSPFv3视图)命令用来开启尾节点保护功能。
如图41所示,在PE 1和PE 2之间建立双向SRv6 TE Policy,承载L3VPN业务。PE 2是SRv6 TE Policy的尾节点,为了增强可靠性,在P设备上配置TI-LFA FRR和尾节点保护功能,PE 3为PE 2提供保护。
当PE 2节点故障时,P设备上感知PE 2下一跳不可达,将设备P与PE 2的接口断开,流量通过PE3设备转发,避免丢包。
图41 SRv6 TE Policy尾节点保护配置组网图
设备 |
接口 |
IP地址 |
设备 |
接口 |
IP地址 |
CE 1 |
HGE1/0/1 |
10.1.1.2/24 |
PE 2 |
Loop0 |
3::3/128 |
PE 1 |
Loop0 |
1::1/128 |
|
HGE1/0/1 |
10.2.1.1/24 |
|
HGE1/0/1 |
10.1.1.1/24 |
|
HGE1/0/2 |
2002::1/64 |
|
HGE1/0/2 |
2001::1/96 |
|
HGE1/0/3 |
2004::2/96 |
P |
Loop0 |
2::2/128 |
PE 3 |
Loop0 |
4::4/128 |
|
HGE1/0/1 |
2001::2/96 |
|
HGE1/0/1 |
10.3.1.1/24 |
|
HGE1/0/2 |
2002::2/64 |
|
HGE1/0/2 |
2003::1/96 |
|
HGE1/0/3 |
2003::2/96 |
|
HGE1/0/3 |
2004::1/96 |
|
|
|
CE 2 |
HGE1/0/1 |
10.2.1.2/24 |
|
|
|
|
HGE1/0/2 |
10.3.1.2/24 |
按图41配置各CE的接口IP地址,配置过程略。
(1) 配置CE 1
# 与PE建立EBGP对等体,引入VPN路由。
<CE1> system-view
[CE1] bgp 65410
[CE1-bgp-default] peer 10.1.1.1 as-number 100
[CE1-bgp-default] address-family ipv4 unicast
[CE1-bgp-default-ipv4] peer 10.1.1.1 enable
[CE1-bgp-default-ipv4] import-route direct
[CE1-bgp-default-ipv4] quit
[CE1-bgp-default] quit
(2) 配置PE 1
# 配置IPv6 IS-IS,实现骨干网互通。
<PE1> system-view
[PE1] isis 1
[PE1-isis-1] is-level level-1
[PE1-isis-1] cost-style wide
[PE1-isis-1] network-entity 10.1111.1111.1111.00
[PE1-isis-1] address-family ipv6 unicast
[PE1-isis-1-ipv6] quit
[PE1-isis-1] quit
[PE1] interface loopback 0
[PE1-LoopBack0] ipv6 address 1::1 128
[PE1-LoopBack0] isis ipv6 enable 1
[PE1-LoopBack0] quit
[PE1] interface hundredgige 1/0/2
[PE1-HundredGigE1/0/2] ipv6 address 2001::1 96
[PE1-HundredGigE1/0/2] isis ipv6 enable 1
[PE1-HundredGigE1/0/2] quit
# 配置VPN实例,将CE接入PE。
[PE1] ip vpn-instance vpn1
[PE1-vpn-instance-vpn1] route-distinguisher 100:1
[PE1-vpn-instance-vpn1] vpn-target 111:1
[PE1-vpn-instance-vpn1] quit
[PE1] interface hundredgige 1/0/1
[PE1-HundredGigE1/0/1] ip binding vpn-instance vpn1
[PE1-HundredGigE1/0/1] ip address 10.1.1.1 24
[PE1-HundredGigE1/0/1] quit
# 与CE建立EBGP对等体,引入VPN路由。
[PE1] bgp 100
[PE1-bgp-default] router-id 1.1.1.1
[PE1-bgp-default] ip vpn-instance vpn1
[PE1-bgp-default-vpn1] peer 10.1.1.2 as-number 65410
[PE1-bgp-default-vpn1] address-family ipv4 unicast
[PE1-bgp-default-ipv4-vpn1] peer 10.1.1.2 enable
[PE1-bgp-default-ipv4-vpn1] quit
[PE1-bgp-default-vpn1] quit
# 在PE之间建立MP-IBGP对等体。
[PE1] bgp 100
[PE1-bgp-default] peer 3::3 as-number 100
[PE1-bgp-default] peer 4::4 as-number 100
[PE1-bgp-default] peer 3::3 connect-interface loopback 0
[PE1-bgp-default] peer 4::4 connect-interface loopback 0
[PE1-bgp-default] address-family vpnv4
[PE1-bgp-default-vpnv4] peer 3::3 enable
[PE1-bgp-default-vpnv4] peer 4::4 enable
[PE1-bgp-default-vpnv4] quit
[PE1-bgp-default] quit
# 配置L3VPN over SRv6 TE Policy。
[PE1] segment-routing ipv6
[PE1-segment-routing-ipv6] encapsulation source-address 1::1
[PE1-segment-routing-ipv6] locator aaa ipv6-prefix 1:2::1:0 96 static 8
[PE1-segment-routing-ipv6-locator-aaa] opcode 1 end-dt4 vpn-instance vpn1
[PE1-segment-routing-ipv6-locator-aaa] quit
[PE1-segment-routing-ipv6] quit
[PE1] bgp 100
[PE1-bgp-default] address-family vpnv4
[PE1-bgp-default-vpnv4] peer 3::3 prefix-sid
[PE1-bgp-default-vpnv4] peer 4::4 prefix-sid
[PE1-bgp-default-vpnv4] quit
[PE1-bgp-default] ip vpn-instance vpn1
[PE1-bgp-default-vpn1] address-family ipv4 unicast
[PE1-bgp-default-ipv4-vpn1] segment-routing ipv6 traffic-engineering best-effort
[PE1-bgp-default-ipv4-vpn1] segment-routing ipv6 locator aaa
[PE1-bgp-default-ipv4-vpn1] quit
[PE1-bgp-default-vpn1] quit
[PE1-bgp-default] quit
[PE1] isis 1
[PE1-isis-1] address-family ipv6 unicast
[PE1-isis-1-ipv6] segment-routing ipv6 locator aaa
[PE1-isis-1-ipv6] quit
[PE1-isis-1] quit
# 配置SRv6 TE Policy。
[PE1] segment-routing ipv6
[PE1-segment-routing-ipv6] traffic-engineering
[PE1-srv6-te] srv6-policy locator aaa
[PE1-srv6-te] segment-list s1
[PE1-srv6-te-s1-s1] index 10 ipv6 100:abc:1::1
[PE1-srv6-te-s1-s1] index 20 ipv6 6:5::1:2
[PE1-srv6-te-s1-s1] quit
[PE1-srv6-te] policy p1
[PE1-srv6-te-policy-p1] binding-sid ipv6 1:2::1:2
[PE1-srv6-te-policy-p1] color 10 end-point ipv6 3::3
[PE1-srv6-te-policy-p1] forwarding ignore-last-sid enable
[PE1-srv6-te-policy-p1] candidate-paths
[PE1-srv6-te-policy-p1-path] preference 10
[PE1-srv6-te-policy-p1-path-pref-10] explicit segment-list s1
[PE1-srv6-te-policy-p1-path-pref-10] quit
[PE1-srv6-te-policy-p1-path] quit
[PE1-srv6-te-policy-p1] quit
[PE1-srv6-te] segment-list s2
[PE1-srv6-te-s2-s2] index 10 ipv6 100:abc:1::1
[PE1-srv6-te-s2-s2] index 20 ipv6 9:7::100
[PE1-srv6-te-s2-s2] quit
[PE1-srv6-te] policy p2
[PE1-srv6-te-policy-p2] binding-sid ipv6 1:2::1:2
[PE1-srv6-te-policy-p2] color 10 end-point ipv6 4::4
[PE1-srv6-te-policy-p2] forwarding ignore-last-sid enable
[PE1-srv6-te-policy-p2] candidate-paths
[PE1-srv6-te-policy-p2-path] preference 20
[PE1-srv6-te-policy-p2-path-pref-20] explicit segment-list s2
[PE1-srv6-te-policy-p2-path-pref-20] quit
[PE1-srv6-te-policy-p2-path] quit
[PE1-srv6-te-policy-p2] quit
[PE1-srv6-te] quit
[PE1-segment-routing-ipv6] quit
(3) 配置P
# 配置IPv6 IS-IS,实现骨干网互通。
<P> system-view
[P] isis 1
[P-isis-1] is-level level-1
[P-isis-1] cost-style wide
[P-isis-1] network-entity 10.2222.2222.2222.00
[P-isis-1] address-family ipv6 unicast
[P-isis-1-ipv6] quit
[P-isis-1] quit
[P] interface loopback 0
[P-LoopBack0] ipv6 address 2::2 128
[P-LoopBack0] isis ipv6 enable 1
[P-LoopBack0] quit
[P] interface hundredgige 1/0/1
[P-HundredGigE1/0/1] ipv6 address 2001::2 96
[P-HundredGigE1/0/1] isis ipv6 enable 1
[P-HundredGigE1/0/1] quit
[P] interface hundredgige 1/0/2
[P-HundredGigE1/0/2] ipv6 address 2002::2 96
[P-HundredGigE1/0/2] isis ipv6 enable 1
[P-HundredGigE1/0/2] quit
[P] interface hundredgige 1/0/3
[P-HundredGigE1/0/3] ipv6 address 2003::2 96
[P-HundredGigE1/0/3] isis ipv6 enable 1
[P-HundredGigE1/0/3] quit
# 配置SRv6功能。
[P] segment-routing ipv6
[P-segment-routing-ipv6] locator p ipv6-prefix 100:abc:1::0 96 static 8
[P-segment-routing-ipv6-locator-p] opcode 1 end
[P-segment-routing-ipv6-locator-p] quit
[P-segment-routing-ipv6] quit
[P] isis 1
[P-isis-1] address-family ipv6 unicast
[P-isis-1-ipv6] segment-routing ipv6 locator p
# 配置快速重路由的备份下一跳信息,并开启尾节点保护功能。
[P-isis-1-ipv6] fast-reroute lfa level-1
[P-isis-1-ipv6] fast-reroute ti-lfa
[P-isis-1-ipv6] fast-reroute mirror enable
[P-isis-1-ipv6] fast-reroute mirror delete-delay 480
[P-isis-1-ipv6] quit
[P-isis-1] quit
(4) 配置PE 2
# 配置IPv6 IS-IS,实现骨干网互通。
<PE2> system-view
[PE2] isis 1
[PE2-isis-1] is-level level-1
[PE2-isis-1] cost-style wide
[PE2-isis-1] network-entity 10.3333.3333.3333.00
[PE2-isis-1] address-family ipv6 unicast
[PE2-isis-1-ipv6] quit
[PE2-isis-1] quit
[PE2] interface loopback 0
[PE2-LoopBack0] ipv6 address 3::3 128
[PE2-LoopBack0] isis ipv6 enable 1
[PE2-LoopBack0] quit
[PE2] interface hundredgige 1/0/2
[PE2-HundredGigE1/0/2] ipv6 address 2002::1 96
[PE2-HundredGigE1/0/2] isis ipv6 enable 1
[PE2-HundredGigE1/0/2] quit
[PE2] interface hundredgige 1/0/3
[PE2-HundredGigE1/0/3] ipv6 address 2004::2 96
[PE2-HundredGigE1/0/3] isis ipv6 enable 1
[PE2-HundredGigE1/0/3] quit
# 配置VPN实例,将CE接入PE。
[PE2] ip vpn-instance vpn1
[PE2-vpn-instance-vpn1] route-distinguisher 100:1
[PE2-vpn-instance-vpn1] vpn-target 111:1
[PE2-vpn-instance-vpn1] quit
[PE2] interface hundredgige 1/0/1
[PE2-HundredGigE1/0/1] ip binding vpn-instance vpn1
[PE2-HundredGigE1/0/1] ip address 10.2.1.1 24
[PE2-HundredGigE1/0/1] quit
# 与CE建立EBGP对等体,引入VPN路由。
[PE2] bgp 100
[PE2-bgp-default] router-id 2.2.2.2
[PE2-bgp-default] ip vpn-instance vpn1
[PE2-bgp-default-vpn1] peer 10.2.1.2 as-number 65420
[PE2-bgp-default-vpn1] address-family ipv4 unicast
[PE2-bgp-default-ipv4-vpn1] peer 10.2.1.2 enable
[PE2-bgp-default-ipv4-vpn1] quit
[PE2-bgp-default-vpn1] quit
# 在PE之间建立MP-IBGP对等体。
[PE2] bgp 100
[PE2-bgp-default] peer 1::1 as-number 100
[PE2-bgp-default] peer 4::4 as-number 100
[PE2-bgp-default] peer 1::1 connect-interface loopback 0
[PE2-bgp-default] peer 4::4 connect-interface loopback 0
[PE2-bgp-default] address-family vpnv4
[PE2-bgp-default-vpnv4] peer 1::1 enable
[PE2-bgp-default-vpnv4] peer 4::4 enable
[PE2-bgp-default-vpnv4] quit
[PE2-bgp-default] quit
# 配置L3VPN over SRv6 TE Policy。
[PE2] segment-routing ipv6
[PE2-segment-routing-ipv6] encapsulation source-address 3::3
[PE2-segment-routing-ipv6] locator bbb ipv6-prefix 6:5::1:0 96 static 8
[PE2-segment-routing-ipv6-locator-bbb] opcode 1 end-dt4 vpn-instance vpn1
[PE2-segment-routing-ipv6-locator-bbb] opcode 2 end
[PE2-segment-routing-ipv6-locator-bbb] quit
[PE2-segment-routing-ipv6] quit
[PE2] bgp 100
[PE2-bgp-default] address-family vpnv4
[PE2-bgp-default-vpnv4] peer 1::1 prefix-sid
[PE2-bgp-default-vpnv4] peer 4::4 prefix-sid
[PE2-bgp-default-vpnv4] quit
[PE2-bgp-default] ip vpn-instance vpn1
[PE2-bgp-default-vpn1] address-family ipv4 unicast
[PE2-bgp-default-ipv4-vpn1] segment-routing ipv6 traffic-engineering best-effort
[PE2-bgp-default-ipv4-vpn1] segment-routing ipv6 locator bbb
[PE2-bgp-default-ipv4-vpn1] quit
[PE2-bgp-default-vpn1] quit
[PE2-bgp-default] quit
[PE2] isis 1
[PE2-isis-1] address-family ipv6 unicast
[PE2-isis-1-ipv6] segment-routing ipv6 locator bbb
[PE2-isis-1-ipv6] quit
[PE2-isis-1] quit
(5) 配置PE 3
# 配置IPv6 IS-IS,实现骨干网互通。
<PE3> system-view
[PE3] isis 1
[PE3-isis-1] is-level level-1
[PE3-isis-1] cost-style wide
[PE3-isis-1] network-entity 10.4444.4444.4444.00
[PE3-isis-1] address-family ipv6 unicast
[PE3-isis-1-ipv6] quit
[PE3-isis-1] quit
[PE3] interface loopback 0
[PE3-LoopBack0] ipv6 address 4::4 128
[PE3-LoopBack0] isis ipv6 enable 1
[PE3-LoopBack0] quit
[PE3] interface hundredgige 1/0/2
[PE3-HundredGigE1/0/2] ipv6 address 2003::1 96
[PE3-HundredGigE1/0/2] isis ipv6 enable 1
[PE3-HundredGigE1/0/2] quit
[PE3] interface hundredgige 1/0/3
[PE3-HundredGigE1/0/3] ipv6 address 2004::1 96
[PE3-HundredGigE1/0/3] isis ipv6 enable 1
[PE3-HundredGigE1/0/3] quit
# 配置VPN实例,将CE接入PE。
[PE3] ip vpn-instance vpn1
[PE3-vpn-instance-vpn1] route-distinguisher 100:1
[PE3-vpn-instance-vpn1] vpn-target 111:1
[PE3-vpn-instance-vpn1] quit
[PE3] interface hundredgige 1/0/1
[PE3-HundredGigE1/0/1] ip binding vpn-instance vpn1
[PE3-HundredGigE1/0/1] ip address 10.3.1.1 24
[PE3-HundredGigE1/0/1] quit
# 与CE建立EBGP对等体,引入VPN路由。
[PE3] bgp 100
[PE3-bgp-default] router-id 3.3.3.3
[PE3-bgp-default] ip vpn-instance vpn1
[PE3-bgp-default-vpn1] peer 10.3.1.2 as-number 65420
[PE3-bgp-default-vpn1] address-family ipv4 unicast
[PE3-bgp-default-ipv4-vpn1] peer 10.3.1.2 enable
[PE3-bgp-default-ipv4-vpn1] quit
[PE3-bgp-default-vpn1] quit
# 在PE之间建立MP-IBGP对等体。
[PE3] bgp 100
[PE3-bgp-default] peer 1::1 as-number 100
[PE3-bgp-default] peer 3::3 as-number 100
[PE3-bgp-default] peer 1::1 connect-interface loopback 0
[PE3-bgp-default] peer 3::3 connect-interface loopback 0
[PE3-bgp-default] address-family vpnv4
[PE3-bgp-default-vpnv4] peer 1::1 enable
[PE3-bgp-default-vpnv4] peer 3::3 enable
[PE3-bgp-default-vpnv4] quit
[PE3-bgp-default] quit
# 配置SRv6封装的IPv6报文头的源地址。
[PE3] segment-routing ipv6
[PE3-segment-routing-ipv6] encapsulation source-address 4::4
# 配置远端SRv6 SID与VPN实例/交叉连接/VSI映射表的延迟删除时间。
[PE3-segment-routing-ipv6] mirror remote-sid delete-delay 21845
# 配置End.M SID来保护PE 2。
[PE3-segment-routing-ipv6] locator ccc ipv6-prefix 9:7::1:0 96 static 8
[PE3-segment-routing-ipv6-locator-ccc] opcode 1 end-m mirror-locator 6:5::1:0 96
[PE3-segment-routing-ipv6-locator-ccc] quit
[PE3-segment-routing-ipv6] quit
# 配置将私网路由迭代到End.M SID的路由条目上。
[PE3] bgp 100
[PE3-bgp-default] address-family vpnv4
[PE3-bgp-default-vpnv4] peer 1::1 prefix-sid
[PE3-bgp-default-vpnv4] peer 3::3 prefix-sid
[PE3-bgp-default-vpnv4] quit
[PE3-bgp-default] ip vpn-instance vpn1
[PE3-bgp-default-vpn1] address-family ipv4 unicast
[PE3-bgp-default-ipv4-vpn1] segment-routing ipv6 locator ccc
[PE3-bgp-default-ipv4-vpn1] quit
[PE3-bgp-default-vpn1] quit
[PE3-bgp-default] quit
[PE3] isis 1
[PE3-isis-1] address-family ipv6 unicast
[PE3-isis-1-ipv6] segment-routing ipv6 locator ccc
[PE3-isis-1-ipv6] quit
[PE3-isis-1] quit
(6) 配置CE 2
# 与PE建立EBGP对等体,引入VPN路由。
<CE2> system-view
[CE2] bgp 65420
[CE2-bgp-default] peer 10.2.1.1 as-number 100
[CE2-bgp-default] peer 10.3.1.1 as-number 100
[CE2-bgp-default] address-family ipv4 unicast
[CE2-bgp-default-ipv4] peer 10.2.1.1 enable
[CE2-bgp-default-ipv4] peer 10.3.1.1 enable
[CE2-bgp-default-ipv4] import-route direct
[CE2-bgp-default-ipv4] quit
[CE2-bgp-default] quit
(1) 查看配置
# 在PE 1上查看SRv6 TE Policy的配置情况,可以看到SRv6 TE Policy处于激活状态,设备可以通过SRv6 TE Policy转发流量。
[PE1] display segment-routing ipv6 te policy
Name/ID: p1/0
Color: 10
End-point: 3::3
Name from BGP:
BSID:
Mode: Explicit Type: Type_2 Request state: Succeeded
Current BSID: 1:2::1:2 Explicit BSID: 1:2::1:2 Dynamic BSID: -
Reference counts: 4
Flags: A/BS/NC
Status: Up
AdminStatus: Up
Up time: 2020-10-28 09:10:33
Down time: 2020-10-28 09:09:32
Hot backup: Disabled
Statistics: Disabled
Statistics by service class: Disabled
Path verification: Disabled
Forwarding ignore last SID: Disabled
Drop-upon-invalid: Disabled
BFD trigger path-down: Disabled
SBFD: Disabled
BFD Echo: Disabled
Forwarding index: 2150629377
Association ID: 1
Service-class: -
Rate-limit: -
PCE delegation: Disabled
PCE delegate report-only: Disabled
Encaps reduced: Disabled
Encaps include local End.X: Disabled
Candidate paths state: Configured
Candidate paths statistics:
CLI paths: 1 BGP paths: 0 PCEP paths: 0
Candidate paths:
Preference : 10
CPathName:
ProtoOrigin: CLI Discriminator: 30
Instance ID: 0 Node address: 0.0.0.0
Originator: 0, ::
Optimal: Y Flags: V/A
Dynamic: Not configured
PCEP: Not configured
Explicit SID list:
ID: 1 Name: s1
Weight: 1 Forwarding index: 2149580801
State: Up State(-): -
Verification State: -
Active path MTU: 1280 bytes
# 在PE 1设备上查看SRv6 TE Policy的转发信息。
[PE1] display segment-routing ipv6 te forwarding verbose
Total forwarding entries: 1
Policy name/ID: p1/0
Binding SID: 1:2::1:2
Forwarding index: 2150629377
Main path:
Seglist Name/ID: 1
Seglist forwarding index: 2149580801
Weight: 1
Outgoing forwarding index: 2148532225
Interface: HGE1/0/2
Nexthop: FE80::988A:B5FF:FED9:316
Path ID: 0
SID list: {100:ABC:1::1, 6:5::1:2}
# 在PE 1上查看转发路径信息,可以看到SRv6 TE Policy对应的转发路径信息。
[PE1] display segment-routing ipv6 forwarding
Total SRv6 forwarding entries: 3
Flags: T - Forwarded through a tunnel
N - Forwarded through the outgoing interface to the nexthop IP address
A - Active forwarding information
B - Backup forwarding information
ID FWD-Type Flags Forwarding info
Attri-Val Attri-Val
--------------------------------------------------------------------------------
2148532225 SRv6PSIDList NA HGE1/0/2
FE80::988A:B5FF:FED9:316
{100:ABC:1::1, 6:5::1:2}
2149580801 SRv6PCPath TA 2148532225
2150629377 SRv6Policy TA 2149580801
p1
# 在PE 3上查看End.M SID所保护的远端SRv6 SID信息。
[PE3] display bgp mirror remote-sid
Remote SID: 6:5::1:1
Remote SID type: End.DT4
Mirror locator: 6:5::1:0/96
Vpn instance name: vpn1
# 在P上查看IS-IS IPv6路由中End.M SID信息。
[P] display isis route ipv6 6:5::1:0 96 verbose
Route information for IS-IS(1)
------------------------------
Level-1 IPv6 forwarding table
-----------------------------
IPv6 dest : 6:5::1:0/96
Flag : R/-/- Cost : 10
Admin tag : - Src count : 3
Nexthop : FE80::988A:BDFF:FEB6:417
NxthopFlag: -
Interface : HGE1/0/2
Mirror FRR:
Interface : HGE1/0/3
BkNextHop : FE80::988A:C6FF:FE0D:517
LsIndex : 0x80000001
Backup label stack(top->bottom): {9:7::1:1}
Nib ID : 0x24000006
Flags: D-Direct, R-Added to Rib, L-Advertised in LSPs, U-Up/Down Bit Set
(2) 流量切换
正常情况下,流量经过路径CE 1-PE 1-P-PE 2-CE 2发布到私网。CE1发往CE2的流量由P设备转发给PE2,出接口为HGE1/0/2。
[P] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 7 3378203 -- --
HGE1/0/3 0 0 -- --
Overflow: More than 14 digits.
--: Not supported.
# 当PE2节点故障时,P设备切换下一跳为备用下一跳HGE1/0/3,流量从PE3转发出去,在此过程中流量零丢包。
[P] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 0 0 -- --
HGE1/0/3 7 3378203 -- --
Overflow: More than 14 digits.
--: Not supported.
# 当PE2节点故障恢复时,P设备切换下一跳为主用下一跳HGE1/0/2,流量从PE2转发出去,在此过程中流量零丢包。
[P] interface hundredgige 1/0/2
[P] display counters rate outbound interface
Usage: Bandwidth utilization in percentage
Interface Usage (%) Total (pps) Broadcast (pps) Multicast (pps)
HGE1/0/1 0 0 -- --
HGE1/0/2 7 3378203 -- --
HGE1/0/3 0 0 -- --
Overflow: More than 14 digits.
--: Not supported.
· 智能无损网络技术白皮书
· SRv6高可靠性技术白皮书