BFD for RSVP-TE and LDP LSPs

This chapter provides information about BFD for RSVP-TE LSPs and LDP LSPs.

Topics in this chapter include:

Applicability

This chapter was initially written based on SR OS Release 15.0.R7, but the MD-CLI in the current edition corresponds to SR OS Release 23.3.R3.

Overview

SR OS supports RFC 5884 and enables LSPs to be monitored between the ingress and egress LERs, regardless of the number of LSRs that the LSP traverses. For continuity checks in MPLS LSPs, BFD packets are transmitted using the MPLS encapsulation, so they share fate with the LSP data path. When enabled, faults to individual LSPs can be detected quickly, so BFD for MPLS LSPs is ideal for monitoring LSPs carrying high-value services, where detecting forwarding failures in a minimum amount of time is critical. The LSPs can be established through RSVP-TE or LDP.

Enabling BFD for LSPs avoids manual hop-by-hop troubleshooting of each element along the LSP. BFD sessions are created and run end-to-end, from ingress to egress, so BFD session state is maintained in the ingress LER and egress LER, but not in intermediate LSRs. If an LSP BFD session changes state, an SNMP trap is generated. Because LSPs are unidirectional, a routed return path is used for the BFD control packets from the egress LER toward the ingress LER.

BFD is only used for fault detection, and will not redirect traffic to an alternate path. On detection of a failure, BFD informs other software components, which then can redirect traffic to avoid faulty links.

BFD is bootstrapped using an LSP ping. An MPLS echo request packet is transmitted along the LSP path, including a BFD discriminator TLV containing the head-end BFD discriminator value. The tail end responds with an echo reply packet, using the IP forwarding path, including the tail-end BFD discriminator value.

Afterward, BFD control packets establish a BFD session between the head end and tail end using the discriminator values from the bootstrap session. The egress LER will send a BFD control packet upon receipt. Every 60 s, the head end transmits an LSP ping for control plane verification. The minimum value for the LSP BFD control transmit interval is 100 ms. RSVP-TE LSP BFD session establishment: BFD handshake shows the MPLS LSP BFD session establishment with a BFD control transmit interval of 1 second.

Figure 1. MPLS LSP BFD session establishment: BFD handshake

An MPLS LSP is created from head-end PE-1 to tail-end PE-2 with BFD enabled. A BFD template is created with transmit and receive interval each equal to 1000 ms in this example. This BFD template is applied to the MPLS LSP.

When the MPLS LSP is enabled, an LSP ping is used to bootstrap BFD to LSP with a default ping interval of 60 s. The BFD discriminators (MD = 0x10 and YD = 0xd) are negotiated using LSP ping, so the BFD session establishment starts with a message containing both discriminators. The MPLS echo reply is sent using IP routing instead of using another MPLS LSP.

Each session has its own pair of discriminators, so multiple discriminators are allocated by the system. The two-way handshake to establish a BFD session between network elements takes a few seconds in this example: 2.5 s to establish the BFD session after the BFD is bootstrapped. If the LSP BFD control transmit interval is as low as 100 ms, the handshake takes less than a second.

BFD can be used for RSVP-TE and LDP LSPs. If BFD is applied to RSVP-TE LSPs, it only runs on the currently active path. It cannot determine if any non-active paths (for example, a secondary path or primary path during reversion) that the system might switch to are up and forwarding. If BFD is applied to LDP LSPs, the session runs on the path defined by the underlying IGP.

BFD for LSPs can be combined with a failure action. For RSVP-TE LSPs, the failure action can be down or failover; see the BFD for RSVP-TE LSPs with Failure Action chapter for more information. For LDP LSPs, the failure action can only be down. LSP BFD does not affect the operational state of an LSP, because the operational state is controlled by the control plane. Therefore, the failure action down will mark the LSP as unavailable for use by services.

Configuration

BFD for RSVP-TE LSPs

BFD for RSVP-TE LSPs - topology shows the example topology for BFD for RSVP-TE LSPs.

Figure 2. BFD for RSVP-TE LSPs - topology

The initial configuration includes:

  • Cards, MDAs, and ports

  • Router interfaces

  • IS-IS as IGP on all interfaces (alternatively, OSPF can be used), with traffic engineering enabled

  • MPLS and RSVP enabled on all interfaces

Base configuration

The example topology from BFD for RSVP-TE LSPs - topology has an LSP defined on PE-5 using two strict paths, where path-5-1-2-6 is taking the upper path and used as the primary path, and path-5-4-3-6 is the lower path and used as the secondary, as follows:

# on PE-5:
configure {
    router "Base" {
        mpls {
            path "path-5-1-2-6" {
                admin-state enable
                hop 10 {
                    ip-address 192.168.15.1
                    type strict
                }
                hop 20 {
                    ip-address 192.168.12.2
                    type strict
                }
                hop 30 {
                    ip-address 192.168.26.2
                    type strict
                }
            }
            path "path-5-4-3-6" {
                admin-state enable
                hop 10 {
                    ip-address 192.168.45.1
                    type strict
                }
                hop 20 {
                    ip-address 192.168.34.1
                    type strict
                }
                hop 30 {
                    ip-address 192.168.36.2
                    type strict
                }
            }
            lsp "lsp-1" {
                admin-state enable
                type p2p-rsvp
                to 192.0.2.6
                path-computation-method local-cspf
                primary "path-5-1-2-6" {
                }
                secondary "path-5-4-3-6" {
                }
            }

BFD for RSVP-TE LSPs configuration

There are four steps to configure BFD for RSVP-TE LSPs:

  1. Configure a BFD template.

  2. Enable LSP BFD on the tail node.

  3. Apply the BFD template to the LSP or LSP path.

  4. Enable BFD on the LSP or LSP path.

Step 1: Configure a BGP template

The BFD template provides the control packet timer values for the BFD session to use at the LSP head end. The general command to define a BFD template is as follows:

configure {
    bfd {
        bfd-template <[32 chars max]> {
            transmit-interval <[10..100000] milli-seconds>
            receive-interval <[10..100000] milli-seconds>
            echo-receive <[100..100000] milli-seconds>
            multiplier <[1..20]>
            type {cpm-np}
         }
Note:

The minimum transmit and receive interval for MPLS LSPs equals 100 ms. Intervals smaller than 100 ms require BFD type CPM-NP and can be used for SR-TE LSPs, but not for RSVP-TE LSPs.

Network processor BFD is not supported for RSVP-TE LSPs. An error is generated if a user tries to apply a BFD template of type cpm-np to an LSP, as follows.

# on PE-5:
configure {
    bfd {
        bfd-template "bfd-cpm-np-Tx100" {
            type cpm-np
        }
*[ex:/configure router "Base" mpls lsp "lsp-1" bfd]
A:admin@PE-5#  bfd-template "bfd-cpm-np-Tx100"

*[ex:/configure router "Base" mpls lsp "lsp-1" bfd]
A:admin@PE-5# commit
MINOR: MGMT_CORE #4001: configure router "Base" mpls lsp "lsp-1" 
bfd bfd-template - bfd-template type is not valid for this application -
 configure bfd bfd-template "bfd-cpm-np-Tx100" type

BFD templates may be used by different BFD applications (for example, LSPs or pseudowires). If the BFD timer values are changed in a template, the BFD sessions on LSPs or spoke-SDPs to which that template applies try to renegotiate their timers to the new values. An error will be generated when the user attempts to commit changes to a BFD template that is already applied to an LSP where the new values are invalid for LSP BFD.

In this example, the BFD template used is configured as follows:

# on PE-5:
configure {
    bfd {
        bfd-template "bfdt-1" {
            multiplier 5
            receive-interval 2000
            transmit-interval 2000
        }
Step 2: Enable LSP BFD on the tail node

The BFD state machine at the tail end initially uses system-wide parameters, because an LSP is unidirectional so no configuration for the LSP exists at the tail end. The head end then attempts to adjust the control packet timer values when it transitions to the INIT state.

LSP BFD is enabled or disabled on a node-wide basis with the bfd-sessions <maxlimit> command in the configure router lsp-bfd context. The maxlimit parameter configures the maximum number of LSP BFD sessions that can be established. This is required at the tail end of the LSP. The BFD state machine at the tail end initially uses system-wide parameters, such as the transmit and receive intervals, which are both 1000 ms by default, but the minimum value is 100 ms.

In this example, the tail node is configured as follows:

# on PE-6:
configure {
    router "Base" {
        lsp-bfd {
            bfd-sessions 10               # must be set to non-zero value
            # tail-end {
                # transmit-interval 1000  # default
                # receive-interval 1000   # default
                # multiplier 3            # default
            # }

Because BFD resources are shared by different BFD applications, the limit defined here must provide sufficient resources for other applications.

Steps 3 and 4: Apply the BGP template to the LSP or LSP path and enable BFD

LSP BFD is applicable to configured RSVP LSPs as well as to mesh point-to-point and one-hop point-to-point auto-created LSPs. It is configured on an RSVP-TE LSP, or on the path of an RSVP-TE LSP, under the bfd context at the LSP head end.

A BFD template must always be configured first. BFD is then enabled using the bfd-liveness command.

To apply and enable the BFD template at RSVP-TE LSP level, the command is as follows:

configure {
    router "Base" {
        mpls {
            lsp <lsp-name> {
                bfd {
                    bfd-liveness <boolean>
                    bfd-template <name>
                    # lsp-ping-interval 60        # default: 60 s
                    # failure-action none         # default: none
                    # wait-for-up-timer 4         # default: 4 s    

When BFD is configured at the LSP level, BFD packets follow the currently active path of the LSP.

To apply and enable the BFD template at primary path level, the command is as follows:

configure {
    router "Base" {
        mpls {
            lsp <lsp-name> {
                primary <path-name> {
                    bfd {
                        bfd-liveness true
                        bfd-template <name>
                    }

It is possible to configure LSP BFD on a secondary path, but the corresponding BFD session will only be established when the secondary path becomes the active path after failover. It is not possible to configure LSP BFD on point-to-multipoint LSPs.

LSP BFD at the LSP level and the path level are mutually exclusive. That is, if LSP BFD is already configured for the LSP, its configuration for the path is blocked. Likewise, it cannot be configured on the LSP if it is already configured at the path level.

LSP BFD is supported on auto-created LSPs. In that case, LSP BFD is configured on mesh point-to-point and one-hop point-to-point auto-created LSPs using the LSP template.

In this example, on the head-end node, the BFD template is applied to the LSP and BFD is enabled, as follows:

# on PE-5:
configure {
    router "Base" {
        mpls {
            lsp "lsp-1" {
                bfd {
                    bfd-liveness true
                    bfd-template "bfdt-1"
                }

BFD verification

The details of the MPLS LSP show that BFD is enabled and using BFD template bfdt-1, as follows:

[/]
A:admin@PE-5# show router mpls lsp detail

===============================================================================
MPLS LSPs (Originating) (Detail)
===============================================================================
Legend :
    + - Inherited
===============================================================================
-------------------------------------------------------------------------------
Type : Originating
-------------------------------------------------------------------------------
LSP Name   : lsp-1
LSP Type        : RegularLsp                LSP Tunnel ID        : 1
LSP Index       : 1                         TTM Tunnel Id        : 1
From            : 192.0.2.5
To              : 192.0.2.6
Adm State       : Up                        Oper State           : Up
LSP Up Time     : 0d 00:26:45               LSP Down Time        : 0d 00:00:00
Transitions     : 1                         Path Changes         : 1
Retry Limit     : 0                         Retry Timer          : 30 sec
Signaling       : RSVP                      Resv. Style          : SE
Hop Limit       : 255                       Negotiated MTU       : 8982
Adaptive        : Enabled                   ClassType            : 0
FastReroute     : Disabled                  Oper FR              : Disabled
PathCompMethod  : local-cspf                ADSPEC               : Disabled
FallbkPathComp  : not-applicable
Metric          : N/A                       Metric Type          : igp
Load Bal Wt     : N/A                       ClassForwarding      : Disabled
Include Grps    :                           Exclude Grps         :
None                                           None
Least Fill      : Disabled                  Soft Preemption      : Enabled
BFD Template    : bfdt-1                    BFD Ping Intvl       : 60
BFD Enable      : True                      BFD Failure-action   : None
WaitForUpTimer  : 4

---snip---

Primary(a)      : path-5-1-2-6
                                            Up Time              : 0d 00:26:45
Bandwidth       : 0 Mbps
Secondary       : path-5-4-3-6
                                            Down Time            : 0d 00:26:45
Bandwidth       : 0 Mbps
===============================================================================

Initially, the BFD session is running over path path-5-1-2-6, as follows:

[/]
A:admin@PE-5# show router bfd session

===============================================================================
Legend:
  Session Id = Interface Name | LSP Name | Prefix | RSVP Sess Name | Service Id
  wp = Working path   pp = Protecting path
===============================================================================
BFD Session
===============================================================================
Session Id                                        State      Tx Pkts    Rx Pkts
  Rem Addr/Info/SdpId:VcId                      Multipl     Tx Intvl   Rx Intvl
  Protocols                                        Type     LAG Port     LAG ID
  Loc Addr                                                             LAG name
-------------------------------------------------------------------------------
lsp-1::path-5-1-2-6                                  Up          795        732
  192.0.2.6                                           5         2000       2000
  rsvpLsp                                       central          N/A        N/A
  192.0.2.5
-------------------------------------------------------------------------------
No. of BFD sessions: 1
===============================================================================

At the head end, the BFD session details are as follows:

[/]
A:admin@PE-5# show router bfd session detail lsp-rsvp head

===============================================================================
BFD On LSP Session
===============================================================================
Rsvp Session   : lsp-1::path-5-1-2-6
Remote Address : 192.0.2.6
Lsp Id         : 52224                    Tunnel Id        : 1
Oper State     : Up                       Protocols        : rsvpLsp
Recd Msgs      : 786                      Sent Msgs        : 855
Up Time        : 0d 00:25:00              Up Transitions   : 1
Last Down Time : 0d 00:00:04              Down Transitions : 0
                                          Version Mismatch : 0

Forwarding Information

Local Discr    : 1                        Local State      : Up
Local Diag     : 0 (None)
Local Mode     : Async
Local Min Tx   : 2000                     Local Mult       : 5
Last Sent      : 07/10/2023 09:04:18      Local Min Rx     : 2000
Type           : central
Remote Discr   : 1                        Remote State     : Up
Remote Diag    : 0 (None)                 Remote Mode      : Async
Remote Min Tx  : 1000                     Remote Mult      : 3
Remote C-flag  : 1
Last Recv      : 07/10/2023 09:04:18      Remote Min Rx    : 1000
===============================================================================
===============================================================================

At the tail end, the BFD session details are as follows:

[/]
A:admin@PE-6# show router bfd session detail lsp-rsvp tail

===============================================================================
BFD On LSP Session
===============================================================================
Rsvp Session   : lsp-1::path-5-1-2-6
Remote Address : 192.0.2.5
Lsp Id         : 52224                    Tunnel Id        : 1
Oper State     : Up                       Protocols        : rsvpLsp
Up Time        : 0d 00:29:55              Up Transitions   : 1
Last Down Time : 0d 00:00:04              Down Transitions : 0
                                          Version Mismatch : 0

Forwarding Information

Local Discr    : 1                        Local State      : Up
Local Diag     : 0 (None)
Local Mode     : Async
Local Min Tx   : 1000                     Local Mult       : 3
Last Sent (ms) : 1                        Local Min Rx     : 1000
Type           : cpm-np
Remote Discr   : 1                        Remote State     : Up
Remote Diag    : 0 (None)                 Remote Mode      : Async
Remote Min Tx  : 2000                     Remote Mult      : 5
Remote C-flag  : 0
Last Recv (ms) : 1                        Remote Min Rx    : 2000
===============================================================================
===============================================================================

A failure is emulated by bringing down the link between PE-1 and PE-2. BFD detects the failure in the upper path quickly, which results in the BFD session being re-established on path-5-4-3-6, as follows:

[/]
A:admin@PE-5# show router bfd session

===============================================================================
Legend:
  Session Id = Interface Name | LSP Name | Prefix | RSVP Sess Name | Service Id
  wp = Working path   pp = Protecting path
===============================================================================
BFD Session
===============================================================================
Session Id                                        State      Tx Pkts    Rx Pkts
  Rem Addr/Info/SdpId:VcId                      Multipl     Tx Intvl   Rx Intvl
  Protocols                                        Type     LAG Port     LAG ID
  Loc Addr                                                             LAG name
-------------------------------------------------------------------------------
lsp-1::path-5-4-3-6                                  Up            6          8
  192.0.2.6                                           5         2000       2000
  rsvpLsp                                       central          N/A        N/A
  192.0.2.5
-------------------------------------------------------------------------------
No. of BFD sessions: 1
===============================================================================

Bringing up the link between PE-1 and PE-2 will result in the primary path becoming active again.

The ping bootstrap and periodic verification information for BFD on LSPs can be displayed at the head end, as follows:

[/]
A:admin@PE-5# show test-oam lsp-bfd lsp-name "lsp-1"

-------------------------------------------------------------------------------
LSP Ping Bootstrap and Periodic Verification Information for BFD on LSPs
-------------------------------------------------------------------------------
OAM Operational State    : Bootstrapped - Sending Periodic Verification
FEC Type                 : RSVP
LSP Name : lsp-1
LSP Path Status          : active
Source Address           : 192.0.2.5
Replying Node            : 192.0.2.6
Latest Return Code       : EgressRtr (3)
Latest Return Subcode    : 1
Local BFD Discriminator  : 2            Remote BFD Discriminator : 2
LSP Ping Tx Interval (s) : 60           Bootstrap Retry Count    : 0
Tx LSP Ping Requests     : 1            Rx LSP Ping Replies      : 1
-------------------------------------------------------------------------------
No. of matching BFD on LSP sessions: 1
-------------------------------------------------------------------------------

BFD sessions changing state are trapped, so these are logged in log 99, as follows:

120 2023/07/10 09:10:21.071 UTC MINOR: BFD #2002 Base 192.0.2.6
"The lspHead BFD session with Local Discriminator 2 on 192.0.2.6 is up (Tunnel Id 1, Path LSP ID 52226)"

121 2023/07/10 09:11:23.500 UTC WARNING: MPLS #2011 Base VR 1:
"LSP path lsp-1::path-5-1-2-6 is operationally enabled ('no shutdown')"

122 2023/07/10 09:11:24.494 UTC MINOR: BFD #2004 Base 192.0.2.6
"The protocol (RSVP LSP) using BFD session on node 192.0.2.6 has been added"

123 2023/07/10 09:11:25.494 UTC MINOR: MPLS #2027 Base VR 1:
"LSP lsp-1 active path lsp-1::path-5-4-3-6 has changed to active path lsp-1::path-5-1-2-6"

124 2023/07/10 09:11:25.494 UTC MINOR: BFD #2004 Base 192.0.2.6
"The protocol (RSVP LSP) using BFD session on node 192.0.2.6 has been cleared"

125 2023/07/10 09:11:25.494 UTC MINOR: BFD #2003 Base 192.0.2.6
"The lspHead BFD Session with Local Discriminator 2 on 192.0.2.6 has been deleted"

126 2023/07/10 09:11:25.495 UTC MAJOR: SVCMGR #2316 Base
"Processing of a SDP state change event is finished and the status of all affected SDP Bindings on SDP 56 has been updated."

127 2023/07/10 09:11:28.494 UTC WARNING: MPLS #2012 Base VR 1:
"LSP path lsp-1::path-5-4-3-6 is operationally disabled ('shutdown') because nonActiveSecondary"

128 2023/07/10 09:11:29.231 UTC MINOR: BFD #2002 Base 192.0.2.6
"The lspHead BFD session with Local Discriminator 3 on 192.0.2.6 is up (Tunnel Id 1, Path LSP ID 52228)"

The tools command for displaying LSP details at the head end also includes BFD related information, if applicable, as follows:

[/]
A:admin@PE-5# tools dump router mpls lspinfo "lsp-1" detail
LSP "lsp-1"  LspIdx 1  LspType Dynamic  State LSPS_UP  Flags 0x2000
AdminState Up  OperState Up  RowStatus Active
From N/A  To 192.0.2.6
NumPaths 2  NumSdps 1  NumCBFSdps 0  NumFltrEntries 0
ActivePath lsp-1::path-5-1-2-6(LspId 52228)
HoldTimeRemaining 0secs  ClassType 0  SoftPreemption TRUE  Metric 0  OperMetric 30
LDPoRsvp Include  VprnAutoBind Include IgpShortCut Include BgpShortCut Include
BgpTransTunnel Include IpShCutTtlPropLocal TRUE IpShCutTtlPropTans TRUE
RelativeMetricOffset 2147483647 MTU 8982 InUseByLdp FALSE TTMPref 7
EntropyLabel inherit  OperEntropyLabel enable  NegEntropyLabel disable
ClassForwarding: Disabled
BFD Enabled Template bfdt-1  PingInterval 60 FailureAction None  WaitForUp 4sec
PCE Report: Disabled  PCE Control: Disabled
Path Profile:
  None
Admin Tags:
  None
Lsp-self-ping: Config: inherit, Oper: Disabled, TimedOutCnt: 0 OamNoRsc: 0
  Path "path-5-1-2-6"  LspId 52228  LspPathIndex 2 PathType Primary  ActivePath Yes
    RowStatus Active  LastChange 000 00:51:09.090
    AdminState Up  OperState Up  OperStateChange 000 00:14:35.230
    TE Computed Hop List:
      Hop[1] IngIp 192.0.2.5 IngLnkId 0 EgrIp 192.168.15.2 EgrLnkId 0 RtrId 192.0.2.5 Flag 0x0
      Hop[2] IngIp 192.168.15.1 IngLnkId 0 EgrIp 192.168.12.1 EgrLnkId 0 RtrId 192.0.2.1 Flag 0x0
      Hop[3] IngIp 192.168.12.2 IngLnkId 0 EgrIp 192.168.26.1 EgrLnkId 0 RtrId 192.0.2.2 Flag 0x0
      Hop[4] IngIp 192.168.26.2 IngLnkId 0 EgrIp 192.0.2.6 EgrLnkId 0 RtrId 192.0.2.6 Flag 0x0
    LspPath FsmState LSP_PATH_S_UP  Flags 0x0 miscFlags 0x2
    RetryAttempts 0  RetryInterval 30  NextRetryIn 0secs
    FailNode 0.0.0.0  FailCode noError
    Class Type 0 SetupPri 7 HoldPri 0 Pref 0 HopLimit 255 BW 0Mbps
    TotIgpCost 30 OperMetric 30 MTU 8982
    BFD Disabled  Template n/a  PingInterval 60  WaitForUp 4sec
    Degraded No
    Oper Values:
        Class Type 0 SetupPri 7 HoldPri 0 HopLimit 255 BW 0Mbps
        RecordRoute RecordLabel No Adspec
        No PropagateAdminGroup Exclude 0x00000000 Include 0x00000000
        No FRR
        Metric 30  CSPF No Least Fill Intra-area
        NegotiatedEntropyLabel Disabled
        PCE-Computed No PCE-Reported No PCE-Controlled No
        BFD State Up  InitTime 0d 00:14:34  UpTime 0d 00:14:30
    OldMBBPathsCleanedUp Yes
  Path "path-5-4-3-6"  LspId 52226  LspPathIndex 3 PathType Secondary  ActivePath No
    RowStatus Active  LastChange 000 00:51:09.090
    AdminState Up  OperState Down  OperStateChange 000 00:14:30.230
    LspPath FsmState LSP_PATH_S_DOWN  Flags 0x40000 miscFlags 0x2
    RetryAttempts 0  RetryInterval 30  NextRetryIn 0secs
    FailNode 192.0.2.5  FailCode nonActiveSecondary
    Class Type 0 SetupPri 7 HoldPri 0 Pref 255 HopLimit 255 BW 0Mbps
    TotIgpCost 0 OperMetric 16777215 MTU 0
    SRLG Disabled  SRLGDisjoint No
    BFD Disabled  Template n/a  PingInterval 60  WaitForUp 4sec
    Degraded No
    OldMBBPathsCleanedUp Yes

Total Ingress LSP Count         : 1

The current BFD session information for RSVP LSPs can be displayed using the following tools command at the head end:

[/]
A:admin@PE-5# tools dump router bfd lsp-rsvp head
--------------------------------------------------------------------------------
FEC: (PTR 0x10eb60f50)
 RSVP : vrId: 1 (To: 192.0.2.6 - 1 - 192.0.2.5), Sender (192.0.2.5 - 52228)

  Session: lsp-1::path-5-1-2-6    refCnt = 1
  PingIntvl: 60 Flags: 0x6  ProtNhidx: 13  NumNextHop: 1
  TemplName: bfdt-1   LspName: lsp-1 TunnelId: 1  NumLspUser: 0
  NextHop: 192.168.15.1  IfIndex: 1  Flags: 0x0  isBackup: N
    PGId: 0 [State: N/A]   NhIdx: 13
    Label:-  [0]524286
       BFD Handle: 3   State: UP   LastEvent: UP
       BFD UserId: 24   TmrActive: N [0]    NumRetry: 0
       DstAddr: 127.0.0.3   LocalDiscr: 3   RemoteDiscr: 0
--------------------------------------------------------------------------------
Total FEC Count in Head: 1

Other tools commands can display BFD LSP information at the tail end, as follows:

[/]
A:admin@PE-6# tools dump test-oam lsp-bfd tail

 -------------------------------------------------------------------------------
 Total Number of Active Tail Cache Sessions : 1
 -------------------------------------------------------------------------------

 VrId              : 1
 RemoteBfdDisc     : 3
 LocalBfdDisc      : 3
 FecType           : rsvp_ipv4(3)
 LspId             : 52228
 TunnelId          : 1
 SenderIp          : 192.0.2.5
 TunnEndIp         : 192.0.2.6
 ExtTunnId         : 192.0.2.5
 Bootstrap Echo Rx : rcvd 2023/07/10 09:11:24.00 UTC
                     handle 3 seqNum 2 rc 3 rsc 1
 Last Echo Req Rx  : rcvd 2023/07/10 09:28:30.00 UTC
                     handle 3 seqNum 19 rc 3 rsc 1
 -------------------------------------------------------------------------------
 Number of Matched Tail Cache Sessions : 1
 -------------------------------------------------------------------------------

BFD for LDP LSPs

BFD for LDP LSPs - topology shows the example topology for BFD for LDP LSPs.

Figure 3. BFD for LDP LSPs - topology

The initial configuration includes:

  • Cards, MDAs, and ports

  • Router interfaces

  • IS-IS as IGP on all interfaces (alternatively, OSPF can be used)

Base configuration

The example topology from BFD for LDP LSPs - topology has LDP configured on all interfaces. LDP automatically generates and distributes labels across the network, so for the topology in BFD for LDP LSPs - topology , LDP tunnels are created so that every node can reach any other node; only the tunnels originating in PE-1 are shown. The LDP configuration for PE-1 is as follows; the LDP configuration for PE-2, PE-3, and PE-4 is similar.

# on PE-1:
configure {
    router "Base" {
        ldp {
             interface-parameters {
                interface "int-PE-1-PE-2" {
                    ipv4 {
                    }
                }
                interface "int-PE-1-PE-4" {
                    ipv4 {
                    }
                }
            }

BFD for LDP LSPs configuration

There are six steps to configure BFD for LDP LSPs:

  1. Create a BFD template.

  2. Enable LSP BFD on the tail node.

  3. Create a prefix list.

  4. Configure LSP BFD for LDP.

  5. Apply the BFD template to the LDP LSP.

  6. Enable BFD on the LDP LSP.

Step 1: Create a BFD template

The command to define a BFD template is the same as for RSVP-TE LSPs. The BFD template used for the LDP LSPs is configured as follows:

# on PE-1:
configure
    bfd {
        bfd-template "bfdt-2" {
            receive-interval 1000
            transmit-interval 1000
        }
Step 2: Enable LSP BFD on the tail node

The command to enable or disable LSP BFD on a node-wide basis at the tail end of the tunnels is the same as for RSVP-TE LSPs. In this example, the tail nodes PE-2 and PE-3 are configured as follows:

# on PE-2 and PE-3:
configure {
    router "Base" {
        lsp-bfd {
            bfd-sessions 5                    # must be set to non-zero value
            # tail-end {
                # transmit-interval 1000      # default
                # receive-interval 1000       # default
                # multiplier 3                # default
            # }
Step 3: Create a prefix list

When high-value services are relying on the LDP tunnels between PE-1, PE-2, and PE-3, a prefix list with the system IP addresses (or other routable loopback addresses) of PE-2 and PE-3 can be used in PE-1 for monitoring these tunnels. In this example, the pfx-lst-1 prefix list is defined as follows:

# on PE-1
configure {
    policy-options {
        prefix-list "pfx-lst-1" {
            prefix 192.0.2.2/32 type exact {
            }
            prefix 192.0.2.3/32 type exact {
            }
        }
Steps 4, 5, and 6: Configure LSP BFD for LDP, apply BFD template, enable BFD

LSP BFD is configured for LDP using the following commands:

configure {
    router "Base" {
        ldp {
            lsp-bfd <prefix-list-name> {
                priority <priority-level>          # default: 1
                bfd-template <bfd-template-name>
                source-address <ip-address>
                bfd-liveness <boolean>
                lsp-ping-interval <seconds>        # default: 60
                failure-action <down>              # default: none
            }

The priority level is set to one, by default, and is used in case a prefix appears in multiple prefix lists; see the 7450 ESS, 7750 SR, 7950 XRS, and VSR MPLS Guide for more information. The source address can be any local address routable by the other nodes in the network; by default, the system IP address is used. The LSP ping interval defines how frequently ping messages must be sent on the LSP. The only possible failure action for LDP LSPs is down, which makes the LSP unavailable for user traffic. By default, no failure action is configured.

In this example, the BFD template is applied to the head-end node in the lsp-bfd context, as follows. The lsp-bfd command takes the prefix list name defined in step 3 as its argument. BFD template must always be applied first. BFD is then enabled using the bfd-liveness command.

# on PE-1:
configure {
    router "Base" {
        ldp {
            lsp-bfd "pfx-lst-1" {
                bfd-template "bfdt-2"
                source-address 192.0.2.1
                bfd-liveness true
            }

BFD verification

The prefix lists applied to LDP BFD are the following:

[/]
A:admin@PE-1# show router ldp lsp-bfd

===========================================================
BFD on LDP LSP Configuration Summary
===========================================================
Prio   Prefix List Name                 Enabled   Prefixes
-----------------------------------------------------------
1      pfx-lst-1                            Yes          2
-----------------------------------------------------------
No. of prefix lists: 1
===========================================================

The LDP BFD information for prefix list pfx-lst-1 is as follows:

[/]
A:admin@PE-1# show router ldp lsp-bfd "pfx-lst-1"

==============================================================================
BFD on LDP LSP Configuration Detail
==============================================================================
Prefix List       : pfx-lst-1
Prefix Count      : 2
BFD Template      : bfdt-2
Source Address    : 192.0.2.1
BFD Enable        : Yes                Failure Action    : none
LSP Ping Interval : 60 seconds         Priority          : 1
==============================================================================

The prefixes of prefix list pfx-lst-1 to which the system tries to establish BFD sessions are the following:

[/]
A:admin@PE-1# show router ldp lsp-bfd "pfx-lst-1" prefixes

=========================================================================
BFD on LDP LSP Prefix List "pfx-lst-1" (Enabled)
=========================================================================
Prefix                                       Operational State
-------------------------------------------------------------------------
192.0.2.2/32                                 Up
192.0.2.3/32                                 Up
-------------------------------------------------------------------------
No. of prefixes: 2
=========================================================================

The LDP BFD session data created and maintained at the head end PE-1 is as follows:

[/]
A:admin@PE-1# show router bfd session lsp-ldp head

===============================================================================
Legend:
  Session Id = Interface Name | LSP Name | Prefix | RSVP Sess Name | Service Id
  wp = Working path   pp = Protecting path
===============================================================================
BFD Session
===============================================================================
Session Id                                        State      Tx Pkts    Rx Pkts
  Rem Addr/Info/SdpId:VcId                      Multipl     Tx Intvl   Rx Intvl
  Protocols                                        Type     LAG Port     LAG ID
  Loc Addr                                                             LAG name
-------------------------------------------------------------------------------
192.0.2.2/32                                         Up          469        427
  N/A                                                 3         1000       1000
  ldpLsp                                        central          N/A        N/A
  192.0.2.1
192.0.2.3/32                                         Up          471        426
  N/A                                                 3         1000       1000
  ldpLsp                                        central          N/A        N/A
  192.0.2.1
-------------------------------------------------------------------------------
No. of BFD sessions: 2
===============================================================================

The following command shows the LDP BFD session information at the tail end PE-3:

[/]
A:admin@PE-3# show router bfd session lsp-ldp tail

===============================================================================
Legend:
  Session Id = Interface Name | LSP Name | Prefix | RSVP Sess Name | Service Id
  wp = Working path   pp = Protecting path
===============================================================================
BFD Session
===============================================================================
Session Id                                        State      Tx Pkts    Rx Pkts
  Rem Addr/Info/SdpId:VcId                      Multipl     Tx Intvl   Rx Intvl
  Protocols                                        Type     LAG Port     LAG ID
  Loc Addr
-------------------------------------------------------------------------------
192.0.2.3/32                                         Up          N/A        N/A
  192.0.2.1                                           3         1000       1000
  ldpLsp                                         cpm-np          N/A        N/A
  192.0.2.3
-------------------------------------------------------------------------------
No. of BFD sessions: 1
===============================================================================

The ping bootstrap and periodic verification information for BFD on LSPs can be displayed at the head end, as follows:

[/]
A:admin@PE-1# show test-oam lsp-bfd

-------------------------------------------------------------------------------
LSP Ping Bootstrap and Periodic Verification Information for BFD on LSPs
-------------------------------------------------------------------------------
OAM Operational State    : Bootstrapped - Sending Periodic Verification
FEC Type                 : LDP
Prefix                   : 192.0.2.2/32
Source Address           : 192.0.2.1
Replying Node            : 192.0.2.2
Latest Return Code       : EgressRtr (3)
Latest Return Subcode    : 1
Local BFD Discriminator  : 1            Remote BFD Discriminator : 1
LSP Ping Tx Interval (s) : 60           Bootstrap Retry Count    : 0
Tx LSP Ping Requests     : 10           Rx LSP Ping Replies      : 10
-------------------------------------------------------------------------------
OAM Operational State    : Bootstrapped - Sending Periodic Verification
FEC Type                 : LDP
Prefix                   : 192.0.2.3/32
Source Address           : 192.0.2.1
Replying Node            : 192.0.2.3
Latest Return Code       : EgressRtr (3)
Latest Return Subcode    : 1
Local BFD Discriminator  : 2            Remote BFD Discriminator : 1
LSP Ping Tx Interval (s) : 60           Bootstrap Retry Count    : 0
Tx LSP Ping Requests     : 10           Rx LSP Ping Replies      : 10
-------------------------------------------------------------------------------
No. of matching BFD on LSP sessions: 2
-------------------------------------------------------------------------------

BFD sessions changing state are trapped, so these are logged to log 99. When the link between PE-1 and PE-2 is restored, the following messages are logged in log 99:

93 2023/07/10 14:13:21.913 UTC WARNING: ISIS #2045 Base VR:  1 ISIS (0) Adjacency state
"Adjacency status changed to initializing for interface: int-PE-1-PE-2, for level: l1l2, LSP-id: 1920.0000.2002.00-00 "

94 2023/07/10 14:13:21.915 UTC WARNING: ISIS #2045 Base VR:  1 ISIS (0) Adjacency state
"Adjacency status changed to up for interface: int-PE-1-PE-2, for level: l1l2, LSP-id: 1920.0000.2002.00-00 "

95 2023/07/10 14:13:22.583 UTC WARNING: RSVP #2003 Base VR 1:
"Neighbor 192.168.12.2 on interface int-PE-1-PE-2 changed to active state"

96 2023/07/10 14:13:22.942 UTC MINOR: BFD #2004 Base 192.0.2.2
"The protocol (LDP LSP) using BFD session on node 192.0.2.2 has been cleared"

97 2023/07/10 14:13:22.942 UTC MINOR: BFD #2004 Base 192.0.2.3
"The protocol (LDP LSP) using BFD session on node 192.0.2.3 has been cleared"

98 2023/07/10 14:13:22.943 UTC MINOR: BFD #2003 Base 192.0.2.2
"The lspHead BFD Session with Local Discriminator 1 on 192.0.2.2 has been deleted"

99 2023/07/10 14:13:22.943 UTC MINOR: BFD #2003 Base 192.0.2.3
"The lspHead BFD Session with Local Discriminator 2 on 192.0.2.3 has been deleted"

100 2023/07/10 14:13:23.382 UTC MINOR: BFD #2004 Base 192.0.2.2
"The protocol (LDP LSP) using BFD session on node 192.0.2.2 has been added"

101 2023/07/10 14:13:23.414 UTC MINOR: BFD #2004 Base 192.0.2.3
"The protocol (LDP LSP) using BFD session on node 192.0.2.3 has been added"

102 2023/07/10 14:13:26.874 UTC MINOR: BFD #2002 Base 192.0.2.3
"The lspHead BFD session with Local Discriminator 4 on 192.0.2.3 is up"

103 2023/07/10 14:13:33.155 UTC MINOR: BFD #2002 Base 192.0.2.2
"The lspHead BFD session with Local Discriminator 3 on 192.0.2.2 is up"

The current BFD session information for LDP LSPs can be displayed using a tools command, as follows:

[/]
A:admin@PE-1# tools dump router bfd lsp-ldp prefix 192.0.2.3/32
--------------------------------------------------------------------------------
FEC: (PTR 0x10eb60ff0)
 LDP: vrId: 1 (To: 192.0.2.3/32), Sender (192.0.2.1)
  PingIntvl: 60 Flags: 0x6  ProtNhidx: 16  NumNextHop: 1
  TemplName: bfdt-2   LspName:  TunnelId: 65538  NumLspUser: 0
  NextHop: 192.168.12.2  IfIndex: 1  Flags: 0x0  isBackup: N
    PGId: 9 [State: UP]   NhIdx: 16
    Label:-  [0]524283
       BFD Handle: 4   State: UP   LastEvent: UP
       BFD UserId: 25   TmrActive: N [0]    NumRetry: 0
       DstAddr: 127.0.0.4   LocalDiscr: 4   RemoteDiscr: 0
--------------------------------------------------------------------------------
Total FEC Count in Head: 1

Total FEC Count in Tail: 0

The BFD templates used by LDP can also be listed using a tools command, as follows:

[/]
A:admin@PE-1# tools dump router ldp lsp-bfd bfd-templates-in-use

==================================================================
BFD on LDP LSP BFD Template Summary
==================================================================
Prefix List Name                 BFD Template Name
------------------------------------------------------------------
pfx-lst-1                        bfdt-2
------------------------------------------------------------------
No. of prefix lists: 1
==================================================================

Conclusion

BFD is supported for RSVP-TE and LDP LSPs and is ideal for monitoring LSPs carrying high-value services, where detecting failures in a minimum amount of time is critical.