Repository navigation
feat(networking): ipv6-based routing - #89
Draft
markovejnovic wants to merge 1 commit into
Draft
markovejnovic wants to merge 1 commit into
markovejnovic wants to merge 1 commit into
Conversation
Remove all VM networking implementation so the subsystem can be rebuilt from a blank state. Interfaces are kept but marked unimplemented: - suidhelper: network prepare/teardown/teardown-orphan/host-init keep their CLI shape but exit with an unimplemented error and touch nothing; netns/veth/NAT/host-init code, jailer --netns and /dev/net/tun in the chroot jail are gone. - Elixir: Hyper.SuidHelper.Network, Hyper.Node.FireVMM.Net and Hyper.Cfg.Network are unimplemented stubs with no callers. VMs boot without a NIC or ip=/hyper.resolver= cmdline; no network_ready preflight; Reaper no longer sweeps netns (Plan.orphans/3). - guest-agent: no longer writes /etc/resolv.conf. - A legacy [network] config table is accepted and ignored. - Docs, setup.sh and provision-kvm-host.sh drop networking setup. net_bw accounting (Sys.Mon.NetBw, NetDev, budgets) is unchanged.
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
Test Results 4 files ± 0 216 suites - 11 3m 20s ⏱️ -3s Results for commit 3ed1a5a. ± Comparison against base commit 3ac24e1. This pull request removes 54 and adds 10 tests. Note that renamed tests count towards both. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a feature branch which implements ipv6-based routing. At the time of writing, this PR completely tears out all of
hyper's networking logic, with the explicit aim of rewriting the networking stack from the ground up.Requirements
Whatever kind of networking solution we come up with needs to support the following.
Routing at L3
@jrimmer has proposed in #74 that we stick a reverse http proxy on the bare metal node. This is rejected because using such a system prevents VMs from serving any other protocol. VMs should feel as close to native as we can make them, so and I want to be able to support anything on IP. This includes UDP, TCP, but also more less known protocols such as SCTP, UDP Lite, etc. Explicitly doing so allows practical application protocols that aren't based on HTTP, including:
The list is effectively infinite, and limiting Hyper to just HTTP feels like a cheap way out of a more generally applicable solution.
Sandboxing and Isolation
TODO
Latency & Bandwidth
TODO
Options
Luckily we've got IPv6 which rocks. Based on my research we have the following options.
Bridge
A Linux bridge interface is an interface that acts like an L2 switch. RedHat has a nice introduction. The effective idea is relatively simple:
flowchart TD router["external router (could be the internet)"] subgraph node if0["if0, public interface"] br0["br0, bridge interface"] subgraph vm1 vif0["vif0, vm1's interface"] end subgraph vm2 vif1["vif1, vm2's interface"] end if0 <--> br0 br0 <---> vif0 br0 <---> vif1 end router <---> if0This kind of configuration implies:
libvirthas aclean-networkfilter and we can mitigate this withnftablesrules too. I suspect the things I listed are not the only possible concerns.Host-managed tunnel adapters
flowchart TD router["external router (could be the internet)"] subgraph node if0["if0, public interface 2001:19f0:5c00:19b9:5400:6ff:fe12:1a00/64 and proxy NDP on 111:1::1"] tap1["tap1, ...:1::2/128"] subgraph vm1 vif0["vif0, vm1's interface 2001:19f0:5c00:19b9:1::2/128"] end tap2["tap2, ...:1::3/128"] subgraph vm2 vif1["vif1, vm2's interface 2001:19f0:5c00:19b9:1::3/128"] end if0 <--->|L3 routing| tap1 if0 <--->|L3 routing| tap2 tap1 <--> vif0 tap2 <--> vif1 end router <---> if0This idea builds on top of the aforementioned bridge idea, however it allocates an additional tunnel adapter on the host, managed by Hyper. Hyper is responsible for allocating the interfaces, their MACs and their IPs. This makes me feel a lot better, since the hypervisor has total control over the IP addresses.
This relies on NDP, which the Hypervisor would be responsible for setting up.
System Components
Hyper.Node.Network.Tap.Registryis a process responsible for creating and issuing the TAP network interfaces. In my head, this is a Registry that stores the currently active TAP devices. A really clean design would be to keep all the processes necessary to boot one VM up in one supervisor, but that's not the system we have right now. Consequently, I'm thinking that just using a plain registry that acquires/releases TAP devices on the hypervisor node is the appropriate 80-20.suidhelperwill receive a brand new set of CLI subcommandsnetfor managing the network interfaces. I'm thinkingsuidhelepr net tap addandsuidhelper net tap downwill be enough.