Skip to main content

Introduce SBFD (IOSXR)

·521 words·3 mins
IOSXR
Rory
Author
Rory
Step by step the ladder is ascended

SBFD (Seamless Bidirectional Forwarding Detection) 无缝双向转发检测。

SBFD Initiator and Reflector

SBFD 分为发起端和反射端, BFD 状态信息仅在头端维护,尾端需要验证 BFD 报文,并响应,尾端无需维护 BFD 状态信息。

Configure the SBFD
#

SBFD Reflector
#

配置 OAM, 配置 local discriminator.

mpls oam
!
sbfd
 local-discriminator 20010551
 local-discriminator interface Loopback66
!

在配置 OAM 后,会在本地安装一条 127.0.0.0/8 的 RIB 信息:

RP/0/RSP0/CPU0:ASR-9904-G-LS#show route | in 127
Sun Apr  7 14:36:34.586 UTC
L    127.0.0.0/8 [0/0] via 0.0.0.0, 3w3d
RP/0/RSP0/CPU0:ASR-9904-G-LS#show route 127.0.0.0
Sun Apr  7 14:36:08.186 UTC

Routing entry for 127.0.0.0/8
  Known via "local LSPV", distance 0, metric 0 (connected)
  Installed Mar 14 09:59:04.773 for 3w3d
  Routing Descriptor Blocks
    directly connected
      Route metric is 0, Wt is 21896
  No advertising protos.

SBFD Initiator
#

SBFD 的 session 将 host 在 LC 的 CPU, 所以需要先配置bfd multipath include location 0/x/CPU0.

配置到 Reflector 的的 Mapping:

sbfd
 remote-target ipv4 x.x.86.57
  remote-discriminator 20010551
 !
 local-discriminator 20010329
 local-discriminator interface Loopback1

在 SRTE 下绑定 SBFD:

segment-routing
 traffic-eng
  policy SBFD-TEST
   color 2 end-point ipv4 x.x.86.57
   bfd
    minimum-interval 200
    multiplier 3
    invalidation-action down
    logging
     session-state-change
    !
   !

SBFD 报文
#

SBFD 使用的是 UDP 端口号为7784.

SBFD Packet

Sender

这里需要注意的是发送方的 Src.address 为配置 Loopback 地址,其中 IPv4 包头的 TTL 为 1 (注意:尾端如果收到的报文不为 1,将会丢掉并不会反射给头端)

Reflect

反射报文的 Src.address 为板卡发送接口地址,目的为头端 Loopback 地址。

SBFD Session
#


RP/0/RSP0/CPU0:ASR-9901-A#show bfd label session
Sun Apr  7 15:01:06.726 UTC

Interface           Label               Local det time(int*mult)      State
                                    Echo             Async
------------------- --------------- ---------------- ---------------- ----------
srte_c_2_ep_ (LSP:4 24060           n/a              600ms(200ms*3)   UP
RP/0/RSP0/CPU0:ASR-9901-A#
RP/0/RSP0/CPU0:ASR-9901-A#show bfd label session detail
Sun Apr  7 15:01:12.843 UTC

I/f: srte_c_2_ep_ (LSP:407), Location: 0/0/CPU0, Label: 24060
 State: UP for 0d:0h:30m:20s, number of times UP: 1
 Session type: SW/LB/V4/SH/TH/SB
Received parameters:
 Version: 1, desired tx interval: 200 ms, required rx interval: 200 ms
 Multiplier: 3, diag: None
 My discr: 20010551, your discr: 65939, state UP, D/F/P/C/A: 0/0/0/1/0
Transmitted parameters:
 Version: 1, desired tx interval: 200 ms, required rx interval: 0 ms
 Multiplier: 3, diag: None
 My discr: 65939, your discr: 20010551, state UP, D/F/P/C/A: 1/0/0/1/0
Timer Values:
 Local negotiated async tx interval: 200 ms
 Remote negotiated async tx interval: 200 ms
async detection time: 600 ms(200 ms*3)
Local Stats:
 Intervals between async packets:
   Tx: Number of intervals=100, min=167 ms, max=201 ms, avg=184 ms
       Last packet transmitted 21 ms ago
   Rx: Number of intervals=100, min=167 ms, max=200 ms, avg=184 ms
       Last packet received 21 ms ago
MP download state: BFD_MP_DOWNLOAD_ACK
State change time: Apr  7 14:30:49.027
Session owner information:
                            Desired               Adjusted
  Client               Interval   Multiplier Interval   Multiplier
  -------------------- --------------------- ---------------------
  XTC                  200 ms     3          200 ms     3
  • 可以使用上述命令检查 SBFD session.
  • SBFD 是 BFD 的一种, 所以常见的检查 BFD 的历史信息的命令依旧可以使用。
  • SBFD 是 host 的 LC 上的, 所以会出现数据包的产生 LC 不在出接口的 LC 上, 此为正常行为。
  • SBFD 是基于 LSP 的,即如果出现新的 LSP,SBFD 会为新的 LSP init session。
  • SBFD 是不支持 ECMP 的,意味着如果有多个 ECMP Path,SBFD 的数据包只会 hash 到其中一条 Link。

注意事项
#

(测试 Topo: ASR9K(header)—–NCS55——–ASR9K(tailer))

请注意mpls ip-ttl-propagate disable的使用。

如果 NCS55 作为倒数第二跳,默认情况下 MPLS 的 TTL 会 copy 到 IP 包头,导致 SBFD 数据包的 TTL 不正确,该数据包被尾节点 ASR9K 接收到后会直接丢掉。

你会在板卡看到类似RSV_DROP_IFIB_TTL_CHECK的 NP drop counter 在增加,SBFD session 起不来。

解决办法为配置mpls ip-ttl-propagate disable

如果 ASR9K 作为倒数第二跳,默认情况的逻辑为copy MPLS TTL to IP TTL , only if IP TTL > MPLS TTL , otherwise use IP TTL;如果配置了mpls ip-ttl-propagate disable则使用 IP TTL. (document at CSCvn35975 and CSCvn84350)

在这种情况下,由于 MPLS TTL 大于 IP TTL, 所以默认情况 ASR9K 仍然适用 IP TTL, 所以 ASR9K 作为倒数第二跳不配置mpls ip-ttl-propagate disable 也可以。

参考文章
#

Configure Seamless Bidirectional Forwarding Detection

Huawei SBFD