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. This option
78 `vrf` selects which domain we want to use.
80 .. 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}]
81 .. 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}]
83 Stops and removes the selected peer.
85 .. index:: show bfd peers [json]
86 .. clicmd:: show bfd peers [json]
88 Show all configured BFD peers information and current status.
90 .. index:: show bfd 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|vrf NAME$vrfname}]> [json]
91 .. clicmd:: show bfd 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|vrf NAME$vrfname}]> [json]
93 Show status for a specific BFD peer.
101 .. index:: detect-multiplier (2-255)
102 .. clicmd:: detect-multiplier (2-255)
104 Configures the detection multiplier to determine packet loss. The
105 remote transmission interval will be multiplied by this value to
106 determine the connection loss detection timer. The default value is
109 Example: when the local system has `detect-multiplier 3` and the
110 remote system has `transmission interval 300`, the local system will
111 detect failures only after 900 milliseconds without receiving
114 .. index:: receive-interval (10-60000)
115 .. clicmd:: receive-interval (10-60000)
117 Configures the minimum interval that this system is capable of
118 receiving control packets. The default value is 300 milliseconds.
120 .. index:: transmit-interval (10-60000)
121 .. clicmd:: transmit-interval (10-60000)
123 The minimum transmission interval (less jitter) that this system
124 wants to use to send BFD control packets.
126 .. index:: echo-interval (10-60000)
127 .. clicmd:: echo-interval (10-60000)
129 Configures the minimal echo receive transmission interval that this
130 system is capable of handling.
132 .. index:: [no] echo-mode
133 .. clicmd:: [no] echo-mode
135 Enables or disables the echo transmission mode. This mode is disabled
138 It is recommended that the transmission interval of control packets
139 to be increased after enabling echo-mode to reduce bandwidth usage.
140 For example: `transmission-interval 2000`.
142 Echo mode is not supported on multi-hop setups (see :rfc:`5883`
145 .. index:: [no] shutdown
146 .. clicmd:: [no] shutdown
148 Enables or disables the peer. When the peer is disabled an
149 'administrative down' message is sent to the remote peer.
151 .. index:: label WORD
152 .. clicmd:: label WORD
154 Labels a peer with the provided word. This word can be referenced
155 later on other daemons to refer to a specific peer.
158 .. _bfd-bgp-peer-config:
160 BGP BFD Configuration
161 ---------------------
163 The following commands are available inside the BGP configuration node.
165 .. index:: neighbor <A.B.C.D|X:X::X:X|WORD> bfd
166 .. clicmd:: neighbor <A.B.C.D|X:X::X:X|WORD> bfd
168 Listen for BFD events registered on the same target as this BGP
169 neighbor. When BFD peer goes down it immediately asks BGP to shutdown
170 the connection with its neighbor and, when it goes back up, notify
171 BGP to try to connect to it.
173 .. index:: no neighbor <A.B.C.D|X:X::X:X|WORD> bfd
174 .. clicmd:: no neighbor <A.B.C.D|X:X::X:X|WORD> bfd
176 Removes any notification registration for this neighbor.
179 .. _bfd-ospf-peer-config:
181 OSPF BFD Configuration
182 ----------------------
184 The following commands are available inside the interface configuration node.
186 .. index:: ip ospf bfd
187 .. clicmd:: ip ospf bfd
189 Listen for BFD events on peers created on the interface. Every time
190 a new neighbor is found a BFD peer is created to monitor the link
191 status for fast convergence.
193 .. index:: no ip ospf bfd
194 .. clicmd:: no ip ospf bfd
196 Removes any notification registration for this interface peers.
199 .. _bfd-ospf6-peer-config:
201 OSPF6 BFD Configuration
202 -----------------------
204 The following commands are available inside the interface configuration node.
206 .. index:: ipv6 ospf6 bfd
207 .. clicmd:: ipv6 ospf6 bfd
209 Listen for BFD events on peers created on the interface. Every time
210 a new neighbor is found a BFD peer is created to monitor the link
211 status for fast convergence.
213 .. index:: no ipv6 ospf6 bfd
214 .. clicmd:: no ipv6 ospf6 bfd
216 Removes any notification registration for this interface peers.
219 .. _bfd-pim-peer-config:
221 PIM BFD Configuration
222 ---------------------
224 The following commands are available inside the interface configuration node.
226 .. index:: ip pim bfd
227 .. clicmd:: ip pim bfd
229 Listen for BFD events on peers created on the interface. Every time
230 a new neighbor is found a BFD peer is created to monitor the link
231 status for fast convergence.
233 .. index:: no ip pim bfd
234 .. clicmd:: no ip pim bfd
236 Removes any notification registration for this interface peers.
239 .. _bfd-configuration:
244 Before applying ``bfdd`` rules to integrated daemons (like BGPd), we must
245 create the corresponding peers inside the ``bfd`` configuration node.
247 Here is an example of BFD configuration:
258 neighbor 192.168.0.1 remote-as 65531
259 neighbor 192.168.0.1 bfd
260 neighbor 192.168.0.2 remote-as 65530
261 neighbor 192.168.0.2 bfd
262 neighbor 192.168.0.3 remote-as 65532
263 neighbor 192.168.0.3 bfd
266 Peers can be identified by its address (use ``multihop`` when you need
267 to specify a multi hop peer) or can be specified manually by a label.
269 Here are the available peer configurations:
275 ! configure a peer on an specific interface
276 peer 192.168.0.1 interface eth0
280 ! configure a multihop peer
281 peer 192.168.0.2 multihop local-address 192.168.0.3
285 ! configure a peer in a different vrf
286 peer 192.168.0.3 vrf foo
290 ! configure a peer with every option possible
294 receive-interval 60000
295 transmit-interval 3000
300 no peer 192.168.0.3 vrf foo
308 You can inspect the current BFD peer status with the following commands:
318 Uptime: 1 minute(s), 51 second(s)
320 Remote diagnostics: ok
322 Receive interval: 300ms
323 Transmission interval: 300ms
324 Echo transmission interval: disabled
326 Receive interval: 300ms
327 Transmission interval: 300ms
328 Echo transmission interval: 50ms
335 Uptime: 1 minute(s), 53 second(s)
337 Remote diagnostics: ok
339 Receive interval: 300ms
340 Transmission interval: 300ms
341 Echo transmission interval: disabled
343 Receive interval: 300ms
344 Transmission interval: 300ms
345 Echo transmission interval: 50ms
347 frr# show bfd peer 192.168.1.1
354 Uptime: 3 minute(s), 4 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.0.1 json
367 {"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}
370 You can also inspect peer session counters with the following commands:
374 frr# show bfd peers counters
376 peer 192.168.2.1 interface r2-eth2
377 Control packet input: 28 packets
378 Control packet output: 28 packets
379 Echo packet input: 0 packets
380 Echo packet output: 0 packets
382 Session down events: 0
383 Zebra notifications: 2
386 Control packet input: 54 packets
387 Control packet output: 103 packets
388 Echo packet input: 965 packets
389 Echo packet output: 966 packets
391 Session down events: 0
392 Zebra notifications: 4
394 frr# show bfd peer 192.168.0.1 counters
396 Control packet input: 126 packets
397 Control packet output: 247 packets
398 Echo packet input: 2409 packets
399 Echo packet output: 2410 packets
401 Session down events: 0
402 Zebra notifications: 4
404 frr# show bfd peer 192.168.0.1 counters json
405 {"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}