WireGuard Performance and UDP Characteristics
You'll learn why WireGuard's use of UDP and lean design deliver exceptional VPN performance, plus the practical implications for real-world deployments.
Why WireGuard Is Fast
WireGuard achieves remarkable performance through two key design choices: a minimal codebase (under 4,000 lines) that reduces overhead, and UDP as its transport protocol. Unlike TCP-based VPNs that maintain connection state, UDP simply fires packets and moves on—no handshakes, no retransmissions at the protocol level.
Think of UDP like dropping letters in a mailbox versus TCP's registered mail with tracking. WireGuard trusts that applications using it (like SSH or HTTPS) already handle reliability, so it avoids duplicate error correction.
UDP Implications
Since WireGuard uses UDP, it won't experience "TCP-over-TCP meltdown"—a problem where TCP retransmissions at both VPN and application layers fight each other, causing severe slowdowns. This makes WireGuard ideal for tunneling any traffic type.
However, UDP means NAT routers might drop idle connections. WireGuard solves this with automatic keepalive packets (configurable, typically every 25 seconds) to maintain NAT mappings.
MTU Considerations
WireGuard adds 60 bytes of overhead per packet (40 bytes for encapsulation + 20 bytes for IP header). On standard 1500-byte Ethernet networks, your effective MTU becomes 1420 bytes. If misconfigured, large packets fragment or drop, causing mysterious connection failures.
You must either:
- Set client MTU to 1420
- Enable path MTU discovery on the interface
NAT Traversal
WireGuard handles NAT gracefully by remembering the source IP/port from the most recent authenticated packet. When peers exchange keepalives, NAT bindings stay active, and connections survive IP changes (mobile roaming).
Key Takeaway: WireGuard's UDP transport and minimal design deliver superior performance while requiring MTU awareness and keepalive configuration for reliable NAT traversal.