Professional Documents
Culture Documents
05-High Availability-BFD Configuration
05-High Availability-BFD Configuration
05-High Availability-BFD Configuration
i
Configuring BFD
About BFD
Bidirectional forwarding detection (BFD) provides a general-purpose, standard, medium- and
protocol-independent fast failure detection mechanism. It can detect and monitor the connectivity of
forwarding paths to detect communication failures quickly so that measures can be taken to ensure
service continuity and enhance network availability.
BFD can uniformly and quickly detect the failures of the bidirectional forwarding paths between two
devices for upper-layer protocols such as routing protocols. The hello mechanism used by
upper-layer protocols needs seconds to detect a link failure, while BFD can provide detection
measured in milliseconds.
1
After a BFD session is established, the two ends can operate in the following BFD operating modes:
• Asynchronous mode—The device periodically sends BFD control packets. The device
considers that the session is down if it does not receive any BFD control packets within a
specific interval.
• Demand mode—The device periodically sends BFD control packets with the D bit set. If the
peer end is operating in Asynchronous mode (default), the peer end stops sending BFD control
packets after receiving control packets with the D bit set. In this case, BFD detects only the
connectivity from the local end to the peer end. If the peer end does not receive control packets
within the detection time, the session is declared down. If the peer end is operating in Demand
mode, both ends stop sending BFD control packets. The system uses other mechanisms such
as Hello mechanism and hardware detection to detect links. The Demand mode can be used to
reduce the overhead when a large number of BFD sessions exist.
Supported features
Features Reference
Static routing
IS-IS
OSPF
Layer 3—IP Routing Configuration Guide
RIP
BGP
IP fast reroute (FRR)
IPv6 static routing
Layer 3—IP Routing Configuration Guide
OSPFv3
PIM IP Multicast Configuration Guide
RSVP
MPLS
MPLS Configuration Guide
MPLS L3VPN
MPLS OAM
Track "Configuring Track"
Ethernet link aggregation Layer 2—LAN Switching Configuration Guide
2
Restrictions and guidelines: BFD configuration
• By default, the device runs BFD version 1 and is compatible with BFD version 0. You cannot
change the BFD version to 0 through commands. When the peer device runs BFD version 0,
the local device automatically switches to BFD version 0.
• After a BFD session is established, the two ends negotiate BFD parameters, including minimum
sending interval, minimum receiving interval, initialization mode, and packet authentication, by
exchanging negotiation packets. They use the negotiated parameters without affecting the
session status.
• BFD session flapping might occur on an aggregate interface with member ports on different
cards. When the card that receives and sends BFD packets is removed or restarted, the backup
card might not immediately take over. For example, the backup card will not take over when the
card has a short detection time or a large number of BFD sessions. (In IRF mode.)
3
Configuring BFD sessions in control packet mode
About BFD session creation methods
BFD sessions in control packet mode can be created statically or established dynamically.
BFD sessions are distinguished by the local discriminator and remote discriminator in control
packets. The main difference between a statically created session and a dynamically established
session is that they obtain the local discriminator and remote discriminator in different ways.
• The local discriminator and remote discriminator of a static BFD session are specified manually
in the bfd static command or in features associated with BFD.
• The local discriminator of a dynamic BFD session is assigned by the device, and the remote
discriminator is obtained during BFD session negotiation. A created session without manually
specified local and remote discriminators is a dynamic BFD session.
4
IPv6:
bfd
static session-name peer-ipv6 ipv6-address interface interface-type
interface-number source-ipv6 ipv6-address discriminator
local local-value remote remote-value
For a static BFD session to be established, specify the IPv6 address of the peer interface where
the static BFD session resides for the peer-ipv6 ipv6-address option. Specify the IPv6
address of the local interface where the static BFD session resides for
the source-ipv6 ipv6-address option.
Creating a static BFD session for single-hop detection of data link layer connectivity
1. Enter system view.
system-view
2. Create a static BFD session and enter static BFD session view.
bfd static session-name peer-ip default-ip
interface interface-type interface-number source-ip ip-address discr
iminator local discr-value remote discr-value
For a static BFD session to be established, specify the IPv6 address of the local interface where
the static BFD session resides for the source-ip ip-address option.
3. (Optional.) Associate the interface state with the static BFD session.
process-interface-status
By default, the state of a static BFD session does not affect the state of the data link layer of the
interface.
4. (Optional.) Configure the timer that delays reporting the first static BFD session establishment
failure to the data link layer.
first-fail-timer seconds
By default, the first static BFD session establishment failure is not reported to the data link layer.
This command takes effect only after you configure the process-interface-status
command.
5. (Optional.) Enable special processing for the static BFD session.
special-processing [ admin-down | authentication-change |
session-up ] *
By default, all types of special processing are disabled for a static BFD session.
Creating a static BFD session for multihop detection
1. Enter system view.
system-view
2. Create a static BFD session and enter static BFD session view.
IPv4:
bfd
static session-name peer-ip ipv4-address [ vpn-instance vpn-instanc
e-name ] source-ip ipv4-address discriminator local local-value
remote remote-value
For a static BFD session to be established, specify the IPv4 address of the peer interface where
the static BFD session resides for the peer-ip ipv4-address option. Specify the IPv4
address of the local interface where the static BFD session resides for
the source-ip ipv4-address option.
IPv6:
5
bfd
static session-name peer-ipv6 ipv6-address [ vpn-instance vpn-insta
nce-name ] source-ipv6 ipv6-address discriminator local local-value
remote remote-value
For a static BFD session to be established, specify the IPv6 address of the peer interface where
the static BFD session resides for the peer-ipv6 ipv6-address option. Specify the IPv6
address of the local interface where the static BFD session resides for
the source-ipv6 ipv6-address option.
6
By default, no authentication is performed.
4. Configure the destination port number for multihop BFD control packets.
bfd multi-hop destination-port port-number
The default setting is 4784.
5. Set the multihop detection time multiplier.
bfd multi-hop detect-multiplier value
The default setting is 5.
6. Set the minimum interval for receiving multihop BFD control packets.
bfd multi-hop min-receive-interval interval
The default setting is 400 milliseconds.
7. Set the minimum interval for transmitting multihop BFD control packets.
bfd multi-hop min-transmit-interval interval
The default setting is 400 milliseconds.
8. (Optional.) Set the delay timer for BFD to notify upper-layer protocols of session establishment
failures.
bfd init-fail-timer seconds
By default, BFD does not notify upper-layer protocols of session establishment failures.
7
Associating the interface state with BFD
About associating the interface state with BFD
By creating a BFD session for single-hop detection through exchange of BFD control packets, this
feature implements fast link detection. When BFD detects a link fault, it sets the link layer protocol
state to DOWN(BFD). This behavior helps applications relying on the link layer protocol state
achieve fast convergence. The source IP address of control packets is specified manually, and the
destination IP address is fixed at 224.0.0.184. As a best practice, specify the IP address of the
interface as the source IP address. If the interface does not have an IP address, specify a unicast IP
address other than 0.0.0.0 as the source IP address.
You can associate the state of the following interfaces with BFD:
• Layer 3 Ethernet interfaces and subinterfaces. For BFD detection to take effect, do not
configure this feature on both a Layer 3 Ethernet interface and its subinterface.
• Layer 3 aggregate interfaces, Layer 3 aggregate subinterfaces, and member ports (Layer 3
Ethernet interfaces only) in a Layer 3 aggregation group. For BFD detection to take effect, do
not configure this feature on any two of the interface types at the same time.
• VLAN interfaces.
Restrictions and guidelines
This function does not take effect on BFD sessions associated with interface states.
Procedure
1. Enter system view.
system-view
2. Enter interface view.
interface interface-type interface-number
3. Associate the interface state with BFD.
bfd detect-interface source-ip ip-address [ template template-name ]
By default, the interface state is not associated with BFD. BFD does not set the link layer
protocol of the interface to DOWN(BFD) state when detecting a failure.
4. (Optional.) Configure the timer that delays reporting the first BFD session establishment failure
to the data link layer.
bfd detect-interface first-fail-timer seconds
By default, the first BFD session establishment failure is not reported to the data link layer.
5. (Optional.) Enable special processing for BFD sessions.
bfd detect-interface special-processing [ admin-down |
authentication-change | session-up ] *
By default, all types of special processing are disabled for BFD sessions.
8
2. Create a BFD template and enter BFD template view.
bfd template template-name
3. (Optional.) Configure the authentication mode for BFD control packets.
bfd authentication-mode { hmac-md5 | hmac-mmd5 | hmac-msha1 |
hmac-sha1 |
m-md5 | m-sha1 | md5 | sha1 | simple } key-id { cipher cipher-string | pl
ain plain-string }
By default, no authentication is performed.
4. Set the detection time multiplier.
bfd detect-multiplier value
The default setting is 5.
5. Set the minimum interval for receiving BFD control packets.
bfd min-receive-interval interval
The default setting is 400 milliseconds.
6. Set the minimum interval for transmitting BFD control packets.
bfd min-transmit-interval interval
The default setting is 400 milliseconds.
Task Command
9
Task Command
display bfd session [ [ dynamic ] [ control | echo ] [ lsp | te |
pw ] [ state { down | admin-down | init | up } ] [ discriminator
remote remote-value ] [ [ peer-ip ipv4-address [
vpn-instance vpn-instance-name ] ] | [ peer-ipv6 ipv6-address [
vpn-instance vpn-instance-name ] ] ] [ verbose ] ]
display bfd session [ [ static ] [ ip ] [ state { down |
admin-down | init | up } ] [
discriminator remote remote-value ] [ peer-ip ipv4-address [
vpn-instance vpn-instance-name ] ] [ verbose ]
display bfd session [ [ static ] [ ipv6 ] [ state { down |
admin-down | init | up } ] [
discriminator remote remote-value ] [ peer-ipv6 ipv6-address [
vpn-instance vpn-instance-name ] ] [ verbose ]
Clear BFD
session reset bfd session statistics
statistics.
10