WireGuard vs OpenVPN vs SSH tunnel benchmarks: throughput, latency and CPU per gigabit

NetworkingSecurity

A tunnel is one more layer of nesting: your packet, encrypted and authenticated, inside another packet. WireGuard and OpenVPN put it inside UDP; SSH puts it inside a TCP connection. Each choice has a price in bytes, in CPU and in what happens when the network drops packets. This benchmark measures that price for five tunnels and two cipher choices, against the same traffic with no tunnel at all.

Everything was measured on one machine, between containers joined by virtual Ethernet, with the link in the middle emulated by tc netem. Every bulk transfer was checked byte for byte and by SHA-256, and every latency probe compared its echo: 2,740 MiB and 26,000 round trips, 0 corrupted.

SetupDetails
WireGuardLinux kernel module (kernel 7.0), wireguard-tools 1.0.20210914 · wireguard-go 0.0.20250522, the userspace implementation, measured as its own row, never in place of the kernel
OpenVPN2.6.14 (OpenSSL 3.5), UDP, point-to-point TLS mode with --peer-fingerprint (self-signed P-256 certificates, TLS 1.3 control channel), data channel AES-256-GCM or ChaCha20-Poly1305, userspace data path (--disable-dco: the kernel’s data-channel-offload module was not loaded on the host)
SSHOpenSSH 10.0p2, Ed25519 keys, compression off · port forwarding (ssh -L) with aes256-gcm@openssh.com or chacha20-poly1305@openssh.com · layer-3 tunnel (ssh -w, a TUN device at each end) with AES-256-GCM
NetworkThree containers with no network of their own: client, router, server, joined by two virtual Ethernet pairs created inside them. 1,500-byte MTU, segmentation offloads off, so every packet has a real Ethernet size · every IP tunnel’s inner MTU 1,420 (WireGuard’s default), so all fit without fragmenting · links emulated in the router with tc netem: LAN (nothing added), 50 ms round trip (25 ms each way), 200 ms round trip with 1 % random loss in each direction
Toolsiperf3 3.18 for throughput · a small Go program for latency, bulk transfers and bring-up time · kernel defaults everywhere else (CUBIC, default socket buffers)
CPUAMD Ryzen AI Max+ 395 · cores 0–7 and their SMT siblings reserved for the benchmark, everything else moved to the other CCD · server on cores 2–3, client on 4–5, router on 6–7
MethodEvery tunnel started fresh for every run and link; every cell a fresh client process; 5 runs · reported value: median of the runs, with min–max · latency p99: each run’s 99th percentile, median across runs · a wait for a quiet link before every cell · throughput is what the iperf3 server received over its own test time (in 3 lossy-link cells over SSH the client could not collect those results through the stalled control connection; the server’s measurement is complete)

The scoreboard

Scoreboard, median per tunnel. Throughput, LAN, one TCP stream: no tunnel 21.1 Gbit/s, kernel WireGuard 4.2 Gbit/s, wireguard-go 8.5 Gbit/s, OpenVPN AES 2.7 Gbit/s, SSH -L AES 14.8 Gbit/s, SSH -w 2.5 Gbit/s. Throughput, 50 ms link, one stream: no tunnel 619 Mbit/s, kernel WireGuard 512 Mbit/s, wireguard-go 550 Mbit/s, OpenVPN AES 47 Mbit/s, SSH -L AES 317 Mbit/s, SSH -w 201 Mbit/s. Throughput, 200 ms + 1 % loss, one stream: no tunnel 1.4 Mbit/s, kernel WireGuard 0.8 Mbit/s, wireguard-go 1.3 Mbit/s, OpenVPN AES 1.0 Mbit/s, SSH -L AES 0.7 Mbit/s, SSH -w 0.7 Mbit/s. Throughput, 200 ms + 1 % loss, four streams: no tunnel 4.8 Mbit/s, kernel WireGuard 4.7 Mbit/s, wireguard-go 7.2 Mbit/s, OpenVPN AES 3.9 Mbit/s, SSH -L AES 0.8 Mbit/s, SSH -w 0.6 Mbit/s. LAN round trip, 100-byte message: no tunnel 5 µs, kernel WireGuard 40 µs, wireguard-go 30 µs, OpenVPN AES 16 µs, SSH -L AES 23 µs, SSH -w 21 µs. Bytes per 100-byte message: no tunnel 152 B, kernel WireGuard 221 B, wireguard-go 221 B, OpenVPN AES 205 B, SSH -L AES 201 B, SSH -w 250 B. CPU-seconds per gigabit: no tunnel 0.07 CPU-s, kernel WireGuard 0.78 CPU-s, wireguard-go 0.29 CPU-s, OpenVPN AES 0.81 CPU-s, SSH -L AES 0.13 CPU-s, SSH -w 0.90 CPU-s. Best in every run, out of 7 measures: SSH -L AES on 3 · wireguard-go on 2 · OpenVPN AES on 1; 1 has no fixed order Seven measures from the sections below · each tunnel as a multiple of the best tunnel kernel WireGuard wireguard-go OpenVPN AES SSH -L AES SSH -w 1× = the best median; grey line: lowest to highest run 1× (best) 2× 3× 5× 10× 20× Throughput, LAN, one TCP stream kernel WireGuard 4.2 Gbit/s wireguard-go 8.5 Gbit/s OpenVPN AES 2.7 Gbit/s SSH -L AES 14.8 Gbit/s SSH -w 2.5 Gbit/s Throughput, 50 ms link, one stream kernel WireGuard 512 Mbit/s wireguard-go 550 Mbit/s OpenVPN AES 47 Mbit/s SSH -L AES 317 Mbit/s SSH -w 201 Mbit/s Throughput, 200 ms + 1 % loss, one stream kernel WireGuard 0.8 Mbit/s wireguard-go 1.3 Mbit/s OpenVPN AES 1.0 Mbit/s SSH -L AES 0.7 Mbit/s SSH -w 0.7 Mbit/s Throughput, 200 ms + 1 % loss, four streams kernel WireGuard 4.7 Mbit/s wireguard-go 7.2 Mbit/s OpenVPN AES 3.9 Mbit/s SSH -L AES 0.8 Mbit/s SSH -w 0.6 Mbit/s LAN round trip, 100-byte message kernel WireGuard 40 µs wireguard-go 30 µs OpenVPN AES 16 µs SSH -L AES 23 µs SSH -w 21 µs Bytes per 100-byte message kernel WireGuard 221 B wireguard-go 221 B OpenVPN AES 205 B SSH -L AES 201 B SSH -w 250 B CPU-seconds per gigabit kernel WireGuard 0.78 CPU-s wireguard-go 0.29 CPU-s OpenVPN AES 0.81 CPU-s SSH -L AES 0.13 CPU-s SSH -w 0.90 CPU-s Each bar is that tunnel's median as a multiple of the best median for the measure, log scale: 1× is the best, a bar twice as long is twice as costly. Grey line: lowest to highest of the 5 process runs; the median is printed after each bar.
Seven headline measures from the sections below, each tunnel's median as a multiple of the best tunnel's median for that measure (1×; log scale, a longer bar is worse), labelled with the measured value. Median of 5 runs; grey line: lowest to highest run. One cipher per tunnel (AES-256-GCM for OpenVPN and SSH; WireGuard is always ChaCha20-Poly1305); the ChaCha20 rows and the bare link are in the sections and in the table. CPU: the median of the per-run totals; the CPU figure's stacked bars add up the medians of their four parts, which can differ in the second decimal.
Scoreboard, median per tunnel. Throughput, LAN, one TCP stream: no tunnel 21.1 Gbit/s, kernel WireGuard 4.2 Gbit/s, wireguard-go 8.5 Gbit/s, OpenVPN AES 2.7 Gbit/s, SSH -L AES 14.8 Gbit/s, SSH -w 2.5 Gbit/s. Throughput, 50 ms link, one stream: no tunnel 619 Mbit/s, kernel WireGuard 512 Mbit/s, wireguard-go 550 Mbit/s, OpenVPN AES 47 Mbit/s, SSH -L AES 317 Mbit/s, SSH -w 201 Mbit/s. Throughput, 200 ms + 1 % loss, one stream: no tunnel 1.4 Mbit/s, kernel WireGuard 0.8 Mbit/s, wireguard-go 1.3 Mbit/s, OpenVPN AES 1.0 Mbit/s, SSH -L AES 0.7 Mbit/s, SSH -w 0.7 Mbit/s. Throughput, 200 ms + 1 % loss, four streams: no tunnel 4.8 Mbit/s, kernel WireGuard 4.7 Mbit/s, wireguard-go 7.2 Mbit/s, OpenVPN AES 3.9 Mbit/s, SSH -L AES 0.8 Mbit/s, SSH -w 0.6 Mbit/s. LAN round trip, 100-byte message: no tunnel 5 µs, kernel WireGuard 40 µs, wireguard-go 30 µs, OpenVPN AES 16 µs, SSH -L AES 23 µs, SSH -w 21 µs. Bytes per 100-byte message: no tunnel 152 B, kernel WireGuard 221 B, wireguard-go 221 B, OpenVPN AES 205 B, SSH -L AES 201 B, SSH -w 250 B. CPU-seconds per gigabit: no tunnel 0.07 CPU-s, kernel WireGuard 0.78 CPU-s, wireguard-go 0.29 CPU-s, OpenVPN AES 0.81 CPU-s, SSH -L AES 0.13 CPU-s, SSH -w 0.90 CPU-s. Best in every run, out of 7 measures: SSH -L AES on 3 · wireguard-go on 2 · OpenVPN AES on 1; 1 has no fixed order Seven measures from the sections below · each tunnel as a multiple of the best tunnel kernel WireGuard wireguard-go OpenVPN AES SSH -L AES SSH -w 1× = the best median; grey line: lowest to highest run 1× (best) 2× 3× 5× 10× 20× LAN, 1 TCP stream kernel WireGuard 4.2 Gbit/s wireguard-go 8.5 Gbit/s OpenVPN AES 2.7 Gbit/s SSH -L AES 14.8 Gbit/s SSH -w 2.5 Gbit/s 50 ms, 1 stream kernel WireGuard 512 Mbit/s wireguard-go 550 Mbit/s OpenVPN AES 47 Mbit/s SSH -L AES 317 Mbit/s SSH -w 201 Mbit/s 200 ms + 1 % loss, 1 stream kernel WireGuard 0.8 Mbit/s wireguard-go 1.3 Mbit/s OpenVPN AES 1.0 Mbit/s SSH -L AES 0.7 Mbit/s SSH -w 0.7 Mbit/s 200 ms + 1 % loss, 4 streams kernel WireGuard 4.7 Mbit/s wireguard-go 7.2 Mbit/s OpenVPN AES 3.9 Mbit/s SSH -L AES 0.8 Mbit/s SSH -w 0.6 Mbit/s LAN round trip kernel WireGuard 40 µs wireguard-go 30 µs OpenVPN AES 16 µs SSH -L AES 23 µs SSH -w 21 µs Bytes per message kernel WireGuard 221 B wireguard-go 221 B OpenVPN AES 205 B SSH -L AES 201 B SSH -w 250 B CPU per gigabit kernel WireGuard 0.78 CPU-s wireguard-go 0.29 CPU-s OpenVPN AES 0.81 CPU-s SSH -L AES 0.13 CPU-s SSH -w 0.90 CPU-s Each bar is that tunnel's median as a multiple of the best median for the measure, log scale: 1× is the best, a bar twice as long is twice as costly. Grey line: lowest to highest of the 5 process runs; the median is printed after each bar.
Seven headline measures from the sections below, each tunnel's median as a multiple of the best tunnel's median for that measure (1×; log scale, a longer bar is worse), labelled with the measured value. Median of 5 runs; grey line: lowest to highest run. One cipher per tunnel (AES-256-GCM for OpenVPN and SSH; WireGuard is always ChaCha20-Poly1305); the ChaCha20 rows and the bare link are in the sections and in the table. CPU: the median of the per-run totals; the CPU figure's stacked bars add up the medians of their four parts, which can differ in the second decimal.
Measureno tunnelkernel WireGuardwireguard-goOpenVPN AESSSH -L AESSSH -w
Throughput, LAN, one TCP stream21.1 Gbit/s
20.9–21.1 Gbit/s
4.2 Gbit/s
4.1–5.5 Gbit/s · 0.20×
8.5 Gbit/s
8.2–8.6 Gbit/s · 0.40×
2.7 Gbit/s
2.7 Gbit/s · 0.13×
14.8 Gbit/s
14.7–15.1 Gbit/s · 0.70×
2.5 Gbit/s
2.2–2.5 Gbit/s · 0.12×
Throughput, 50 ms link, one stream619 Mbit/s
614–622 Mbit/s
512 Mbit/s
500–518 Mbit/s · 0.83×
550 Mbit/s
549–554 Mbit/s · 0.89×
47 Mbit/s
22–156 Mbit/s · 0.076×
317 Mbit/s
313–322 Mbit/s · 0.51×
201 Mbit/s
163–277 Mbit/s · 0.33×
Throughput, 200 ms + 1 % loss, one stream1.4 Mbit/s
0.6–2.0 Mbit/s
0.8 Mbit/s
0.4–1.8 Mbit/s · 0.60×
1.3 Mbit/s
0.7–3.0 Mbit/s · 0.95×
1.0 Mbit/s
0.8–2.3 Mbit/s · 0.75×
0.7 Mbit/s
0.6–0.9 Mbit/s · 0.54×
0.7 Mbit/s
0.6–0.9 Mbit/s · 0.50×
Throughput, 200 ms + 1 % loss, four streams4.8 Mbit/s
3.7–5.2 Mbit/s
4.7 Mbit/s
3.4–5.7 Mbit/s · 0.99×
7.2 Mbit/s
6.7–8.2 Mbit/s · 1.5×
3.9 Mbit/s
3.5–4.6 Mbit/s · 0.83×
0.8 Mbit/s
0.5–0.9 Mbit/s · 0.16×
0.6 Mbit/s
0.5–0.7 Mbit/s · 0.12×
LAN round trip, 100-byte message5 µs
5 µs
40 µs
32–51 µs · 0.13×
30 µs
29–32 µs · 0.17×
16 µs
16–17 µs · 0.31×
23 µs
23–24 µs · 0.22×
21 µs
21 µs · 0.24×
Bytes per 100-byte message152 B
152 B
221 B
221 B · 0.69×
221 B
221 B · 0.69×
205 B
205 B · 0.74×
201 B
201 B · 0.76×
250 B
250 B · 0.61×
CPU-seconds per gigabit0.07 CPU-s
0.06–0.07 CPU-s
0.78 CPU-s
0.71–0.83 CPU-s · 0.088×
0.29 CPU-s
0.28–0.29 CPU-s · 0.24×
0.81 CPU-s
0.80–0.82 CPU-s · 0.085×
0.13 CPU-s
0.13 CPU-s · 0.52×
0.90 CPU-s
0.90–0.96 CPU-s · 0.076×

Median of 5 process runs, lowest to highest run beneath; bold: best apart from no tunnel in every run; after the range, the factor against no tunnel: above 1× better than no tunnel, below 1× worse, same: rounds to 1×.

Cost of each tunnel against no tunnel, lowest to highest measure: kernel WireGuard 1.0× on throughput, 200 ms + 1 % loss, four streams to 11× on CPU-seconds per gigabit; wireguard-go 0.66× on throughput, 200 ms + 1 % loss, four streams to 5.9× on LAN round trip, 100-byte message; OpenVPN AES 1.2× on throughput, 200 ms + 1 % loss, four streams to 13× on throughput, 50 ms link, one stream; SSH -L AES 1.3× on bytes per 100-byte message to 6.3× on throughput, 200 ms + 1 % loss, four streams; SSH -w 1.6× on bytes per 100-byte message to 13× on CPU-seconds per gigabit. Counting a measure only where every run agrees, wireguard-go is better than no tunnel on 1 (up to 1.5× on throughput, 200 ms + 1 % loss, four streams). The sections below take each measure in turn, with the ChaCha20 ciphers, UDP, the time to bring each tunnel up and the runs behind every median.

Factor against no tunnel per measure, above 1 is better than no tunnel. Throughput, LAN, one TCP stream: kernel WireGuard 0.20×, wireguard-go 0.40×, OpenVPN AES 0.13×, SSH -L AES 0.70×, SSH -w 0.12×. Throughput, 50 ms link, one stream: kernel WireGuard 0.83×, wireguard-go 0.89×, OpenVPN AES 0.076×, SSH -L AES 0.51×, SSH -w 0.33×. Throughput, 200 ms + 1 % loss, one stream: kernel WireGuard 0.60×, wireguard-go 0.95×, OpenVPN AES 0.75×, SSH -L AES 0.54×, SSH -w 0.50×. Throughput, 200 ms + 1 % loss, four streams: kernel WireGuard 0.99×, wireguard-go 1.5×, OpenVPN AES 0.83×, SSH -L AES 0.16×, SSH -w 0.12×. LAN round trip, 100-byte message: kernel WireGuard 0.13×, wireguard-go 0.17×, OpenVPN AES 0.31×, SSH -L AES 0.22×, SSH -w 0.24×. Bytes per 100-byte message: kernel WireGuard 0.69×, wireguard-go 0.69×, OpenVPN AES 0.74×, SSH -L AES 0.76×, SSH -w 0.61×. CPU-seconds per gigabit: kernel WireGuard 0.088×, wireguard-go 0.24×, OpenVPN AES 0.085×, SSH -L AES 0.52×, SSH -w 0.076×. Cost of each tunnel against no tunnel, lowest to highest of 7 measures: kernel WireGuard 1.0–11× · wireguard-go 0.66–5.9× · OpenVPN AES 1.2–13× · SSH -L AES 1.3–6.3× · SSH -w 1.6–13×; wireguard-go better on 1 Medians of 5 process runs · log scale · above 1× is better than no tunnel kernel WireGuard wireguard-go OpenVPN AES SSH -L AES SSH -w 0.1× 0.2× 0.5× 1× (parity) 2× Throughput, LAN, one TCP stream kernel WireGuard 0.20× wireguard-go 0.40× OpenVPN AES 0.13× SSH -L AES 0.70× SSH -w 0.12× Throughput, 50 ms link, one stream kernel WireGuard 0.83× wireguard-go 0.89× OpenVPN AES 0.076× SSH -L AES 0.51× SSH -w 0.33× Throughput, 200 ms + 1 % loss, one stream kernel WireGuard 0.60× wireguard-go 0.95× OpenVPN AES 0.75× SSH -L AES 0.54× SSH -w 0.50× Throughput, 200 ms + 1 % loss, four streams kernel WireGuard 0.99× wireguard-go 1.5× OpenVPN AES 0.83× SSH -L AES 0.16× SSH -w 0.12× LAN round trip, 100-byte message kernel WireGuard 0.13× wireguard-go 0.17× OpenVPN AES 0.31× SSH -L AES 0.22× SSH -w 0.24× Bytes per 100-byte message kernel WireGuard 0.69× wireguard-go 0.69× OpenVPN AES 0.74× SSH -L AES 0.76× SSH -w 0.61× CPU-seconds per gigabit kernel WireGuard 0.088× wireguard-go 0.24× OpenVPN AES 0.085× SSH -L AES 0.52× SSH -w 0.076× ← no tunnel better the others better →
Each tunnel's median against the bare link's on the same measure, log scale; above 1× it would be better than no tunnel (more throughput, a shorter round trip, fewer bytes or less CPU). Median of 5 runs.
Factor against no tunnel per measure, above 1 is better than no tunnel. Throughput, LAN, one TCP stream: kernel WireGuard 0.20×, wireguard-go 0.40×, OpenVPN AES 0.13×, SSH -L AES 0.70×, SSH -w 0.12×. Throughput, 50 ms link, one stream: kernel WireGuard 0.83×, wireguard-go 0.89×, OpenVPN AES 0.076×, SSH -L AES 0.51×, SSH -w 0.33×. Throughput, 200 ms + 1 % loss, one stream: kernel WireGuard 0.60×, wireguard-go 0.95×, OpenVPN AES 0.75×, SSH -L AES 0.54×, SSH -w 0.50×. Throughput, 200 ms + 1 % loss, four streams: kernel WireGuard 0.99×, wireguard-go 1.5×, OpenVPN AES 0.83×, SSH -L AES 0.16×, SSH -w 0.12×. LAN round trip, 100-byte message: kernel WireGuard 0.13×, wireguard-go 0.17×, OpenVPN AES 0.31×, SSH -L AES 0.22×, SSH -w 0.24×. Bytes per 100-byte message: kernel WireGuard 0.69×, wireguard-go 0.69×, OpenVPN AES 0.74×, SSH -L AES 0.76×, SSH -w 0.61×. CPU-seconds per gigabit: kernel WireGuard 0.088×, wireguard-go 0.24×, OpenVPN AES 0.085×, SSH -L AES 0.52×, SSH -w 0.076×. Cost of each tunnel against no tunnel, lowest to highest of 7 measures: kernel WireGuard 1.0–11× · wireguard-go 0.66–5.9× · OpenVPN AES 1.2–13× · SSH -L AES 1.3–6.3× · SSH -w 1.6–13×; wireguard-go better on 1 Medians of 5 process runs · log scale · above 1× is better than no tunnel kernel WireGuard wireguard-go OpenVPN AES SSH -L AES SSH -w 0.1× 0.2× 0.5× 1× (parity) 2× LAN, 1 TCP stream kernel WireGuard 0.20× wireguard-go 0.40× OpenVPN AES 0.13× SSH -L AES 0.70× SSH -w 0.12× 50 ms, 1 stream kernel WireGuard 0.83× wireguard-go 0.89× OpenVPN AES 0.076× SSH -L AES 0.51× SSH -w 0.33× 200 ms + 1 % loss, 1 stream kernel WireGuard 0.60× wireguard-go 0.95× OpenVPN AES 0.75× SSH -L AES 0.54× SSH -w 0.50× 200 ms + 1 % loss, 4 streams kernel WireGuard 0.99× wireguard-go 1.5× OpenVPN AES 0.83× SSH -L AES 0.16× SSH -w 0.12× LAN round trip kernel WireGuard 0.13× wireguard-go 0.17× OpenVPN AES 0.31× SSH -L AES 0.22× SSH -w 0.24× Bytes per message kernel WireGuard 0.69× wireguard-go 0.69× OpenVPN AES 0.74× SSH -L AES 0.76× SSH -w 0.61× CPU per gigabit kernel WireGuard 0.088× wireguard-go 0.24× OpenVPN AES 0.085× SSH -L AES 0.52× SSH -w 0.076× ← no tunnel better the others better →
Each tunnel's median against the bare link's on the same measure, log scale; above 1× it would be better than no tunnel (more throughput, a shorter round trip, fewer bytes or less CPU). Median of 5 runs.

Throughput on a LAN

The first question is the obvious one: how fast can each tunnel go when the network is not the limit?

Throughput on the LAN through each tunnel and without one. No tunnel: one TCP stream 21.1 Gbit/s, four streams 40.7 Gbit/s, UDP delivered 8.7 Gbit/s. WireGuard, kernel: one TCP stream 4.2 Gbit/s, four streams 4.1 Gbit/s, UDP delivered 5.0 Gbit/s. WireGuard, wireguard-go: one TCP stream 8.5 Gbit/s, four streams 6.8 Gbit/s, UDP delivered 2.1 Gbit/s. OpenVPN, AES-256-GCM: one TCP stream 2.7 Gbit/s, four streams 3.6 Gbit/s, UDP delivered 4.0 Gbit/s. OpenVPN, ChaCha20: one TCP stream 2.4 Gbit/s, four streams 3.0 Gbit/s, UDP delivered 3.3 Gbit/s. SSH -L, AES-256-GCM: one TCP stream 14.8 Gbit/s, four streams 15.6 Gbit/s, UDP not carried. SSH -L, ChaCha20: one TCP stream 8.4 Gbit/s, four streams 8.4 Gbit/s, UDP not carried. SSH -w (TUN), AES-256-GCM: one TCP stream 2.5 Gbit/s, four streams 2.5 Gbit/s, UDP delivered 3.0 Gbit/s. On a LAN SSH -L with AES is the fastest tunnel in every run: 14.8 Gbit/s on one TCP stream, 21.1 Gbit/s without a tunnel; wireguard-go 8.5, SSH -L with ChaCha20 8.4, kernel WireGuard 4.2, OpenVPN and SSH -w 2.4–2.7 Gbit/s Gbit/s delivered · median of runs · every panel on its own scale no tunnel WireGuard OpenVPN SSH grey line: lowest to highest run One TCP stream No tunnel 21.1 Gbit/s WireGuard, kernel 4.2 Gbit/s WireGuard, wireguard-go 8.5 Gbit/s OpenVPN, AES-256-GCM 2.7 Gbit/s OpenVPN, ChaCha20 2.4 Gbit/s SSH -L, AES-256-GCM 14.8 Gbit/s SSH -L, ChaCha20 8.4 Gbit/s SSH -w (TUN), AES-256-GCM 2.5 Gbit/s Four TCP streams No tunnel 40.7 Gbit/s WireGuard, kernel 4.1 Gbit/s WireGuard, wireguard-go 6.8 Gbit/s OpenVPN, AES-256-GCM 3.6 Gbit/s OpenVPN, ChaCha20 3.0 Gbit/s SSH -L, AES-256-GCM 15.6 Gbit/s SSH -L, ChaCha20 8.4 Gbit/s SSH -w (TUN), AES-256-GCM 2.5 Gbit/s UDP, delivered No tunnel 8.7 Gbit/s · 0 % lost WireGuard, kernel 5.0 Gbit/s · 0 % lost WireGuard, wireguard-go 2.1 Gbit/s · 88 % lost OpenVPN, AES-256-GCM 4.0 Gbit/s · 78 % lost OpenVPN, ChaCha20 3.3 Gbit/s · 82 % lost SSH -w (TUN), AES-256-GCM 3.0 Gbit/s · 84 % lost No tunnel reaches the bare link's 21.1 Gbit/s: every packet is encrypted and authenticated once on the way out and checked once on the way in, and that work, not the wire, sets the ceiling. Kernel WireGuard varied most from run to run, 4.1–5.5 Gbit/s.
iperf3 3.18, 5 seconds per cell, median of 5 runs (each a fresh iperf3 client and a freshly started tunnel); the grey line runs from the slowest to the fastest run. UDP: 1,200-byte datagrams sent as fast as the sender can, counted at the receiver. SSH port forwarding carries TCP only. Client, router and server each on two pinned cores.
Throughput on the LAN through each tunnel and without one. No tunnel: one TCP stream 21.1 Gbit/s, four streams 40.7 Gbit/s, UDP delivered 8.7 Gbit/s. WireGuard, kernel: one TCP stream 4.2 Gbit/s, four streams 4.1 Gbit/s, UDP delivered 5.0 Gbit/s. WireGuard, wireguard-go: one TCP stream 8.5 Gbit/s, four streams 6.8 Gbit/s, UDP delivered 2.1 Gbit/s. OpenVPN, AES-256-GCM: one TCP stream 2.7 Gbit/s, four streams 3.6 Gbit/s, UDP delivered 4.0 Gbit/s. OpenVPN, ChaCha20: one TCP stream 2.4 Gbit/s, four streams 3.0 Gbit/s, UDP delivered 3.3 Gbit/s. SSH -L, AES-256-GCM: one TCP stream 14.8 Gbit/s, four streams 15.6 Gbit/s, UDP not carried. SSH -L, ChaCha20: one TCP stream 8.4 Gbit/s, four streams 8.4 Gbit/s, UDP not carried. SSH -w (TUN), AES-256-GCM: one TCP stream 2.5 Gbit/s, four streams 2.5 Gbit/s, UDP delivered 3.0 Gbit/s. On a LAN SSH -L with AES is the fastest tunnel in every run: 14.8 Gbit/s on one TCP stream, 21.1 Gbit/s without a tunnel; wireguard-go 8.5, SSH -L with ChaCha20 8.4, kernel WireGuard 4.2, OpenVPN and SSH -w 2.4–2.7 Gbit/s Gbit/s delivered · median of runs · every panel on its own scale no tunnel WireGuard OpenVPN SSH grey line: lowest to highest run One TCP stream No tunnel 21.1 Gbit/s WireGuard, kernel 4.2 Gbit/s WireGuard, wireguard-go 8.5 Gbit/s OpenVPN, AES-256-GCM 2.7 Gbit/s OpenVPN, ChaCha20 2.4 Gbit/s SSH -L, AES-256-GCM 14.8 Gbit/s SSH -L, ChaCha20 8.4 Gbit/s SSH -w (TUN), AES-256-GCM 2.5 Gbit/s Four TCP streams No tunnel 40.7 Gbit/s WireGuard, kernel 4.1 Gbit/s WireGuard, wireguard-go 6.8 Gbit/s OpenVPN, AES-256-GCM 3.6 Gbit/s OpenVPN, ChaCha20 3.0 Gbit/s SSH -L, AES-256-GCM 15.6 Gbit/s SSH -L, ChaCha20 8.4 Gbit/s SSH -w (TUN), AES-256-GCM 2.5 Gbit/s UDP, delivered No tunnel 8.7 Gbit/s · 0 % lost WireGuard, kernel 5.0 Gbit/s · 0 % lost WireGuard, wireguard-go 2.1 Gbit/s · 88 % lost OpenVPN, AES-256-GCM 4.0 Gbit/s · 78 % lost OpenVPN, ChaCha20 3.3 Gbit/s · 82 % lost SSH -w (TUN), AES-256-GCM 3.0 Gbit/s · 84 % lost No tunnel reaches the bare link's 21.1 Gbit/s: every packet is encrypted and authenticated once on the way out and checked once on the way in, and that work, not the wire, sets the ceiling. Kernel WireGuard varied most from run to run, 4.1–5.5 Gbit/s.
iperf3 3.18, 5 seconds per cell, median of 5 runs (each a fresh iperf3 client and a freshly started tunnel); the grey line runs from the slowest to the fastest run. UDP: 1,200-byte datagrams sent as fast as the sender can, counted at the receiver. SSH port forwarding carries TCP only. Client, router and server each on two pinned cores.
ThroughputLAN, 1 streamLAN, 4 streamsLAN, UDP50 ms, 1 stream200 ms + 1 %, 1 stream200 ms + 1 %, 4 streams
No tunnel21.1 Gbit/s
20.9–21.1 Gbit/s
40.7 Gbit/s
40.5–41.0 Gbit/s
8.7 Gbit/s
8.4–8.8 Gbit/s
619 Mbit/s
614–622 Mbit/s
1.4 Mbit/s
0.6–2.0 Mbit/s
4.8 Mbit/s
3.7–5.2 Mbit/s
WireGuard, kernel4.2 Gbit/s
4.1–5.5 Gbit/s
4.1 Gbit/s
4.0–5.4 Gbit/s
5.0 Gbit/s
4.8–6.5 Gbit/s
512 Mbit/s
500–518 Mbit/s
0.8 Mbit/s
0.4–1.8 Mbit/s
4.7 Mbit/s
3.4–5.7 Mbit/s
WireGuard, wireguard-go8.5 Gbit/s
8.2–8.6 Gbit/s
6.8 Gbit/s
6.4–6.8 Gbit/s
2.1 Gbit/s
2.1–2.2 Gbit/s
550 Mbit/s
549–554 Mbit/s
1.3 Mbit/s
0.7–3.0 Mbit/s
7.2 Mbit/s
6.7–8.2 Mbit/s
OpenVPN, AES-256-GCM2.7 Gbit/s
2.7–2.7 Gbit/s
3.6 Gbit/s
3.6–3.7 Gbit/s
4.0 Gbit/s
3.9–4.3 Gbit/s
47 Mbit/s
22–156 Mbit/s
1.0 Mbit/s
0.8–2.3 Mbit/s
3.9 Mbit/s
3.5–4.6 Mbit/s
OpenVPN, ChaCha202.4 Gbit/s
2.3–2.4 Gbit/s
3.0 Gbit/s
3.0–3.1 Gbit/s
3.3 Gbit/s
3.2–3.7 Gbit/s
29 Mbit/s
25–249 Mbit/s
0.9 Mbit/s
0.6–1.5 Mbit/s
3.9 Mbit/s
3.3–4.5 Mbit/s
SSH -L, AES-256-GCM14.8 Gbit/s
14.7–15.1 Gbit/s
15.6 Gbit/s
15.0–15.9 Gbit/s
—317 Mbit/s
313–322 Mbit/s
0.7 Mbit/s
0.6–0.9 Mbit/s
0.8 Mbit/s
0.5–0.9 Mbit/s
SSH -L, ChaCha208.4 Gbit/s
8.2–8.6 Gbit/s
8.4 Gbit/s
8.2–8.4 Gbit/s
—313 Mbit/s
311–320 Mbit/s
0.8 Mbit/s
0.5–0.9 Mbit/s
0.6 Mbit/s
0.6–0.7 Mbit/s
SSH -w (TUN), AES-256-GCM2.5 Gbit/s
2.2–2.5 Gbit/s
2.5 Gbit/s
2.4–2.5 Gbit/s
3.0 Gbit/s
2.7–3.0 Gbit/s
201 Mbit/s
163–277 Mbit/s
0.7 Mbit/s
0.6–0.9 Mbit/s
0.6 Mbit/s
0.5–0.7 Mbit/s

Without a tunnel one TCP stream moves 21.1 Gbit/s through the router. Through a tunnel (the numbers are measured; the reasons given under them are how each program is built, which this benchmark did not isolate):

Four streams change little inside a tunnel: OpenVPN gets 1.3–1.4× what one stream got, the other tunnels 0.8–1.1×: WireGuard (kernel) 4.1 Gbit/s, wireguard-go 6.8 Gbit/s, OpenVPN with AES-256-GCM 3.6 Gbit/s, OpenVPN with ChaCha20-Poly1305 3.0 Gbit/s, SSH port forwarding with AES-256-GCM 15.6 Gbit/s, SSH port forwarding with ChaCha20-Poly1305 8.4 Gbit/s, the SSH layer-3 tunnel 2.5 Gbit/s. Only the bare link scales, to 40.7 Gbit/s (1.9×). Explanation: each tunnel is one encrypting pipeline, already full with one stream.

UDP at full speed is a different test: iperf3 sends 1,200-byte datagrams as fast as it can and counts what arrives. A tunnel that cannot keep up has nowhere to put the excess, and the losses are reported as losses: the userspace tunnels lost 78–88 % of what was sent. Kernel WireGuard lost 0 % and delivered 5.0 Gbit/s: the sender was held back to what the tunnel could carry instead of having its datagrams dropped. SSH’s layer-3 tunnel survived the flood in all 5 measured runs. In development runs on cores shared with other work it did not: sshd closed the session within seconds with “channel 0: peer ignored channel window”, because the client kept writing TUN packets into the channel past the window the server had granted. Under a UDP flood, ssh -w depends on timing.

CPU per gigabit

Throughput on a LAN is really a CPU measurement, so measure the CPU directly: every busy core-second on the client, the router and the server, plus kernel worker threads anywhere else, divided by the gigabits delivered.

CPU time per gigabit moved, one TCP stream on the LAN, all cores: No tunnel 0.07 CPU-seconds, WireGuard, kernel 0.76 CPU-seconds, WireGuard, wireguard-go 0.29 CPU-seconds, OpenVPN, AES-256-GCM 0.81 CPU-seconds, OpenVPN, ChaCha20 0.94 CPU-seconds, SSH -L, AES-256-GCM 0.13 CPU-seconds, SSH -L, ChaCha20 0.23 CPU-seconds, SSH -w (TUN), AES-256-GCM 0.91 CPU-seconds. Per gigabit, SSH -L with AES costs 0.13 CPU-seconds and wireguard-go 0.29; OpenVPN, SSH -w, kernel WireGuard 0.76–0.94, 6–7× as much CPU-seconds per gigabit, one TCP stream on the LAN, every core that did work counted · split between core groups approximate client cores link (router) cores server cores kernel workers on other cores grey line: lowest to highest run No tunnel 0.07 WireGuard, kernel 0.76 WireGuard, wireguard-go 0.29 OpenVPN, AES-256-GCM 0.81 OpenVPN, ChaCha20 0.94 SSH -L, AES-256-GCM 0.13 SSH -L, ChaCha20 0.23 SSH -w (TUN), AES-256-GCM 0.91 Kernel WireGuard did 76 % of its work on kernel worker threads outside the six pinned cores: it spreads encryption over every core in the machine. Without a tunnel moving a gigabit costs 0.07 CPU-seconds.
Busy time of the client's, the router's and the server's two pinned cores each (from /proc/stat, so interrupts and kernel work count), plus kernel worker threads on every other core, divided by the gigabits delivered in the one-stream LAN cell. The split between the pinned groups is only approximate: a virtual Ethernet pair delivers a packet on the core that sent it, so some of the router's and the server's work lands on the sender's cores. The totals are not affected. Median of 5 runs; the grey line runs from the cheapest to the dearest run's total. 1.0 = one core fully busy for every 1 Gbit/s.
CPU time per gigabit moved, one TCP stream on the LAN, all cores: No tunnel 0.07 CPU-seconds, WireGuard, kernel 0.76 CPU-seconds, WireGuard, wireguard-go 0.29 CPU-seconds, OpenVPN, AES-256-GCM 0.81 CPU-seconds, OpenVPN, ChaCha20 0.94 CPU-seconds, SSH -L, AES-256-GCM 0.13 CPU-seconds, SSH -L, ChaCha20 0.23 CPU-seconds, SSH -w (TUN), AES-256-GCM 0.91 CPU-seconds. Per gigabit, SSH -L with AES costs 0.13 CPU-seconds and wireguard-go 0.29; OpenVPN, SSH -w, kernel WireGuard 0.76–0.94, 6–7× as much CPU-seconds per gigabit, one TCP stream on the LAN, every core that did work counted · split between core groups approximate client cores link (router) cores server cores kernel workers on other cores grey line: lowest to highest run No tunnel 0.07 WireGuard, kernel 0.76 WireGuard, wireguard-go 0.29 OpenVPN, AES-256-GCM 0.81 OpenVPN, ChaCha20 0.94 SSH -L, AES-256-GCM 0.13 SSH -L, ChaCha20 0.23 SSH -w (TUN), AES-256-GCM 0.91 Kernel WireGuard did 76 % of its work on kernel worker threads outside the six pinned cores: it spreads encryption over every core in the machine. Without a tunnel moving a gigabit costs 0.07 CPU-seconds.
Busy time of the client's, the router's and the server's two pinned cores each (from /proc/stat, so interrupts and kernel work count), plus kernel worker threads on every other core, divided by the gigabits delivered in the one-stream LAN cell. The split between the pinned groups is only approximate: a virtual Ethernet pair delivers a packet on the core that sent it, so some of the router's and the server's work lands on the sender's cores. The totals are not affected. Median of 5 runs; the grey line runs from the cheapest to the dearest run's total. 1.0 = one core fully busy for every 1 Gbit/s.

Moving a gigabit without a tunnel costs 0.07 CPU-seconds: copying data in and out of sockets and pushing packets through two virtual links. Each tunnel adds encryption, authentication, and, for the userspace ones, trips between the kernel and a daemon. The totals are solid; the split between client, router and server cores is approximate, because a virtual Ethernet pair delivers a packet on the core that sent it. Three results stand out (the reasons are explanations from how the programs are built, not something measured here):

Bytes per packet

What does each tunnel add to every packet? A 100-byte message on an open TCP connection, counted on the client’s interface; the difference per packet is what the tunnel adds:

IP bytes on the wire per 100-byte message, all headers included: No tunnel 152 B in 1.01 packets, WireGuard, kernel 221 B in 1.01 packets, WireGuard, wireguard-go 221 B in 1.01 packets, OpenVPN, AES-256-GCM 205 B in 1.01 packets, OpenVPN, ChaCha20 205 B in 1.01 packets, SSH -L, AES-256-GCM 201 B in 1.01 packets, SSH -L, ChaCha20 193 B in 1.01 packets, SSH -w (TUN), AES-256-GCM 250 B in 1.02 packets. A 100-byte message gains 68 B in WireGuard, 52 B in OpenVPN, 48 B in SSH -L, 95 B in SSH -w (TUN) One 100-byte message on an open connection · IP bytes per message, acknowledgements included no tunnel WireGuard OpenVPN SSH No tunnel 152 B WireGuard, kernel 221 B · +68 B WireGuard, wireguard-go 221 B · +68 B OpenVPN, AES-256-GCM 205 B · +52 B OpenVPN, ChaCha20 205 B · +52 B SSH -L, AES-256-GCM 201 B · +48 B SSH -L, ChaCha20 193 B · +40 B SSH -w (TUN), AES-256-GCM 250 B · +95 B Packets per message stay at 1.01–1.02 for every row: a tunnel makes each packet bigger, not more numerous.
Interface counters on the underlay before and after the LAN latency cell (500 requests and 500 responses of 100 bytes), divided by the 1,000 messages; IP header and everything above it, Ethernet header excluded. Median of 5 runs. After the bar: what the tunnel adds per packet (bytes per packet minus the same without a tunnel).
IP bytes on the wire per 100-byte message, all headers included: No tunnel 152 B in 1.01 packets, WireGuard, kernel 221 B in 1.01 packets, WireGuard, wireguard-go 221 B in 1.01 packets, OpenVPN, AES-256-GCM 205 B in 1.01 packets, OpenVPN, ChaCha20 205 B in 1.01 packets, SSH -L, AES-256-GCM 201 B in 1.01 packets, SSH -L, ChaCha20 193 B in 1.01 packets, SSH -w (TUN), AES-256-GCM 250 B in 1.02 packets. A 100-byte message gains 68 B in WireGuard, 52 B in OpenVPN, 48 B in SSH -L, 95 B in SSH -w (TUN) One 100-byte message on an open connection · IP bytes per message, acknowledgements included no tunnel WireGuard OpenVPN SSH No tunnel 152 B WireGuard, kernel 221 B · +68 B WireGuard, wireguard-go 221 B · +68 B OpenVPN, AES-256-GCM 205 B · +52 B OpenVPN, ChaCha20 205 B · +52 B SSH -L, AES-256-GCM 201 B · +48 B SSH -L, ChaCha20 193 B · +40 B SSH -w (TUN), AES-256-GCM 250 B · +95 B Packets per message stay at 1.01–1.02 for every row: a tunnel makes each packet bigger, not more numerous.
Interface counters on the underlay before and after the LAN latency cell (500 requests and 500 responses of 100 bytes), divided by the 1,000 messages; IP header and everything above it, Ethernet header excluded. Median of 5 runs. After the bar: what the tunnel adds per packet (bytes per packet minus the same without a tunnel).

Without a tunnel the message is 152 bytes on the wire: 100 bytes of data, 20 of IPv4 and 32 of TCP with timestamps. What each tunnel adds:

For a full 1,420-byte packet these are 3–7 % of the bytes on the wire. For the small packets of a voice call or a game they can be half.

Latency added

One 100-byte request and its response, over and over, on an open connection:

Request/response latency, 100-byte messages over TCP, median per link. LAN, no added delay: No tunnel 5 µs, WireGuard, kernel 40 µs, WireGuard, wireguard-go 30 µs, OpenVPN, AES-256-GCM 16 µs, OpenVPN, ChaCha20 18 µs, SSH -L, AES-256-GCM 23 µs, SSH -L, ChaCha20 26 µs, SSH -w (TUN), AES-256-GCM 21 µs. 50 ms round trip: No tunnel 50.1 ms, WireGuard, kernel 50.3 ms, WireGuard, wireguard-go 50.2 ms, OpenVPN, AES-256-GCM 50.3 ms, OpenVPN, ChaCha20 50.5 ms, SSH -L, AES-256-GCM 50.2 ms, SSH -L, ChaCha20 50.3 ms, SSH -w (TUN), AES-256-GCM 50.5 ms. 200 ms round trip, 1 % loss: No tunnel 200 ms, WireGuard, kernel 201 ms, WireGuard, wireguard-go 201 ms, OpenVPN, AES-256-GCM 201 ms, OpenVPN, ChaCha20 201 ms, SSH -L, AES-256-GCM 201 ms, SSH -L, ChaCha20 200 ms, SSH -w (TUN), AES-256-GCM 201 ms. A tunnel adds 11–35 µs to a 5 µs LAN round trip, least OpenVPN with AES, most kernel WireGuard; on a slow link the delay of the link itself hides it Round trip of one 100-byte request and its response · median of runs · p99 = the slowest 1 % of round trips no tunnel WireGuard OpenVPN SSH each link has its own scale · grey line: lowest to highest run LAN, no added delay No tunnel 5 µs · p99 18 µs WireGuard, kernel 40 µs · p99 1.34 ms WireGuard, wireguard-go 30 µs · p99 67 µs OpenVPN, AES-256-GCM 16 µs · p99 46 µs OpenVPN, ChaCha20 18 µs · p99 42 µs SSH -L, AES-256-GCM 23 µs · p99 46 µs SSH -L, ChaCha20 26 µs · p99 63 µs SSH -w (TUN), AES-256-GCM 21 µs · p99 57 µs 50 ms round trip No tunnel 50.1 ms · p99 50.7 ms WireGuard, kernel 50.3 ms · p99 52.3 ms WireGuard, wireguard-go 50.2 ms · p99 50.9 ms OpenVPN, AES-256-GCM 50.3 ms · p99 50.8 ms OpenVPN, ChaCha20 50.5 ms · p99 51.0 ms SSH -L, AES-256-GCM 50.2 ms · p99 51.0 ms SSH -L, ChaCha20 50.3 ms · p99 51.0 ms SSH -w (TUN), AES-256-GCM 50.5 ms · p99 51.1 ms 200 ms round trip, 1 % loss No tunnel 200 ms · p99 201 ms WireGuard, kernel 201 ms · p99 608 ms WireGuard, wireguard-go 201 ms · p99 201 ms OpenVPN, AES-256-GCM 201 ms · p99 605 ms OpenVPN, ChaCha20 201 ms · p99 619 ms SSH -L, AES-256-GCM 201 ms · p99 401 ms SSH -L, ChaCha20 200 ms · p99 603 ms SSH -w (TUN), AES-256-GCM 201 ms · p99 605 ms Without a tunnel a LAN round trip takes 5 µs. On the 50 ms link every tunnel is within 370 µs of the bare link's 50.1 ms. With 1 % loss the p99 is where a lost packet and its retransmission show; with 50 round trips per run that is luck, not the tunnel.
One 100-byte request, one 100-byte response, the next request after the response; TCP_NODELAY on; 500 round trips per run on the LAN, 100 at 50 ms, 50 on the lossy link; median of 5 runs, the grey line from the lowest to the highest run's median. p99: each run's 99th percentile, median across runs. Each link has its own scale.
Request/response latency, 100-byte messages over TCP, median per link. LAN, no added delay: No tunnel 5 µs, WireGuard, kernel 40 µs, WireGuard, wireguard-go 30 µs, OpenVPN, AES-256-GCM 16 µs, OpenVPN, ChaCha20 18 µs, SSH -L, AES-256-GCM 23 µs, SSH -L, ChaCha20 26 µs, SSH -w (TUN), AES-256-GCM 21 µs. 50 ms round trip: No tunnel 50.1 ms, WireGuard, kernel 50.3 ms, WireGuard, wireguard-go 50.2 ms, OpenVPN, AES-256-GCM 50.3 ms, OpenVPN, ChaCha20 50.5 ms, SSH -L, AES-256-GCM 50.2 ms, SSH -L, ChaCha20 50.3 ms, SSH -w (TUN), AES-256-GCM 50.5 ms. 200 ms round trip, 1 % loss: No tunnel 200 ms, WireGuard, kernel 201 ms, WireGuard, wireguard-go 201 ms, OpenVPN, AES-256-GCM 201 ms, OpenVPN, ChaCha20 201 ms, SSH -L, AES-256-GCM 201 ms, SSH -L, ChaCha20 200 ms, SSH -w (TUN), AES-256-GCM 201 ms. A tunnel adds 11–35 µs to a 5 µs LAN round trip, least OpenVPN with AES, most kernel WireGuard; on a slow link the delay of the link itself hides it Round trip of one 100-byte request and its response · median of runs · p99 = the slowest 1 % of round trips no tunnel WireGuard OpenVPN SSH each link has its own scale · grey line: lowest to highest run LAN, no added delay No tunnel 5 µs · p99 18 µs WireGuard, kernel 40 µs · p99 1.34 ms WireGuard, wireguard-go 30 µs · p99 67 µs OpenVPN, AES-256-GCM 16 µs · p99 46 µs OpenVPN, ChaCha20 18 µs · p99 42 µs SSH -L, AES-256-GCM 23 µs · p99 46 µs SSH -L, ChaCha20 26 µs · p99 63 µs SSH -w (TUN), AES-256-GCM 21 µs · p99 57 µs 50 ms round trip No tunnel 50.1 ms · p99 50.7 ms WireGuard, kernel 50.3 ms · p99 52.3 ms WireGuard, wireguard-go 50.2 ms · p99 50.9 ms OpenVPN, AES-256-GCM 50.3 ms · p99 50.8 ms OpenVPN, ChaCha20 50.5 ms · p99 51.0 ms SSH -L, AES-256-GCM 50.2 ms · p99 51.0 ms SSH -L, ChaCha20 50.3 ms · p99 51.0 ms SSH -w (TUN), AES-256-GCM 50.5 ms · p99 51.1 ms 200 ms round trip, 1 % loss No tunnel 200 ms · p99 201 ms WireGuard, kernel 201 ms · p99 608 ms WireGuard, wireguard-go 201 ms · p99 201 ms OpenVPN, AES-256-GCM 201 ms · p99 605 ms OpenVPN, ChaCha20 201 ms · p99 619 ms SSH -L, AES-256-GCM 201 ms · p99 401 ms SSH -L, ChaCha20 200 ms · p99 603 ms SSH -w (TUN), AES-256-GCM 201 ms · p99 605 ms Without a tunnel a LAN round trip takes 5 µs. On the 50 ms link every tunnel is within 370 µs of the bare link's 50.1 ms. With 1 % loss the p99 is where a lost packet and its retransmission show; with 50 round trips per run that is luck, not the tunnel.
One 100-byte request, one 100-byte response, the next request after the response; TCP_NODELAY on; 500 round trips per run on the LAN, 100 at 50 ms, 50 on the lossy link; median of 5 runs, the grey line from the lowest to the highest run's median. p99: each run's 99th percentile, median across runs. Each link has its own scale.

On the LAN a round trip without a tunnel takes 5 µs. The tunnels add between 11 µs and 35 µs, OpenVPN the least and kernel WireGuard the most in every run. A likely explanation, not measured: the userspace tunnels pay for waking a daemon at each end, kernel WireGuard for its hand-off to a worker queue and the reordering after it. On the 50 ms link those microseconds disappear inside the network’s own delay. On the lossy link the medians stay near 200 ms for everyone. The 99th percentile is where a lost packet shows, as a retransmission that takes at least another round trip: 201 ms to 619 ms across the rows. With 50 round trips per run, whether a run’s slowest one includes a lost packet is mostly luck, so these tails say little about the tunnels.

Bringing a tunnel up

How long from starting the tunnel until the first byte gets through it? The clock starts when the client side is launched (the server side is already listening) and stops when a TCP connection through the tunnel echoes its first bytes. That probe needs two round trips itself, a TCP handshake and the echo, which is all the no-tunnel row measures.

Time from starting the tunnel to the first verified echo through it, per link. LAN, no added delay: WireGuard, kernel 10.3 ms, WireGuard, wireguard-go 13.2 ms, OpenVPN, AES-256-GCM 436 ms, OpenVPN, ChaCha20 722 ms, SSH -L, AES-256-GCM 75.7 ms, SSH -L, ChaCha20 75.5 ms, SSH -w (TUN), AES-256-GCM 75.9 ms. 50 ms round trip: WireGuard, kernel 161 ms, WireGuard, wireguard-go 164 ms, OpenVPN, AES-256-GCM 642 ms, OpenVPN, ChaCha20 377 ms, SSH -L, AES-256-GCM 660 ms, SSH -L, ChaCha20 660 ms, SSH -w (TUN), AES-256-GCM 702 ms. 200 ms round trip, 1 % loss: WireGuard, kernel 611 ms, WireGuard, wireguard-go 615 ms, OpenVPN, AES-256-GCM 1,667 ms, OpenVPN, ChaCha20 1,391 ms, SSH -L, AES-256-GCM 2,314 ms, SSH -L, ChaCha20 2,540 ms, SSH -w (TUN), AES-256-GCM 2,904 ms. WireGuard is up first on every link, in every run: on the LAN 10.3–13.2 ms, SSH 75.5–75.9 ms, OpenVPN 436–722 ms; at 200 ms WireGuard 611–615 ms, OpenVPN 1,391–1,667 ms, SSH 2,314–2,904 ms From starting the tunnel to the first byte echoed through it · median of runs WireGuard OpenVPN SSH each link has its own scale · grey line: lowest to highest run LAN, no added delay WireGuard, kernel 10.3 ms WireGuard, wireguard-go 13.2 ms OpenVPN, AES-256-GCM 436 ms OpenVPN, ChaCha20 722 ms SSH -L, AES-256-GCM 75.7 ms SSH -L, ChaCha20 75.5 ms SSH -w (TUN), AES-256-GCM 75.9 ms 50 ms round trip WireGuard, kernel 161 ms WireGuard, wireguard-go 164 ms OpenVPN, AES-256-GCM 642 ms OpenVPN, ChaCha20 377 ms SSH -L, AES-256-GCM 660 ms SSH -L, ChaCha20 660 ms SSH -w (TUN), AES-256-GCM 702 ms 200 ms round trip, 1 % loss WireGuard, kernel 611 ms WireGuard, wireguard-go 615 ms OpenVPN, AES-256-GCM 1,667 ms OpenVPN, ChaCha20 1,391 ms SSH -L, AES-256-GCM 2,314 ms SSH -L, ChaCha20 2,540 ms SSH -w (TUN), AES-256-GCM 2,904 ms WireGuard sends one handshake message each way and then data. SSH and OpenVPN exchange several messages first; OpenVPN also waits on timers that count in whole seconds, so on the LAN its runs spread from 40.1–982 ms, while at 200 ms it came up before SSH in 4 of 5 runs.
The clock starts in the client container just before the client side is started (interface configured, daemon launched, ssh run); it stops when a TCP connection through the tunnel echoes 29 bytes back intact. Probes start every 5 ms. The server side was already listening. Median of 5 runs; the grey line runs from the fastest to the slowest run. Each link has its own scale.
Time from starting the tunnel to the first verified echo through it, per link. LAN, no added delay: WireGuard, kernel 10.3 ms, WireGuard, wireguard-go 13.2 ms, OpenVPN, AES-256-GCM 436 ms, OpenVPN, ChaCha20 722 ms, SSH -L, AES-256-GCM 75.7 ms, SSH -L, ChaCha20 75.5 ms, SSH -w (TUN), AES-256-GCM 75.9 ms. 50 ms round trip: WireGuard, kernel 161 ms, WireGuard, wireguard-go 164 ms, OpenVPN, AES-256-GCM 642 ms, OpenVPN, ChaCha20 377 ms, SSH -L, AES-256-GCM 660 ms, SSH -L, ChaCha20 660 ms, SSH -w (TUN), AES-256-GCM 702 ms. 200 ms round trip, 1 % loss: WireGuard, kernel 611 ms, WireGuard, wireguard-go 615 ms, OpenVPN, AES-256-GCM 1,667 ms, OpenVPN, ChaCha20 1,391 ms, SSH -L, AES-256-GCM 2,314 ms, SSH -L, ChaCha20 2,540 ms, SSH -w (TUN), AES-256-GCM 2,904 ms. WireGuard is up first on every link, in every run: on the LAN 10.3–13.2 ms, SSH 75.5–75.9 ms, OpenVPN 436–722 ms; at 200 ms WireGuard 611–615 ms, OpenVPN 1,391–1,667 ms, SSH 2,314–2,904 ms From starting the tunnel to the first byte echoed through it · median of runs WireGuard OpenVPN SSH each link has its own scale · grey line: lowest to highest run LAN, no added delay WireGuard, kernel 10.3 ms WireGuard, wireguard-go 13.2 ms OpenVPN, AES-256-GCM 436 ms OpenVPN, ChaCha20 722 ms SSH -L, AES-256-GCM 75.7 ms SSH -L, ChaCha20 75.5 ms SSH -w (TUN), AES-256-GCM 75.9 ms 50 ms round trip WireGuard, kernel 161 ms WireGuard, wireguard-go 164 ms OpenVPN, AES-256-GCM 642 ms OpenVPN, ChaCha20 377 ms SSH -L, AES-256-GCM 660 ms SSH -L, ChaCha20 660 ms SSH -w (TUN), AES-256-GCM 702 ms 200 ms round trip, 1 % loss WireGuard, kernel 611 ms WireGuard, wireguard-go 615 ms OpenVPN, AES-256-GCM 1,667 ms OpenVPN, ChaCha20 1,391 ms SSH -L, AES-256-GCM 2,314 ms SSH -L, ChaCha20 2,540 ms SSH -w (TUN), AES-256-GCM 2,904 ms WireGuard sends one handshake message each way and then data. SSH and OpenVPN exchange several messages first; OpenVPN also waits on timers that count in whole seconds, so on the LAN its runs spread from 40.1–982 ms, while at 200 ms it came up before SSH in 4 of 5 runs.
The clock starts in the client container just before the client side is started (interface configured, daemon launched, ssh run); it stops when a TCP connection through the tunnel echoes 29 bytes back intact. Probes start every 5 ms. The server side was already listening. Median of 5 runs; the grey line runs from the fastest to the slowest run. Each link has its own scale.

On the 200 ms link the order between the two slow ones turned: OpenVPN was up in 1,391–1,667 ms, SSH in 2,314–2,904 ms, OpenVPN first in 4 of 5 runs. Explanation: once each round trip costs 200 ms, SSH’s longer exchange outweighs OpenVPN’s timers. A lost handshake packet has to time out before it is resent, and the slowest runs show it: OpenVPN’s slowest bring-up took 7,346 ms, SSH’s 3,187 ms, WireGuard’s 618 ms.

The textbook warning about SSH tunnels and other TCP-based VPNs is TCP meltdown: when a packet is lost, the outer TCP connection retransmits it and holds everything behind it, while the inner TCP connections see a sudden delay, time out and retransmit too, piling more data into a connection that is already recovering. UDP tunnels don’t have this problem: a lost outer packet is a lost inner packet, and only the inner TCP reacts.

TCP throughput on slow links. 50 ms round trip, one stream: No tunnel 619 Mbit/s, WireGuard, kernel 512 Mbit/s, WireGuard, wireguard-go 550 Mbit/s, OpenVPN, AES-256-GCM 47 Mbit/s, OpenVPN, ChaCha20 29 Mbit/s, SSH -L, AES-256-GCM 317 Mbit/s, SSH -L, ChaCha20 313 Mbit/s, SSH -w (TUN), AES-256-GCM 201 Mbit/s. 200 ms round trip, 1 % loss, one stream: No tunnel 1.4 Mbit/s, WireGuard, kernel 0.8 Mbit/s, WireGuard, wireguard-go 1.3 Mbit/s, OpenVPN, AES-256-GCM 1.0 Mbit/s, OpenVPN, ChaCha20 0.9 Mbit/s, SSH -L, AES-256-GCM 0.7 Mbit/s, SSH -L, ChaCha20 0.8 Mbit/s, SSH -w (TUN), AES-256-GCM 0.7 Mbit/s. 200 ms with 1 % loss, four streams: No tunnel 4.8 Mbit/s, WireGuard, kernel 4.7 Mbit/s, WireGuard, wireguard-go 7.2 Mbit/s, OpenVPN, AES-256-GCM 3.9 Mbit/s, OpenVPN, ChaCha20 3.9 Mbit/s, SSH -L, AES-256-GCM 0.8 Mbit/s, SSH -L, ChaCha20 0.6 Mbit/s, SSH -w (TUN), AES-256-GCM 0.6 Mbit/s. With 1 % loss on 200 ms, four streams get 3.5–5.7× one stream without a tunnel or inside a UDP tunnel, 0.7–1.0× inside SSH; one stream is a toss-up Median of runs · each panel on its own scale no tunnel WireGuard OpenVPN SSH grey line: lowest to highest run 50 ms round trip, one stream No tunnel 619 Mbit/s WireGuard, kernel 512 Mbit/s WireGuard, wireguard-go 550 Mbit/s OpenVPN, AES-256-GCM 47 Mbit/s OpenVPN, ChaCha20 29 Mbit/s SSH -L, AES-256-GCM 317 Mbit/s SSH -L, ChaCha20 313 Mbit/s SSH -w (TUN), AES-256-GCM 201 Mbit/s 200 ms round trip, 1 % loss, one stream: runs overlap, no order No tunnel 1.4 Mbit/s WireGuard, kernel 0.8 Mbit/s WireGuard, wireguard-go 1.3 Mbit/s OpenVPN, AES-256-GCM 1.0 Mbit/s OpenVPN, ChaCha20 0.9 Mbit/s SSH -L, AES-256-GCM 0.7 Mbit/s SSH -L, ChaCha20 0.8 Mbit/s SSH -w (TUN), AES-256-GCM 0.7 Mbit/s 200 ms round trip, 1 % loss, four streams No tunnel 4.8 Mbit/s WireGuard, kernel 4.7 Mbit/s WireGuard, wireguard-go 7.2 Mbit/s OpenVPN, AES-256-GCM 3.9 Mbit/s OpenVPN, ChaCha20 3.9 Mbit/s SSH -L, AES-256-GCM 0.8 Mbit/s SSH -L, ChaCha20 0.6 Mbit/s SSH -w (TUN), AES-256-GCM 0.6 Mbit/s Four connections inside one SSH connection share its losses: together 0.6–0.8 Mbit/s, against 3.9–7.2 Mbit/s when each recovers on its own, in every run. On the 50 ms link OpenVPN was the slowest in every run: its UDP socket buffer overflowed (see the text).
iperf3, 10 s on the 50 ms link and 15 s on the lossy one, median of 5 runs; the grey line runs from the slowest to the fastest run. Throughput is what the server received over its own test time, which includes draining what the tunnel had buffered. Loss is applied to the underlay packets, so a tunnel over UDP loses outer packets and the inner TCP sees each loss once; a tunnel over TCP (SSH) retransmits underneath and the inner TCP sees a stall instead.
TCP throughput on slow links. 50 ms round trip, one stream: No tunnel 619 Mbit/s, WireGuard, kernel 512 Mbit/s, WireGuard, wireguard-go 550 Mbit/s, OpenVPN, AES-256-GCM 47 Mbit/s, OpenVPN, ChaCha20 29 Mbit/s, SSH -L, AES-256-GCM 317 Mbit/s, SSH -L, ChaCha20 313 Mbit/s, SSH -w (TUN), AES-256-GCM 201 Mbit/s. 200 ms round trip, 1 % loss, one stream: No tunnel 1.4 Mbit/s, WireGuard, kernel 0.8 Mbit/s, WireGuard, wireguard-go 1.3 Mbit/s, OpenVPN, AES-256-GCM 1.0 Mbit/s, OpenVPN, ChaCha20 0.9 Mbit/s, SSH -L, AES-256-GCM 0.7 Mbit/s, SSH -L, ChaCha20 0.8 Mbit/s, SSH -w (TUN), AES-256-GCM 0.7 Mbit/s. 200 ms with 1 % loss, four streams: No tunnel 4.8 Mbit/s, WireGuard, kernel 4.7 Mbit/s, WireGuard, wireguard-go 7.2 Mbit/s, OpenVPN, AES-256-GCM 3.9 Mbit/s, OpenVPN, ChaCha20 3.9 Mbit/s, SSH -L, AES-256-GCM 0.8 Mbit/s, SSH -L, ChaCha20 0.6 Mbit/s, SSH -w (TUN), AES-256-GCM 0.6 Mbit/s. With 1 % loss on 200 ms, four streams get 3.5–5.7× one stream without a tunnel or inside a UDP tunnel, 0.7–1.0× inside SSH; one stream is a toss-up Median of runs · each panel on its own scale no tunnel WireGuard OpenVPN SSH grey line: lowest to highest run 50 ms round trip, one stream No tunnel 619 Mbit/s WireGuard, kernel 512 Mbit/s WireGuard, wireguard-go 550 Mbit/s OpenVPN, AES-256-GCM 47 Mbit/s OpenVPN, ChaCha20 29 Mbit/s SSH -L, AES-256-GCM 317 Mbit/s SSH -L, ChaCha20 313 Mbit/s SSH -w (TUN), AES-256-GCM 201 Mbit/s 200 ms round trip, 1 % loss, one stream No tunnel 1.4 Mbit/s WireGuard, kernel 0.8 Mbit/s WireGuard, wireguard-go 1.3 Mbit/s OpenVPN, AES-256-GCM 1.0 Mbit/s OpenVPN, ChaCha20 0.9 Mbit/s SSH -L, AES-256-GCM 0.7 Mbit/s SSH -L, ChaCha20 0.8 Mbit/s SSH -w (TUN), AES-256-GCM 0.7 Mbit/s 200 ms round trip, 1 % loss, four streams No tunnel 4.8 Mbit/s WireGuard, kernel 4.7 Mbit/s WireGuard, wireguard-go 7.2 Mbit/s OpenVPN, AES-256-GCM 3.9 Mbit/s OpenVPN, ChaCha20 3.9 Mbit/s SSH -L, AES-256-GCM 0.8 Mbit/s SSH -L, ChaCha20 0.6 Mbit/s SSH -w (TUN), AES-256-GCM 0.6 Mbit/s Four connections inside one SSH connection share its losses: together 0.6–0.8 Mbit/s, against 3.9–7.2 Mbit/s when each recovers on its own, in every run. On the 50 ms link OpenVPN was the slowest in every run: its UDP socket buffer overflowed (see the text).
iperf3, 10 s on the 50 ms link and 15 s on the lossy one, median of 5 runs; the grey line runs from the slowest to the fastest run. Throughput is what the server received over its own test time, which includes draining what the tunnel had buffered. Loss is applied to the underlay packets, so a tunnel over UDP loses outer packets and the inner TCP sees each loss once; a tunnel over TCP (SSH) retransmits underneath and the inner TCP sees a stall instead.

On the 50 ms link without loss, one stream without a tunnel reaches 619 Mbit/s, set by the default socket buffers, not the link. OpenVPN falls to 47 Mbit/s (22–249 Mbit/s across runs and ciphers, the slowest row in every run), and not because of the link: the inner TCP sends in bursts, the bursts arrive faster than one OpenVPN thread can decrypt them, and OpenVPN’s UDP socket, at its default 212,992-byte buffer, overflows. The kernel counted 540 datagrams dropped that way per run, against 0 for wireguard-go, which asks for larger buffers itself. Each drop is a lost packet to the inner TCP, which shrinks its window every time. OpenVPN’s --rcvbuf and --sndbuf options exist for this; they were left at their defaults here, as everything else was. On the 200 ms link with 1 % loss, single-stream throughput collapses for everyone: without a tunnel 1.4 Mbit/s, inside the UDP tunnels 0.8–1.3 Mbit/s, inside SSH 0.7–0.8 Mbit/s. SSH’s medians are the lowest, but runs of the same tunnel spread wider than the gaps between tunnels (see the table above): on one stream there is no clear meltdown. One TCP connection with 1 % loss on a 200 ms round trip cannot do much better whatever carries it: the Mathis estimate, 1.22 × segment size ÷ (round trip × √loss), gives 0.7 Mbit/s for 1,448-byte segments. Four streams are where the two kinds of tunnel separate:

4 streams, 200 ms + 1 %Throughputvs one stream
no tunnel4.8 Mbit/s3.5×
WireGuard (kernel)4.7 Mbit/s5.7×
wireguard-go7.2 Mbit/s5.5×
OpenVPN with AES-256-GCM3.9 Mbit/s3.8×
OpenVPN with ChaCha20-Poly13053.9 Mbit/s4.3×
SSH port forwarding with AES-256-GCM0.8 Mbit/s1.0×
SSH port forwarding with ChaCha20-Poly13050.6 Mbit/s0.7×
the SSH layer-3 tunnel0.6 Mbit/s0.8×

Four TCP connections inside a UDP tunnel are four independent connections: each loses its own packets and recovers on its own, and together they got 3.5–5.7× as much as one. Four connections inside one SSH connection are not: they share the outer TCP connection, which still loses 1 % of its packets and still recovers from each loss alone, so the four inner streams only divide the same 0.8 Mbit/s among themselves.

What this does not show

What the numbers say

Reproduce it

The harness is three shell scripts, a Go program for latency, bulk transfer and bring-up time, and a Dockerfile. It needs Docker and, for the kernel WireGuard row, the wireguard module already loaded on the host.

docker build -t tunb . && ./keys.sh          # image, throwaway keys and certificates
./up.sh 4-5 2-3 6-7                          # client, server, router cores
docker exec tn-r tc qdisc replace dev ra root netem delay 25ms limit 100000   # the 50 ms link,
docker exec tn-r tc qdisc replace dev rb root netem delay 25ms limit 100000   # both directions
docker exec tn-b sh /h/t.sh srv wg && docker exec tn-a sh /h/t.sh cli wg     # prints {"connect_ms": ...}
docker exec tn-a iperf3 -c 198.51.100.2 -t 10
docker exec tn-a tb rr -addr 198.51.100.2:7000 -n 100 -size 100

run.sh runs the whole matrix and writes one JSON line per cell: throughput, every latency sample, the interface counters and the transfer checks.

Questions? Let's Chat :)

protocols