002. Userspace WireGuard, not the kernel module

Status: accepted

Context

Kernel WireGuard is faster than wireguard-go and needs no embedding. On Linux it is the obvious choice.

Decision

Use userspace WireGuard (wireguard-go) everywhere.

Why

NAT traversal and the tunnel must share one UDP socket. Tailscale states the constraint plainly: otherwise the reflexive address you discover via STUN or an in-band echo is not the port your data actually arrives on, and hole punches land on the wrong mapping.

Kernel WireGuard owns its socket and will not share it. This is why Tailscale runs wireguard-go on every platform despite the kernel module existing.

Two supporting reasons:

Consequences