summaryrefslogtreecommitdiff
path: root/Bidirectional Forwarding Detection (BFD).md
blob: de1ffe7296b0e2232171e387cd1133a74f9bb89d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
tags:
  - network
rfc: https://datatracker.ietf.org/doc/html/rfc5880
---
Used to detect faults in any component that is connecting two endpoint; e.g the forwarding engine, link or port.

It is low-overhead and fast.

A session is established between two nodes through a three-way handshake. 

It is transport agnostic, thus it can be used over raw ethernet or tunnels, etc.

Two modes: asynchronous and on-demand.

**Async**: each peer periodically sends packet; if x time no packets received link is declared down.
**On-demand**: an out-of-band system is expected to do this detection, but BFD can choose to verify whenever it feels like it and sends some array of packets and expecting some in return.

It is important to note that in async mode each peer sends packets in one direction and doesn't expect a reply to those. In on-demand mode one peer sends packets and **does** expect packets in return.

> A function exists called "Echo function" that does make it so packets are looped back to the sender. If any of those don't return the link is declared down.

- Pure Async without echo: less packets than with echo.
- With echo: possibly faster detection, less jitter, more packets
- On-demand: if there are alot of links, thus alot of BFD sessions and the overhead is too big

> On-demand cannot work if the round-trip time is larger than the desired detection time