Skip to content

Performance Baseline ​

Measured dataplane throughput baseline for the WireGuard data plane, with the tuning knobs that move it. Every number below comes from a real run of the reproducible netns harness (scripts/bench-dataplane.sh). No extrapolation and no hand-written figures. Re-run it any time on any Linux host with passwordless sudo, wg, iperf3 and ethtool. It builds throwaway network namespaces, measures, and cleans up after itself.

Environment ​

ItemValue
Date2026-11-04
Kernel7.0.0-38-generic
CPUIntel Core i9-10880H @ 2.30 GHz, 14 vCPU (KVM VM, shared host)
Memory45 GiB
Underlayveth pairs on an L2 bridge (jumbo variant: veth MTU 9000)
Tunnel MTU1420 (default) / 8920 (jumbo variant)
Offloadsgro/gso/tso/rx/tx/sg on unless stated
Tooliperf 3.20, 8 s per run, 1 s warm-up skipped
MTU probe payload1392 (= 1420 − 28), adaptive since this lane

Honest caveats: all paths run inside one kernel (veth + netns). The result is shape-accurate but not wire-accurate: no NIC rings, no real RTT. host_busy counts every core of the shared VM, not the benchmark alone. Run-to-run variance on this host is roughly ±10 %, so treat small deltas as noise. The load CPU usage during the recorded run was 52–90 % whole-host.

Three paths ​

  1. Relay — client A → hub → client B. Kernel forwarding (ip_forward) in the hub netns, both clients hold the hub as their only peer with allowed-ips 10.240.0.0/16. This is the shape of Meshlet's default path. Per docs/architecture/overview.md, every device pair relays through the hub unless a direct link is promoted.
  2. Direct — client A → client B as a direct /32 WireGuard peer over the same LAN underlay. This is exactly what apps/agent/src/direct.rs (DirectManager::Promote) installs for same-LAN peers.
  3. Bare — plain WireGuard pair over a back-to-back veth (no bridge, no hub, nothing Meshlet-specific). Control: Meshlet only writes kernel wg state. The relay/direct numbers minus this number therefore bound Meshlet's own data-plane overhead. The expected cost is ≈ 0; observed costs come from topology.

Results (single run, 2026-11-04) ​

Bitrate in Gbit/s (iperf3 receiver unless noted); UDP offered at 1 Gbit/s.

Defaults: underlay MTU 1500, tunnel MTU 1420, offloads on

PathTCP 1 streamTCP 4 streams (retrans)UDP 1 Gbit/s receivedUDP loss
Relay1.321.36 (279)858 Mbit/s9.8 %
Direct1.201.21 (0)975 Mbit/s2.6 %
Bare1.471.56 (1509)951 Mbit/s8.7 %

Jumbo underlay: underlay MTU 9000, tunnel MTU 8920, offloads on

PathTCP 1 streamTCP 4 streams (retrans)UDP 1 Gbit/s receivedUDP loss
Relay5.335.45 (338)940 Mbit/s6.0 %
Direct8.065.26 (0)973 Mbit/s2.7 %
Bare8.425.87 (1)984 Mbit/s1.6 %

Offloads off: underlay MTU 1500, tunnel MTU 1420, gro/gso/tso/rx/tx/sg off

PathTCP 1 streamTCP 4 streams (retrans)UDP 1 Gbit/s receivedUDP loss
Relay1.181.17 (0)936 Mbit/s6.4 %
Direct1.221.17 (0)977 Mbit/s2.4 %
Bare1.471.50 (0)973 Mbit/s2.7 %

What the numbers say ​

  • MTU 1420 is not conservative — it is exactly right for a 1500-byte underlay (1500 − 80 B WireGuard overhead). The size to challenge is the underlay, not the tunnel. On a jumbo-capable underlay, raising the tunnel MTU is the single biggest lever (see below).
  • Jumbo underlay is a 4–6.7× lever. Relay TCP 4-stream 1.36 → 5.45 Gbit/s; direct TCP 1-stream 1.20 → 8.06 Gbit/s. At 8920 B per packet the packet rate drops ~6× at the same bitrate, which also shows up as lower UDP loss everywhere.
  • Meshlet's relay shape costs ~13 % vs bare (TCP 4-stream 1.36 vs 1.56), from double encryption at the hub plus the bridge hop — kernel, not agent: there is no userspace data plane. Direct (same LAN) lands between relay and bare. It shows zero TCP retransmits in every run at default MTU. Relay retransmits whenever the path is loaded. If both devices sit on the same LAN, the promoted direct link is measurably the better path.

Stream count and offloads:

  • Multi-stream does not help. 4 streams ≈ 1 stream at every MTU (the bottleneck is per-packet crypto/segmentation, not a single flow's window). Don't spin up parallel flows expecting more.
  • Offloads on vs off is within noise on this kernel except relay multi-stream TCP (1.36 → 1.17, −14 % with them off). Note: crates/meshlet-network/tests/wg_forwarding.rs disables all veth offloads. A handshake once failed silently with them on. On kernel 7.0.0-38 that failure does not reproduce: handshakes and throughput both work with offloads on. Keep the test's workaround, but do not carry the "offloads break WG" assumption into production guidance.

Tuning checklist ​

#KnobActionBefore → after (measured)
1Tunnel MTU on jumbo underlayset tunnel_mtu = 8920 (underlay MTU − 80) in the server config; every hop of the underlay (including bridge ports) must carry the jumbo MTU — a single 1500-byte bridge port silently blackholes every big frame (hit for real while building this harness)relay TCP4 1.36 → 5.45 Gbit/s; direct TCP1 1.20 → 8.06 Gbit/s
2MTU-adaptive probe (shipped in this lane)agent reads its default-route interface MTU and sizes the DF probe accordingly (derive_tunnel_mtu, §7.5 evidence); plan-pinned MTU always wins; Windows/others fall back to the 1392 defaultevidence-only change; no data-plane effect by design
3Direct link when peers share a LANkeep §12 direct promotion enabled0 retransmits vs relay's 279 on a loaded path (default MTU)
4Offloadsleave GRO/GSO/TSO on (kernel default)−14 % relay multi-stream TCP with them off; otherwise within noise
5qdisc on hub underlaynot measured in this environment — WG interfaces use noqueue and the veth underlay default noqueue/pfifo_fast; an fq A/B on a real NIC underlay is still openenvironment did not support a meaningful A/B
6UDP-heavy workloads over relayprefer jumbo MTU (6× fewer packets per bit)relay UDP loss 9.8 % → 6.0 % at the same 1 Gbit/s offer

Windows (advice only, no code in this lane) ​

  • Check the physical adapter MTU: Get-NetIPInterface -AddressFamily IPv4.
  • The WireGuard interface MTU is planned by the server (tunnel_mtu); the agent enforces it. On a jumbo underlay, set the adapter MTU and the server tunnel_mtu to underlay − 80. Record a new revision so the hub applies it too. The hub's own interface follows the applied revision — see R-04 for the convergence caveat.
  • Keep adapter offloads (Large Send / Receive Side Scaling) at their Windows defaults; the wireguard-windows driver handles segmentation itself.
  • Verify the path from a device after any MTU change: ping -f -l <planned_mtu - 28> <overlay-peer-ip> (Windows -l is payload, -f is DF — the same probe the agent reports as mtu_probe_payload).

Reproduce ​

bash
sudo scripts/bench-dataplane.sh            # defaults only
sudo scripts/bench-dataplane.sh 8 1 1      # + jumbo and offloads-off matrices

The script prints the environment header. For each mode × path it runs a TCP 1-stream, a TCP 4-stream (with retransmits) and a UDP 1 Gbit/s block. Each block takes a whole-host CPU busy sample during the run. Requires: passwordless sudo, wg, iperf3, ethtool; skips cleanly without them.