Example for Configuring Dynamic BFD for CR-LSPs
Networking Requirements
The path of the primary CR-LSP is LSRA -> LSRB -> LSRC.
The path of the backup CR-LSP is LSRA -> LSRD -> LSRC.
When the primary CR-LSP fails, traffic switches to the backup CR-LSP. After the primary CR-LSP recovers, traffic switches back to the primary CR-LSP in 15 seconds. If both the primary CR-LSP and backup CR-LSP fail, traffic switches to the best-effort path. Explicit paths can be configured for the primary and backup CR-LSPs. A best-effort path can be generated automatically. In this example, the best-effort path is LSRA -> LSRD -> LSRB -> LSRC. The calculated best-effort path varies according to the faulty node.
Dynamic BFD for CR-LSPs needs to be configured to detect primary and backup CR-LSPs:
When the primary CR-LSP fails, traffic fast switches to the backup CR-LSP.
When the backup CR-LSP fails within 15 seconds after the primary CR-LSP recovers, traffic switches back to the primary CR-LSP.
Compared with static BFD, dynamic BFD is much easy to configure. In addition, dynamic BFD can reduce the number of BFD sessions, and use less network resources because only one BFD session can be created on a tunnel interface.
Configuration Roadmap
The configuration roadmap is as follows:
Configure a hot-standby CR-LSP and best-effort path.
Enable BFD on the ingress node, configure dynamic BFD for CR-LSPs, and set the intervals for sending and receiving BFD packets and local BFD detection multiplier.
Enable the capability to passively create BFD sessions on the egress node.
Procedure
- Assign an IP address to each interface and configure OSPF.
# Configure LSRA. The configurations of LSRB, LSRC, and LSRD are similar to the configuration of LSRA, and are not mentioned here.
<Huawei> system-view [Huawei] sysname LSRA [LSRA] interface gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] ip address 172.1.1.1 255.255.255.0 [LSRA-GigabitEthernet1/0/0] quit [LSRA] interface gigabitethernet 2/0/0 [LSRA-GigabitEthernet2/0/0] ip address 172.5.1.1 255.255.255.0 [LSRA-GigabitEthernet2/0/0] quit [LSRA] interface loopback 1 [LSRA-LoopBack1] ip address 1.1.1.9 255.255.255.255 [LSRA-LoopBack1] quit [LSRA] ospf 1 [LSRA-ospf-1] area 0 [LSRA-ospf-1-area-0.0.0.0] network 1.1.1.9 0.0.0.0 [LSRA-ospf-1-area-0.0.0.0] network 172.1.1.0 0.0.0.255 [LSRA-ospf-1-area-0.0.0.0] network 172.5.1.0 0.0.0.255 [LSRA-ospf-1-area-0.0.0.0] quit [LSRA-ospf-1] quit
After the configurations are complete, run the display ip routing-table command on each LSR. You can see that the LSRs learn the routes to Loopback1 of each other.
- Configure basic MPLS functions and enable MPLS TE, RSVP-TE,
and CSPF.
On each node, enable MPLS TE and RSVP-TE in the MPLS view and in the interface view. Enable CSPF on the ingress node.
# Configure LSRA. The configurations of LSRB, LSRC, and LSRD are similar to the configuration of LSRA, and are not mentioned here. CSPF only needs to be configured on the ingress nodes of the primary tunnel and bypass tunnel. That is, CSPF needs to be enabled on only LSRA.
[LSRA] mpls lsr-id 1.1.1.9 [LSRA] mpls [LSRA-mpls] mpls te [LSRA-mpls] mpls rsvp-te [LSRA-mpls] mpls te cspf [LSRA-mpls] quit [LSRA] interface gigabitethernet 1/0/0 [LSRA-GigabitEthernet1/0/0] mpls [LSRA-GigabitEthernet1/0/0] mpls te [LSRA-GigabitEthernet1/0/0] mpls rsvp-te [LSRA-GigabitEthernet1/0/0] quit [LSRA] interface gigabitethernet 2/0/0 [LSRA-GigabitEthernet2/0/0] mpls [LSRA-GigabitEthernet2/0/0] mpls te [LSRA-GigabitEthernet2/0/0] mpls rsvp-te [LSRA-GigabitEthernet2/0/0] quit
- Configure OSPF TE.
# Configure LSRA. The configurations of LSRB, LSRC, and LSRD are similar to the configuration of LSRA, and are not mentioned here.
[LSRA] ospf [LSRA-ospf-1] opaque-capability enable [LSRA-ospf-1] area 0 [LSRA-ospf-1-area-0.0.0.0] mpls-te enable [LSRA-ospf-1-area-0.0.0.0] quit [LSRA-ospf-1] quit
- Configure the explicit paths for the primary and backup
CR-LSPs.
# Configure the explicit path of the primary CR-LSP on LSRA.
[LSRA] explicit-path pri-path [LSRA-explicit-path-pri-path] next hop 172.1.1.2 [LSRA-explicit-path-pri-path] next hop 172.2.1.2 [LSRA-explicit-path-pri-path] next hop 3.3.3.9 [LSRA-explicit-path-pri-path] quit
# Configure the explicit path of the backup CR-LSP on LSRA.
[LSRA] explicit-path backup-path [LSRA-explicit-path-backup-path] next hop 172.5.1.2 [LSRA-explicit-path-backup-path] next hop 172.3.1.1 [LSRA-explicit-path-backup-path] next hop 3.3.3.9 [LSRA-explicit-path-backup-path] quit
- Configure a tunnel interface.
# Configure a tunnel interface on LSRA and specify an explicit path.
[LSRA] interface tunnel 0/0/1 [LSRA-Tunnel0/0/1] ip address unnumbered interface loopback 1 [LSRA-Tunnel0/0/1] tunnel-protocol mpls te [LSRA-Tunnel0/0/1] destination 3.3.3.9 [LSRA-Tunnel0/0/1] mpls te tunnel-id 100 [LSRA-Tunnel0/0/1] mpls te path explicit-path pri-path
# Configure CR-LSP hot standby on the tunnel interface, set the WTR time to 15 seconds, specify an explicit path, and configure the best-effort path.
[LSRA-Tunnel0/0/1] mpls te backup hot-standby wtr 15 [LSRA-Tunnel0/0/1] mpls te path explicit-path backup-path secondary [LSRA-Tunnel0/0/1] mpls te backup ordinary best-effort [LSRA-Tunnel0/0/1] mpls te commit [LSRA-Tunnel0/0/1] quit
After the configurations are complete, run the display mpls te tunnel-interface tunnel 0/0/1 command on LSRA. You can see that the primary and backup CR-LSPs are successfully established.
- Configure dynamic BFD for CR-LSPs on the ingress node.
Configure dynamic BFD for CR-LSPs, and set the intervals for sending and receiving BFD packets to 500 ms and local BFD detection multiplier to 3.
# Configure LSRA.
[LSRA] bfd [LSRA-bfd] quit [LSRA] interface tunnel 0/0/1 [LSRA-Tunnel0/0/1] mpls te bfd enable [LSRA-Tunnel0/0/1] mpls te bfd min-tx-interval 500 min-rx-interval 500 detect-multiplier 3 [LSRA-Tunnel0/0/1] mpls te commit
- Enable the capability to passively create BFD sessions
on the egress node.
# Configure LSRC.
[LSRC] bfd [LSRC-bfd] mpls-passive [LSRC-bfd] quit
After the configurations are complete, run the display bfd session mpls-te interface Tunnel 0/0/1 te-lsp command on LSRA. You can see that the BFD session status is Up.
[LSRA] display bfd session mpls-te interface Tunnel 0/0/1 te-lsp -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 8192 8192 3.3.3.9 Up D_TE_LSP Tunnel0/0/1 -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
Run the display bfd session passive-dynamic command on LSRC. You can see that a BFD session is created passively.
[LSRC] display bfd session passive-dynamic -------------------------------------------------------------------------------- Local Remote PeerIpAddr State Type InterfaceName -------------------------------------------------------------------------------- 8192 8192 1.1.1.9 Up E_Dynamic - -------------------------------------------------------------------------------- Total UP/DOWN Session Number : 1/0
- Verify the configuration.
# Connect two interfaces, Port 1 and Port 2, on a tester to LSRA and LSRC respectively. On Port 1, inject MPLS traffic and send traffic to Port 2. After the cable attached to GE1/0/0 on LSRA or LSRB is removed, traffic fast switches to the backup CR-LSP at the millisecond level.
# After the cable is inserted into GE1/0/0, run the display mpls te tunnel-interface tunnel 0/0/1 command to view tunnel information until the primary CR-LSP is set up. Then remove the cable from GE2/0/0 on LSRA or LSRD within 15s. You can see that traffic switches back to the primary CR-LSP at the millisecond level.
Configuration Files
LSRA configuration file
# sysname LSRA # bfd # mpls lsr-id 1.1.1.9 mpls mpls te mpls rsvp-te mpls te cspf # explicit-path backup-path next hop 172.5.1.2 next hop 172.3.1.1 next hop 3.3.3.9 # explicit-path pri-path next hop 172.1.1.2 next hop 172.2.1.2 next hop 3.3.3.9 # interface GigabitEthernet1/0/0 ip address 172.1.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet2/0/0 ip address 172.5.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface LoopBack1 ip address 1.1.1.9 255.255.255.255 # interface Tunnel0/0/1 ip address unnumbered interface LoopBack1 tunnel-protocol mpls te destination 3.3.3.9 mpls te tunnel-id 100 mpls te bfd enable mpls te bfd min-tx-interval 500 min-rx-interval 500 mpls te record-route mpls te path explicit-path pri-path mpls te path explicit-path backup-path secondary mpls te backup hot-standby mode revertive wtr 15 mpls te backup ordinary best-effort mpls te commit # ospf 1 opaque-capability enable area 0.0.0.0 network 1.1.1.9 0.0.0.0 network 172.1.1.0 0.0.0.255 network 172.5.1.0 0.0.0.255 mpls-te enable # return
LSRB configuration file
# sysname LSRB # mpls lsr-id 2.2.2.9 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 ip address 172.1.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet2/0/0 ip address 172.2.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet3/0/0 ip address 172.4.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface LoopBack1 ip address 2.2.2.9 255.255.255.255 # ospf 1 opaque-capability enable area 0.0.0.0 network 2.2.2.9 0.0.0.0 network 172.1.1.0 0.0.0.255 network 172.2.1.0 0.0.0.255 network 172.4.1.0 0.0.0.255 mpls-te enable # return
LSRC configuration file
# sysname LSRC # bfd mpls-passive # mpls lsr-id 3.3.3.9 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 ip address 172.3.1.1 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet2/0/0 ip address 172.2.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface LoopBack1 ip address 3.3.3.9 255.255.255.255 # ospf 1 opaque-capability enable area 0.0.0.0 network 3.3.3.9 0.0.0.0 network 172.2.1.0 0.0.0.255 network 172.3.1.0 0.0.0.255 mpls-te enable # return
LSRD configuration file
# sysname LSRD # mpls lsr-id 4.4.4.9 mpls mpls te mpls rsvp-te # interface GigabitEthernet1/0/0 ip address 172.3.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet2/0/0 ip address 172.5.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface GigabitEthernet3/0/0 ip address 172.4.1.2 255.255.255.0 mpls mpls te mpls rsvp-te # interface LoopBack1 ip address 4.4.4.9 255.255.255.255 # ospf 1 opaque-capability enable area 0.0.0.0 network 4.4.4.9 0.0.0.0 network 172.3.1.0 0.0.0.255 network 172.4.1.0 0.0.0.255 network 172.5.1.0 0.0.0.255 mpls-te enable # return