Skip to content

Bidirectional Forwarding Detection#67

Merged
rcgoodfellow merged 18 commits into
mainfrom
bfd
Jan 31, 2024
Merged

Bidirectional Forwarding Detection#67
rcgoodfellow merged 18 commits into
mainfrom
bfd

Conversation

@rcgoodfellow

@rcgoodfellow rcgoodfellow commented May 29, 2023

Copy link
Copy Markdown
Collaborator

This is an initial implementation of the RFC 5880: Bidirectional Forwarding Detection (BFD) protocol. This PR is limited in scope to RFC 5883: Bidirectional Forwarding Detection (BFD) for Multihop Paths and RFC 5881: Bidirectional Forwarding Detection (BFD) for IPv4 and IPv6 (Single Hop). Authentication is not covered in this initial PR but will likely be added in a follow-on based on recommendations from RFC 5883.

This is purely a protocol implementation. No attempt is made to influence an underlying forwarding platform or interact with routing daemons. BFD is now fully integrated with the Maghemite RIB.

The driving use case for BFD, as described in RFD 276 Section 3.1, is providing an HA path into an Oxide rack for customers who use static routing. BFD is commonly implemented in enterprise-grade networking equipment for precisely this purpose. To make this direction work, we only need to implement the upper half of the protocol. This will inform upstream routers/firewalls about what sidecar to send packets to in the event of an outage. Integration with the Maghemite RIB allows our switches to detect upstream forwarding faults and react accordingly.

In addition to the CI-based tests that have been added. I have also tested this against the VyOS/FRR BFD implementation, and the basic detection mechanisms look good. As we move forward, I'll work on integrating testing for FortiGate, PanOS, and others.

The BFD functionality is plumbed into the mgd API is designed to be driven by an overarching control plane. No static configuration is available whatsoever - everything is configured through the API. A basic CLI commands are provided in mgadm along with additions to the progenitor-based client library for mfd. The daemon is also stateless, meaning that a higher-level entity is responsible for managing state across daemon restarts. The deamon stores session information in the Maghemite RDB. It will restore BFD sessions on restart. The RDB does not survive a sled reboot, as its on the ramdisk. At that point, it's the control plane's responsibility to repopulate things. The I've tested that the Omicron BFD RPW performs this function as expected.

Finally, the core functionality in the BFD library is independent of network transport. This was done to make lightweight testing possible without having to set up complete networks with a bunch of zones/VMs and the whole nine yards. BFD sessions are linked to an underlying UDP mechanism through bidirectional channels that carry packet data and destination addresses. This makes it really simple to define multi-daemon protocol tests.

@rcgoodfellow rcgoodfellow marked this pull request as ready for review June 2, 2023 04:46
@rcgoodfellow rcgoodfellow requested a review from Nieuwejaar June 2, 2023 04:46
@rcgoodfellow rcgoodfellow force-pushed the bfd branch 2 times, most recently from f1406da to 3fc1954 Compare June 6, 2023 16:19

@Nieuwejaar Nieuwejaar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this meant to be open-sourced, or not yet? If so, we need copyrights,etc.

I need to step away from the keyboard for a bit. I've gone through everything but sm.rs. So far it all looks good. It really is a refreshingly simple protocol.

Comment thread bfd/cli/src/main.rs Outdated
Comment thread bfd/daemon/src/admin.rs Outdated
Comment thread bfd/daemon/src/admin.rs Outdated
Comment thread bfd/daemon/src/udp.rs Outdated
Comment thread bfd/daemon/src/udp.rs Outdated
Comment thread bfd/lib/src/util.rs Outdated
Comment thread bfd/lib/src/util.rs Outdated
Comment thread bfd/peer-test-config/vyos.vbash
Comment thread bfd/lib/src/packet.rs Outdated
Comment thread bfd/lib/src/packet.rs
Comment thread bfd/lib/src/sm.rs
Comment thread bfd/lib/src/sm.rs
Comment thread bfd/lib/src/sm.rs Outdated
@askfongjojo askfongjojo added this to the 1.0.2 milestone Aug 4, 2023
@askfongjojo askfongjojo removed this from the 1.0.2 milestone Aug 21, 2023
@morlandi7 morlandi7 added this to the 3 milestone Oct 13, 2023
@askfongjojo askfongjojo removed this from the 3 milestone Oct 21, 2023
@rcgoodfellow rcgoodfellow force-pushed the bfd branch 5 times, most recently from c9b2ead to 53dfa7a Compare January 19, 2024 04:20
@rcgoodfellow rcgoodfellow force-pushed the bfd branch 5 times, most recently from 712a2e8 to 2fd0b4c Compare January 29, 2024 03:47

@Nieuwejaar Nieuwejaar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still have a few files to get through, but I'm done for the night. So far, this looks really solid.

Comment thread bfd/src/lib.rs
Comment thread bfd/src/lib.rs
Comment thread bfd/src/lib.rs Outdated
Comment thread bfd/src/lib.rs Outdated
Comment thread mg-lower/src/dendrite.rs Outdated
Comment thread bfd/src/packet.rs Outdated
Comment thread bfd/src/packet.rs
Comment thread bfd/src/packet.rs Outdated
Comment thread bfd/src/lib.rs
Comment thread bfd/src/sm.rs
Comment thread bfd/src/sm.rs
Comment thread bfd/src/sm.rs Outdated
Comment thread bfd/src/sm.rs
Comment thread bfd/src/sm.rs
Comment thread mgd/src/bfd_admin.rs Outdated
Comment thread mgd/src/bfd_admin.rs
Comment thread mgd/src/bfd_admin.rs Outdated

@Nieuwejaar Nieuwejaar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One final spelling nit. Otherwise, good to go.

Comment thread bfd/src/sm.rs
Comment thread bfd/src/sm.rs Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Want bidirectional forwarding detection (BFD)

4 participants