mininet icon indicating copy to clipboard operation
mininet copied to clipboard

BPF filesystem not available

Open YuMi-coding opened this issue 4 years ago • 2 comments

I am trying to create BPF maps under the simulated hosts by mininet. However, the BPF filesystem is not available at the hosts. I can access this directory by checking /sys/fs/bpf/, but cannot create any subdirectories or files here.

Expected/Desired Behavior:

The simulated hosts should be able to operate on the BPF filesystem.

Actual Behavior:

The creation of files and directories is not successful.

Detailed Steps to Reproduce the Behavior:

sudo mn xterm h1 At the xterm of h1: cd /sys/fs/bpf mkdir tc

Additional Information:

I am not sure if this problem is intended or not. Perhaps this issue is requesting a new feature for BPF fs.

YuMi-coding avatar Jun 17 '21 20:06 YuMi-coding

I also experienced this issue. Did you found any workaround for this?

SPYFF avatar Jul 27 '21 08:07 SPYFF

My current workaround for tc is:

Binding the unnamed network namespaces created by mininet as described here:

# lsns | grep h1 | grep net
4026532351 net         1  1776 root             bash --norc --noediting -is mininet:h2
# touch /run/netns/h2
# mount -o bind /proc/1776/ns/net /run/netns/h2
# ip netns exec h2 tc filter add dev h2-eth0 egress bpf da obj bpf_filter.o

That way my BPF object attached to the network interface of the h2 outside of its process namespace where BPF filesystem not mounted.

SPYFF avatar Jul 27 '21 08:07 SPYFF

@lantz SPYFF seems to have found a workaround and the issue looks related to Linux container limitations rather than a mininet issue. Consider closing this.

janev94 avatar Nov 17 '22 12:11 janev94