Thursday, February 6, 2014

NTS: BFD

BFD




BFD (Bidirectional Forwarding Detection) is defined in RFC 5880.
BFD for one-hop IPv4/IPv6 is defined in RFC 5881.
BFD for multi-hop is defined in RFC 5883.
BFD for MPLS LSPs is defined in RFC 5884.



Common BFD applications
  • Control plane liveliness detection
  • Tunnel endpoint liveliness detection
  • Trigger mechanism for IP/MPLS FRR
  • MPLS date plane failure detection

BFD advantages
  • failure detection in sub-sec
  • generic/consistent failure detection mechanism for all protocols
  • less CPU intensive if distributed to the data plane 



BFD modes
  • Asynchronous mode
    • continuous and periodic BFD packets
  • Demand mode
    • BFD packets only after a demand

BFD echo (where a stream of echo packets is sent and received) is the most common function for both modes.

Cisco supports the asynchronous mode and the echo function by default.

BFD payload control packets are encapsulated in UDP packets
  • destination port 3784
  • source port 49152

Echo packets are also encapsulated in UDP packets
  • destination port 3785
  • source port 3785
BFD control packets are always sent as unicast packets to the BFD peer.

The encapsulation of BFD Control packets for multihop application in IPv4 and IPv6 is identical to that above, except that the UDP destination port is 4784.

Each system reports in the BFD Control packet how rapidly it would like to transmit BFD packets, as well as how rapidly it is prepared to receive them.  This allows either system to determine the max packet rate (minimum interval) in both directions.

To establish a BFD neighbor in IOS-XR, BFD must either be configured under an IGP or as a static route.



BFD Configuration

BFD can be configured
  • under an interface for a specific protocol (IOS)
  • under the protocol process for a specific interface (IOS-XR)
  • under the protocol process for all interfaces (IOS)
  • under the protocol process for all neighbors (IOS-XR)
  • under the protocol process for a specific neighbor (IOS,IOS-XR)

In all cases, BFD timers (interval, min_rx, multiplier) must be defined under the relevant interfaces too. BFD and BGP in IOS-XR is the exception, as show below.

If you are using BFD with uRPF on a particular interface, then you need to use the "echo disable" command to disable the echo mode on that interface, otherwise echo packets are rejected. You can disable echo mode for the entire router, or for an individual interface.

BFD can be combined with "carrier-delay 0" for quicker protocol reaction.

In IOS-XR, "bfd fast-detect" is required in order to start the BFD process.

BFD might cause crashes and malfunctions when enabled on GNS3 emulated routers.

Instead of running BFD at the link-level, you can also run BFD at the LSP level (aka across the LSP), something that offers faster detection in case of path protection.



BFD & BGP

IOS
interface X
 bfd interval 300 min_rx 300 multiplier 3
!
router bgp 100
 neighbor 2.2.2.2 fall-over bfd

IOS-XR
router bgp 100
 neighbor 2.2.2.2
  bfd fast-detect
  bfd multiplier 3
  bfd minimum-interval 300



In IOS-XR, BFD parameters (multiplier, min-interval) can be configured for all BGP neighbors (under the BGP process) or for a specific BGP neighbor. BFD activation is always per neighbor.

It is generally not recommended to use BFD for iBGP, when the underlying IGP is already doing so.



BFD & ISIS


IOS
interface X
 bfd interval 150 min_rx 150 multiplier 3
 isis bfd

or

IOS
router isis 1
 bfd all-interfaces
!
interface X
 bfd disable


IOS-XR
router isis 1
 interface X
  bfd minimum-interval 150
  bfd multiplier 3
  bfd fast-detect ipv4





BFD & OSPF


IOS
interface X
 bfd interval 150 min_rx 150 multiplier 3
 ip ospf bfd

or

IOS
router ospf 1
 bfd all-interfaces
!
interface X
 bfd disable


IOS-XR
router ospf 1
 area 0
 interface X
  bfd minimum-interval 150
  bfd multiplier 3
  bfd fast-detect ipv4



BFD parameters can also be configured directly under the ospf process.

BFD establishes sessions from a neighbor to a DR or BDR, only when the neighbor state is full.

BFD does not establish sessions between DR-Other neighbors (for example, when their OSPF states are both 2-way)



BFD & RSVP-TE/FRR


IOS
ip rsvp signalling hello bfd
!

interface X
 bfd interval 300 min_rx 300 multiplier 3
 ip rsvp signalling hello bfd



IOS-XR
mpls traffic-eng
 interface TenGigE0/0/0/0
  bfd fast-detect
 !
 bfd minimum-interval 150
 bfd multiplier 3



IOS relates the BFD configuration to RSVP configuration, while IOS-XR relates it to MPLS TE configuration.

IOS
R3#sh bfd neighbors detail

NeighAddr                         LD/RD    RH/RS     State     Int
12.3.4.4                           1/1     Up        Up        Fa0/0.34
Session state is UP and using echo function with 300 ms interval.
OurAddr: 12.3.4.3      
Local Diag: 0, Demand mode: 0, Poll bit: 0
MinTxInt: 1000000, MinRxInt: 1000000, Multiplier: 3
Received MinRxInt: 1000000, Received Multiplier: 3
Holddown (hits): 0(0), Hello (hits): 1000(17)
Rx Count: 15, Rx Interval (ms) min/max/avg: 1/996/834 last: 312 ms ago
Tx Count: 18, Tx Interval (ms) min/max/avg: 1/1000/845 last: 344 ms ago
Elapsed time watermarks: 0 0 (last: 0)
Registered protocols: CEF TE/FRR
Uptime: 00:00:11
Last packet: Version: 1                  - Diagnostic: 0
             State bit: Up               - Demand bit: 0
             Poll bit: 0                 - Final bit: 0
             Multiplier: 3               - Length: 24
             My Discr.: 1                - Your Discr.: 1
             Min tx interval: 1000000    - Min rx interval: 1000000
             Min Echo interval: 300000 





BFD & IPv6

BFD for IPv6 (BFDv6) is not supported in IOS-XR < 4.1.

BFDv6 supports both global and link-local IPv6 addresses for neighbor session creation. BFDv6 sessions select automatically source addresses to match the neighbor address types. Each type of IPv6 address on the local router must be paired with the same type on the peer router.

You can have an IPv6 static route (2001:DB8::/64) pointing to a peer router associated with a BFD neighbor (2001::1). In order to remove this IPv6 static route from the RIB if the BFD neighbor goes down, you must associate the static route with the BFD neighbor

IOS
ipv6 route 2001:DB8::/64 Ethernet0/0 2001::1
ipv6 route static bfd Ethernet0/0 2001::1

In BFD associated mode (default), an IPv6 static route is automatically associated with an IPv6 BFD neighbor, if the static route next-hop matches exactly the static BFD neighbor. If you want to avoid this, you can configure the static route as "unassociated".





No comments:

Post a Comment