BFD establishes a session between two endpoints over a particular link. If more than one link exists between two systems, multiple BFD sessions may be established to monitor each one of them. The session is established with a three-way handshake, and is torn down the same way. Authentication may be enabled on the session. A choice of simple password, MD5 or SHA1 authentication is available.
Typically, BFD can be used at any protocol layer.inparticular, the BGP, EIGRP, IS-IS, and OSPF routing protocols.
BFD Versions:
There are two versions of BFD, version 0 and version 1.
All BFD versions comes up as version 1 by default and can interoperable with version 0.BFD Sessions between nighbors will run in the highest common BFD Version between nighbor. For example:
if i have a Router run BFD version 0 and another run BFD version 1. so BFD session between these two routers is version 0.
Benifets of using BFD for links detection failures:
Although reducing the EIGRP, 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 EIGRP, 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 EIGRP, IS-IS, and OSPF timers, which exist wholly at the control plane.
Example of Using BFD:
let us assume that we have Router AR1 and AR8
and we need to know if a link failure happened between AR2 and AR8 from AR1 perspective.
so we configure BFD session between AR1 and AR8.
in case of link failure So AR1 won't send packet to AR8 through AR2
it will detect the failure and pick the apopriate route.wich is through AR3.
BFD session is used through multiple routers and for long hopps.

