WireGuard for Windows now uses high speed kernel implementation
twitter.com
twitter.com
I am curious (though happy) about their focus on performance. For most security projects, the specification seems to be 'sufficient' performance and beyond that they invest their limited resources elsewhere. The WireGuard team seems to make it a top priority.
Maybe this upgrade was needed to be 'sufficient'? Maybe they see performance as key to adoption? Or maybe they have other reasons. I could see how WireGuard's significant reduction in complexity, compared to other VPN software, could feed performance.
It's hard to imagine the Internet without WireGuard, without a VPN I have confidence in. Thank you Jason and team!
A big part of the WireGuard project since the beginning has been trying to figure out how to do high security tunneling that also performs acceptably. It's easy to do one without the other, but doing them both together has meant thinking about a lot of fundamentals, from the protocol state machines on up. It's hard to do tunneling in the kernel at high speed while still maintaining a strong security posture. That's a principal challenge the project endeavors to solve.
More generally, it's worth noting that cryptographers also care about performance quite a bit in things like symmetric crypto. We know well how to make a good cipher now, but making one that also performs at increasingly high speeds remains an open area of research, with whole conferences, such as FSE, devoted to it.
Legacy VPN protocols fare terribly against WireGuard on what should be the most important concern, of design and implementation security. But the reasons why are, though obvious to people with domain expertise, subtle enough that you can't mic-drop them in a conversation and expect to overcome the standard "but it's standard" objection in favor of IPSEC.
Performance has been a potent tool of persuasion for WireGuard. I've convinced people based on WireGuard speed that I don't think I could have persuaded based on security.
If the goal is getting people off fetid 1990s-grade cryptography and C code, WireGuard's performance is an indirect force towards that goal. It was smart to focus on it, because people obviously care a lot about it. It's great to see a security project where simplicity and performance line up with improved security.
Oh dear me, getting IPSEC to work did not win it any admiration from me. Of course, what I was doing with it would have been better served by TLS with server and client certificates, but the other end were telcos so sure, I can setup IPSEC and cry myself to sleep.
I wonder if we shouldn't standardize something very similar to wireguard as a general successor of ipsec.
Something like wireguard + iana/ietf considerations.
I was just thinking that it'd be nice to have something a-la wireguard standardized.
I am already using it for production purposes where both endpoints are Linux, though.
With regards to the WireGuard for Windows client, though, whether we'll put the time in to develop such a WFP driver and integrate it there I guess is still up in the air, like many feature wishlist items are.
It's also arguably more difficult to do a given task in the kernel than in userland, code for the kernel is much more security-sensitive and even subtle bugs can be detrimental to overall system performance (or even exploitable).
Best thing would be to fix the OS instead of piling up kludges.
https://arstechnica.com/gadgets/2020/03/wireguard-vpn-makes-...
https://www.freebsd.org/cgi/man.cgi?query=ipsec&sektion=4&fo...
By mapping the same buffer into both processes, or moving it from one process to the other, depending on security needs. Mapping the buffer into multiple memory spaces is how a kernel VPN driver would accomplish the same thing.
> as little context switching as the design allows
A raw context switch only costs 20 nanoseconds for a round trip. And it's only a few more to save the normal registers. The rest is up to kernel design. So it sure sounds like it's the kernel's fault if putting tasks like that outside the kernel is too expensive. Especially since one context switch can process as many packets as you want.
Flushing TLBs. Flushing caches. Etc etc.
Fixing that is the point of, for example, io_uring in Linux. I don't know if Windows has an equivalent. Perhaps not, thus a kernel driver. But there is nothing mysterious about solving that problem.
* Dynamic loading of drivers is no longer an issue, the kernel already knows how to dynamically load processes anyway and a driver is just another proces. No need for special 'kernel maintainers' for drivers, or for drivers to be open source (in case of the Linux kernel).
* Much better system stability, since drivers can do no harm. Kernel architecture can be simpler too.
* Much simpler drivers. Instead of strict cooperation rules the kernel can just pre-empt them when needed.
Unfortunately it appears there is no credible effort in developing a mainstream microkernel OS at this time. Nonetheless, the few I've worked with in the past were amazing and I'd love to see this idea come back.
So microkernels are dead, performance buries them deeper and deeper.
Most of the time I forget i'm even using wiregaurd until I hit a site that blocks non-consumer IPs, which I think says a lot for just how performant it is - More than simply not slowing down the connection much, it's actually improved reliability considerably for me since I started using it a couple of years ago, in some cases throughput is also improved due to better routing.
It's also made a huge difference to the stability of my SSH connections, making my day to day work a lot more pleasant. Before, SSH connections would arbitrarily drop due to carrier grade NATing ignoring TCP keep alive rules... it's almost impossible to find a consumer ISP these days that doesn't drop idle SSH connections like rocks. With wiregaurd I can keep them alive even while I change connections! my tmux use has dropped to when I actually need to multiplex.
Well, if people adopt WireGuard because it's really fast, they'll also end up with a relatively secure VPN. Together, it's really compelling.
Actually, I think in the beginning there was even a "marketing chart" with throughput numbers in addition to the chart with lines-of-code numbers?
Edit: performance being a top priority also makes sense strategically: if you want people to use secure software en-masse, then the experience needs to be stellar in UX and performance as well.
That's my impression too. Nothing wrong with it, but I wonder what their thinking is.
I think this impression is basically mistaken, but I'd love to hear about any examples you have in mind.
An example? Signal. I love it but performance isn't more than sufficient IME. I'm glad Moxie and crew are spending their time inventing new security technology for the world.
Wireguard on Linux is simply amazing, been using it for the last year plus to link all of my devices in a single tunneled LAN, it's been a blast (I can access any of my devices from any of my devices, wherever I or they may be physically located).
I do keep one windoze box because I occasionally need to run things that refuse to run on anything but that, and I recently installed wireguard on it ... was expecting headaches ... what do you know, it worked right out of the box, and I can actually securely ssh into the Redmond-spawned contraption from any of my other devices, including my android phone.
Wireguard FTW.
Maybe another way to describe it is: Hollywood ("show business" as a whole, but it leaks into popular media in many ways, thus popular [anything]) has a huge presence in both positive and negative ways.
As usual in idioms, context is extremely important / often more important than the words themselves. "Show business" is a reference to a highly visible and influential segment of [a population], though often devoid of analysis beyond that point.
American culture for the past 40 years. Seriously, this is a common idiom.
* i'll add that whare i am 'the hardest working folks in show business', is often a compliment: we have our backstage (offices etc), and front of house (dealing with customers) where we have our smiley faces plastered on.
- Last I checked, dynamic server IPs were not supported
- It's system wide by default. With all VPNs, it is relatively difficult to say: use this connection for these applications, or these addresses. Popular VPN apps have per-app-settings, but I find them buggy and not trustworthy. And if you are an expert you can set your own routing of course. But it would be great if you could just right click on a titlebar and say "use VPN for this app", and it was integrated with the OS
- There is no obfuscation for hostile environments. I would like a VPN which has pluggable transports, and can, say, look like ssh or http or a game, and route over 20 random servers. I know of shadowsocks etc., but I could never get it to run.
- There is no integration with Windows login AFAIK. If you want to log into a Windows AD domain, you need to be in the VPN, but you can't establish connection when you are not logged in. This is really annoying. There is a capability in Windows for this, but I never found a VPN where it works properly.
So technically WireGuard is great, security and speed wise, but for me the potential VPN killer application would be defined by superior UX, not by tech.
WireGuard encrypted UDP packets have obvious signature due to the packet type field in the header being in cleartext. DPI can easily filter/drop WG traffic just by checking the first few bytes of each UDP packet and doing simple statistics.
To obfuscate in this context means to morph WireGuard encrypted UDP packets to look like something else (e.g. VoIP traffic).
Current kernel-based official WireGuard implementations leave no possibility of doing so while staying in-kernel.
But OK, this doesn't cover the second need, I'm guessing what you need is down one layer, and should be done in kernel if you really think it important, but how does wg prevent you from doing that?
Build your tunnel obfuscator one layer down (I did some stateful, user-land driven, packet patching not long ago, with ebpf, it is not easy but the tooling is getting better. It seems the new way to do things nowadays anyway... And it runs in-kernel. Then lay wg above it. But having the wg codebase do what in fact the kernel should propose (pluggable transports, etc.) seems... asking the wrong team.
The Linux kernel network stack is already plenty composable without ebpf...
you can specify a domain name to connect (so can use a dyndns service)
>it is relatively difficult to say: use this connection for these addresses
you can specify addresses that will go through wireguard. For example: AllowedIPs = 192.168.1.0/24,
I just point my peers at wg.<mydomain>.tld and i'm set! This effectively costs just the registration fee annually (about $7 on cloudflare currently) but could also be done with a free service like no-ip or similar.
To be pedantic, shadowsocks is a proxy not a VPN but it does what you describe very well, and anecdotally it is better at circumventing the great firewall than wireguard(with its predictable signature it's quickly blocked). Granted I'm not in China anymore and you probably aren't there either, so both wireguard and shadowsocks work really well, but you might want to consider using a proxy over a VPN. If you've had trouble installing SS before, I recommend the streisand ansible script. Connect it to a VPS and it'll install wireguard, shadowsocks with V2ray plugin pointing to github for obfuscation, TOR, OpenVPN and more all at once.
https://github.com/StreisandEffect/streisand
If you're an iOS user and have multiple shadowsocks server, the shadowrocket app makes it very easy to make rulesets that look like so(don't worry there's a UI for it):
https://raw.githubusercontent.com/a00789123/rules-bak/main/S...
You can get specific like "BBC traffic goes through my london proxy, leave netflix un-proxied, twitter traffic goes through germany, etc."
I also do the opposite of VPNing, where I use home PC as a server too so that when I'm traveling I don't get flagged with anti-fraud stuff when I want to check my bank apps and I can watch American Netflix without every worrying about it being blocked.
edit: looks like streisand got archived at the same time as Ubuntu 16.04 got EOL'd. I didnt know because some of my instances have run for years. You can read the discussions on github for some alternative projects.
I appreciate WireGuard is designed for simplicity but I don't see how it can scale with this limitation.
In the end most everyone who uses git puts up with the slowly improving 'mainline' porcelain and all the replacements never go anywhere.
In particular, I imagine it was important for initial adoption to create the android/ios apps but it really feels like now we're stuck with the kind of clunky (super easy for the user, but super hard to get right for the admin of the network imo) flow they created.
This works with Cisco AnyConnect and Palo Alto GlobalProtect (I've seen it work). Those products are pretty terrible, but that one thing works.
Quite easy to use
In the end I switched to IPsec which solved Windows performance issues. These times wireguard seems like a perfect solution, because IPsec configuration with various clients takes too much time.
But now all the procols are encrypted (SMB3, RDP, etc). Combine that with an IP while list auto applied to each machine's firewall and I don't think you really need a VPN anymore between your own machines. I only use VPNs for torrents now.
wtf? I can easily get 200 Mb/s on windows, on a commercial VPN provider.
* socket-buffer size too small (fixed now)
* default fragmentation handling is sub-optimal (needs mssfix)
* sheduling priority of the openvpn process too lowhttps://lists.zx2c4.com/pipermail/wireguard/2020-December/00...
Weirdly it isn't GPU bound at all, my GPU is basically idling the entire time.
Best improvement to pair with the best VPN protocol
ChaCha20 for symmetric encryption, authenticated with Poly1305, using RFC7539's AEAD construction Curve25519 for ECDH BLAKE2s for hashing and keyed hashing, described in RFC7693 SipHash24 for hashtable keys HKDF for key derivation, as described in RFC5869
- https://patchwork.kernel.org/project/linux-crypto/cover/2018...
- https://patchwork.kernel.org/project/linux-crypto/patch/2018...
- https://patchwork.kernel.org/project/linux-crypto/patch/2019...
And yes, Wintun beats the pants of OpenVPN's TAP driver, but the kernel implementation is even faster yet.