rLFAにおける動的迂回経路の生成

12/26(日)20:00-21:30 Segment Routing TI-LFAの勉強会を開催しました。
大変ありがたいことに11名の方に参加いただきました。(初:3名、リピーター8名)
年の瀬にもかかわらず、ご参加いただき誠にありがとうございました!

https://connpass.com/event/233995/
勉強会#12(SR MPLS)
Segment Routing Topology Independent LFA (TI-LFA)

元ネタURL
https://www.segment-routing.net/tutorials/2016-09-27-topology-independent-lfa-ti-lfa/
Segment Routing Topology Independent LFA (TI-LFA)

約一年前にTI-LFAの”P-space”、”Q-space”、”PQ-space”を苦労して理解しました。
これは誰かに話してぇ!そうだ勉強会をしよう!と心に決めた日が懐かしいです。
勉強会では、rLFAとは何なのかについて話しましたが、デモが十分ではなかったのでデモを補足するブログを書きました。

1. 検証構成

CML2で、CSR1000v(Cisco IOS XE Software, Version 16.11.01b)を7台使って検証しました。
f:id:chimay_wh:20211231160758p:plain

2.Config

R1-config

hostname R1
!
mpls label range 1000 1099
mpls traffic-eng tunnels
!
interface Loopback0
 ip address 1.1.1.1 255.255.255.255
 ip ospf 1 area 0
!
interface Tunnel1235
 ip unnumbered Loopback0
 tunnel mode mpls traffic-eng
 tunnel destination 5.5.5.5
 tunnel mpls traffic-eng path-option 10 explicit name PATH1
 tunnel mpls traffic-eng fast-reroute
!
interface GigabitEthernet1
 ip address 10.1.2.1 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 mpls traffic-eng tunnels
 bfd interval 50 min_rx 50 multiplier 3
 ip rsvp bandwidth 10000000 10000000
!
!
router ospf 1
 router-id 1.1.1.1
 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
 bfd all-interfaces
 mpls traffic-eng router-id Loopback0
 mpls traffic-eng area 0
!
ip explicit-path name PATH1 enable
 index 1 next-address 1.1.1.2
 index 2 next-address 1.1.1.3
 index 3 next-address 1.1.1.5
!
mpls ldp router-id Loopback0 force
!
end

R2-config

hostname R2
!
mpls label range 2000 2099
mpls traffic-eng tunnels
!
interface Loopback0
 ip address 1.1.1.2 255.255.255.255
 ip ospf 1 area 0
!
interface GigabitEthernet1
 ip address 10.1.2.2 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 mpls traffic-eng tunnels
 bfd interval 50 min_rx 50 multiplier 3
 ip rsvp bandwidth 10000000 10000000
!
interface GigabitEthernet2
 ip address 10.2.6.2 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
interface GigabitEthernet3
 ip address 10.2.3.2 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 mpls traffic-eng tunnels
 bfd interval 50 min_rx 50 multiplier 3
 ip rsvp bandwidth 10000000 10000000
!
interface GigabitEthernet4
 ip address 10.2.4.2 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
!
router ospf 1
 router-id 1.1.1.2
 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
 bfd all-interfaces
 mpls traffic-eng router-id Loopback0
 mpls traffic-eng area 0
!
mpls ldp router-id Loopback0 force
!
end

R3-config

hostname R3
!
mpls label range 3000 3099
mpls traffic-eng tunnels
!
interface Loopback0
 ip address 1.1.1.3 255.255.255.255
 ip ospf 1 area 0
!
interface GigabitEthernet1
 ip address 10.2.3.3 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 mpls traffic-eng tunnels
 bfd interval 50 min_rx 50 multiplier 3
 ip rsvp bandwidth 10000000 10000000
!
interface GigabitEthernet2
 ip address 10.3.7.3 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
interface GigabitEthernet3
 ip address 10.3.4.3 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
interface GigabitEthernet4
 ip address 10.3.8.3 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
interface GigabitEthernet5
 ip address 10.3.5.3 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 mpls traffic-eng tunnels
 bfd interval 50 min_rx 50 multiplier 3
 ip rsvp bandwidth 10000000 10000000
!
!
router ospf 1
 router-id 1.1.1.3
 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
 bfd all-interfaces
 mpls traffic-eng router-id Loopback0
 mpls traffic-eng area 0
!
mpls ldp router-id Loopback0

R4-config

hostname R4
!
mpls label range 4000 4099
!
interface Loopback0
 ip address 1.1.1.4 255.255.255.255
 ip ospf 1 area 0
!
interface GigabitEthernet1
 ip address 10.2.4.4 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
interface GigabitEthernet2
 ip address 10.3.4.4 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
router ospf 1
 router-id 1.1.1.4
 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
 bfd all-interfaces
 mpls traffic-eng router-id Loopback0
!
mpls ldp router-id Loopback0 force
!
end

R5-config

hostname R5
!
mpls label range 5000 5099
mpls traffic-eng tunnels
!
interface Loopback0
 ip address 1.1.1.5 255.255.255.255
 ip ospf 1 area 0
!
interface GigabitEthernet1
 ip address 10.3.5.5 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 mpls traffic-eng tunnels
 bfd interval 50 min_rx 50 multiplier 3
 ip rsvp bandwidth 10000000 10000000
!
!
router ospf 1
 router-id 1.1.1.5
 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
 bfd all-interfaces
 mpls traffic-eng router-id Loopback0
 mpls traffic-eng area 0
!
mpls ldp router-id Loopback0 force
!
end

R6-config

hostname R6
!
mpls label range 6000 6099
!
interface Loopback0
 ip address 1.1.1.6 255.255.255.255
 ip ospf 1 area 0
!
interface GigabitEthernet1
 ip address 10.6.7.6 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
interface GigabitEthernet2
 ip address 10.2.6.6 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
!
router ospf 1
 router-id 1.1.1.6
 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
 bfd all-interfaces
!
mpls ldp router-id Loopback0 force
!
end

R7-config

hostname R7
!
mpls label range 7000 7099
!
interface Loopback0
 ip address 1.1.1.7 255.255.255.255
 ip ospf 1 area 0
!
interface GigabitEthernet1
 ip address 10.6.7.7 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
interface GigabitEthernet2
 ip address 10.3.7.7 255.255.255.0
 ip ospf network point-to-point
 ip ospf 1 area 0
 mpls ip
 bfd interval 50 min_rx 50 multiplier 3
!
!
router ospf 1
 router-id 1.1.1.7
 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
 bfd all-interfaces
!
mpls ldp router-id Loopback0 force
!
end

3. rLFA検証

今回は各ルータのラベルがどのように変化していくのかをR2を中心に見ていきます。 rLFAとは何なのかについては、以前書いたブログをご参照ください。
https://chimay-wh.hatenablog.com/entry/2021/12/07/121630

3.1 rLFAなし

最初は、TE-tunnelだけの状態です。
f:id:chimay_wh:20211231161218p:plain

BACKUP経路の定義をしていないため、トポロジーカバー率は表示されません。

R2#show ip ospf fast-reroute prefix-summary 

            OSPF Router with ID (1.1.1.2) (Process ID 1)

Loop-free Fast Reroute not configured.

R2#

3.2 rLFA定義

rLFAは、インターフェースでldpを有効にする必要があります。
CCOによると、rLFAを定義することにより他のLDP トンネルはアップしないとあります。
www.cisco.com

Tunnel built is an MPLS LDP tunnel. Therefore, it requires LDP to be enabled in environment. However, pre-requisite for running remote LFA is direct LFA, else LDP tunnel does not come up.

rLFAとClassic-LFAは併用できませんが、direct LFA protection を有効にすることができるので、逆に楽になるように思えます。
f:id:chimay_wh:20211231161358p:plain

3.2.1 enable directly connected LFA

OSPFでdirectly connected LFAの定義を有効化します。

fast-reroute per-prefix enable area【area-num】prefix-priority high
 fast-reroute keep-all-paths

Router configuration (config-router)オンラインヘルプ

R2(config-router)#?
Router configuration commands:
<snip>
  fast-reroute             LFA FastReroute parameters
<snip>
          
R2(config-router)#fast-reroute ?
  keep-all-paths  Keep LFA FRR audit trail
  per-prefix      Per-prefix LFA FRR parameters

R2(config-router)#fast-reroute per-prefix ?
  enable      Enable LFA Fast Reroute

R2(config-router)#fast-reroute per-prefix enable ?
  area             Area to enable LFA FRR in

R2(config-router)#fast-reroute per-prefix enable area ?
  <0-4294967295>  OSPF area ID as a decimal value
  A.B.C.D         OSPF area ID in IP address format

R2(config-router)#fast-reroute per-prefix enable area 0 ?
  prefix-priority  Priority of prefixes to be protected

R2(config-router)#fast-reroute per-prefix enable area 0 prefix-priority ?
  high  High priority prefixes
  low   Low priority prefixes

R2(config-router)#fast-reroute per-prefix enable area 0 prefix-priority high ?
  <cr>  <cr>

R2(config-router)#fast-reroute per-prefix enable area 0 prefix-priority high 
R2(config-router)#
R2(config-router)#fast-reroute ?
  keep-all-paths  Keep LFA FRR audit trail

R2(config-router)#fast-reroute keep-all-paths 
R2(config-router)#

3.2.2 enable remote LFA

OSPFでremote LFAの定義を有効化します。

fast-reroute per-prefix remote-lfa area【area-num】tunnel mpls-ldp

Router configuration (config-router)オンラインヘルプ

R2(config-router)#?
Router configuration commands:
<snip>
  fast-reroute             LFA FastReroute parameters
<snip>
          
R2(config-router)#fast-reroute ?
  per-prefix      Per-prefix LFA FRR parameters

R2(config-router)#fast-reroute per-prefix ?
  remote-lfa  Remote LFA FastReroute parameters

R2(config-router)#fast-reroute per-prefix remote-lfa ?
  area          Area for remote LFA command

R2(config-router)#fast-reroute per-prefix remote-lfa area ?
  <0-4294967295>  OSPF area ID as a decimal value
  A.B.C.D         OSPF area ID in IP address format

R2(config-router)#fast-reroute per-prefix remote-lfa area 0 ?
  tunnel        Remote LFA tunnel type

R2(config-router)#fast-reroute per-prefix remote-lfa area 0 tunnel ?
  mpls-ldp  Enable remote LFA tunneling via MPLS

R2(config-router)#fast-reroute per-prefix remote-lfa area 0 tunnel mpls-ldp ?
  <cr>  <cr>

R2(config-router)#fast-reroute per-prefix remote-lfa area 0 tunnel mpls-ldp 
R2(config-router)#

以降、”directly connected LFA”と”remote LFA”を”rLFA定義”と省略して表記します。

Classic-LFAでは、Backup pathの定義とprotect-linkの指定をする必要がありましたが、rLFAではそれが不要となります。

3.3 rLFA定義後の確認

Primary LSP の Link(R2-R3)を保護している状況を確認します。
PLRはR2です。PLRのneighborであるR4は、1.1.1.5/32宛のラベル情報を保持しています。
なお、R2,R3,R4のCEFとLFIBの出力結果よりR4におけるdirectly connected LFAは、オレンジの破線となります。
f:id:chimay_wh:20211231161640p:plain

R2は、LSD(Label Switching Databaseの略です。以後LSDと省略します。)にR4が保持しているラベル情報(Label:4015)を格納していませんが、 内部的にそのラベル情報を学習しています。
f:id:chimay_wh:20211231161715p:plain

”rLFA定義”を全ノードに定義することにより、repair pathが自動的に構築されます。
図の中では、Primary LSP のR2-R3をlink protect している状況のみをピックアップしています。
f:id:chimay_wh:20211231161812p:plain
トポロジーカバー率は以下のようになります。

R2#show ip  ospf fast-reroute prefix-summary 

            OSPF Router with ID (1.1.1.2) (Process ID 1)
                    Base Topology (MTID 0)

Area 0:

Interface        Protected    Primary paths    Protected paths Percent protected
                             All  High   Low   All  High   Low    All High  Low
Lo0                    Yes     0     0     0     0     0     0     0%   0%   0%
Gi4                    Yes     2     1     1     1     1     0    50% 100%   0%
Gi3                    Yes     6     3     3     3     3     0    50% 100%   0%
Gi2                    Yes     3     2     1     2     2     0    66% 100%   0%
Gi1                    Yes     1     1     0     0     0     0     0%   0%   0%

Area total:                   12     7     5     6     6     0    50%  85%   0%

Process total:                12     7     5     6     6     0    50%  85%   0%

R2#

R2-R3間でlink-downを発生させます。
f:id:chimay_wh:20211231161910p:plain
トポロジーカバー率に変化が生じます。(R2's Gi3 がlink-downとなり、トポロジーカバー率が悪化します。) 細部は以降に示します。
迂回経路でラベル通信をします。
f:id:chimay_wh:20211231162047p:plain
迂回経路でラベル通信をする(赤色の実線)と同時に新しい迂回経路(青色の実線)が自動的に構築されます。PLR(R2)のneighborであるR6は、1.1.1.5/32宛のラベル情報を保持しています。
なお、R2,R6,R4のCEFとLFIBの出力結果よりR6におけるdirectly connected LFAは、水色の破線となります。
f:id:chimay_wh:20211231162124p:plain
R2は、LSDにR6が保持しているラベル情報(Label:6016)を格納していませんが、内部的にそのラベル情報を学習しています。図の中では、Primary LSP におけるR2-R3のlink protect している状況と、R7のrLFA(Targeted-LDP)を表記しています。
なお、R7の1.1.1.5/32に対するrepair pathのnext-hopは、1.1.1.2(R2)であり、これはrLFAです。unidirectionであることに注意してください。
説明が複雑になるため省略していますが、R2では別prefix宛のrepair pathに対してrLFAを生成しています。
f:id:chimay_wh:20211231162231p:plain
R2-R3でlink-downが発生しても、迂回経路でラベル通信を継続する(赤色の実線)と同時に新しい迂回経路(青色の実線)が自動的に構築されます。
物理linkが使用できなくなりますが、動的に迂回経路を自動構築することでトポロジーカバー率がそれほど悪化していません。

初めてこの動きを見た時は、「こいつ・・・動くぞ!1」と感動しました。
f:id:chimay_wh:20211231162325p:plain

R2#show ip  ospf fast-reroute prefix-summary 

            OSPF Router with ID (1.1.1.2) (Process ID 1)
                    Base Topology (MTID 0)

Area 0:

Interface        Protected    Primary paths    Protected paths Percent protected
                             All  High   Low   All  High   Low    All High  Low
Lo0                    Yes     0     0     0     0     0     0     0%   0%   0%
Gi4                    Yes     6     3     3     3     3     0    50% 100%   0%
Gi3                    Yes     0     0     0     0     0     0     0%   0%   0%
Gi2                    Yes     4     2     2     2     2     0    50% 100%   0%
Gi1                    Yes     1     1     0     0     0     0     0%   0%   0%

Area total:                   11     6     5     5     5     0    45%  83%   0%

Process total:                11     6     5     5     5     0    45%  83%   0%

R2#

R2-R3間に加えて更にR2-R4間もlink-downを発生させます。
f:id:chimay_wh:20211231162412p:plain
トポロジーカバー率に変化が生じます。

R2#show ip  ospf fast-reroute prefix-summary 

            OSPF Router with ID (1.1.1.2) (Process ID 1)
                    Base Topology (MTID 0)

Area 0:

Interface        Protected    Primary paths    Protected paths Percent protected
                             All  High   Low   All  High   Low    All High  Low
Lo0                    Yes     0     0     0     0     0     0     0%   0%   0%
Gi4                    Yes     0     0     0     0     0     0     0%   0%   0%
Gi3                    Yes     0     0     0     0     0     0     0%   0%   0%
Gi2                    Yes     9     5     4     0     0     0     0%   0%   0%
Gi1                    Yes     1     1     0     0     0     0     0%   0%   0%

Area total:                   10     6     4     0     0     0     0%   0%   0%

Process total:                10     6     4     0     0     0     0%   0%   0%

R2#

細部は以降に示します。
R2-R3でlink障害が発生すると迂回経路でラベル通信をして、更に新しい迂回経路を構築します。そして、R2-R4(迂回経路)でlink障害が発生すると、新しい迂回経路でラベル通信をします。
f:id:chimay_wh:20211231162529p:plain
R2,R6,R7,R3のCEFとLFIBの出力結果より、これ以上迂回経路がないことが分かります。
∵ repair: attached-nexthop という出力が得られないため
f:id:chimay_wh:20211231162602p:plain

TI-LFAだけではなく、rLFAも動的に迂回経路を生成することが分かりました。IOS-XRではまだ検証していないので、今度はIOS-XRでrLFAを定義してTI-LFAと比較検証してみようと思います。

4. 勉強会の宣伝

不定期ですが、土曜夜20:00-21:30 ZOOMで画面共有して勉強会を開催しています。
次回は「Segment Routing TI-LFA 第二部」を予定しています。 日程決まりましたらTwitter、connpassで通知いたしますので、どうぞお気軽にご参加ください。
f:id:chimay_wh:20211231162709p:plain

過去の資料をご覧になりたい方は、その旨ご連絡ください。
Twitter: やすお@Chimay_wh にDM送ってください。

2021.01.23  勉強会#4 Segment Routing Introduction ・
        Segment Routing MPLS data plane(60ページ)
2021.02.07  勉強会#5 Segment Routing Global Block (SRGB)(51ページ)
2021.02.27  勉強会#6 Segment Routing IGP Control Plane(前編)(80ページ)
2021.03.20  勉強会#7 Segment Routing IGP Control Plane(後編)(80ページ)
2021.04.03  勉強会#8 Segment Routing - Co-existence with LDP(62ページ)
2021.04.24  勉強会#9 Segment Routing - Mapping server(87ページ)
2021.05.29  勉強会#10 Segment Routing - SR/LDP interworking(79ページ)
2021.12.18  勉強会#11 OSPF TSHOOT 1st (72ページ)
2021.12.26  勉強会#12 Segment Routing - Topology Independent LFA(87ページ)

最後までお読みいただきありがとうございました。


  1. 機動戦士ガンダム」第一話で主人公アムロ・レイガンダムコクピットに入って発した言葉です。