Sometimes you need to speed up your BGP network convergence times. This was my case in building a plan for a multi-homing BGP network topology. The issue was I was seeing 60-90 second fall-over times when a single router link went down. I looked into a few options, but settled on BFD in this case. I have gotten the fall-over time down to 5-6 seconds now.
Here is Cisco’s definition of BFD:
BFD provides a low-overhead, short-duration method of detecting failures in the forwarding path between two adjacent routers, including the interfaces, data links, and forwarding planes. BFD is a detection protocol that you enable at the interface and routing protocol levels. Cisco supports the BFD asynchronous mode, which depends on the sending of BFD control packets between two systems to activate and maintain BFD neighbor sessions between routers. Therefore, in order for a BFD session to be created, you must configure BFD on both systems (or BFD peers). Once BFD has been enabled on the interfaces and at the router level for the appropriate routing protocols, a BFD session is created, BFD timers are negotiated, and the BFD peers will begin to send BFD control packets to each other at the negotiated interval.
BFD provides fast BFD peer failure detection times independently of all media types, encapsulations, topologies, and routing protocols BGP, EIGRP, IS-IS, and OSPF. By sending rapid failure detection notices to the routing protocols in the local router to initiate the routing table recalculation process, BFD contributes to greatly reduced overall network convergence time.
Now on to the matter of setting it all up. There are two main steps to the process and they are really very simple.
On each interface that is connecting to the other device you are establishing a BGP neighbor with, you want to setup the BFD settings. The common ones that I use look like this:
Router(config-if)# bfd interval 50 min_rx 50 multiplier 5
- Interval is the rate that packets are sent to the neighbor
- min_rx is the rate the router can expect to receive packets back
- I use these same settings on all routers so there is no issue with the amount of packets a router should expect.
- Multiplier is the number of packets that must be missed to declare the neighbor unavailable (and in our case, trigger the fallover)
It is worth noting that this BFD command must be entered on both interfaces that will be connecting to each other. From there, an additional neighbor statement for BGP is needed to prompt the router to be tracking the BFD status. This statement is:
router bgp 65400
neighbor 192.168.1.1 remote-as 65400
neighbor 192.168.1.1 fall-over bfd
Once you have that all configured and written to memory, shut one of the routers down, or unplug a cable if you are working in a physical lab. Within a matter of seconds the neighbor relationship will drop when the routers detect the failure.