Skip to content
Nov 21 / Greg

BFD – Bidirectional Forwarding Detection

BFD is a routing protocol independent fast failure detection method(subsecond detection is possible). It is basically a faster way to signal to your dynamic routing protocols({Cisco – OSPF, IS-IS, EIGRP, and BGP}{Mikrotik – OSPF and BGP}) that there has been a failure of a neighbor.

The Cisco link above has a very good description of how the whole process works, so I’m simply going to paraphrase here.

  • BFD sends UDP packets to neighbors on port 3784.
  • Each neighbor sets his desired message send rate and his desired receive rate. The neighbors negotiate the rates to be whatever is slowest for each direction. You can have a different send/receive rate negotiated.
  • If packets aren’t received up to the set multiplier value, then BFD says there is a failure.
  • BFD does not determine a reaction by itself. It merely informs other protocols of a failure.
  • The router will run a new instance of BFD for each protocol in use. If both OSPF and BGP are using BFD it will run two separate instances.
  • Configurations

    Interval
    This is the desired rate at which this router will send BFD packets to a neighbor.

    min-rx(Mikrotik) or min_rx(Cisco)
    This is the desire rate at which this router will receive BFD packets from a neighbor.

    Note: The rate negotiated for send/receive doesn’t have to be the same. Whichever rate is slower will be used for each direction.

    Multiplier
    The number of consecutively missed BFD packets before BFD informs the associated protocol that there was a failure.

    Cisco Configuration

    Setting baseline BFD parameters via interface configuration mode:

    1
    
    bfd interval milliseconds min_rx milliseconds multiplier multiplier-value

    If you are going to be connecting this Cisco router to a Mikrotik via BFD you must disable BFD echo mode on the Cisco:

    1
    
    no bfd echo

    Now you must inform individual protocols that they are to use BFD:
    To enable on all active EIGRP interfaces:

    1
    2
    
    router eigrp 111
    bfd all-interfaces

    To enable on individual EIGRP interfaces:

    1
    2
    
    router eigrp 123
    bfd interface Gig1/0

    Mikrotik Configuration

    Setting baseline BFD parameters for interfaces(Mikrotik defaults to already having 2MS timers with a multiplier of 5 configured for all interfaces):

    1
    2
    
    /routing bfd interface
    add disabled=no interface=ether1 interval=0.2s min-rx=0.2s multiplier=5

    Now inform the routing protocol:

    1
    
    /routing ospf interface add interface=ether1 use-bfd=yes

    or

    1
    
    /routing bgp peer add remote-address=1.1.1.1 remote-as=1111 use-bfd=yes

    Troubleshooting/Verification

    Cisco
    Neighbor info including neighbor address, interface, protocol, negotiated timers, uptime, up/down, and number of state changes.

    1
    
    show bfd neighbors [details]

    Debugging BFD:

    1
    
    debug bfd packet [neighbor address]

    Debug state transitions:

    1
    
    debug bfd event

    Mikrotik
    This prints neighbor information including neighbor address, interface, protocol, negotiated timers, uptime, up/down, and number of state changes.

    1
    
    /routing bfd neighbor print detail

    Logging BFD related messages:

    1
    2
    
    /system logging
    add topics=bfd

    So BFD is an interesting addition to routing that may make a large difference to you in certain situations. Having said that, I don’t actually run this in my infrastructure. Since I’m in an ISP environment I generally like OSPF’s speed which is at a moderate pace.

    There are some instances where I can see the real value of this. Most of the BGP sessions I establish occur over some layer two medium. If there is a failure between the peering router and me, my router doesn’t know about it until it’s default timers run out. In BGP the default hello is 60 seconds and the default dead is 3 iterations which means it takes 3 minutes for my router to realize there is an issue and to tear down the session. When establishing the BGP session I usually attempt to keep as much default as possible, but this would allow you to put a little zip in the process.

    7 Comments

    leave a comment
    1. tom / Nov 27 2012

      Get to know something new every day! I must admit I never knew something like this existed, but now that it do, I like it 🙂

      Will have to do some inhouse testing, but this could be useful in certain cases.

    2. Greg / Nov 27 2012

      @Tom
      I doubt I’ll have time to test it out properly…if you do Cisco to MTK, let me know how it works.

    3. Don / Nov 30 2012

      The bad man at the US MUM had to come poke all you wisp people.

      TOM! I missed the RE class in TX and I “must” have it for your IE visit… lets talk.

      Don

    4. Don / Dec 4 2012

      Really, you didn’t approve my last comment.

    5. Greg / Dec 10 2012

      @Don
      Sorry for the delay. The notification email got buried and I’m just now hitting the backlog.

    6. Don / Dec 12 2012

      @Greg – Thanks 🙂

      Thought you guys didn’t like us HA people for a second.

    7. Greg / Dec 12 2012

      @Don
      HA could mean so many things…I’ve usually heard it as AH. BA-ZING! I like everyone to express themselves here 🙂

    Leave a Comment

     

    *