Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macvtap networking #2

Merged
merged 19 commits into from
Jan 19, 2021
Merged

Macvtap networking #2

merged 19 commits into from
Jan 19, 2021

Conversation

hellt
Copy link
Owner

@hellt hellt commented Jan 18, 2021

this branch is an attempt to parametrize connection mode that vrnetlab uses

this is done by adding --connection-mode variable to launch.py that takes vrxcon (default) and bridge value.

values macvtap and ovs can be added, if someone will add the appropriate code and make it work

linux bridge

linux bridge based networking is added, based on original work in vrnetlab#188

The downside of this driver is that it doesn't pass through LACP and BPDU packets

ovs

ovs can pass bpdu, but to make it work inside the container requires some trickery. I haven't proceed.

macvtap

The macvtap connection mode will create macvtap interafaces for each ethX interface (where X !=0) and instruct qemu to use this interface.

The problem is that I can't yet make the datapath workin, I see the packets reaching the vrnetlab macvtap interface, but I can't verify that the packets reach qemu's interface.

The complication is that qemu doesn't natively support macvtap interfaces, thus its needed to manually open /dev/tapX device and pass the file descriptor to the qemu.

I wonder if @networkop or @plajjan you have some courage to look at that?

PS. here is the docker command I used:

docker create --rm -i --privileged -v /dev:/dev --name vr-sros vrnetlab/vr-sros:20.10.R1 --connection-mode macvtap
docker network connect net1 vr-sros
docker start -ia vr-sros

@hellt
Copy link
Owner Author

hellt commented Jan 18, 2021

my assumption is that somehow the opening process of the TAP device finishes, thus the file descriptor doesn't really point to the device

https://github.com/hellt/vrnetlab/pull/2/files#diff-90a8e5693dd578cdb77e5881950a539f63419037f994bea412fb6a741542a1ebR291

@hellt hellt marked this pull request as ready for review January 19, 2021 12:18
@hellt hellt merged commit f917c1a into master Jan 19, 2021
@networkop
Copy link

so did you make macvtap work @hellt ?

@hellt
Copy link
Owner Author

hellt commented Jan 19, 2021 via email

@hellt
Copy link
Owner Author

hellt commented Jan 19, 2021

Looking at the macvtap-cni https://github.com/kubevirt/macvtap-cni/blob/master/pkg/util/netlink.go#L237 I suppose the root cause might be that I was creating macvtap interface in the container namespace, whereas it might be needed to be created on the host, and then moved into the container netns

@networkop
Copy link

yeah, good point. although the namespace-aware macvtap kernel patch seems to address this issue.

@hellt
Copy link
Owner Author

hellt commented Jan 19, 2021 via email

@networkop
Copy link

yeah, i might give it another go, later in the week.
do you have some script to set up a test environment? e.g. something that would bring up two container with cirros inside them?

@hellt
Copy link
Owner Author

hellt commented Jan 19, 2021 via email

hellt pushed a commit that referenced this pull request Mar 13, 2024
SROS: fix ixr-x1 and ixr-xs definition
jaro0149 added a commit to jaro0149/vrnetlab that referenced this pull request Sep 15, 2024
hellt added a commit that referenced this pull request Sep 29, 2024
* Add Cisco vIOS support

- Motivation: low memory footprint compared to IOS XE/XR.
- More information is in the README.md.

* Fixed some code-style issues #1

* Fixed some code-style issues #2

* Change docker image to debian:bookworm-slim

- With small changes:
  - added --no-install-recommends arg to save some space
    (final docker image has 291MB)
  - install python3 instead of python3-ipy, python3-ipy seems
    to be not needed
  - install qemu-utils package - it does not work at all without
    qemu-utils in comparison to ubuntu image

* format with ruff

* add simple version extraction scheme

---------

Co-authored-by: Roman Dodin <dodin.roman@gmail.com>
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.

2 participants