Repository navigation
Conversation
This is the network for mantsana, a macOS CI VM backend replacing Tart
(see the DESIGN.md that follows), but nothing in it is macOS-specific.
A guest's virtual NIC hands us raw Ethernet frames (on macOS over a
SOCK_DGRAM socketpair to a VZFileHandleNetworkDeviceAttachment) and they
all terminate in a gVisor netstack owned by the guest's Net, so a guest
can only reach what we connect it to, and can't see other guests:
- The gateway, IMDS (169.254.169.254) and DNS (169.254.169.253)
addresses are on our NIC, so gVisor answers ARP and ICMP for them,
and the guest needs no route or DNS changes to reach them. ARP for
any other address is dropped: the NIC is promiscuous, and answering
the guest's DHCP duplicate-address probe makes it decline its lease.
- DHCP is answered from the frame loop with one fixed lease, the same
in every slot, so a VM memory snapshot restores anywhere.
- Each TCP SYN and UDP flow is dispatched by destination to a
registered Service (a guest-facing server, or a forward to a
host-side address), to DNS (any port 53) or NTP (any port 123)
interception, or to egress dialed from the host, subject to a deny
list. Every flow and DNS query is logged.
- The host reaches the guest only by DialGuest; there is no host
route to it.
guestnettest provides a fake guest stack for tests of code built on it.
Updates tailscale/corp#39994
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
Change-Id: I5b359a459ae52218e97cef3b74ecc14a806e0cc7
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 the network for mantsana, a macOS CI VM backend replacing Tart
(see the DESIGN.md that follows), but nothing in it is macOS-specific.
A guest's virtual NIC hands us raw Ethernet frames (on macOS over a
SOCK_DGRAM socketpair to a VZFileHandleNetworkDeviceAttachment) and they
all terminate in a gVisor netstack owned by the guest's Net, so a guest
can only reach what we connect it to, and can't see other guests:
addresses are on our NIC, so gVisor answers ARP and ICMP for them,
and the guest needs no route or DNS changes to reach them. ARP for
any other address is dropped: the NIC is promiscuous, and answering
the guest's DHCP duplicate-address probe makes it decline its lease.
in every slot, so a VM memory snapshot restores anywhere.
registered Service (a guest-facing server, or a forward to a
host-side address), to DNS (any port 53) or NTP (any port 123)
interception, or to egress dialed from the host, subject to a deny
list. Every flow and DNS query is logged.
route to it.
guestnettest provides a fake guest stack for tests of code built on it.
Updates tailscale/corp#39994