Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Bidirectional Forwarding Detection (BFD)

SUMMARY An overview of the BFD protocol and the different types of BFD sessions.

Understanding BFD

The Bidirectional Forwarding Detection (BFD) protocol is a simple hello mechanism that detects failures in a network. A pair of routing devices exchange BFD packets. The devices send hello packets at a specified, regular interval. The device detects a neighbor failure when the routing device stops receiving a reply after a specified interval.

Benefits

  • Use BFD to check the health of your network.
  • BFD works with a wide variety of network environments and topologies.
  • The BFD failure detection timers have short time limits, so they provide fast failure detection.
  • BFD timers are adaptive. You can adjust them to be more or less aggressive.

Types of BFD Sessions

There are four types of BFD sessions based on the source from which BFD packets are sent to the neighbors. The different types of BFD sessions are:

Type of BFD session

Description

Centralized (or non-distributed) BFD

BFD sessions run completely on the Routing Engine.

Distributed BFD

BFD sessions run completely on the FPC CPU.

Inline BFD

BFD sessions run on the FPC software.

Hardware-assisted inline BFD

BFD sessions run on the ASIC firmware.

Single-hop and Multihop BFD

  • Single-hop BFD—Single-hop BFD in Junos OS runs in distributed mode by default. The exceptions are OSPFv3 BFD and PIMv6 BFD, which only support non-distributed BFD. Single-hop BFD control packets use UDP port 3784.

  • Multihop BFD—One desirable application of BFD is to detect connectivity to routing devices that span multiple network hops and follow unpredictable paths. This is known as a multihop session. Multihop BFD control packets use UDP port 4784.

Consider the following when using multihop BFD:

  • Prior to Junos OS Release 12.3, multihop BFD is non-distributed and runs on the Routing Engine. Starting in Junos OS Release 12.3, multihop BFD runs in distributed mode by default.
  • In a multichassis link aggregation group (MC-LAG) setup, Inter-Chassis Control Protocol (ICCP) uses BFD in multihop mode. Multihop BFD runs in centralized mode in this kind of setup.

  • Starting in Junos OS Release 13.3R5, Junos OS does not execute firewall filters that you apply on a loopback interface for a multihop BFD session with a delegated anchor FPC. There is an implicit filter on all ingress FPCs to forward packets to the anchor FPC. Therefore, the firewall filter on the loopback interface is not applied on these packets. If you do not want these packets to be forwarded to the anchor FPC, you can configure the no-delegate-processing option.

Centralized BFD

In centralized BFD mode (also called non-distributed BFD mode), the Routing Engine handles BFD.

For both single-hop BFD and multihop BFD, you can run the BFD session in non-distributed mode by configuring set routing-options ppm no-delegate-processing and then running the clear bfd session command.

If the Routing Engine CPU goes too high, there is a chance that BFD will flap. Even in cases where the Routing Engine CPU is normal, smaller values of minimum-interval can lead to BFD packets not being processed if other higher priority tasks are running. You should select the minimum interval value based on proper testing.

For information about troubleshooting BFD, see Juniper Networks Knowledge Base article 26746.

Distributed BFD

The term distributed BFD refers to BFD that runs on the FPC CPU. The Routing Engine creates the BFD sessions and the FPC CPU processes them.

Benefits

The benefits of distributed BFD are mainly in the scaling and performance areas. Distributed BFD:

  • Allows for the creation of a larger number of BFD sessions.

  • Runs BFD sessions with a shorter transfer/receive timer interval, which can in turn be used to bring down the overall detection time.

  • Separates the functionality of BFD from that of the Routing Engine.

  • A BFD session can stay up during graceful restart, even with an aggressive interval. The minimum interval for Routing Engine-based BFD sessions to survive graceful Routing Engine switchover is 2500 ms. Distributed BFD sessions have a minimum interval of less than a second.

  • Frees up the Routing Engine CPU, which improves scaling and performance for Routing Engine-based applications.

  • BFD protocol packets flow even when the Routing Engine CPU is congested.

Configuration and Support

SRX Series devices support a BFD failure detection time of 3 x 100 ms. We support this feature for a standalone SRX Series device. It is not supported for chassis clusters.

Enable distributed mode on the SRX5000 line of devices with SPC3 line cards and SRX1500, SRX4100, SRX4200, and SRX4600 devices by configuring the BFD failure detection time to a value less than 500 ms. SRX1500 devices run in dedicated mode if you've configured set chassis dedicated-ukern-cpu, regardless of the BFD failure detection time. You can enable distributed mode on SRX1500 devices only when dedicated mode is not enabled.

To determine if a BFD peer is running distributed BFD, run the show bfd sessions extensive command and look for Remote is control-plane independent in the command output.

For distributed BFD to work, you need to configure the lo0 interface with unit 0 and the appropriate family.

This is true for the following types of BFD sessions:

  • BFD over aggregated Ethernet logical interfaces, both IPv4 and IPv6

  • Multihop BFD, both IPv4 and IPv6

  • BFD over VLAN interfaces in EX Series switches, both IPv4 and IPv6

  • Virtual Circuit Connectivity Verification (VCCV) BFD (Layer 2 circuit, Layer 3 VPN, and VPLS) (MPLS)

Note:

Starting in Junos OS Release 13.3, the distribution of adjacency entry (the IP addresses of adjacent routers) and transmit entry (the IP address of transmitting routers) for a BFD session is asymmetric. This is because an adjacency entry that requires rules might or might not be distributed based on the redirect rule, and the distribution of transmit entries is not dependent on the redirect rule.

The term redirect rule here denotes the capability of an interface to send protocol redirect messages. See Disabling the Transmission of Redirect Messages on an Interface.

Inline BFD

We support two types of inline BFD: inline BFD and hardware-assisted inline BFD. Inline BFD sessions run on the FPC software. Hardware-assisted inline BFD sessions run on the ASIC firmware. Support depends on your device and software version.

Benefits

  • Inline BFD sessions can have keepalive intervals of less than a second, so you can detect errors in milliseconds.
  • If you are running inline BFD and the Routing Engine crashes, the inline BFD sessions will continue without interruption for 15 seconds.
  • Inline BFD has many of the same benefits as distributed BFD since it also separates the functionality of BFD from the Routing Engine.
  • The Packet Forwarding Engine software and the ASIC firmware process the packets more quickly than the FPC CPU, so inline BFD is faster than distributed BFD.

Inline BFD

Inline BFD sessions run on the FPC software. The Routing Engine creates the BFD sessions and the Packet Forwarding Engine software processes them. Starting in Junos OS Release 16.1R1, integrated routing and bridging (IRB) interfaces support inline BFD sessions.

MX Series routers only support inline BFD if the router is static and has MPCs/MICs with enhanced-ip configured.

QFX5110, QFX5120, QFX5200, and QFX5210 switches support 10 multihop inline BFD sessions. You can configure them with a timer of 150 x 3 milliseconds.

Hardware-Assisted Inline BFD

Hardware-assisted inline BFD sessions run on the ASIC firmware. Hardware-assisted inline BFD is a hardware implementation of the inline BFD protocol. The Routing Engine creates BFD sessions and passes them to the ASIC firmware for processing. The device uses existing paths to forward any BFD events that need to be processed by protocol processes.

Regular inline BFD is a software approach. In hardware-assisted inline BFD, the firmware handles most of the BFD protocol processing. The ASIC firmware processes the packets more quickly than the software, so hardware-assisted inline BFD is faster than regular inline BFD. We support this feature for single-hop and multihop IPv4 and IPv6 BFD sessions.

Devices support either regular inline BFD or hardware-assisted inline BFD. Starting in Junos OS Release 21.2R1, QFX5120-32C and QFX5120-48Y switches support hardware-assisted inline BFD. They support a timer of 100 x 3 milliseconds. They can run up to 128 hardware-assisted inline BFD sessions, which can be a mix of single-hop and multihop BFD sessions.

Limitations

If the Packet Forwarding Engine process restarts or the system reboots, the BFD sessions will go down.

Hardware-assisted inline BFD:

  • Does not support micro BFD.
  • Is only supported on standalone devices.
  • Does not support BFD authentication.
  • Does not support IPv6 link local BFD sessions.
  • Cannot be used with VXLAN encapsulation of BFD packets.
Note:

If you have configured EVPN overlay BGP peerings, do not use hardware-assisted inline BFD. Use distributed BFD instead.

Configuration

Devices support either regular inline BFD or hardware-assisted inline BFD. Use the set routing-options ppm inline-processing-enable command to enable the type of inline BFD that your device supports. To return BFD to the default mode, delete the configuration.

Release History Table
Release
Description
16.1R1
Starting in Junos OS Release 16.1R1, inline BFD sessions are supported on integrated routing and bridging (IRB) interfaces.
13.3R5
Starting in Junos OS Release 13.3R5, if you apply a firewall filter on a loopback interface for a multihop BFD session with a delegated anchor FPC, Junos OS does not execute this filter, because there is an implicit filter on all ingress FPCs to forward packets to the anchor FPC.
13.3
Starting in Junos OS Release 13.3, the distribution of adjacency entry (the IP addresses of adjacent routers) and transmit entry (the IP address of transmitting routers) for a BFD session is asymmetric.
13.3
Starting in Junos OS Release 13.3, inline BFD is supported only on static MX Series routers with MPCs/MICs that have configured enhanced-ip.