cloudius-systems / osv

OSv, a new operating system for the cloud.
osv.io
Other
4.08k stars 602 forks source link

IPv6 Support #927

Open rickpayne opened 6 years ago

rickpayne commented 6 years ago

Its about time we had ipv6 support!

I guess this means pulling in the appropriate files from FreeBSD's netinet6 tree and massaging them to suite OSv? Any other tips?

nyh commented 6 years ago

There may be some complications to this endeavor:

  1. We already have some IPV6 code we copied from FreeBSD. I don't know how much of it is functional, and which additional files we're missing. Try "git grep -i ipv6" and see a lot of stuff.
  2. After we copied FreeBSD's network stack, we did big changes to it to restructure it according to Van Jacobson's "netchannels" idea (we explained this in the OSv paper from USENIX ATC - http://nadav.harel.org.il/homepage/papers/osv-atc14.pdf). We probably did not take into account IPv6 in that code, and I don't know how much of the new code (which is about TCP, not the IP layer, after all) works for IPv6 and/or the old code paths still work and could be used for IPv6.
  3. I know for certain that some pieces of new code neglected IPv6 support. For example bsd/sys/net/routecache.hh and probably even drivers/virtio-net.*. The fixes may not be very hard, but someone will need to do them....
  4. IPv6 is fairly new (hmm, relatively) and it's possible that in the 4 years that have passed since we copied FreeBSD's network stack, things have improved there and we may need to copy some of their fixes?
rickpayne commented 6 years ago

Thanks for the comments. Usually the TCP part of the stack is very similar between v4 and v6, modulo changes for address types. Do you have a reference to which version of Freebsd was the original donor?

wkozaczuk commented 6 years ago

I am not sure about the exact version of FreeBSD but good chunk of this code was brought in from FreeBSD in Feb 2013 - https://github.com/cloudius-systems/osv/commit/a6db14f705598eb1bc58aa0b7d0403ac46e2ac39#diff-4fdaaaa37922686d1bdd41e98e1d1c4a

wkozaczuk commented 5 years ago

There is a big patch implementing IPV6 sent to the mailing list if somebody wants to pick it up - https://groups.google.com/d/msg/osv-dev/WJ52lvQtC9Q/gCyNWsO0CwAJ.

wkozaczuk commented 3 years ago

Over a year ago I merged the aforementioned patch by @cmyers-spirent into the ipv6 branch. Occasionally, I merge the master into the ipv6 branch (it is overdue now).

I wonder what we shall do about this issue. Shall we keep it around given we have ipv6 support on that branch only or wait until we merge the ipv6 branch into master? The latter is not a bad idea given that ipv6 code is enabled with conf-INET6. On another hand, keeping it on a separate branch has its own merits - risk of introducing possible bugs to master, code size and most people probably do not need ipv6 support.

Having said it, it would probably make sense to merge a subset of ipv6 branch into master to add netlink support which would help us fix #1096 and possibly allow running libpcap. This branch might also have some fixes for other areas of TCP layer.

jeromegn commented 3 years ago

fwiw, we'd need strong IPv6 support (and netlink, and wireguard) to run our firecracker microvms at Fly.io.

We use IPv6 for private networking between VMs.

I'd love to create a whole segment of tiny, single-purpose, fast-booting VMs with OSv.