Remote Loop Free Alternate Path with OSPFv2

一、基本原理

基于RFC5286的LFA FRR在计算备份路径的时候需要满足不等式关系D(N,D) < D(N,S) + D(S,D) ,且只能是直连的邻居作为备份下一跳。那么下面这种场景,OSPF链路的COST值都为10,R1到R6(10.6.6.6)的主路径为R1–>R5–>R6,COST为21(R1->R5->R6->Lo0), 直连邻居只有一个R2,不等式41(R2->R3->R4->R5->R6->Lo0)<10(R2->R1)+21(R1->R5->R6->Lo0)不成立,R1->R6无法计算出直连的LFA:

Remote-Loop-Free-Alternate-Path-with-OSPF-00

基于RFC7490的RLFA,可以通过建立MPLS LFA Tunnel,计算出R3作为RLFA,也就是PQ点,当R1->R6主路径故障,快速切换流量到备份路径:

Remote-Loop-Free-Alternate-Path-with-OSP-01

如何计算PQ点,以RFC7490第四页拓扑为例,S->E为需要保护的链路,对于S节点:

4

1.P-Space:S能够到达的这些节点的集合,基于SPF算法S节点到达这些节点的最短路径不经过保护链路S->E,排除掉等价路径经过保护链路S->E的节点。上面的拓扑中S基于SPF算法到达A,B,C节点的路径可以不经过保护链路S->E,但是S到C的一条等价路径S->E->D->C经过了保护链路,所以C不能算作P-Space
2.Q-Space:能够到达E的这些节点的集合,基于SPF算法能到达E的这些节点的最短路径不经过保护链路S->E,排除掉等价路径经过保护链路S->E的节点。上面拓扑中B,C,D节点基于SPF算法到达E节点的路径可以不经过保护链路S->E,但是B节点有一条等价路径经过了保护链路S->E,所以Q-Space是C,D
3.PQ点:P-Space和Q-Space的交集就是PQ点。当算不出PQ点的时候,就需要运行Extended P-space来进一步计算。
4.Extended P-space:再次以S节点的邻居A为根节点来计算出P-Space为B,C,那么最终的Extended P-space为A,B,C,由于Q-Space为C,D,所以交集为C,C为节点S到E链路的PQ点,作为RLFA。

根据PQ计算的原则:

  • P-Space为:R2,R3
  • Q-Space为:R3,R4,R5
  • PQ为R3

二、实验拓扑

以下面这个拓扑为例,来做个验证:

Remote-Loop-Free-Alternate-Path-with-OSP-02

三、基本配置:

R1

interface Loopback0
ip address 10.1.1.1 255.255.255.255
!
interface GigabitEthernet1
ip address 10.0.12.1 255.255.255.0
mpls ip
!
interface GigabitEthernet3
ip address 10.0.15.1 255.255.255.0
mpls ip

router ospf 100
fast-reroute per-prefix enable area 0 prefix-priority high
fast-reroute per-prefix remote-lfa area 0 tunnel mpls-ldp
fast-reroute keep-all-paths
network 10.0.0.0 0.255.255.255 area 0

R2

interface Loopback0
ip address 10.2.2.2 255.255.255.255
!
interface GigabitEthernet1
ip address 10.0.12.2 255.255.255.0
mpls ip
!
interface GigabitEthernet2
ip address 10.0.23.2 255.255.255.0
mpls ip

router ospf 100
fast-reroute per-prefix enable area 0 prefix-priority high
fast-reroute per-prefix remote-lfa area 0 tunnel mpls-ldp
fast-reroute keep-all-paths
network 10.0.0.0 0.255.255.255 area 0

R3

interface Loopback0
ip address 10.3.3.3 255.255.255.255
!
interface GigabitEthernet1
ip address 10.0.34.3 255.255.255.0
mpls ip
!
interface GigabitEthernet2
ip address 10.0.23.3 255.255.255.0
mpls ip

router ospf 100
fast-reroute per-prefix enable area 0 prefix-priority high
fast-reroute per-prefix remote-lfa area 0 tunnel mpls-ldp
fast-reroute keep-all-paths
network 10.0.0.0 0.255.255.255 area 0

R4

interface Loopback0
ip address 10.4.4.4 255.255.255.255
!
interface GigabitEthernet1
ip address 10.0.34.4 255.255.255.0
mpls ip
!
interface GigabitEthernet2
ip address 10.0.45.4 255.255.255.0
mpls ip

router ospf 100
fast-reroute per-prefix enable area 0 prefix-priority high
fast-reroute per-prefix remote-lfa area 0 tunnel mpls-ldp
fast-reroute keep-all-paths
network 10.0.0.0 0.255.255.255 area 0

R5

interface Loopback0
ip address 10.5.5.5 255.255.255.255
!
interface GigabitEthernet1
ip address 10.0.56.5 255.255.255.0
!
interface GigabitEthernet2
ip address 10.0.45.5 255.255.255.0
mpls ip
!
interface GigabitEthernet3
ip address 10.0.15.5 255.255.255.0
mpls ip

router ospf 100
fast-reroute per-prefix enable area 0 prefix-priority high
fast-reroute per-prefix remote-lfa area 0 tunnel mpls-ldp
fast-reroute keep-all-paths
network 10.0.0.0 0.255.255.255 area 0

R6

interface Loopback0
ip address 10.6.6.6 255.255.255.0
!
interface GigabitEthernet1
ip address 10.0.56.6 255.255.255.0
!
router ospf 100
fast-reroute per-prefix enable area 0 prefix-priority high
fast-reroute keep-all-paths
network 10.0.0.0 0.255.255.255 area 0

四、验证结果:

根据PQ的计算规则,R3为PQ点,作为RLFA,当主链路R1->R5 DOWN掉后,流量会立即切换到备份路径

Remote-Loop-Free-Alternate-Path-with-OSP-03

在R1上查看路由10.6.6.6:主路径为R1->R5,通过MPLS Remote-LFA Tunnel形成备份路径R1->R3

Remote-Loop-Free-Alternate-Path-with-OSP-04

在R1上查看MPLS Remote-LFA Tunnel状态为up,备份路径已经安装进RIB

Remote-Loop-Free-Alternate-Path-with-OSP-05

在实际的网络中,还会部署BFD,通过BFD检测主链路DOWN后,立即切换流量到备份路径,确保倒换时延小于50ms

在R1上面有两条到10.6.6.6的LSP,标签分别为500和300,500是R5分配的,300是RLFA R3分配的

Remote-Loop-Free-Alternate-Path-with-OSP-06

Remote-Loop-Free-Alternate-Path-with-OSP-07

Remote-Loop-Free-Alternate-Path-with-OSP-08

在R1上面查看MPLS Remote-LFA Tunnel

Remote-Loop-Free-Alternate-Path-with-OSP-09五、关键点:

  1. 需要配置MPLS LDP,通过MPLS LDP形成remote-lfa的Tunnel
  2. LFA和RLFA只能在动态链路状态路由协议OSPF和ISIS中配置,运行OSPF和ISIS的路由器根据全网的链路状态信息来计算LFA/RLFA
  3. 在计算备份路径的时候会优先计算直连LFA,没有直连LFA的时候才会去计算RLFA
  4. 在S节点查看到E的LSP有两条,LDP标签分别由主路径下一跳和MPLS LDP形成remote-lfa的Tunnel下一跳分配

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google photo

You are commenting using your Google account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s