• Sources: primary, discussion
  • Summary: Firezone's macOS client topped out near 1 Gbit/s down, with uploads often at a few hundred Mbit/s. Reading the XNU source, the team found unconnected UDP sockets never fill their send buffer, so non-blocking writes never return EWOULDBLOCK while the interface transmit queue drops datagrams, and SO_SNDBUF only caps datagram size. Connected UDP sockets instead fail with ENOBUFS when the queue is full and wake on write-readiness, which Firezone now uses to pause its transmit thread, and with batching the client exceeds 5 Gbit/s.
  • Why it matters: Any async runtime that relies on EWOULDBLOCK for UDP on macOS or iOS can lose packets under load, so VPN and QUIC code there needs explicit ENOBUFS handling.
  • Background: Loss-based TCP congestion controllers such as CUBIC shrink their window when acknowledgments show missing data. A VPN's TUN device looks like a network link to the inner TCP connection, so packets dropped inside the VPN software are read as congestion and throttle the sender even when the real link has spare capacity. XNU is the kernel under macOS and iOS, and its networking stack descends from BSD.