Skip to content

fix(net): answer proxy NDP at once, so a VM's first SYN is not lost - #201

Open
markovejnovic wants to merge 1 commit into
mainfrom
fix/proxy-ndp-delay
Open

markovejnovic wants to merge 1 commit into
mainfrom
fix/proxy-ndp-delay

Conversation

@markovejnovic

Copy link
Copy Markdown
Contributor

Why: host_init turns on proxy NDP on the uplink, so the host answers the router's neighbour solicitations for VM addresses. Linux delays proxied answers by a random time up to proxy_delay, 0.8 s by default. The router drops whatever it holds for the address meanwhile, so the first connection to a new VM loses its SYN and waits for TCP to resend it after 1 s.

On hypervm.sh every login paid that second. Between usher handing sshpiperd the VM's address and sshpiperd's pipe to it coming up, three logins took 1.08, 1.09 and 1.11 s. A capture on the node:

10:31:34.351551  2605:6440:0:a6::1 > ff02::1:ff00:10: neighbor solicitation, who has 2605:6440:0:a6:1::10
10:31:35.077110  2605:6440:0:a6:925a:8ff:fe31:9b79 > 2605:6440:0:a6::1: neighbor advertisement, tgt is 2605:6440:0:a6:1::10

That's 726 ms.

What: host_init sets the uplink's proxy_delay to 0, next to proxy_ndp, through a new Sysctl::net().ipv6().neigh(link).no_proxy_delay() in hyperrs-linux. The delay exists to spare a busy segment, and a node proxies one address per VM. The install guide and changelog say so.

Tests: no_proxy_delay_zeroes_only_the_namespace_it_is_written_in_as_root writes it on lo in a scratch network namespace and checks it reads back 0 there, with the host's value untouched. Like the other sysctl tests, it skips without root.

Checked locally: cargo fmt --check, plus cargo check and cargo clippy --all-targets -D warnings for x86_64-unknown-linux-musl on hyperrs-linux and hyper-suidhelper. The root test needs Linux and root, so it runs in CI.

This replaces harmont-dev/hyper-app#42, which set the same sysctl from Ansible.

host_init turns on proxy NDP on the uplink so the host answers the
router's neighbour solicitations for VM addresses, but Linux delays
proxied answers by a random time up to proxy_delay, 0.8 s by default.
The router drops what it holds for the address meanwhile, so the first
connection to a new VM loses its SYN and waits for TCP to resend it
after a second. On hypervm.sh every login paid that second: 1.08 to
1.11 s between usher handing sshpiperd the VM's address and the pipe
to it coming up, and a capture on the node showed the answer 726 ms
after the router asked.

host_init now sets the uplink's proxy_delay to 0, through a new
Sysctl::net().ipv6().neigh(link).no_proxy_delay(). The delay exists to
spare a busy segment; a node proxies one address per VM.
@codecov

codecov Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown

Test Results

    4 files  ±0    364 suites  ±0   5m 37s ⏱️ -6s
1 737 tests +1  1 737 ✅ +1    0 💤 ±0  0 ❌ ±0 
2 416 runs  +1  1 737 ✅ +1  679 💤 ±0  0 ❌ ±0 

Results for commit 1141052. ± Comparison against base commit d1840b0.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant