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

Switch from legacy to vector User-mode Linux networking #39

Open
b177y opened this issue Jan 7, 2021 · 2 comments
Open

Switch from legacy to vector User-mode Linux networking #39

b177y opened this issue Jan 7, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@b177y
Copy link
Contributor

b177y commented Jan 7, 2021

Is your feature request related to a problem? Please describe.
The current methods of networking in Netkit are (legacy) tuntap devices and uml_switch daemons. These are now deprecated methods, which at some point will be removed from Linux. This is not an urgent issue as the current kernels should still be fine when these legacy methods are fully removed, but it would be good to look into implementing them.

Describe the solution you'd like
Research into the 'vector' networking methods, test them out, consider how these could be used with netkit.

It looks like legacy tuntap would be replaced with vector tap, which looks like it shouldnt require too much change to the code - it might be worth looking at this along with the multiple tuntap issue as that will also require changing the code around tuntap interfaces. It might be worth considering using setuid binaries / binaries with set capabilities to avoid making the user having to run scripts as root.

The uml_switch daemon would be replaced by BESS (github). This doesn't require any additional privileges (similar to the legacy uml_switch daemon).

Another vector networking method for uml that might be worth looking at is raw socket transport. This can be used to connect to a side of a veth pair, with the other side connected to a bridge with brctl, or a virtual switch for example with OVS. This is probably not the route to go but may be worth looking at?

@b177y b177y added the enhancement New feature or request label Jan 7, 2021
@TechSupportJosh
Copy link
Collaborator

Related issue #31

@TechSupportJosh
Copy link
Collaborator

TechSupportJosh commented Jan 7, 2021

Collection of resources related to this issue:

Post I made on the UML mailing list:
http://lists.infradead.org/pipermail/linux-um/2021-January/001011.html

Bess looks liks the most similar to daemon mode of transport that we currently use:
https://github.com/torvalds/linux/blob/master/Documentation/virt/uml/user_mode_linux_howto_v2.rst#bess-socket-transport
https://github.com/NetSys/bess

Commit in kernel where bess support was added:
torvalds/linux@77f1073

Pull request from Anton who updated the linux kernel docs with bess support talking about how UML + Bess doesn't work correctly atm. Also includes a possible example of a switch using the unix sockets.
NetSys/bess#1022

UnixSocketPort(name='u0', path="/var/tmp/uml-test-0")
UnixSocketPort(name='u1', path="/var/tmp/uml-test-1")
PortInc(port="u0") -> repl::Replicate(gates=[0,1])
PortInc(port="u1") -> repl
repl:0 -> PortOut(port="u0", rpfcheck=1)
repl:1 -> PortOut(port="u1", rpfcheck=1)

New vs old:
vecX:transport=bess,src=$unix_src,dst=$unix_dst
vs
eth0=daemon,,,/home/josh/.Netkit/hubs/vhub_meme.cnct

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants