]> git.proxmox.com Git - mirror_frr.git/blob - doc/user/bfd.rst
Merge pull request #4436 from donaldsharp/tools_frr_flush
[mirror_frr.git] / doc / user / bfd.rst
1 .. _bfd:
2
3 **********************************
4 Bidirectional Forwarding Detection
5 **********************************
6
7 :abbr:`BFD (Bidirectional Forwarding Detection)` stands for
8 Bidirectional Forwarding Detection and it is described and extended by
9 the following RFCs:
10
11 * :rfc:`5880`
12 * :rfc:`5881`
13 * :rfc:`5883`
14
15 Currently, there are two implementations of the BFD commands in FRR:
16
17 * :abbr:`PTM (Prescriptive Topology Manager)`: an external daemon which
18 implements BFD;
19 * ``bfdd``: a BFD implementation that is able to talk with remote peers;
20
21 This document will focus on the later implementation: *bfdd*.
22
23
24 .. _bfd-starting:
25
26 Starting BFD
27 ============
28
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`.
32
33 *bfdd* specific invocation options are described below. Common options
34 may also be specified (:ref:`common-invocation-options`).
35
36 .. program:: bfdd
37
38 .. option:: --bfdctl <unix-socket>
39
40 Set the BFD daemon control socket location. If using a non-default
41 socket location::
42
43 /usr/lib/frr/bfdd --bfdctl /tmp/bfdd.sock
44
45
46 The default UNIX socket location is:
47
48 #define BFDD_CONTROL_SOCKET "|INSTALL_PREFIX_STATE|/bfdd.sock"
49
50
51 .. _bfd-commands:
52
53 BFDd Commands
54 =============
55
56 .. index:: bfd
57 .. clicmd:: bfd
58
59 Opens the BFD daemon configuration node.
60
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}]
63
64 Creates and configures a new BFD peer to listen and talk to.
65
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).
70
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.
74
75 `interface` selects which interface we should use.
76
77 `vrf` selects which domain we want to use.
78
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}]
81
82 Stops and removes the selected peer.
83
84 .. index:: show bfd [vrf NAME] peers [json]
85 .. clicmd:: show bfd [vrf NAME] peers [json]
86
87 Show all configured BFD peers information and current status.
88
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]
91
92 Show status for a specific BFD peer.
93
94
95 .. _bfd-peer-config:
96
97 Peer Configurations
98 -------------------
99
100 .. index:: detect-multiplier (2-255)
101 .. clicmd:: detect-multiplier (2-255)
102
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
106 3.
107
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
111 packets.
112
113 .. index:: receive-interval (10-60000)
114 .. clicmd:: receive-interval (10-60000)
115
116 Configures the minimum interval that this system is capable of
117 receiving control packets. The default value is 300 milliseconds.
118
119 .. index:: transmit-interval (10-60000)
120 .. clicmd:: transmit-interval (10-60000)
121
122 The minimum transmission interval (less jitter) that this system
123 wants to use to send BFD control packets.
124
125 .. index:: echo-interval (10-60000)
126 .. clicmd:: echo-interval (10-60000)
127
128 Configures the minimal echo receive transmission interval that this
129 system is capable of handling.
130
131 .. index:: [no] echo-mode
132 .. clicmd:: [no] echo-mode
133
134 Enables or disables the echo transmission mode. This mode is disabled
135 by default.
136
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`.
140
141 Echo mode is not supported on multi-hop setups (see :rfc:`5883`
142 section 3).
143
144 .. index:: [no] shutdown
145 .. clicmd:: [no] shutdown
146
147 Enables or disables the peer. When the peer is disabled an
148 'administrative down' message is sent to the remote peer.
149
150 .. index:: label WORD
151 .. clicmd:: label WORD
152
153 Labels a peer with the provided word. This word can be referenced
154 later on other daemons to refer to a specific peer.
155
156
157 .. _bfd-bgp-peer-config:
158
159 BGP BFD Configuration
160 ---------------------
161
162 The following commands are available inside the BGP configuration node.
163
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
166
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.
171
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
174
175 Removes any notification registration for this neighbor.
176
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
179
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.
186
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
189
190 Disallow to write CBIT independence in BFD outgoing packets. Also disallow
191 to ignore BFD down notification. This is the default behaviour.
192
193 .. _bfd-ospf-peer-config:
194
195 OSPF BFD Configuration
196 ----------------------
197
198 The following commands are available inside the interface configuration node.
199
200 .. index:: ip ospf bfd
201 .. clicmd:: ip ospf bfd
202
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.
206
207 .. index:: no ip ospf bfd
208 .. clicmd:: no ip ospf bfd
209
210 Removes any notification registration for this interface peers.
211
212
213 .. _bfd-ospf6-peer-config:
214
215 OSPF6 BFD Configuration
216 -----------------------
217
218 The following commands are available inside the interface configuration node.
219
220 .. index:: ipv6 ospf6 bfd
221 .. clicmd:: ipv6 ospf6 bfd
222
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.
226
227 .. index:: no ipv6 ospf6 bfd
228 .. clicmd:: no ipv6 ospf6 bfd
229
230 Removes any notification registration for this interface peers.
231
232
233 .. _bfd-pim-peer-config:
234
235 PIM BFD Configuration
236 ---------------------
237
238 The following commands are available inside the interface configuration node.
239
240 .. index:: ip pim bfd
241 .. clicmd:: ip pim bfd
242
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.
246
247 .. index:: no ip pim bfd
248 .. clicmd:: no ip pim bfd
249
250 Removes any notification registration for this interface peers.
251
252
253 .. _bfd-configuration:
254
255 Configuration
256 =============
257
258 Before applying ``bfdd`` rules to integrated daemons (like BGPd), we must
259 create the corresponding peers inside the ``bfd`` configuration node.
260
261 Here is an example of BFD configuration:
262
263 ::
264
265 bfd
266 peer 192.168.0.1
267 label home-peer
268 no shutdown
269 !
270 !
271 router bgp 65530
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
278 !
279
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.
282
283 Here are the available peer configurations:
284
285 ::
286
287 bfd
288
289 ! configure a peer on an specific interface
290 peer 192.168.0.1 interface eth0
291 no shutdown
292 !
293
294 ! configure a multihop peer
295 peer 192.168.0.2 multihop local-address 192.168.0.3
296 shutdown
297 !
298
299 ! configure a peer in a different vrf
300 peer 192.168.0.3 vrf foo
301 shutdown
302 !
303
304 ! configure a peer with every option possible
305 peer 192.168.0.4
306 label peer-label
307 detect-multiplier 50
308 receive-interval 60000
309 transmit-interval 3000
310 shutdown
311 !
312
313 ! configure a peer on an interface from a separate vrf
314 peer 192.168.0.5 interface eth1 vrf vrf2
315 no shutdown
316 !
317
318 ! remove a peer
319 no peer 192.168.0.3 vrf foo
320
321
322 .. _bfd-status:
323
324 Status
325 ======
326
327 You can inspect the current BFD peer status with the following commands:
328
329 ::
330
331 frr# show bfd peers
332 BFD Peers:
333 peer 192.168.0.1
334 ID: 1
335 Remote ID: 1
336 Status: up
337 Uptime: 1 minute(s), 51 second(s)
338 Diagnostics: ok
339 Remote diagnostics: ok
340 Local timers:
341 Receive interval: 300ms
342 Transmission interval: 300ms
343 Echo transmission interval: disabled
344 Remote timers:
345 Receive interval: 300ms
346 Transmission interval: 300ms
347 Echo transmission interval: 50ms
348
349 peer 192.168.1.1
350 label: router3-peer
351 ID: 2
352 Remote ID: 2
353 Status: up
354 Uptime: 1 minute(s), 53 second(s)
355 Diagnostics: ok
356 Remote diagnostics: ok
357 Local timers:
358 Receive interval: 300ms
359 Transmission interval: 300ms
360 Echo transmission interval: disabled
361 Remote timers:
362 Receive interval: 300ms
363 Transmission interval: 300ms
364 Echo transmission interval: 50ms
365
366 frr# show bfd peer 192.168.1.1
367 BFD Peer:
368 peer 192.168.1.1
369 label: router3-peer
370 ID: 2
371 Remote ID: 2
372 Status: up
373 Uptime: 3 minute(s), 4 second(s)
374 Diagnostics: ok
375 Remote diagnostics: ok
376 Local timers:
377 Receive interval: 300ms
378 Transmission interval: 300ms
379 Echo transmission interval: disabled
380 Remote timers:
381 Receive interval: 300ms
382 Transmission interval: 300ms
383 Echo transmission interval: 50ms
384
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}
387
388
389 You can also inspect peer session counters with the following commands:
390
391 ::
392
393 frr# show bfd peers counters
394 BFD Peers:
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
400 Session up events: 1
401 Session down events: 0
402 Zebra notifications: 2
403
404 peer 192.168.0.1
405 Control packet input: 54 packets
406 Control packet output: 103 packets
407 Echo packet input: 965 packets
408 Echo packet output: 966 packets
409 Session up events: 1
410 Session down events: 0
411 Zebra notifications: 4
412
413 frr# show bfd peer 192.168.0.1 counters
414 peer 192.168.0.1
415 Control packet input: 126 packets
416 Control packet output: 247 packets
417 Echo packet input: 2409 packets
418 Echo packet output: 2410 packets
419 Session up events: 1
420 Session down events: 0
421 Zebra notifications: 4
422
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}