https://github.com/davidcoles/bfd
Experimental BFD implementation in Go. Incomplete and probably very wrong.
https://github.com/davidcoles/bfd
bfd golang networking rfc5880 rfc5881
Last synced: about 1 year ago
JSON representation
Experimental BFD implementation in Go. Incomplete and probably very wrong.
- Host: GitHub
- URL: https://github.com/davidcoles/bfd
- Owner: davidcoles
- License: gpl-2.0
- Created: 2024-06-29T14:45:15.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-07-09T12:27:26.000Z (almost 2 years ago)
- Last Synced: 2025-03-23T06:26:58.277Z (over 1 year ago)
- Topics: bfd, golang, networking, rfc5880, rfc5881
- Language: Go
- Homepage:
- Size: 151 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BFD
Experimental Bidirectional Forwarding Detection implementation in Go. Incomplete and probably very wrong.
Partially implements:
* [RFC 5880 - Bidirectional Forwarding Detection (BFD)](https://datatracker.ietf.org/doc/html/rfc5880)
* [RCF 5881 - Bidirectional Forwarding Detection (BFD) for IPv4 and IPv6 (Single Hop)](https://datatracker.ietf.org/doc/html/rfc5881)
This package will negotiate a BFD session with any directly connected peer that attempts to connect.
Only one session per peer is supported currently.
## Example usage
```
func main() {
ip := netip.MustParseAddr(os.Args[1])
bfd := bfd.BFD{}
err := bfd.Start()
if err != nil {
log.Fatal("Start: ", err)
}
for {
fmt.Println(ip, bfd.Query(ip))
time.Sleep(time.Second)
}
}
```
If you were running this on 10.1.2.3 as `go run main.go 10.1.2.4`, and on host 10.1.2.4 you set BIRD up with:
```
protocol bfd {
neighbor 10.1.2.3;
}
```
then you should see a BFD session come up:
```
root:~/bfd/cmd# go run main.go 10.1.2.4
10.1.2.4 false
10.1.2.4 true
10.1.2.4 true
10.1.2.4 true
...
```