BFD for BGP speeds up fault detection and therefore increases the route convergence speed.
Currently, voice and video services are widely applied. These services are quite sensitive to the packet loss and delay. BGP periodically sends Keepalive messages to a peer to monitor the peer's status, but this mechanism takes an excessively long time, more than 1 second, to detect a fault. If data is transmitted at Gbit/s rates and a link fault occurs, such a lengthy detection period will result in a large amount of data being lost, making it impossible to meet the high reliability requirements of carrier-grade networks.
To address this issue, BFD for BGP has been introduced. BFD for BGP detects faults on links between BGP peers within milliseconds. The fast detection speed ensures fast BGP route convergence and minimizes traffic loss.
Before configuring BFD for BGP, complete the following task:
Configure parameters of the link layer protocol and IP addresses for interfaces to ensure that the link layer protocol on the interfaces is up.
The system view is displayed.
BFD is enabled globally.
Return to the system view.
The BGP view is displayed.
The BGP-VPN instance IPv4 address family view is displayed.
BFD for BGP can be configured for the VPN instance in this view. To configure BFD for BGP for the public network, skip this step.
BFD is configured for a peer or peer group, and default BFD parameters are useto establish a BFD session.
BFD is enabled for the peer or peer group and a BFD session is established using default parameters.
After BFD is enabled for a peer group, BFD sessions will be created on the peers that belong to this peer group and are not configured with the peer bfd block command.
Whether single-hop-prefer Is Configured |
Whether compatible Is Configured |
Direct IBGP Scenario |
Multi-hop IBGP Scenario |
Direct EBGP Scenario |
Multi-hop EBGP Scenario |
---|---|---|---|---|---|
N |
N |
In the packets sent by BFD, the UDP port number is 4784, and the TTL is 253. |
In the packets sent by BFD, the UDP port number is 4784, and the TTL is 253. |
In the packets sent by BFD, the UDP port number is 3784, and the TTL is 255. |
In the packets sent by BFD, the UDP port number is 4784, and the TTL is 253. |
Y |
N |
In the packets sent by BFD, the UDP port number is 3784, and the TTL is 255. |
In the packets sent by BFD, the UDP port number is 4784, and the TTL is 253. |
No BFD sessions can be created. |
No BFD sessions can be created. |
N |
Y |
In the packets sent by BFD, the UDP port number is 4784, and the TTL is 255. |
In the packets sent by BFD, the UDP port number is 4784, and the TTL is 255. |
In the packets sent by BFD, the UDP port number is 3784, and the TTL is 255. |
In the packets sent by BFD, the UDP port number is 4784, and the TTL is 255. |
Y |
Y |
In the packets sent by BFD, the UDP port number is 3784, and the TTL is 255. |
In the packets sent by BFD, the UDP port number is 4784, and the TTL is 255. If the peer UDP port number is 3784, the local BFD session can learn the port number, and then changes the UDP port number in the BFD packets to be sent to the peer end to 3784. |
No BFD sessions can be created. |
No BFD sessions can be created. |
In the preceding table, the UDP port numbers in the packets sent by BFD are those obtained during initial negotiation. BFD has the automatic adaptation function. If the UDP port number of a received response packet is different from that of the sent packet, BFD automatically changes the UDP port number of the sent packet to be the same as the received one and re-sends the packet to the peer end.
BFD session parameters are modified.
The BFD parameters of a single peer take precedence over those of a peer group. If BFD parameters are configured on peers, they will be used in BFD session establishment.
When changing the default values, pay attention to the network status and the network reliability requirement. A short interval for transmitting BFD packets can be configured for a link that has a higher reliability requirement. A long interval for transmitting BFD packets can be configured for a link that has a lower reliability requirement.
There are three formulas: Actual interval for the local device to send BFD packets = max {Locally configured interval for transmitting BFD packets, Remotely configured interval for receiving BFD packets}, Actual interval for the local device to receive BFD packets = max {Remotely configured interval for transmitting BFD packets, Locally configured interval for receiving BFD packets}, and Local detection period = Actual interval for receiving BFD packets x Remotely configured BFD detection multiplier.
For example:
On the local device, the configured interval for transmitting BFD packets is 200 ms, the interval for receiving BFD packets is 300 ms, and the detection multiplier is 4.
On the peer device, the configured interval for transmitting BFD packets is 100 ms, the interval for receiving BFD packets is 600 ms, and the detection multiplier is 5.
Then:
On the local device, the actual interval for transmitting BFD packets is 600 ms calculated by using the formula max {200 ms, 600 ms}; the interval for receiving BFD packets is 300 ms calculated by using the formula max {100 ms, 300 ms}; the detection period is 1500 ms calculated by multiplying 300 ms by 5.
On the peer device, the actual interval for transmitting BFD packets is 300 ms calculated by using the formula max {100 ms, 300 ms}; the interval for receiving BFD packets is 600 ms calculated by using the formula max {200 ms, 600 ms}; the detection period is 2400 ms calculated by multiplying 600 ms by 4.
A TTL value is set for checking the BFD session with a specified peer or each peer in a specified peer group.
This configuration allows the traffic forwarding path to be quickly adjusted if BFD detects a fault on the link between the local device and BGP peer that are not directly connected. Specifically, the local interface used to establish the BFD session forwards only the BFD packets with a TTL value greater than or equal to the configured TTL value. If the TTL value in a BFD packet is smaller than the configured TTL value, the interface discards this packet, the BFD session goes down, and BFD notifies BGP of this event. In this manner, BGP routes are re-converged so that the traffic forwarding path is adjusted.
The peer bfd valid-ttl-hops and peer bfd enable single-hop-prefer commands are mutually exclusive.
The peer bfd valid-ttl-hops and peer bfd enable per-link one-arm-echo commands are mutually exclusive.
A peer is prevented from inheriting the BFD function of the peer group to which it belongs.
If a peer joins a peer group enabled with BFD, the peer inherits the BFD configuration of the group and creates a BFD session. To prevent the peer from inheriting the BFD function of the peer group, perform this step.
The peer bfd block command and the peer bfd enable command are mutually exclusive. After the peer bfd block command is run, the BFD session is automatically deleted.
The configuration is committed.
After configuring BFD for BGP, you can run the following command to verify the configuration.