3 **********************************
4 Bidirectional Forwarding Detection
5 **********************************
7 :abbr:`BFD (Bidirectional Forwarding Detection)` stands for
8 Bidirectional Forwarding Detection and it is described and extended by
15 Currently, there are two implementations of the BFD commands in FRR:
17 * :abbr:`PTM (Prescriptive Topology Manager)`: an external daemon which
19 * ``bfdd``: a BFD implementation that is able to talk with remote peers;
21 This document will focus on the later implementation: *bfdd*.
29 *bfdd* default configuration file is :file:`bfdd.conf`. *bfdd* searches
30 the current directory first then |INSTALL_PREFIX_ETC|/bfdd.conf. All of
31 *bfdd*'s command must be configured in :file:`bfdd.conf`.
33 *bfdd* specific invocation options are described below. Common options
34 may also be specified (:ref:`common-invocation-options`).
38 .. option:: --bfdctl <unix-socket>
40 Set the BFD daemon control socket location. If using a non-default
43 /usr/lib/frr/bfdd --bfdctl /tmp/bfdd.sock
46 The default UNIX socket location is:
48 #define BFDD_CONTROL_SOCKET "|INSTALL_PREFIX_STATE|/bfdd.sock"
59 Opens the BFD daemon configuration node.
61 .. index:: peer <A.B.C.D|X:X::X:X> [{multihop|local-address <A.B.C.D|X:X::X:X>|interface IFNAME|vrf NAME}]
62 .. clicmd:: peer <A.B.C.D|X:X::X:X> [{multihop|local-address <A.B.C.D|X:X::X:X>|interface IFNAME|vrf NAME}]
64 Creates and configures a new BFD peer to listen and talk to.
66 `multihop` tells the BFD daemon that we should expect packets with
67 TTL less than 254 (because it will take more than one hop) and to
68 listen on the multihop port (4784). When using multi-hop mode
69 `echo-mode` will not work (see :rfc:`5883` section 3).
71 `local-address` provides a local address that we should bind our
72 peer listener to and the address we should use to send the packets.
73 This option is mandatory for IPv6.
75 `interface` selects which interface we should use.
77 `vrf` selects which domain we want to use.
79 .. index:: no peer <A.B.C.D|X:X::X:X>$peer [{multihop|local-address <A.B.C.D|X:X::X:X>$local|interface IFNAME$ifname|vrf NAME$vrfname}]
80 .. clicmd:: no peer <A.B.C.D|X:X::X:X>$peer [{multihop|local-address <A.B.C.D|X:X::X:X>$local|interface IFNAME$ifname|vrf NAME$vrfname}]
82 Stops and removes the selected peer.
84 .. index:: show bfd [vrf NAME] peers [json]
85 .. clicmd:: show bfd [vrf NAME] peers [json]
87 Show all configured BFD peers information and current status.
89 .. index:: show bfd [vrf NAME$vrfname] peer <WORD$label|<A.B.C.D|X:X::X:X>$peer [{multihop|local-address <A.B.C.D|X:X::X:X>$local|interface IFNAME$ifname}]> [json]
90 .. clicmd:: show bfd [vrf NAME$vrfname] peer <WORD$label|<A.B.C.D|X:X::X:X>$peer [{multihop|local-address <A.B.C.D|X:X::X:X>$local|interface IFNAME$ifname}]> [json]
92 Show status for a specific BFD peer.
100 .. index:: detect-multiplier (2-255)
101 .. clicmd:: detect-multiplier (2-255)
103 Configures the detection multiplier to determine packet loss. The
104 remote transmission interval will be multiplied by this value to
105 determine the connection loss detection timer. The default value is
108 Example: when the local system has `detect-multiplier 3` and the
109 remote system has `transmission interval 300`, the local system will
110 detect failures only after 900 milliseconds without receiving
113 .. index:: receive-interval (10-60000)
114 .. clicmd:: receive-interval (10-60000)
116 Configures the minimum interval that this system is capable of
117 receiving control packets. The default value is 300 milliseconds.
119 .. index:: transmit-interval (10-60000)
120 .. clicmd:: transmit-interval (10-60000)
122 The minimum transmission interval (less jitter) that this system
123 wants to use to send BFD control packets.
125 .. index:: echo-interval (10-60000)
126 .. clicmd:: echo-interval (10-60000)
128 Configures the minimal echo receive transmission interval that this
129 system is capable of handling.
131 .. index:: [no] echo-mode
132 .. clicmd:: [no] echo-mode
134 Enables or disables the echo transmission mode. This mode is disabled
137 It is recommended that the transmission interval of control packets
138 to be increased after enabling echo-mode to reduce bandwidth usage.
139 For example: `transmission-interval 2000`.
141 Echo mode is not supported on multi-hop setups (see :rfc:`5883`
144 .. index:: [no] shutdown
145 .. clicmd:: [no] shutdown
147 Enables or disables the peer. When the peer is disabled an
148 'administrative down' message is sent to the remote peer.
150 .. index:: label WORD
151 .. clicmd:: label WORD
153 Labels a peer with the provided word. This word can be referenced
154 later on other daemons to refer to a specific peer.
157 .. _bfd-bgp-peer-config:
159 BGP BFD Configuration
160 ---------------------
162 The following commands are available inside the BGP configuration node.
164 .. index:: neighbor <A.B.C.D|X:X::X:X|WORD> bfd
165 .. clicmd:: neighbor <A.B.C.D|X:X::X:X|WORD> bfd
167 Listen for BFD events registered on the same target as this BGP
168 neighbor. When BFD peer goes down it immediately asks BGP to shutdown
169 the connection with its neighbor and, when it goes back up, notify
170 BGP to try to connect to it.
172 .. index:: no neighbor <A.B.C.D|X:X::X:X|WORD> bfd
173 .. clicmd:: no neighbor <A.B.C.D|X:X::X:X|WORD> bfd
175 Removes any notification registration for this neighbor.
177 .. index:: neighbor <A.B.C.D|X:X::X:X|WORD> bfd check-control-plane-failure
178 .. clicmd:: neighbor <A.B.C.D|X:X::X:X|WORD> bfd check-control-plane-failure
180 Allow to write CBIT independence in BFD outgoing packets. Also allow to
181 read both C-BIT value of BFD and lookup BGP peer status. This command is
182 useful when a BFD down event is caught, while the BGP peer requested that
183 local BGP keeps the remote BGP entries as staled if such issue is detected.
184 This is the case when graceful restart is enabled, and it is wished to
185 ignore the BD event while waiting for the remote router to restart.
187 .. index:: no neighbor <A.B.C.D|X:X::X:X|WORD> bfd check-control-plane-failure
188 .. clicmd:: no neighbor <A.B.C.D|X:X::X:X|WORD> bfd check-control-plane-failure
190 Disallow to write CBIT independence in BFD outgoing packets. Also disallow
191 to ignore BFD down notification. This is the default behaviour.
193 .. _bfd-ospf-peer-config:
195 OSPF BFD Configuration
196 ----------------------
198 The following commands are available inside the interface configuration node.
200 .. index:: ip ospf bfd
201 .. clicmd:: ip ospf bfd
203 Listen for BFD events on peers created on the interface. Every time
204 a new neighbor is found a BFD peer is created to monitor the link
205 status for fast convergence.
207 .. index:: no ip ospf bfd
208 .. clicmd:: no ip ospf bfd
210 Removes any notification registration for this interface peers.
213 .. _bfd-ospf6-peer-config:
215 OSPF6 BFD Configuration
216 -----------------------
218 The following commands are available inside the interface configuration node.
220 .. index:: ipv6 ospf6 bfd
221 .. clicmd:: ipv6 ospf6 bfd
223 Listen for BFD events on peers created on the interface. Every time
224 a new neighbor is found a BFD peer is created to monitor the link
225 status for fast convergence.
227 .. index:: no ipv6 ospf6 bfd
228 .. clicmd:: no ipv6 ospf6 bfd
230 Removes any notification registration for this interface peers.
233 .. _bfd-pim-peer-config:
235 PIM BFD Configuration
236 ---------------------
238 The following commands are available inside the interface configuration node.
240 .. index:: ip pim bfd
241 .. clicmd:: ip pim bfd
243 Listen for BFD events on peers created on the interface. Every time
244 a new neighbor is found a BFD peer is created to monitor the link
245 status for fast convergence.
247 .. index:: no ip pim bfd
248 .. clicmd:: no ip pim bfd
250 Removes any notification registration for this interface peers.
253 .. _bfd-configuration:
258 Before applying ``bfdd`` rules to integrated daemons (like BGPd), we must
259 create the corresponding peers inside the ``bfd`` configuration node.
261 Here is an example of BFD configuration:
272 neighbor 192.168.0.1 remote-as 65531
273 neighbor 192.168.0.1 bfd
274 neighbor 192.168.0.2 remote-as 65530
275 neighbor 192.168.0.2 bfd
276 neighbor 192.168.0.3 remote-as 65532
277 neighbor 192.168.0.3 bfd
280 Peers can be identified by its address (use ``multihop`` when you need
281 to specify a multi hop peer) or can be specified manually by a label.
283 Here are the available peer configurations:
289 ! configure a peer on an specific interface
290 peer 192.168.0.1 interface eth0
294 ! configure a multihop peer
295 peer 192.168.0.2 multihop local-address 192.168.0.3
299 ! configure a peer in a different vrf
300 peer 192.168.0.3 vrf foo
304 ! configure a peer with every option possible
308 receive-interval 60000
309 transmit-interval 3000
313 ! configure a peer on an interface from a separate vrf
314 peer 192.168.0.5 interface eth1 vrf vrf2
319 no peer 192.168.0.3 vrf foo
327 You can inspect the current BFD peer status with the following commands:
337 Uptime: 1 minute(s), 51 second(s)
339 Remote diagnostics: ok
341 Receive interval: 300ms
342 Transmission interval: 300ms
343 Echo transmission interval: disabled
345 Receive interval: 300ms
346 Transmission interval: 300ms
347 Echo transmission interval: 50ms
354 Uptime: 1 minute(s), 53 second(s)
356 Remote diagnostics: ok
358 Receive interval: 300ms
359 Transmission interval: 300ms
360 Echo transmission interval: disabled
362 Receive interval: 300ms
363 Transmission interval: 300ms
364 Echo transmission interval: 50ms
366 frr# show bfd peer 192.168.1.1
373 Uptime: 3 minute(s), 4 second(s)
375 Remote diagnostics: ok
377 Receive interval: 300ms
378 Transmission interval: 300ms
379 Echo transmission interval: disabled
381 Receive interval: 300ms
382 Transmission interval: 300ms
383 Echo transmission interval: 50ms
385 frr# show bfd peer 192.168.0.1 json
386 {"multihop":false,"peer":"192.168.0.1","id":1,"remote-id":1,"status":"up","uptime":161,"diagnostic":"ok","remote-diagnostic":"ok","receive-interval":300,"transmit-interval":300,"echo-interval":50,"remote-receive-interval":300,"remote-transmit-interval":300,"remote-echo-interval":50}
389 You can also inspect peer session counters with the following commands:
393 frr# show bfd peers counters
395 peer 192.168.2.1 interface r2-eth2
396 Control packet input: 28 packets
397 Control packet output: 28 packets
398 Echo packet input: 0 packets
399 Echo packet output: 0 packets
401 Session down events: 0
402 Zebra notifications: 2
405 Control packet input: 54 packets
406 Control packet output: 103 packets
407 Echo packet input: 965 packets
408 Echo packet output: 966 packets
410 Session down events: 0
411 Zebra notifications: 4
413 frr# show bfd peer 192.168.0.1 counters
415 Control packet input: 126 packets
416 Control packet output: 247 packets
417 Echo packet input: 2409 packets
418 Echo packet output: 2410 packets
420 Session down events: 0
421 Zebra notifications: 4
423 frr# show bfd peer 192.168.0.1 counters json
424 {"multihop":false,"peer":"192.168.0.1","control-packet-input":348,"control-packet-output":685,"echo-packet-input":6815,"echo-packet-output":6816,"session-up":1,"session-down":0,"zebra-notifications":4}