Skip to content

tstest/natlab: add WAN MTU support, with a repro for #311 - #20681

Closed
bcreane wants to merge 1 commit into
mainfrom
bcreane/investigate-tailscale-issue-20668-slow-dataplane
Closed

bcreane wants to merge 1 commit into
mainfrom
bcreane/investigate-tailscale-issue-20668-slow-dataplane

Conversation

@bcreane

@bcreane bcreane commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

vnet had no MTU concept, so nothing could exercise a path whose real MTU is smaller than the one tailscaled assumes. Adds Network.SetMTU, which drops oversized forwarded packets without an ICMP reply (the worst case for a sender that assumes rather than probes), plus a tta /bytes endpoint and Env.HTTPGetN to drive a bulk node-to-node transfer.

Only forwarded traffic crossing the WAN link is constrained - same-LAN packets and netstack-originated traffic (control, DERP, DNS) are unaffected - so a test can narrow the underlay between two nodes while leaving their paths to control and DERP full-size.

What it shows

Underlay MTU PMTUD Transferred
1500 (control) off 1048576 / 1048576 - 590ms, 14.2 Mbit/s
1280 off 512 / 1048576
1280 on 512 / 1048576

Dropped packets are 1340 bytes: a 1280-byte TUN payload plus 60 of framing.

Enabling PMTUD makes no difference, which is the useful part. Probing runs and finds the right answer - only the 1280-byte probe is answered - but DefaultTUNMTU discards it and returns safeTUNMTU per its TODO, pending PTB generation. So the remaining work in #311 is the plumbing plus PTB, not the probing. Full evidence in my comment on #311.

Tests

  • vnet/mtu_test.go - pure Go, no VMs, ~30ms. Covers egress/ingress, the boundary cases, that 0 means unlimited, and that same-LAN traffic is exempt.
  • TestLargeMTUUnderlayThroughput - the 1500-byte control. Expected to pass, runs in CI.
  • TestSmallMTUUnderlayThroughput - the repro. Fails until FR: Implement peer MTU discovery through the tailnet #311 is fixed, so it's behind --run-unfixed-tests (natlab CI discovers every Test* in the package, and this would otherwise be permanently red).

Both VM tests verified locally under TCG; the control passes, the repro fails as described. Needs the run-natlab-tests label to exercise them in CI.

Updates #311
Updates #20668

@bcreane
bcreane force-pushed the bcreane/investigate-tailscale-issue-20668-slow-dataplane branch from 1a61204 to 1223459 Compare August 6, 2026 14:51
@bcreane bcreane changed the title tstest/natlab: add WAN MTU support, with a repro for #20668 tstest/natlab: add WAN MTU support, with a repro for #311 Aug 6, 2026
vnet had no MTU concept, so nothing could exercise a path whose real MTU
is smaller than the one tailscaled assumes. Add Network.SetMTU, which
drops oversized forwarded packets without an ICMP reply (the worst case
for a sender that assumes rather than probes), plus a tta /bytes
endpoint and Env.HTTPGetN to drive a bulk node-to-node transfer.

With a 1280-byte underlay, a 1 MiB transfer over a direct path moves 512
bytes; the same topology at 1500 moves all of it in 590ms. The dropped
packets are 1340 bytes: a 1280-byte TUN payload plus 60 of framing.

Enabling PMTUD does not change that, which is the useful part. The
probes go out and only the 1280-byte one is answered, so discovery finds
the real MTU, but DefaultTUNMTU discards it and returns safeTUNMTU per
its TODO, pending PTB generation. Throughput is byte-identical either
way, so the remaining work is the plumbing plus PTB, not the probing.

The repro is behind --run-unfixed-tests since it fails until that lands;
TestLargeMTUUnderlayThroughput is the same scenario with a 1500-byte
underlay and runs in CI as a harness control.

Updates #311
Updates #20668

Signed-off-by: Brendan Creane <[email protected]>
@bcreane
bcreane force-pushed the bcreane/investigate-tailscale-issue-20668-slow-dataplane branch from 1223459 to 157a866 Compare August 6, 2026 15:16
@bcreane
bcreane marked this pull request as ready for review August 6, 2026 16:36
@bcreane

bcreane commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

@bcreane

bcreane commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

As @raggi points out:

A 1280 byte underlay should not even work. We require at least 1340 for ipv4 underlay or 1360 for ipv6

Closing this test since its based on faulty assumptions.

@bcreane bcreane closed this Aug 6, 2026
@bcreane
bcreane deleted the bcreane/investigate-tailscale-issue-20668-slow-dataplane branch August 6, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant