Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wenxin-wang/flowlabel-switching
flowlabel-base label switching for IPv6
https://github.com/wenxin-wang/flowlabel-switching
Last synced: 2 months ago
JSON representation
flowlabel-base label switching for IPv6
- Host: GitHub
- URL: https://github.com/wenxin-wang/flowlabel-switching
- Owner: wenxin-wang
- License: mit
- Archived: true
- Created: 2019-01-20T15:47:46.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-23T04:47:57.000Z (over 5 years ago)
- Last Synced: 2024-08-02T01:20:03.434Z (5 months ago)
- Language: C
- Size: 60.5 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Edge
1. labeling: lwt xmit
2. switching: like backbone
3. unlabeling: lwt xmit## Labeling
lwt xmit bpf cannot have arguments
1. lpm match for a label value
2. if not match, unset flowlabel
3. if match, change flowlabel
4. continue routing## Unlabeling
Just set flowlabel to 0
# Backbone
xdp bpf
## Fallback
unlabel + routing: switching fallback to this when seeing 0-label or unknown
label (sets label to 0 before routing)# Build
## Prerequisites
1. linux-kernel >= 4.18 (for `fib_lookup`): See [BPF Features by Linux Kernel
Version](https://github.com/iovisor/bcc/blob/master/docs/kernel-versions.md)
2. bcc: for libbpf## Build & Install
```bash
cd flowlabel-switching/
make
```# Examples
See [test/]().
# About `ip netns exec`
The default bpf filesystem, used for pinning bpf programs and maps, is mounted
on `/sys/fs/bpf/` by `iproute2` programs. However, `ip netns exec` happens to
unmount `/sys` before `exec`, so the called program never sees that bpf
filesystem.And it seems that bpf filesystem cannot be mounted by any command invoked with
`ip netns exec`. I don't know the reason behind.So before calling `ip netns exec`, mount a bpf filesystem somewhere other than
`/sys`, e.g. `/run/flsw/bpffs/`, and `ip netns exec` will see that filesystem.And by setting `TC_BPF_MNT` environment variable to ~~subdirectories of the
previously mounted bpf filesystem.~~ (iproute2 tries to mount bpf filesystem
whenever `TC_BPF_MNT` is not a bpf mount point, whether it's a subdirectory of a
bpf fs or not, probably with good reason) different mount points of bpf
filesystems, we can have different bpf objects with the same name for different
netns.