Configuration Guide
Reliability Configuration
BFD Configuration
21 min
bfd configuration bfd configuration introduction introduction bidirectional forwarding detection (bfd) is a unified network wide detection mechanism used to quickly monitor the forwarding connectivity status of links or ip routes within a network when certain links do not provide hardware detection, applications rely on the upper layer protocol's own hello message mechanism for fault detection however, the fault detection time of upper layer protocols is usually above 1 second, which is unacceptable for some applications the bfd protocol was developed in this context bfd provides a standardized, media independent, and protocol independent fast fault detection mechanism, enabling rapid detection and monitoring of the forwarding connectivity status of links or ip routes in the network this improves network performance by quickly detecting communication failures between neighboring systems, users can establish backup channels more quickly to recover communication and ensure network reliability explanation of principles explanation of principles bfd (bidirectional forwarding detection) is used to establish sessions between two network devices to detect bidirectional forwarding paths and provide services to upper layer applications bfd itself does not have a discovery mechanism; instead, it relies on upper layer protocols to notify it of new neighbor relationships when an upper layer protocol establishes a new neighbor relationship, it informs bfd of the neighbor's parameters, and bfd establishes a session based on the received parameters once the session is established, both parties periodically send bfd packets to each other quickly if no bfd packets are received from the peer within the detection time, the bidirectional forwarding path is considered to have failed the failure information is then communicated to the upper layer application served by the session, which takes appropriate action bfd configuration bfd configuration configure tasks instructions create a bfd session required configure the detection multiplier for the bfd session optional configure the minimum transmit interval for bfd packets optional configure the bfd mode as passive optional configure the receive interval for bfd packets optional configure the transmit interval for bfd packets optional terminate bfd session detection optional configure the bfd session as single arm echo function optional configure bfd policy group and bind it to the peer optional configure bfd session as data plane mode optional creating a bfd session creating a bfd session operation command description enter the system configuration view configure terminal enter the bfd view bfd create a bfd session and enter the bfd peer view peer ip address \[{multihop|local address ip address | interface interface type interface name }] peer address ip address of the peer device session name the name of the bfd session local address the desired local ip address for sourcing bfd packets interface type the type of the interface interface number interface number configuring the detection multiplier for the bfd session configuring the detection multiplier for the bfd session the detection time of a bfd session is determined by the local detection multiplier configured for that session users can adjust the local detection multiplier based on the actual network conditions to increase or decrease the detection time of the bfd session for example, for a relatively stable link where frequent detection of link status is not necessary, you can increase the local detection multiplier the formula to calculate the bfd detection time is bfd detection time = local detection multiplier x transmission interval operation command description enter the bfd peer view peer ip address configure the detection multiplier for the bfd session detect multiplier value the range of value is 2 255 configuring the minimum transmit interval for bfd packets configuring the minimum transmit interval for bfd packets bfd (bidirectional forwarding detection) protocol relies on the time to live (ttl) field in its packets to play a crucial role in network operations used for swiftly detecting the availability of network paths, bfd monitors link status by sending probing packets the ttl field specifies the maximum time or hop count that a packet can exist in the network here's how the ttl field functions limiting packet propagation the ttl field restricts the scope of bfd probing packets within the network when a packet reaches its designated ttl, it is discarded, preventing it from indefinitely propagating across the network rapid fault detection ttl assists bfd in swiftly detecting link failures if a probing packet fails to reach its destination within the specified ttl, bfd promptly concludes a link failure and notifies network devices to take appropriate actions, such as switching to alternate paths conserving network resources by setting an appropriate ttl value, unnecessary network traffic can be minimized setting a ttl too high might waste bandwidth and processing resources, while setting it too low could burden network devices with frequent bfd packet processing operation command description enter the bfd peer view peer ip address configure the minimum transmit interval for bfd packets minimum ttl value the range of value is 1 254 configuring the bfd mode as passive configuring the bfd mode as passive in passive mode, bfd (bidirectional forwarding detection) operates by waiting for probe packets from the peer device and responding to them, rather than periodically sending its own probe packets here's how passive mode works waiting for peer probe packets in passive mode, the device continuously listens for bfd probe packets from the peer device these probe packets are typically sent at regular intervals responding to peer probe packets upon receiving bfd probe packets from the peer device, the device promptly responds the response can be a simple acknowledgment or may include additional information such as packet sequence numbers detecting link status the device determines the link status by responding to the peer's probe packets if no probe packets are received from the peer for a period of time, the device assumes that a link failure may have occurred and triggers the appropriate fault handling mechanism the advantage of passive mode is that it conserves bandwidth and processing resources since the device does not need to periodically send probe packets it is suitable for scenarios where the link is stable, bandwidth is limited, or sensitivity to network resource consumption is high however, passive mode may not promptly detect link failures because it relies on probe packets from the peer device operation command description enter the bfd peer view peer ip address configure the bfd mode as passive passive mode the default value is active mode configuring the receive interval for bfd packets configuring the receive interval for bfd packets operation command description enter the bfd peer view peer ip address configure the receive interval for bfd packets receive interval value the range value is 10 60000 unit is ms configuring the transmit interval for bfd packets configuring the transmit interval for bfd packets operation command description enter the bfd peer view peer ip address configure the transmit interval for bfd packets receive interval value the range value is 10 60000 unit is ms terminate bfd session detection terminate bfd session detection operation command description enter the bfd peer view peer ip address terminate bfd session detection shutdown configuring single arm echo function configuring single arm echo function by configuring a unidirectional echo mode bfd session on the bfd capable device, it can send bfd control packets to the non bfd capable device when the non bfd capable device receives these packets, it simply loops them back at the ip layer this loopback allows the bfd capable device to detect link failures more quickly, as it can receive and process the echoed packets without waiting for a response from the non bfd capable device this approach helps improve the efficiency of link failure detection in scenarios where only one device supports bfd operation command description enter the bfd peer view peer ip address configure the bfd session as single arm echo function echo mode configure the receive interval for bfd packets echo intervall value the range value is 10 60000 unit is ms configuring bfd policy group configuring bfd policy group configuring bfd sessions individually can be time consuming and inefficient, especially when dealing with a large number of sessions by creating bfd policy groups, you can define common parameters for multiple bfd sessions and then simply bind the policy group to each peer, reducing the configuration workload and ensuring consistency across multiple sessions this approach streamlines the configuration process and makes it more manageable, particularly in environments with numerous bfd sessions operation command description enter the bfd view bfd create a bfd policy group profile profile name enter the bfd peer view peer ip address bind bfd policy to peer profile profile name configuring bfd session as data plane mode configuring bfd session as data plane mode software bfd refers to the process where packet transmission and reception during bfd detection, as well as the maintenance of bfd session state machines, rely entirely on the cpu for processing software bfd consumes a significant amount of cpu resources, so it can be used in conjunction with hardware bfd hardware bfd offloads tasks such as packet transmission, reception, and fault detection to dedicated hardware chips, thereby improving cpu utilization the device supports a maximum of eight data plane bfd sessions operation command description enter the bgp view router bgp asn configure bfd session as date plane mode neighbor neighbor ip bfd data plane display and maintenance display and maintenance operation command display the bfd session info show bfd peers brief display the bfd session statistics info show bfd peers counters bfd and bgp linkage configuration example bfd and bgp linkage configuration example network requirements in the network, device a and device d establish ebgp neighbors on device b and device c respectively, device a can receive the route announced by bgp on device d in the form of ecmp, and the next hops are device b and device c respectively cut off device a's ethernet 49 port the bfd can detect the link break quickly and converge the route quickly procedure device a configuration \# interface configuration ip address sonic(config)# interface ethernet 49 sonic(config if 49)# ip address 20 0 0 2/30 sonic(config if 49)# exit sonic(config)# interface ethernet 50 sonic(config if 50)# ip address 30 0 0 2/30 sonic(config if 50)# exit sonic(config)# interface loopback 0 sonic(config if lo0)# ip address 10 1 15 10/32 \# configuring ebgp connections sonic(config)# router bgp 65003 sonic(config router)# bgp router id 10 1 15 10 sonic(config router)# no bgp ebgp requires policy sonic(config router)# neighbor 20 0 0 1 remote as 65003 sonic(config router)# neighbor 20 0 0 1 bfd sonic(config router)# neighbor 20 0 0 1 description deviceb sonic(config router)# neighbor 30 0 0 1 remote as 65003 sonic(config router)# neighbor 30 0 0 1 bfd sonic(config router)# neighbor 30 0 0 1 description devicec device b configuration \# interface configuration ip address sonic(config)# interface ethernet 50 sonic(config if 50)# ip address 40 0 0 1/30 sonic(config if 50)# exit sonic(config)# interface loopback 0 sonic(config if lo0)# ip address 10 1 15 20/32 \# configuring ebgp connections sonic(config)# router bgp 65003 sonic(config router)# bgp router id 10 1 15 20 sonic(config router)# no bgp ebgp requires policy sonic(config router)# neighbor 20 0 0 2 remote as 65001 sonic(config router)# neighbor 20 0 0 2 bfd sonic(config router)# neighbor 20 0 0 2 description devicea sonic(config router)# neighbor 40 0 0 2 remote as 65002 sonic(config router)# neighbor 40 0 0 2 bfd sonic(config router)# neighbor 40 0 0 2 description deviced device c, device d configuration is similar verify configuration view bgp, bfd session establishment device on line speed forwarding can hit the traffic declared route on device d, cut the link, verify the convergence time verify that the convergence time meets the millisecond requirements
