Repository navigation
fix(minimald,minvmd,switch): on a microVM guest, node-plane traffic leaves as 100.64.255.253 and the - #3712
Conversation
SwitchSubnet::host_ip_cohort_address sits below the Box Egress Proxy, and last_ptask now ends below it, so no lease takes it.
The guest render SNATs the cohort mark to the subnet's cohort address and the node-plane mark to the daemon address. eth0 carries both, and the node relay admits the cohort address and sends its frames at the address's derived MAC, which the Box Egress Proxy leg checks. The lease run is one address shorter, so the allocator tests in net/mod.rs move their literals and use a /28 for the small-subnet cases.
A frame from 100.64.255.251 is decided by the resident host_ip boxes' rules, and a frame from 100.64.255.253 by the node baseline. The cohort record, the host_ip rules, the proxy's cohort source and the DNS pins key on the cohort address. Hand-out literals in the tests move down by one with the shorter lease run.
On a VM-backed host the cohort leaves as the cohort address and the node plane as the daemon address, and the gate picks the cohort's row or the node's row by the source address.
…vm-guest-node-plane-traffic-leaves-as
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
/revise
This PR moves the node plane off the host-address cohort's source address in the guest (#3080). The gate now drops a frame from a resident host_ip box that its rule admits. So the new source or mark for node-plane traffic is likely also being applied to the box's own marked frames, or the gate no longer matches that box's frames to its row. Make the box's admitted frames keep their old source and mark, so only node-plane traffic moves. Then run |
|
That Round 2 of 10 was not counted; #3080 carries the same sentence. |
Follow-up
Fixes #3080
crates/switch/src/lib.rscrates/minimald/src/main.rscrates/minimald/src/guest.rscrates/minimald/src/net/switch.rscrates/minimald/src/net/classifier.rscrates/minvmd/src/box_registry.rscrates/minvmd/src/net/egress_gate.rscrates/minvmd/src/net/bep_stub.rsdocs/specs/18-spec-box-networking/18-spec-box-networking.mdTask marker
Proof
On a VM-backed host, the guest SNATs a host-address box's connections to 100.64.255.251 and the daemon's own to 100.64.255.253. eth0 carries both addresses. The gate decides a 100.64.255.251 frame by the cohort row (the resident host_ip boxes' rules) and a 100.64.255.253 frame by the node row (the baseline set). The unit tests above show this. No live VM run was made on this box.
Notes from the agent: Files outside the layers, each needed by the switch layer's own change: (1) crates/minimald/src/net/mod.rs tests: the lease run is now one address shorter, so the hand-out and reserve literals move down by one. The /29 cases move to a /28, because a /29 now has a single PTask address. (2) crates/minvmd/src/control.rs test: the same hand-out literal moves. (3) crates/minvmd/src/net/dns_pins.rs: two lines. Host_ip DNS queries and replies were keyed only to the daemon address, so the cohort's name pins broke after the SNAT change. (4) crates/minvmd/tests/guest_classifier_integration.rs (KVM lane, not run here): its native digest now renders with the two distinct addresses that the guest uses. Design choices: the host_ip boxes' compiled rules now hold the cohort address as their source. Because of this, a box-marked frame from the daemon address (an older guest, or a spoof) now drops and is not admitted. Three gate tests changed to send from the cohort address. The node relay in net/switch.rs also rewrites the MAC: cohort frames leave at the cohort address's derived MAC, and frames to that MAC go back to the tap's MAC. Without this, the Box Egress Proxy leg refuses the cohort (it checks the source's switch-derived MAC). Behaviour change: a /29 switch subnet now leaves the daemon's self-allocation reserve empty (one PTask address, which goes to the hand-out run). Pre-existing failures on this box, the same at the base commit: several minimald net::switch relay tests, box_manager/box_actor tests, and minvmd answerer/sock tests (these fail only in a full-process …[truncated]
Tests
cargo test -p switch host_ip_cohort_addresscargo test -p minimald guest_render_gives_cohort_and_node_plane_distinct_addressescargo test -p minvmd gate_decides_cohort_and_node_rows_by_source_addresscargo test -p minvmd gate_decides_cohort_and_node_rows_by_source_addressVerify
min task run agent-verifypassed ([tasks.verify]).The coder's box did not compile these files. Check them in CI:
crates/minimald/src/guest.rs,crates/minimald/src/main.rs,crates/minimald/src/net/classifier.rs,crates/minimald/src/net/mod.rs,crates/minimald/src/net/switch.rs,crates/minvmd/tests/guest_classifier_integration.rs.Base
The base branch moved while the coder worked and was merged in before the tests ran. These files changed on BOTH sides since the branch point — read them first, because a rewrite from a stale reading can undo a merge without a conflict:
docs/specs/18-spec-box-networking/18-spec-box-networking.mdOut of scope
These files are outside the task's
layers:, so this PR is a draft:crates/minimald/src/net/mod.rscrates/minvmd/src/control.rscrates/minvmd/src/net/dns_pins.rscrates/minvmd/tests/guest_classifier_integration.rs