Bidirectional Forwarding Detection
This document describes how to enable the Bidirectional Forwarding Detection (BFD) protocol. BFD is a detection protocol that is designed to provide fast forwarding path failure detection times for all media types, encapsulations, topologies, and routing protocols.
BFD provides a consistent failure detection method for network administrators, in addition to fast forwarding path failure detection. Because the network administrator can use BFD to detect forwarding path failures at a uniform rate, rather than the variable rates for different routing protocol hello mechanisms, network profiling and planning will be easier, and reconvergence time will be consistent and predictable.
Prerequisites for Bidirectional Forwarding Detection
-
All participating switches must enable Cisco Express Forwarding and IP routing.
-
Before BFD is deployed on a switch, it is necessary to configure one of the IP routing protocols that are supported by BFD. You should implement fast convergence for the routing protocol that you are using. See IP routing documentation for your version of Cisco IOS software for information on configuring fast convergence. See the "Restrictions for Bidirectional Forwarding Detection" section for more information on BFD routing protocol support in Cisco IOS software.
Restrictions for Bidirectional Forwarding Detection
-
BFD works only for directly connected neighbors. BFD neighbors must be no more than one IP hop away. BFD does not support Multihop configurations.
-
BFD support is not available for all platforms and interfaces. To confirm if a specific platform or interface has BFD support and to obtain the most accurate platform and hardware restrictions, see the Cisco IOS software release notes for your software version.
-
The QoS policy for self-generated packets does not match BFD packets.
-
The class class-default command matches BFD packets. So, you must make sure of the availability of appropriate bandwidth to prevent dropping of BFD packets due to oversubscription.
-
BFD HA is not supported.
Information About Bidirectional Forwarding Detection
BFD Operation
BFD provides a low-overhead, short-duration method of detecting failures in the forwarding path between two adjacent devices. These devices include the interfaces, data links, and forwarding planes.
BFD is a detection protocol that you enable at the interface and routing protocol levels. Cisco supports BFD asynchronous mode. BFD asychronous mode depends on the sending of BFD control packets between two systems to activate and maintain BFD neighbor sessions between devices. Therefore, in order to create a BFD session, you must configure BFD on both systems (or BFD peers). A BFD session is created once BFD is enabled on the interfaces and at the device level for the appropriate routing protocols. BFD timers are negotiated, and the BFD peers begin to send BFD control packets to each other at the negotiated interval.
Neighbor Relationships
BFD provides fast BFD peer failure detection times independently. This is independent of all media types, encapsulations, topologies, and routing protocols such as BGP, EIGRP, IS-IS, and OSPF. BFD sends rapid failure detection notices to the routing protocols in the local router to initiate the routing table recalculation process. In this way, BFD contributes to greatly reduced overall network convergence time. The figure below shows a simple network with two routers running OSPF and BFD. When OSPF discovers a neighbor (1), it sends a request to the local BFD process. It initiates a BFD neighbor session with the OSPF neighbor router (2). The BFD neighbor session with the OSPF neighbor router is established (3).
![](/c/dam/en/us/td/i/300001-400000/350001-360000/354001-355000/354704.eps/_jcr_content/renditions/354704.jpg)
The figure below shows what happens when a failure occurs in the network (1). The BFD neighbor session with the OSPF neighbor router is torn down (2). BFD notifies the local OSPF process that the BFD neighbor is no longer reachable (3). The local OSPF process tears down the OSPF neighbor relationship (4). If an alternative path is available, the routers immediately start converging on it.
![](/c/dam/en/us/td/i/300001-400000/350001-360000/354001-355000/354705.eps/_jcr_content/renditions/354705.jpg)
A routing protocol must register with BFD for every neighbor it acquires. Once a neighbor is registered, BFD initiates a session with the neighbor if a session does not already exist.
OSPF registers with BFD when:
-
A neighbor finite state machine (FSM) transitions to full state.
-
Both OSPF BFD and BFD are enabled.
On broadcast interfaces, OSPF establishes a BFD session only with the designated router (DR) and backup designated router (BDR). The session is not established between any two routers in a DROTHER state.
BFD Detection of Failures
Once a BFD session is established and timer negations are complete, BFD peers send BFD control packets. The packets act in the same manner as an IGP hello protocol to detect liveliness, except at a more accelerated rate. The following information should be noted:
-
BFD is a forwarding path failure detection protocol. BFD detects a failure, but the routing protocol must act to bypass a failed peer.
-
Starting with Cisco IOS XE Denali 16.3.1, Cisco devices support BFD version 0. Devices use one BFD session for multiple client protocols in the implementation. For example, if a network is running OSPF and EIGRP across the same link to the same peer, only one BFD session is established. BFD shares session information with both routing protocols.
BFD Version Interoperability
All BFD sessions come up as Version 1 by default and are interoperable with Version 0. The system automatically performs BFD version detection, and BFD sessions between neighbors run in the highest common BFD version between neighbors. For example, if one BFD neighbor is running BFD Version 0 and the other BFD neighbor is running Version 1, the session runs BFD Version 0. The output from the show bfd neighbors [details ] command verifies which BFD version a BFD neighbor is running.
See the "Example Configuring BFD in an EIGRP Network with Echo Mode Enabled by Default" for an example of BFD version detection.
BFD Session Limits
The maximum number of BFD sessions that can be created is 128.
BFD Support for Nonbroadcast Media Interfaces
Starting from Cisco IOS XE Denali 16.3.1, the BFD feature is supported on routed, SVI, and L3 port channels. The bfd interval command must be configured on the interface to initiate BFD monitoring.
BFD Support for Nonstop Forwarding with Stateful Switchover
Typically, when a networking device restarts, all routing peers of that device detect that the device went down and then came back up. This transition results in a routing flap, which could spread across multiple routing domains. Routing flaps that are caused by routing restarts create routing instabilities, which are detrimental to the overall network performance. Nonstop forwarding (NSF) helps to suppress routing flaps in devices enabled with stateful switchover (SSO), thus reducing network instability.
NSF allows for the forwarding of data packets to continue along known routes while the routing protocol information is restored after a switchover. With NSF, peer networking devices do not experience routing flaps. Data traffic is forwarded through intelligent line cards or dual forwarding processors while the standby RP assumes control from the failed active RP during a switchover. One key to NSF operation is the ability of line cards and forwarding processors to remain up through a switchover. They remain current with the Forwarding Information Base (FIB) on the active RP.
In devices that support dual RPs, SSO establishes one of the RPs as the active processor; the other RP is designated as the standby processor. SSO synchronizes information between the active and standby processor. A switchover from the active to the standby processor occurs when the active RP fails, it is removed from the networking device, or it is manually taken down for maintenance.
Benefits of Using BFD for Failure Detection
When you deploy any feature, it is important to consider all the alternatives and be aware of any trade-offs being made.
The closest alternative to BFD in conventional IS-IS, and OSPF deployments is the use of modified failure detection mechanisms for EIGRP, IS-IS, and OSPF routing protocols. If you use fast hellos for either IS-IS or OSPF, these Interior Gateway Protocol (IGP) protocols reduce their failure detection mechanisms to a minimum of one second.
There are several advantages to implementing BFD over reduced timer mechanisms for routing protocols:
-
Although reducing the IS-IS, and OSPF timers can result in minimum detection timer of one to two seconds, BFD can provide failure detection in less than one second.
-
Because BFD is not tied to any particular routing protocol, it can be used as a generic and consistent failure detection mechanism for IS-IS, and OSPF.
-
Because some parts of BFD can be distributed to the data plane, it can be less CPU-intensive than the reduced IS-IS, and OSPF timers, which exist wholly at the control plane.
How to Configure Bidirectional Forwarding Detection
Configuring BFD Session Parameters on the Interface
To configure BFD on an interface, you must set the baseline BFD session parameters. Repeat the steps in this procedure for each interface over which you want to run BFD sessions to BFD neighbors.
The following procedure shows BFD configuration steps for a physical interface. Please use the corresponding BFD timer values for SVIs and ether-channels respectively.
Procedure
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode. Enter your password if prompted. |
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
Perform one of the following steps:
Example:
|
|
Step 4 |
bfd interval milliseconds min_rx milliseconds multiplier interval-multiplier Example:
|
Enables BFD on the interface. The BFD interval configuration is removed when the subinterface on which it is configured is removed. The BFD interval configuration is not removed when:
|
Step 5 |
end Example:
|
Exits interface configuration mode and returns to privileged EXEC mode. |
Configuring BFD Support for Dynamic Routing Protocols
The following sections provide configurational information about BFD support for dynamic routing protocols.
Configuring BFD Support for IS-IS
This section describes the procedures for configuring BFD support for IS-IS so that IS-IS is a registered protocol with BFD and will receive forwarding path detection failure messages from BFD. There are two methods for enabling BFD support for IS-IS:
-
You can enable BFD for all of the interfaces on which IS-IS is supporting IPv4 routing by using the bfd all-interfaces command in router configuration mode. You can then disable BFD for one or more of those interfaces using the isis bfd disable command in interface configuration mode.
-
You can enable BFD for a subset of the interfaces for which IS-IS is routing by using the isis bfd command in interface configuration mode.
To configure BFD support for IS-IS, perform the steps in one of the following sections:
Prerequisites
-
IS-IS must be running on all participating devices.
-
The baseline parameters for BFD sessions on the interfaces that you want to run BFD sessions to BFD neighbors over must be configured. See the "Configuring BFD Session Parameters on the Interface" section for more information.
Note
Output from the show bfd neighbors details command shows the configured intervals. The output does not show intervals that were changed because hardware-offloaded BFD sessions were configured with Tx and Rx intervals that are not multiples of 50 ms.
Configuring BFD Support for IS-IS for All Interfaces
To configure BFD on all IS-IS interfaces that support IPv4 routing, perform the steps in this section.
SUMMARY STEPS
- enable
- configure terminal
- router isis area-tag
- bfd all-interfaces
- exit
- interface type number
- ip router isis [ tag ]
- isis bfd [disable ]
- end
- show bfd neighbors [details ]
- show clns interface
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
||
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
||
Step 3 |
router isis area-tag Example:
|
Specifies an IS-IS process and enters router configuration mode. |
||
Step 4 |
bfd all-interfaces Example:
|
Enables BFD globally on all interfaces associated with the IS-IS routing process. |
||
Step 5 |
exit Example:
|
(Optional) Returns the router to global configuration mode. |
||
Step 6 |
interface type number Example:
|
(Optional) Enters interface configuration mode. |
||
Step 7 |
ip router isis [ tag ] Example:
|
(Optional) Enables support for IPv4 routing on the interface. |
||
Step 8 |
isis bfd [disable ] Example:
|
(Optional) Enables or disables BFD on a per-interface basis for one or more interfaces associated with the IS-IS routing process.
|
||
Step 9 |
end Example:
|
Exits interface configuration mode and returns the router to privileged EXEC mode. |
||
Step 10 |
show bfd neighbors [details ] Example:
|
(Optional) Displays information that can be used to verify if the BFD neighbor is active and displays the routing protocols that BFD has registered. |
||
Step 11 |
show clns interface Example:
|
(Optional) Displays information that can be used to verify if BFD for IS-IS has been enabled for a specific IS-IS interface that is associated. |
Configuring BFD Support for IS-IS for One or More Interfaces
To configure BFD for only one or more IS-IS interfaces, perform the steps in this section.
SUMMARY STEPS
- enable
- configure terminal
- interface type number
- ip router isis [ tag ]
- isis bfd [disable]
- end
- show bfd neighbors [details ]
- show clns interface
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
||
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
||
Step 3 |
interface type number Example:
|
Enters interface configuration mode. |
||
Step 4 |
ip router isis [ tag ] Example:
|
Enables support for IPv4 routing on the interface. |
||
Step 5 |
isis bfd [disable] Example:
|
Enables or disables BFD on a per-interface basis for one or more interfaces associated with the IS-IS routing process.
|
||
Step 6 |
end Example:
|
Exits interface configuration mode and returns the router to privileged EXEC mode. |
||
Step 7 |
show bfd neighbors [details ] Example:
|
(Optional) Displays information that can help verify if the BFD neighbor is active and displays the routing protocols that BFD has registered. |
||
Step 8 |
show clns interface Example:
|
(Optional) Displays information that can help verify if BFD for IS-IS has been enabled for a specific IS-IS interface that is associated. |
Configuring BFD Support for OSPF
This section describes the procedures for configuring BFD support for OSPF so that OSPF is a registered protocol with BFD and will receive forwarding path detection failure messages from BFD. You can either configure BFD support for OSPF globally on all interfaces or configure it selectively on one or more interfaces.
There are two methods for enabling BFD support for OSPF:
-
You can enable BFD for all the interfaces for which OSPF is routing by using the bfd all-interfaces command in router configuration mode. You can disable BFD support on individual interfaces using the ip ospf bfd [disable ] command in interface configuration mode.
-
You can enable BFD for a subset of the interfaces for which OSPF is routing by using the ip ospf bfd command in interface configuration mode.
See the following sections for tasks for configuring BFD support for OSPF:
Configuring BFD Support for OSPF for All Interfaces
To configure BFD for all OSPF interfaces, perform the steps in this section.
If you do not want to configure BFD on all OSPF interfaces and would rather configure BFD support specifically for one or more interfaces, see the "Configuring BFD Support for OSPF for One or More Interfaces" section.
Before you begin
-
OSPF must be running on all participating routers.
-
The baseline parameters for BFD sessions on the interfaces over which you want to run BFD sessions to BFD neighbors must be configured. See the "Configuring BFD Session Parameters on the Interface" section for more information.
Procedure
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
||
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
||
Step 3 |
router ospf process-id Example:
|
Specifies an OSPF process and enters router configuration mode. |
||
Step 4 |
bfd all-interfaces Example:
|
Enables BFD globally on all interfaces associated with the OSPF routing process. |
||
Step 5 |
exit Example:
|
(Optional) Returns the device to global configuration mode. Enter this command only if you want to perform Step 7 to disable BFD for one or more interfaces. |
||
Step 6 |
interface type number Example:
|
(Optional) Enters interface configuration mode. Enter this command only if you want to perform Step 7 to disable BFD for one or more interfaces. |
||
Step 7 |
ip ospf bfd [disable ] Example:
|
(Optional) Disables BFD on a per-interface basis for one or more interfaces associated with the OSPF routing process.
|
||
Step 8 |
end Example:
|
Exits interface configuration mode and returns the router to privileged EXEC mode. |
||
Step 9 |
show bfd neighbors [details ] Example:
|
(Optional) Displays information that can help verify if the BFD neighbor is active and displays the routing protocols that BFD has registered. |
||
Step 10 |
show ip ospf Example:
|
(Optional) Displays information that can help verify if BFD for OSPF has been enabled. |
Configuring OSPF Support for BFD over IPv4 for One or More Interfaces
To configure BFD on one or more OSPF interfaces, perform the steps in this section.
SUMMARY STEPS
- enable
- configure terminal
- interface type number
- ip ospf bfd [disable ]
- end
- show bfd neighbors [details ]
- show ip ospf
DETAILED STEPS
Command or Action | Purpose | |||
---|---|---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
||
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
||
Step 3 |
interface type number Example:
|
Enters interface configuration mode. |
||
Step 4 |
ip ospf bfd [disable ] Example:
|
Enables or disables BFD on a per-interface basis for one or more interfaces associated with the OSPF routing process.
|
||
Step 5 |
end Example:
|
Exits interface configuration mode and returns the device to privileged EXEC mode. |
||
Step 6 |
show bfd neighbors [details ] Example:
|
(Optional) Displays information that can help verify if the BFD neighbor is active and displays the routing protocols that BFD has registered.
|
||
Step 7 |
show ip ospf Example:
|
(Optional) Displays information that can help verify if BFD support for OSPF has been enabled. |
Configuring BFD Support for HSRP
Perform this task to enable BFD support for Hot Standby Router Protocol (HSRP.) Repeat the steps in this procedure for each interface over which you want to run BFD sessions to HSRP peers.
HSRP supports BFD by default. If HSRP support for BFD has been manually disabled, you can reenable it at the router level to enable BFD support globally for all interfaces or on a per-interface basis at the interface level.
Before you begin
-
HSRP must be running on all participating routers.
-
Cisco Express Forwarding must be enabled.
Procedure
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
ip cef [distributed ] Example:
|
Enables Cisco Express Forwarding or distributed Cisco Express Forwarding. |
Step 4 |
interface type number Example:
|
Enters interface configuration mode. |
Step 5 |
ip address ip-address mask Example:
|
Configures an IP address for the interface. |
Step 6 |
standby [group-number ] ip [ip-address [secondary ]] Example:
|
Activates HSRP. |
Step 7 |
standby bfd Example:
|
(Optional) Enables HSRP support for BFD on the interface. |
Step 8 |
exit Example:
|
Exits interface configuration mode. |
Step 9 |
standby bfd all-interfaces Example:
|
(Optional) Enables HSRP support for BFD on all interfaces. |
Step 10 |
exit Example:
|
Exits global configuration mode. |
Step 11 |
show standby neighbors Example:
|
(Optional) Displays information about HSRP support for BFD. |
Configuring BFD Support for Static Routing
Perform this task to configure BFD support for static routing. Repeat the steps in this procedure on each BFD neighbor. For more information, see the "Example: Configuring BFD Support for Static Routing" section.
Procedure
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
interface type number Example:
|
Configures an interface and enters interface configuration mode. |
Step 4 |
Perform one of the following steps:
Example:
|
|
Step 5 |
bfd interval milliseconds mix_rx milliseconds multiplier interval-multiplier Example:
|
Enables BFD on the interface. The bfd interval configuration is removed when the subinterface on which it is configured is removed. The bfd interval configuration is not removed when:
|
Step 6 |
exit Example:
|
Exits interface configuration mode and returns to global configuration mode. |
Step 7 |
ip route static bfd interface-type interface-number ip-address [group group-name [passive]] Example:
|
Specifies a static route BFD neighbor.
|
Step 8 |
ip route [vrf vrf-name] prefix mask {ip-address | interface-type interface-number [ip-address]} [dhcp] [distance] [name next-hop-name] [permanent | track number] [tag tag] Example:
|
Specifies a static route BFD neighbor. |
Step 9 |
exit Example:
|
Exits global configuration mode and returns to privileged EXEC mode. |
Step 10 |
show ip static route Example:
|
(Optional) Displays static route database information. |
Step 11 |
show ip static route bfd Example:
|
(Optional) Displays information about the static BFD configuration from the configured BFD groups and nongroup entries. |
Step 12 |
exit Example:
|
Exits privileged EXEC mode and returns to user EXEC mode. |
Configuring BFD Echo Mode
BFD echo mode is enabled by default, but you can disable it such that it can run independently in each direction.
BFD echo mode works with asynchronous BFD. Echo packets are sent by the forwarding engine and forwarded back along the same path in order to perform detection--the BFD session at the other end does not participate in the actual forwarding of the echo packets. The echo function and the forwarding engine are responsible for the detection process; therefore, the number of BFD control packets that are sent out between two BFD neighbors is reduced. In addition, because the forwarding engine is testing the forwarding path on the remote (neighbor) system without involving the remote system, there is an opportunity to improve the interpacket delay variance, thereby achieving quicker failure detection times than when using BFD Version 0 with BFD control packets for the BFD session.
Echo mode is described as without asymmetry when it is running on both sides (both BFD neighbors are running echo mode).
Prerequisites
-
BFD must be running on all participating devices.
-
Before using BFD echo mode, you must disable the sending of Internet Control Message Protocol (ICMP) redirect messages by entering the no ip redirects command, in order to avoid high CPU utilization.
-
The baseline parameters for BFD sessions on the interfaces over which you want to run BFD sessions to BFD neighbors must be configured. See the Configuring BFD Session Parameters on the Interface section for more information.
Restrictions
BFD echo mode does not work in conjunction with Unicast Reverse Path Forwarding (uRPF) configuration. If BFD echo mode and uRPF configurations are enabled, then the sessions will flap.
Disabling BFD Echo Mode Without Asymmetry
The steps in this procedure show how to disable BFD echo mode without asymmetry—no echo packets will be sent by the device, and the device will not forward BFD echo packets that are received from any neighbor devices.
Repeat the steps in this procedure for each BFD Device.
Procedure
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode.
|
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
no bfd echo Example:
|
Disables BFD echo mode.
|
Step 4 |
end Example:
|
Exits global configuration mode and returns to privileged EXEC mode. |
Creating and Configuring BFD Templates
You can configure a single-hop template to specify a set of BFD interval values. BFD interval values specified as part of the BFD template are not specific to a single interface.
![]() Note |
Configuring BFD-template will disable echo mode. |
Configuring a Single-Hop Template
Perform this task to create a BFD single-hop template and configure BFD interval timers.
Procedure
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode. Enter your password if prompted. |
Step 2 |
configure terminal Example:
|
Enters global configuration mode. |
Step 3 |
bfd-template single-hop template-name Example:
|
Creates a single-hop BFD template and enters BFD configuration mode. |
Step 4 |
interval min-tx milliseconds min-rx milliseconds multiplier multiplier-value Example:
|
Configures the transmit and receive intervals between BFD packets, and specifies the number of consecutive BFD control packets that must be missed before BFD declares that a peer is unavailable. |
Step 5 |
end Example:
|
Exits BFD configuration mode and returns the device to privileged EXEC mode. |
Monitoring and Troubleshooting BFD
This section describes how to retrieve BFD information for maintenance and troubleshooting. The commands in these tasks can be entered in any order as needed.
This section contains information for monitoring and troubleshooting BFD for the following Cisco platforms:
Monitoring and Troubleshooting BFD
To monitor or troubleshoot BFD, perform one or more of the steps in this section.
SUMMARY STEPS
- enable
- show bfd neighbors [details ]
- debug bfd [packet | event ]
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
Step 1 |
enable Example:
|
Enables privileged EXEC mode. Enter your password if prompted. |
Step 2 |
show bfd neighbors [details ] Example:
|
(Optional) Displays the BFD adjacency database. The details keyword shows all BFD protocol parameters and timers per neighbor. |
Step 3 |
debug bfd [packet | event ] Example:
|
(Optional) Displays debugging information about BFD packets. |
Configuration Examples for Bidirectional Forwarding Detection
This section provides configuration examples for Bidirectional Forwarding Detection:
Feature Information for Bidirectional Forwarding Detection
Release |
Feature Information |
---|---|
Cisco IOS XE Fuji 16.9.2 |
This feature was introduced |