]>
Commit | Line | Data |
---|---|---|
c44032c1 RZ |
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 | |
123582b3 | 41 | socket location:: |
c44032c1 RZ |
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. This option | |
76 | conflicts with `vrf`. | |
77 | ||
78 | `vrf` selects which domain we want to use. | |
79 | ||
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}] | |
82 | ||
83 | Stops and removes the selected peer. | |
84 | ||
85 | .. index:: show bfd peers [json] | |
86 | .. clicmd:: show bfd peers [json] | |
87 | ||
88 | Show all configured BFD peers information and current status. | |
89 | ||
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] | |
92 | ||
93 | Show status for a specific BFD peer. | |
94 | ||
95 | ||
96 | .. _bfd-peer-config: | |
97 | ||
98 | Peer Configurations | |
99 | ------------------- | |
100 | ||
101 | .. index:: detect-multiplier (2-255) | |
102 | .. clicmd:: detect-multiplier (2-255) | |
103 | ||
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 | |
107 | 3. | |
108 | ||
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 | |
112 | packets. | |
113 | ||
114 | .. index:: receive-interval (10-60000) | |
115 | .. clicmd:: receive-interval (10-60000) | |
116 | ||
117 | Configures the minimum interval that this system is capable of | |
118 | receiving control packets. The default value is 300 milliseconds. | |
119 | ||
120 | .. index:: transmit-interval (10-60000) | |
121 | .. clicmd:: transmit-interval (10-60000) | |
122 | ||
123 | The minimum transmission interval (less jitter) that this system | |
124 | wants to use to send BFD control packets. | |
125 | ||
126 | .. index:: echo-interval (10-60000) | |
127 | .. clicmd:: echo-interval (10-60000) | |
128 | ||
129 | Configures the minimal echo receive transmission interval that this | |
130 | system is capable of handling. | |
131 | ||
132 | .. index:: [no] echo-mode | |
133 | .. clicmd:: [no] echo-mode | |
134 | ||
135 | Enables or disables the echo transmission mode. This mode is disabled | |
136 | by default. | |
137 | ||
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`. | |
141 | ||
142 | Echo mode is not supported on multi-hop setups (see :rfc:`5883` | |
143 | section 3). | |
144 | ||
145 | .. index:: [no] shutdown | |
146 | .. clicmd:: [no] shutdown | |
147 | ||
148 | Enables or disables the peer. When the peer is disabled an | |
149 | 'administrative down' message is sent to the remote peer. | |
150 | ||
151 | .. index:: label WORD | |
152 | .. clicmd:: label WORD | |
153 | ||
154 | Labels a peer with the provided word. This word can be referenced | |
155 | later on other daemons to refer to a specific peer. | |
156 | ||
157 | ||
158 | .. _bfd-bgp-peer-config: | |
159 | ||
160 | BGP BFD Configuration | |
161 | --------------------- | |
162 | ||
123582b3 RZ |
163 | The following commands are available inside the BGP configuration node. |
164 | ||
c44032c1 RZ |
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 | |
167 | ||
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. | |
172 | ||
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 | |
175 | ||
176 | Removes any notification registration for this neighbor. | |
177 | ||
178 | ||
123582b3 RZ |
179 | .. _bfd-ospf-peer-config: |
180 | ||
181 | OSPF BFD Configuration | |
e36ff3f3 | 182 | ---------------------- |
123582b3 RZ |
183 | |
184 | The following commands are available inside the interface configuration node. | |
185 | ||
186 | .. index:: ip ospf bfd | |
187 | .. clicmd:: ip ospf bfd | |
188 | ||
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. | |
192 | ||
193 | .. index:: no ip ospf bfd | |
194 | .. clicmd:: no ip ospf bfd | |
195 | ||
196 | Removes any notification registration for this interface peers. | |
197 | ||
198 | ||
199 | .. _bfd-ospf6-peer-config: | |
200 | ||
201 | OSPF6 BFD Configuration | |
202 | ----------------------- | |
203 | ||
204 | The following commands are available inside the interface configuration node. | |
205 | ||
206 | .. index:: ipv6 ospf6 bfd | |
207 | .. clicmd:: ipv6 ospf6 bfd | |
208 | ||
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. | |
212 | ||
213 | .. index:: no ipv6 ospf6 bfd | |
214 | .. clicmd:: no ipv6 ospf6 bfd | |
215 | ||
216 | Removes any notification registration for this interface peers. | |
217 | ||
218 | ||
219 | .. _bfd-pim-peer-config: | |
220 | ||
221 | PIM BFD Configuration | |
222 | --------------------- | |
223 | ||
224 | The following commands are available inside the interface configuration node. | |
225 | ||
226 | .. index:: ip pim bfd | |
227 | .. clicmd:: ip pim bfd | |
228 | ||
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. | |
232 | ||
233 | .. index:: no ip pim bfd | |
234 | .. clicmd:: no ip pim bfd | |
235 | ||
236 | Removes any notification registration for this interface peers. | |
237 | ||
238 | ||
c44032c1 RZ |
239 | .. _bfd-configuration: |
240 | ||
241 | Configuration | |
242 | ============= | |
243 | ||
244 | Before applying ``bfdd`` rules to integrated daemons (like BGPd), we must | |
245 | create the corresponding peers inside the ``bfd`` configuration node. | |
246 | ||
247 | Here is an example of BFD configuration: | |
248 | ||
249 | :: | |
250 | ||
251 | bfd | |
252 | peer 192.168.0.1 | |
253 | label home-peer | |
254 | no shutdown | |
255 | ! | |
256 | ! | |
257 | router bgp 65530 | |
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 | |
264 | ! | |
265 | ||
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. | |
268 | ||
269 | Here are the available peer configurations: | |
270 | ||
271 | :: | |
272 | ||
273 | bfd | |
274 | ||
275 | ! configure a peer on an specific interface | |
276 | peer 192.168.0.1 interface eth0 | |
277 | no shutdown | |
278 | ! | |
279 | ||
280 | ! configure a multihop peer | |
281 | peer 192.168.0.2 multihop local-address 192.168.0.3 | |
282 | shutdown | |
283 | ! | |
284 | ||
285 | ! configure a peer in a different vrf | |
286 | peer 192.168.0.3 vrf foo | |
287 | shutdown | |
288 | ! | |
289 | ||
290 | ! configure a peer with every option possible | |
291 | peer 192.168.0.4 | |
292 | label peer-label | |
293 | detect-multiplier 50 | |
294 | receive-interval 60000 | |
295 | transmit-interval 3000 | |
296 | shutdown | |
297 | ! | |
298 | ||
299 | ! remove a peer | |
300 | no peer 192.168.0.3 vrf foo | |
301 | ||
302 | ||
303 | .. _bfd-status: | |
304 | ||
305 | Status | |
306 | ====== | |
307 | ||
308 | You can inspect the current BFD peer status with the following commands: | |
309 | ||
310 | :: | |
311 | ||
312 | frr# show bfd peers | |
313 | BFD Peers: | |
314 | peer 192.168.0.1 | |
315 | ID: 1 | |
316 | Remote ID: 1 | |
317 | Status: up | |
318 | Uptime: 1 minute(s), 51 second(s) | |
319 | Diagnostics: ok | |
320 | Remote diagnostics: ok | |
321 | Local timers: | |
322 | Receive interval: 300ms | |
323 | Transmission interval: 300ms | |
324 | Echo transmission interval: disabled | |
325 | Remote timers: | |
326 | Receive interval: 300ms | |
327 | Transmission interval: 300ms | |
328 | Echo transmission interval: 50ms | |
329 | ||
330 | peer 192.168.1.1 | |
331 | label: router3-peer | |
332 | ID: 2 | |
333 | Remote ID: 2 | |
334 | Status: up | |
335 | Uptime: 1 minute(s), 53 second(s) | |
336 | Diagnostics: ok | |
337 | Remote diagnostics: ok | |
338 | Local timers: | |
339 | Receive interval: 300ms | |
340 | Transmission interval: 300ms | |
341 | Echo transmission interval: disabled | |
342 | Remote timers: | |
343 | Receive interval: 300ms | |
344 | Transmission interval: 300ms | |
345 | Echo transmission interval: 50ms | |
346 | ||
347 | frr# show bfd peer 192.168.1.1 | |
348 | BFD Peer: | |
349 | peer 192.168.1.1 | |
350 | label: router3-peer | |
351 | ID: 2 | |
352 | Remote ID: 2 | |
353 | Status: up | |
354 | Uptime: 3 minute(s), 4 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 | |
123582b3 RZ |
365 | |
366 | frr# show bfd peer 192.168.0.1 json | |
e36ff3f3 | 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} |
123582b3 RZ |
368 | |
369 | ||
370 | You can also inspect peer session counters with the following commands: | |
371 | ||
372 | :: | |
373 | ||
374 | frr# show bfd peers counters | |
375 | BFD Peers: | |
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 | |
381 | Session up events: 1 | |
382 | Session down events: 0 | |
383 | Zebra notifications: 2 | |
384 | ||
385 | peer 192.168.0.1 | |
386 | Control packet input: 54 packets | |
387 | Control packet output: 103 packets | |
388 | Echo packet input: 965 packets | |
389 | Echo packet output: 966 packets | |
390 | Session up events: 1 | |
391 | Session down events: 0 | |
392 | Zebra notifications: 4 | |
393 | ||
394 | frr# show bfd peer 192.168.0.1 counters | |
395 | peer 192.168.0.1 | |
396 | Control packet input: 126 packets | |
397 | Control packet output: 247 packets | |
398 | Echo packet input: 2409 packets | |
399 | Echo packet output: 2410 packets | |
400 | Session up events: 1 | |
401 | Session down events: 0 | |
402 | Zebra notifications: 4 | |
403 | ||
404 | frr# show bfd peer 192.168.0.1 counters json | |
e36ff3f3 | 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} |