Thomas Eizinger follows Firezone’s macOS VPN from disappointing throughput into Apple’s XNU kernel. The first problem was packet loss inside the local machine. TCP interpreted those drops as network congestion and slowed down, even when the physical link had spare capacity.
- Check the operating system’s actual behavior. On the UDP path Firezone investigated, increasing the socket send buffer did little. Packets bypassed it and could be dropped at the interface queue while writes still reported success.
- Restore backpressure. Connected UDP sockets exposed a full queue through
ENOBUFS. Firezone handled that signal specially and waited for write readiness, allowing bounded internal queues to slow upstream work. - Batch across boundaries. Apple’s
sendmsg_xandrecvmsg_xlet Firezone move multiple packets per call on both UDP sockets and the TUN virtual network interface. That spreads system-call overhead across a batch. - Reduce downstream work too. Combining consecutive TCP segments before returning them to the kernel cut per-segment processing. The same trick would break UDP’s separate-message semantics.
Firezone measured 5.87 Gbit/s upload and 5.76 Gbit/s download on two M1 Macs connected over 40 Gbit/s Thunderbolt. The comparison selectively disables optimizations, with each result the median of three single-stream tests; it is a controlled benchmark, not an Internet-speed guarantee.
Backpressure has to survive every boundary in a pipeline. A familiar socket API can hide different queueing behavior on another operating system, and faster processing can simply make an existing packet-loss problem worse.