Guide · How it works
What WireGuard is, and why it connects instantly
WireGuard is the thing doing the actual work when a modern VPN app says it is connected. It is not an app and not a service: it is a tunnelling protocol, plus a compact implementation of it that has shipped inside the Linux kernel since version 5.6 and reaches phones and laptops through an app rather than through the operating system. Its entire design philosophy fits in one sentence. Decide everything in advance, keep the code small enough that a person can read it, and move packets.
What follows explains it in order, for someone who is not a network engineer: how a tunnel is really just a network interface, why running inside the kernel changes the economics, what a one-round-trip handshake buys you, which three constraints the design accepts in exchange, and what WireGuard refuses to handle at all, which is the part that decides how much the software wrapped around it matters.
A tunnel is a network interface with a guest list
Strip away the branding and a WireGuard tunnel is a network interface on your device, in the same family as Wi-Fi or Ethernet. Programs do not talk to it, negotiate with it, or know it exists. They send packets to an address; the operating system decides those packets belong to the tunnel interface; the interface encrypts each one, wraps it inside a UDP packet addressed to the far end, and sends it out over whatever ordinary network you happen to be sitting on.
The interface keeps a short list of peers, and that list is where WireGuard's most distinctive idea lives. Each peer is a public key, and each public key is paired with the range of addresses it is permitted to use. The pairing does two jobs at once: it decides where an outgoing packet should go, and it decides whether an incoming packet is allowed to claim the source address written on it. The project calls this cryptokey routing.
- An outgoing packet is encrypted for whichever peer's permitted range covers its destination. If no peer claims that range, the packet is not sent anywhere.
- An incoming packet is decrypted first, then checked: if the source address inside it is not one the sending key is allowed to use, it is dropped rather than forwarded.
- The key is the identity. The protocol has no username, no password and no login step, so routing and authorisation are literally the same table and cannot drift apart.
Why it matters that the code sits in the kernel
Older tunnelling software typically ran as a user-space daemon: an ordinary program that the kernel handed packets to, which performed the cryptography and handed the result back. Every packet therefore crossed the boundary between kernel and program twice, and that boundary is not free. It costs a context switch and a copy in each direction, paid again for every packet, in both directions, forever.
WireGuard was written as kernel code, so on a Linux host the packet never makes that trip. Encryption happens on the path the packet is already travelling, with no copy out to a separate program and no copy back. What that buys is CPU time per packet rather than a headline speed figure, and spending less of it is the unglamorous reason the protocol tends to feel light rather than merely quick.
The caveat deserves stating plainly, because it is usually glossed over. Apple does not let an app install kernel code, so on iPhone, iPad and Mac the tunnel runs inside a Network Extension, a separate system-provided process, and the packets do cross a process boundary after all. Android goes through VpnService, using the in-kernel implementation where the device's kernel has one and a userspace implementation where it does not. The architectural saving is therefore largest on a Linux machine with the module available and smaller everywhere else. The protocol, the handshake and the key handling are identical in every case, which is why a phone and a server interoperate without either one knowing which implementation the other is running.
Small enough that one person can read it
The security argument usually made for WireGuard is not that its mathematics is exotic. The primitives it uses are well known and widely deployed elsewhere. The argument is about volume: the project puts its core implementation at a few thousand lines, against the hundreds of thousands reached by older tunnelling stacks once their options, legacy modes and configuration machinery are counted. Those are the project's own figures and the exact count depends on what you agree to include, but the order of magnitude is not seriously disputed.
That gap is not an aesthetic preference. Bugs hide in code nobody has read, and nobody reads a hundred thousand lines carefully. A few thousand lines is a weekend for an experienced reviewer, which means the code can be examined by people outside the project rather than trusted on reputation. Reviewability is the property being claimed, and it is worth stating precisely, because it is a more modest claim than it sounds: code that is easier to check is not the same as code proven correct.
It is also worth knowing where the smallness comes from. It is not cleverness, it is subtraction. Every option the protocol declines to offer is code that does not exist, and code that does not exist cannot be wrong, misconfigured or exploited.
One round trip, and nothing to reconnect to
Bringing a tunnel up means two machines agreeing on keys. WireGuard does it in a single round trip, using a fixed handshake pattern borrowed from the Noise framework: your device sends a 148-byte initiation message, the far end answers with 92 bytes, and your side can send real traffic the moment that answer lands, because the answer is itself the proof that the handshake worked. There is no separate phase for agreeing on algorithms and no certificate chain to validate, which is the direct reason connecting feels instantaneous rather than like something you wait for.
One detail the short version leaves out: the far end is not allowed to send data first. It has to wait until it has received an authenticated data packet from the side that started the handshake, which is what confirms the new keys are genuinely in use rather than replayed from an older conversation. In practice your device always has something to send, so the wait is invisible. It is, however, the reason a server cannot nudge a device that has gone silent and moved: until the device speaks, the far end has nowhere to speak to.
After that, the tunnel is not a connection in the way a phone call is a connection. There is no session held open and nothing to tear down. Each side holds current keys for the other and sends UDP packets when it has something to send; when nothing is being sent, nothing travels. Keys are then replaced on a timer rather than on request: after roughly two minutes of use a fresh handshake runs in the background while the existing keys are still valid, keys older than about three minutes are refused outright, and an initiation that gets no answer is simply retried every few seconds. Rotation is invisible, and a stale key cannot be used indefinitely.
Roaming, idle tunnels, and unanswered scans
Silence has one practical cost. Because an idle tunnel really does send nothing, a home router or mobile carrier can forget the address mapping it was holding for you, and an incoming packet then has nowhere to land. The protocol's answer is an optional keepalive: a peer can be told to send one small authenticated packet every 25 seconds, which costs almost nothing and holds the path open. It is a configuration setting rather than part of the handshake, and it is the only case in which a WireGuard tunnel sends traffic nobody asked it for.
Roaming falls out of all this rather than being bolted on, which is why a phone that moves from Wi-Fi to cellular resumes instead of reconnecting. When the network changes your public address and port change, but your key does not. The first authenticated packet arriving at the far end from the new address is enough: the recorded endpoint for that key is updated and the tunnel carries on where it left off, with nothing renegotiated, because there was never a negotiation to repeat. Two qualifications keep that honest. Your device has to send that first packet, so the far end learns the new address from you rather than noticing by itself, and if the phone slept long enough for the keys to age out, a fresh handshake runs — still one exchange, not a reconnection sequence.
A related consequence is how an endpoint treats traffic it cannot verify: it ignores it. Every handshake message carries an authentication code computed with the recipient's public key, and anything failing that check is dropped with no reply at all, so a listener does not answer a scan that does not already know what it is looking for. Under enough load to care, it still declines to trust the sender's return address: instead of doing the expensive cryptography it replies with a cookie the sender must echo back, which proves the address is really theirs before any real work is spent on them.
Two philosophies of tunnel design
The generation of tunnelling protocols that came before WireGuard were built to accommodate. They were standardised by committee, had to work between equipment from vendors who disagreed with each other, and had to keep working as cryptography advanced over decades. The sensible answer in that world is negotiation: both ends arrive with a list of ciphers, authentication methods and modes they support, and they talk until they find something in common.
Negotiation solves a genuine problem and creates its own. A protocol that can agree on anything must be able to agree on something weak, and an attacker able to influence that conversation may be able to steer it toward the feeblest option both ends will still accept, a class of problem known as downgrade. The negotiation itself also has to be specified, implemented, configured and understood, which means more code, more decisions handed to whoever deploys it, and more ways for a tunnel to be technically up while being set up badly.
WireGuard takes the opposite position: there is no negotiation, because there is nothing to negotiate. Curve25519 for key agreement, ChaCha20 with Poly1305 for encryption and authentication, BLAKE2s for hashing, fixed for everybody. Downgrade is not defended against so much as absent, since the protocol contains no weaker alternative to be steered toward and no cipher choice for an administrator to get wrong.
The cost is real and the project is open about it. If one of those primitives ever needs replacing, you do not renegotiate, you ship a new version of the protocol and both ends move to it. Flexibility is pushed out of the handshake and into versioning, which is slower and more disruptive when that day comes. The bet is that one well-chosen way of working, replaced wholesale when it must be, goes wrong less often than a protocol that can be talked into a bad state on an ordinary Tuesday.
Three constraints that come with those choices
A design this decided has edges, and knowing where they are saves an afternoon when something behaves oddly. The first is transport. WireGuard is UDP, and only UDP: there is no TCP mode in the protocol, partly because carrying a reliable stream inside another reliable stream makes both of them worse under loss. A network that forwards only TCP therefore cannot carry the handshake at all, and the failure is quiet from your side — the initiation goes out, nothing comes back, and there is no error to read, because an error would have to come from the far end that never heard you.
The second is packet size. Wrapping a packet costs 60 bytes of header and authentication tag on an IPv4 path and 80 on IPv6, so the tunnel interface has to advertise a smaller maximum packet size than the network underneath it, and 1420 bytes is the common default. Where the real path is smaller still, which happens on some mobile networks and on anything adding another layer of encapsulation, you get a recognisable signature: short requests succeed, pages load halfway, and large transfers stall rather than fail. Lowering the tunnel's MTU is the fix, and nothing else looks wrong while it is happening.
The third is that the private key on a device is the entirety of that device's identity. There is no password to rotate and no second factor inside the protocol; whoever holds the key is that peer, for as long as the far end keeps listing it. That is why the key pair should be generated on the device and the private half should never leave it, and why revoking access is work for the service around the protocol — removing a peer from the far end's list — rather than anything the protocol does by itself.
- UDP only. No TCP fallback exists to be enabled, so a network that drops UDP drops the handshake with it.
- 60 bytes of overhead over IPv4, 80 over IPv6, hence a tunnel MTU near 1420 and stalled large transfers when the path underneath is smaller.
- The device's private key is its credential. Generated locally, never transmitted, and withdrawn by removing the peer at the other end.
What WireGuard leaves to the software around it
WireGuard is deliberately incomplete. It authenticates and moves packets between keys it has already been told about, and it stops there. Everything needed to turn that into something a person can actually use is someone else's job, and those jobs are worth naming, because they are where one provider differs from another in ways the protocol cannot.
- Identity. The protocol knows public keys, not people. Deciding that a key belongs to your account, and that the account is entitled to connect, happens entirely outside it.
- Key distribution. A key pair has to be generated on the device and the public half has to reach the server without anyone being able to substitute their own. That exchange is designed by the provider.
- Addressing and name resolution. Which internal address your device receives, and which resolver it is told to use, are configuration handed to the interface. WireGuard carries DNS queries like any other packet and has no opinion about them.
- Filtering. Blocking ads and trackers is not a tunnel feature. In WrapVPN it happens during name resolution, so a lookup for a known tracker host is refused before the device opens any connection to it, a decision made in the resolver rather than in the protocol.
- Lifecycle. Reconnecting after a reboot, offering a region list with live latency so you can pick the fastest, and stopping cleanly when a subscription ends are all app-layer work.
Where the protocol's promise ends
One boundary is worth stating precisely, because WireGuard is often credited with more than it claims. It secures the hop between your device and the peer at the far end, and that is the whole of its promise: on the network you are sitting on, the contents and destinations of your packets are unreadable, and nothing can be injected into the tunnel without the key. That is a real guarantee and it is the one most people actually want on a shared network.
What happens to a packet after it leaves that far end and continues to the open internet is not a protocol question at all. The cryptography has finished by then. Whether traffic is recorded, what is kept, for how long and under what circumstances are properties of whoever runs the server, and no amount of reading the specification will tell you. The protocol is a floor you can verify rather than an answer to that question.
The useful way to read this is as a division of labour. Judge the protocol on what it is: a small, fixed, reviewable design with no negotiation to go wrong. Judge the app on whether it generates keys on the device, keeps the private half there, reconnects reliably and gets out of the way. Judge the service on how it is run and what it commits to in writing. WireGuard settles the first of those three and is silent on the other two, and a page that tells you otherwise is selling a protocol as if it were a provider.
What it costs
Short plans, priced so a week costs what a week is worth. Cancel by not renewing.
$1.99per week
$3.99per month
No annual subscription. No long-term commitment.
7-day free trial
See all plansCommon questions
Is WireGuard more secure than older VPN protocols?
Its security argument is reviewability plus the absence of options: a few thousand lines of code and one fixed modern cipher suite leave far less room for a weak configuration or a downgrade. That is a narrower claim than it sounds, because it describes the protocol only. How keys reach the server, and how the service at the far end is run, are decided by the software and the provider around it.
Why does a WireGuard tunnel come up so quickly?
Because the handshake is one round trip and there is nothing to negotiate. Your device sends a single short message, the far end answers, and your side can send traffic the moment that answer arrives, with no cipher agreement or certificate chain in between. Where the in-kernel implementation is available, the packets are also encrypted without being copied out to a separate program and back.
Does the tunnel survive moving from Wi-Fi to mobile data?
Yes, and that falls out of the design rather than being bolted on. A peer is identified by its key, not its address, so when your phone's IP changes the first authenticated packet from the new address updates the far end's record and the tunnel continues. Your device has to send that packet, and if the keys have aged out meanwhile there is one fresh handshake, which is still a single exchange.
Does WireGuard work over TCP, or on a network that blocks UDP?
No. The protocol is UDP only and has no TCP mode to switch on, so a network that forwards nothing but TCP cannot carry even the first handshake message. The symptom is a connection attempt that produces no error, because there is no reply: your device sends the initiation and nothing comes back. A second network, such as mobile data, is the quickest way to tell that apart from a problem with the app.
Why would large downloads stall while small pages load fine?
That pattern is almost always packet size rather than the tunnel. Wrapping a packet adds 60 bytes over IPv4 and 80 over IPv6, so the tunnel advertises a smaller maximum packet size, usually around 1420 bytes. If the path underneath is smaller still, oversized packets are dropped silently: short requests get through, big transfers stop partway. Lowering the tunnel MTU resolves it.
Can I use WireGuard without installing anything?
No. It works at the network layer, so it needs a real interface on the device, which means either support built into the operating system or an app that provides it. There is no browser-only version, because a browser cannot route the rest of the system's packets through a tunnel.
What does WireGuard deliberately not do?
It does not manage identities, distribute keys, assign addresses, resolve names, filter anything, or know what a subscription is, and it makes no promise about what happens to traffic once it leaves the far end. It authenticates and moves packets between peers whose public keys it already holds. Everything else you associate with a VPN app is built on top of that, by the app and the service.
Do I need to understand any of this to use WrapVPN?
Not at all. The app generates the keys, applies the configuration and shows live latency per region, so connecting is one tap on iPhone, iPad, Mac or Android. It is worth knowing there is no long contract wrapped around the protocol either: WrapVPN is $1.99 per week or $3.99 per month, with a 7-day free trial on the monthly plan and no annual subscription.
Get WrapVPN
One account covers your phone, tablet and computer. Connect in a tap, from any of our regions.
Keep reading
Closely related pages, chosen because they answer the question this one raises next.
Guide
How to set up a VPN on iPhone
Set up a VPN on iPhone in a few minutes: the iOS permission prompt, where the configuration lives in Settings, the status-bar badge, and the two usual failures.
Location
VPN servers in Germany: the Frankfurt exit
WrapVPN's German region exits in Frankfurt, beside DE-CIX. What a German IP changes on screen, the route distances behind the latency, and what the exit sees.
Guide
Blocking ads and trackers at the DNS layer
Why declining a name lookup stops an ad before it is requested, what hostname filtering genuinely cannot do, and why it reaches apps no browser extension can see.
Guide
Do you need a VPN on an iPhone?
iOS already handles much of what VPN adverts warn about. What a tunnel still changes on an iPhone, who genuinely benefits, and who should not bother buying one.