VPN WireGuard included in the Linux kernel 5.6

Today, Linus has merged the net-next branch with VPN interfaces. WireGuardThis event is reported informed in the WireGuard mailing list.

VPN WireGuard included in the Linux kernel 5.6

Currently, the code for the new Linux kernel 5.6 is being collected. WireGuard is a fast next-generation VPN that implements modern cryptography. It was initially developed as a simpler and more user-friendly alternative to existing VPNs. Its author is Canadian information security specialist Jason Donenfeld. In August 2018, WireGuard gained praise from Linus Torvalds. Around the same time, work began to include the VPN in the Linux kernel. The process took a bit longer than expected.

"I see that Jason has made a pull request to include WireGuard in the kernel," Linus wrote on August 2, 2018. "Can I just once again state my love for this VPN and hope for a quick merge? The code may not be perfect, but I’ve looked it over, and compared to the horrors of OpenVPN and IPSec, it's a true work of art."

Despite Linus’s wishes, the merge was delayed for a year and a half. The main issue was the reliance on proprietary implementations of cryptographic functions that were used for performance improvements. After lengthy negotiations, in September 2019, a compromise was reached to port the patches to the existing kernel’s Crypto API functions, to which WireGuard developers had performance and overall security concerns. However, it was decided to set apart the native crypto functions of WireGuard in a separate low-level Zinc API and gradually port them to the kernel. In November, kernel developers kept their promise and agreed to transfer part of the code from Zinc into the main kernel. For instance, in Crypto API, includes the fast implementations of ChaCha20 and Poly1305 algorithms prepared in WireGuard.

Eventually, on December 9, 2019, David Miller, responsible for the networking subsystem of the Linux kernel, accepted into the net-next branch patches merged the VPN interface from the WireGuard project.

And today, on January 29, 2020, the changes were sent to Linus for inclusion in the kernel.

VPN WireGuard included in the Linux kernel 5.6

The stated advantages of WireGuard over other VPN solutions are:

  • Easy to use.
  • Uses modern cryptography: Noise protocol framework, Curve25519, ChaCha20, Poly1305, BLAKE2, SipHash24, HKDF, etc.
  • Compact, readable code, easier to audit for vulnerabilities.
  • High performance.
  • Clear and well-designed specification.

The entire core logic of WireGuard comprises less than 4000 lines of code, while OpenVPN and IPSec consist of hundreds of thousands of lines.

WireGuard employs a concept of routing based on encryption keys, which involves binding a private key to each network interface and using it to link public keys. The exchange of public keys to establish a connection is similar to SSH. The Noise_IK mechanism is used for key agreement and connection without launching a separate user-space daemon. Noise Protocol Framework, similar to maintaining authorized_keys in SSH. Data transmission is accomplished through encapsulation in UDP packets. It supports changing the IP address of the VPN server (roaming) without disconnecting, with automatic client reconfiguration. writes Opennet.

For encryption a layer the stream cipher ChaCha20 and the message authentication algorithm (MAC) Poly1305., developed by Daniel Bernstein (Daniel J. Bernstein), Tanja Lange and Peter Schwabe. ChaCha20 and Poly1305 are positioned as faster and safer alternatives to AES-256-CTR and HMAC, the software implementation of which achieves consistent execution time without requiring special hardware support. The Diffie-Hellman protocol on elliptic curves is used to generate a shared secret key in implementation Curve25519, also proposed by Daniel Bernstein. The hashing algorithm used is BLAKE2s (RFC7693)».

Results performance tests from the official website:

Throughput (megabits/s)
VPN WireGuard included in the Linux kernel 5.6

Ping (ms)
VPN WireGuard included in the Linux kernel 5.6

Test configuration:

  • Intel Core i7-3820QM and Intel Core i7-5200U
  • Gigabit Intel 82579LM and Intel I218LM cards
  • Linux 4.6.1
  • WireGuard configuration: 256-bit ChaCha20 with Poly1305 for MAC
  • First IPsec configuration: 256-bit ChaCha20 with Poly1305 for MAC
  • Second IPsec configuration: AES-256-GCM-128 (with AES-NI)
  • OpenVPN configuration: equivalent cipher suite of 256-bit AES with HMAC-SHA2-256, UDP mode
  • Performance was measured using iperf3, showing the average result over 30 minutes.

Theoretically, after integration into the network stack, WireGuard should work even faster. However, in reality, this may not necessarily be the case due to the transition to kernel-integrated cryptographic functions of Crypto API. It is possible that not all of them are yet optimized to the performance level of native WireGuard.

"From my perspective, WireGuard is perfect for the user. All low-level decisions are made in the specification, so the process of preparing a typical VPN infrastructure takes only a few minutes. It's practically impossible to mess up the configuration," reported as noted on Habr in 2018. "The installation process detailed description on the official site, I want to particularly highlight the excellent support for OpenWRTThis level of ease of use and the compactness of the codebase have been achieved by eliminating the distribution of keys. There is no complicated certificate system or all that corporate horror; short encryption keys are distributed much like SSH keys.

The WireGuard project has been in development since 2015, and it has undergone an audit and formal verification. WireGuard support is integrated into NetworkManager and systemd, and kernel patches are included in the base distributions of Debian Unstable, Mageia, Alpine, Arch, Gentoo, OpenWrt, NixOS, Subgraph, and ALT.

Source: habr.com

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster