Bidirectional Forwarding Detection (BFD) Infrastructure
Many protocols uses slow Hello mechanisms and failure is detection usually seconds after the problem occurs. The BFD goal is to provide low overhead short duration detection of failures between adjacent nodes and single mechanism that can be used for liveness detection over any media.
BFD session is established by the application that uses it. There is no discovery mechanism. E.g. in OSPF BFD session is established to neighbors that were discovered by OSPF hello protocol.
BFD supports multiple modes: one of them is Asynchronous.
In Asynchronous mode a system periodically sends BFD packets to verify connectivity. If a number of packets in a row are not received – the session is declared down.
A system can be passive or active. Active system initiates BDF sessions. Both systems can be active. (Only active mode is supported.)
BFD is not yet supported for BGP unnumbered. Adjusting keepalive/hold timers may need to be considered to achieve faster convergence.
A session begins with exchange of control packets. When bidirectional communication is achieved – a session becomes Up.
After session becomes up – control packet rate can be incremented.
Each side informs the neighbor in what intervals it is going to send BFD packets and what minimum interval it can receive BFD packets is.
Detection time is different in both directions and depends on negotiated parameters.
In Asynchronous mode—agreed transmit interval or remote system—max between local minimum rx time and last received min transmit time.
Detection time is equal to agreed transmit interval of remote system multiplied to multiplier received from remote system.
BFD session can be single-hop or multi-hop:
Single hop session traverse between two adjacent IP neighbors. BFD control packet should be encapsulated in UDP with DPORT = 3784. SPORT should be in range 49152 to 65535. Same SPORT must be used for all control BFD packets for given session and is unique between different sessions. TTL value is 255.
Multi-hop sessions traverse between to remote ip neighbors. Control packets are encapsulated in UDP with DPORT = 4784.
If different protocols want to establish a BFD session with the same remote system for same data plane – they should share BFD session.
IPv4 and IPv6 data protocols have different BFD sessions.
In OSPF Protocol neighbor discovery protocol establishes single hop BFD sessions. For OSPF when session fails – it tears down OSPF neighbor.
BFD session is established to BGP neighbor (single hop or multiple hop).
Single hop BFD session can be established for static route next hop.
protocol bfd
protocol bfd no protocol bfd Enables bfd on a system level The no form of the command removes bfd configuration. |
||
Syntax Description |
N/A |
|
Default |
N/A |
|
Configuration Mode |
config router bgp |
|
History |
3.6.4070 |
|
Example |
switch (config router bgp)# protocol bfd |
|
Related Commands |
||
Notes |
The command returns an error if BFD is enabled in clients already running on the system (static routes or BGP of OSPF) |
bfd shutdown
bfd shutdown [vrf <vrf-name>] no bfd shutdown [vrf <vrf-name>] Disables bfd sessions but doesn't remove the configuration. if VRF is not given the command will be executed in active VRF. |
||
Syntax Description |
N/A |
|
Default |
N/A |
|
Configuration Mode |
config router bgp |
|
History |
3.6.4070 |
|
Example |
switch (config) # ip bfd shutdown |
|
Related Commands |
||
Notes |
|
bfd interval
bfd interval [vrf <vrf-name>] [transmit-rate] [min-rx] [multiplier] no bfd interval Sets the interval rates between BFD messages. The no form of the command removes bfd interval rates. |
||
Syntax Description |
transmit-rate |
Transfer time between two consecutive BFD messages, the actual time is negotiated between two systems Range: 50-60000 (msec) |
min_rx |
Minimum time between neighbor messages, the actual time is negotiated between two systems Range: 50-60000 (msec) |
|
multiplier |
Defines a time period to detect BFD failure Range: 3-50 |
|
Default |
transmit-rate – 300 min-rx – 150 multiplier – 3 |
|
Configuration Mode |
config |
|
History |
3.6.4070 |
|
Example |
switch (config) # ip bfd interval transmit-rate 300 multiplier 3 min-rx 300 force |
|
Related Commands |
||
Notes |
The command is executed in the active VRF if a VRF is not specified |
ip ospf bfd
ip ospf bfd no ip ospf bfd Enables BFD on the given interface for all OSPF neighbors on a number of active sessions. The no form of the command disables BFD on all OSPF neighbors. |
||
Syntax Description |
N/A |
|
Default |
N/A |
|
Configuration Mode |
config interface ethernet |
|
History |
3.6.4070 |
|
3.6.4110 |
Added “no” form of the command |
|
Example |
switch (config interface ethernet 1/2)# ip ospf bfd |
|
Related Commands |
||
Notes |
The command “ip ospf bfd” affects traffic, OSPF restores the connection based on Hello protocol |
ip route bfd
ip route [vrf <vrf_name>] <prefix> <next_hop> bfd no ip route [vrf <vrf_name>] <prefix> <next_hop> bfd Configures static route with BFD enabled on a specified VRF. The no form of the commands removes the route. |
||
Syntax Description |
vrf-name |
VRF session name |
prefix |
Subnet IP address |
|
next_hop |
IP address of next hop |
|
Default |
N/A |
|
Configuration Mode |
config |
|
History |
3.6.4070 |
|
3.7.1100 |
Updated command syntax and Example |
|
Example |
switch (config) # ip route vrf default 1.1.1.0/24 3.3.3.3 bfd |
|
Related Commands |
||
Notes |
When a session fails, all static routes pointing to the specified gateway are removed from the routing decision |
show ip route static
show ip route [vrf [<vrf-name> | all]] static Displays static routing table of VRF instance. |
||
Syntax Description |
all |
Displays routing tables for all VRF instances |
vrf |
VRF name |
|
Default |
Default vrf |
|
Configuration Mode |
Any command mode |
|
History |
3.6.4070 |
|
3.7.1100 |
Update command syntax |
|
Example |
switch (config) # show ip route vrf default static |
|
Related Commands |
ip route |
|
Notes |
If no routing-context is specified, the “routing-context” VRF is automatically displayed |
show ip bfd neighbors
show ip bfd [vrf <name> | all] neighbors [brief | <ip>] Displays BFD table of neighbor VRF instances. |
||
Syntax Description |
all |
Displays tables for all VRF instances |
Default |
N/A |
|
Configuration Mode |
Any command mode |
|
History |
3.6.4110 |
|
Example |
||
switch (config) # show ip bgp neighbors 1000::1040 BGP neighbor: 1000::1040, remote AS: 100, link: external |
||
Related Commands |
||
Notes |