Software:WireGuard

From HandWiki
Revision as of 16:23, 9 February 2024 by MainAI (talk | contribs) (linkage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Free and open-source VPN protocol
WireGuard
The WireGuard logo
Original author(s)Jason A. Donenfeld
Developer(s)Jason A. Donenfeld
Initial release2015; 9 years ago (2015)[1]
Written inC (Linux, FreeBSD kernel modules, NetBSD, OpenBSD kernel drivers, Windows kernel drivers), Go (userspace implementation)
Operating system
TypeVirtual private network
Licensevarious free and open-source
Website{{{1}}}

WireGuard is a communication protocol and free and open-source software that implements encrypted virtual private networks (VPNs), and was designed with the goals of ease of use, high speed performance, and low attack surface.[4] It aims for better performance and more power than IPsec and OpenVPN, two common tunneling protocols.[5] The WireGuard protocol passes traffic over UDP.[6]

In March 2020, the Linux version of the software reached a stable production release and was incorporated into the Linux 5.6 kernel, and backported to earlier Linux kernels in some Linux distributions.[3] The Linux kernel components are licensed under the GNU General Public License (GPL) version 2; other implementations are under GPLv2 or other free/open-source licenses.[4]

The name WireGuard is a registered trademark of Jason A. Donenfeld.[4]

Protocol

WireGuard uses the following:[7]

In May 2019, researchers from INRIA published a machine-checked proof of the WireGuard protocol, produced using the CryptoVerif proof assistant.[8]

Optional Pre-shared Symmetric Key Mode

WireGuard supports pre-shared symmetric key mode, which provides an additional layer of symmetric encryption to mitigate future advances in quantum computing. This addresses the risk that traffic may be stored until quantum computers are capable of breaking Curve25519, at which point traffic could be decrypted. Pre-shared keys are "usually troublesome from a key management perspective and might be more likely stolen", but in the shorter term, if the symmetric key is compromised, the Curve25519 keys still provide more than sufficient protection.[9]

Networking

WireGuard uses only[10] UDP,[4] due to the potential disadvantages of TCP-over-TCP.[10][11][12] Tunneling TCP over a TCP-based connection is known as "TCP-over-TCP", and doing so can induce a dramatic loss in transmission performance (a problem known as "TCP meltdown"). TCP meltdown occurs when a TCP connection is stacked on top of another. The underlying layer may detect a problem and attempt to compensate, and the layer above it then overcompensates because of that, and this overcompensation causes said delays and degraded transmission performance.

WireGuard fully supports IPv6, both inside and outside of tunnel. It supports only layer 3 for both IPv4 and IPv6 and can encapsulate v4-in-v6 and vice versa.[13]

MTU overhead

The overhead of WireGuard breaks down as follows:[14]

  • 20-byte IPv4 header or 40 bytes IPv6 header
  • 8-byte UDP header
  • 4-byte type
  • 4-byte key index
  • 8-byte nonce
  • N-byte encrypted data
  • 16-byte authentication tag
MTU Operational considerations

If we assume the underlay network that is transporting the WireGuard packets to be 1500 bytes MTU, then we would want to configure the WireGuard interface MTU to 1420 bytes (for all the peers involved) if we intend to carry IPv6 + IPv4 traffic. However, if we carry legacy IPv4-only traffic, we can get away with a higher MTU for the WireGuard interface at 1440 bytes.[14]

It would be optimal from an operational standpoint and network configuration consistency, however, if we opted to just configure 1420 network (peer)-wide for the WireGuard interfaces, in the event we eventually wanted to enable IPv6 for the WireGuard peers and interfaces.

Caveat

There may be situations where, for instance, a peer is behind a network with 1500 bytes MTU, and a second peer is behind a wireless network such as an LTE network, where often times, the carrier opted to use an MTU that is far lower than 1420 bytes — In such cases, the underlying IP networking stack of the host will fragment the UDP encapsulated packet and send the packets through, the packets inside the tunnel however will remain consistent and will not be required to fragment as PMTUD will detect the MTU between the peers (in this example, that would be 1420 bytes) and send a fixed packet size between the peers.

Extensibility

WireGuard is designed to be extended by third-party programmes and scripts. This has been used to augment WireGuard with various features including more user-friendly management interfaces (including easier setting up of keys), logging, dynamic firewall updates, dynamic IP assignment,[15] and LDAP integration.[citation needed]

Excluding such complex features from the minimal core codebase improves its stability and security. For ensuring security, WireGuard restricts the options for implementing cryptographic controls, limits the choices for key exchange processes, and maps algorithms[7] to a small subset of modern cryptographic primitives. If a flaw is found in any of the primitives, a new version can be released that resolves the issue.

Reception

A review by Ars Technica found that WireGuard was easy to set up and use, used strong ciphers, and had a minimal codebase that provided for a small attack surface.[16]

WireGuard has received funding from the Open Technology Fund.[17] and donations from Mullvad, Private Internet Access, IVPN, the NLnet Foundation[18] and OVPN.[19]

Oregon senator Ron Wyden has recommended to the National Institute of Standards and Technology (NIST) that they evaluate WireGuard as a replacement for existing technologies.[20]

Availability

Implementations

Implementations of the WireGuard protocol include:

  • Donenfeld's initial implementation, written in C and Go.[21]
  • Cloudflare's BoringTun, a user space implementation written in Rust.[22][23]
  • Matt Dunwoodie's implementation for OpenBSD, written in C.[24]
  • Ryota Ozaki's wg(4) implementation, for NetBSD, is written in C.[25]
  • The FreeBSD implementation is written in C and shares most of the data path with the OpenBSD implementation.[26]
  • Native Windows kernel implementation named "wireguard-nt", since August 2021.[27]

History

Early snapshots of the code base exist from 30 June 2016.[28] Four early adopters of WireGuard were the VPN service providers Mullvad,[29] AzireVPN,[30] IVPN[31] and cryptostorm.[32]

On 9 December 2019, David Miller – primary maintainer of the Linux networking stack – accepted the WireGuard patches into the "net-next" maintainer tree, for inclusion in an upcoming kernel.[33][34][35]

On 28 January 2020, Linus Torvalds merged David Miller's net-next tree, and WireGuard entered the mainline Linux kernel tree.[36]

On 20 March 2020, Debian developers enabled the module build options for WireGuard in their kernel config for the Debian 11 version (testing).[37]

On 29 March 2020 WireGuard was incorporated into the Linux 5.6 release tree. The Windows version of the software remains at beta.[3]

On 30 March 2020, Android developers added native kernel support for WireGuard in their Generic Kernel Image.[38]

On 22 April 2020, NetworkManager developer Beniamino Galvani merged GUI support for WireGuard.[39]

On 12 May 2020, Matt Dunwoodie proposed patches for native kernel support of WireGuard in OpenBSD.[40]

On 22 June 2020, after the work of Matt Dunwoodie and Jason A. Donenfeld, WireGuard support was imported into OpenBSD.[41]

On 23 November 2020, Jason A. Donenfeld released an update of the Windows package improving installation, stability, ARM support, and enterprise features.[42]

On 29 November 2020, WireGuard support was imported into the FreeBSD 13 kernel.[26]

On 19 January 2021, WireGuard support was added for preview in pfSense Community Edition (CE) 2.5.0 development snapshots.[43]

In March 2021, kernel-mode WireGuard support was removed from FreeBSD 13.0, still in testing, after an urgent code cleanup in FreeBSD WireGuard could not be completed quickly.[44] FreeBSD-based pfSense Community Edition (CE) 2.5.0 and pfSense Plus 21.02 removed kernel-based WireGuard as well.[45]

In May 2021, WireGuard support was re-introduced back into pfSense CE and pfSense Plus development snapshots as an experimental package written by a member of the pfSense community, Christian McDonald. The WireGuard package for pfSense incorporates the ongoing kernel-mode WireGuard development work by Jason A. Donenfeld that was originally sponsored by Netgate.[46][47][48]

In June 2021, the official package repositories for both pfSense CE 2.5.2 and pfSense Plus 21.05 included the WireGuard package.[49]

See also

Notes

  1. Not all platforms may have a currently released version and some may be at beta.[needs update?]

References

  1. Grauer, Yael (2021-01-16). "How one hacker's push to secure the internet became a crucial part of Mac, Linux, and Windows operating systems". Business Insider. https://www.businessinsider.com/wireguard-jason-a-donenfeld-profile-secure-vpn-linux-mac-windows-2021-1. 
  2. "Installation". WireGuard. https://www.wireguard.com/install. 
  3. 3.0 3.1 3.2 Salter, Jim (30 March 2020). "WireGuard VPN makes it to 1.0.0—and into the next Linux kernel". https://arstechnica.com/gadgets/2020/03/wireguard-vpn-makes-it-to-1-0-0-and-into-the-next-linux-kernel/. 
  4. 4.0 4.1 4.2 4.3 "WireGuard: fast, modern, secure VPN tunnel". WireGuard. https://www.wireguard.com/. 
  5. Applied Cryptography and Network Security. Springer. 11 June 2018. ISBN 978-3-319-93387-0. https://books.google.com/books?id=UKJfDwAAQBAJ&pg=PA3. Retrieved 25 June 2018. 
  6. 6.0 6.1 Donenfeld, Jason A.. "Known Limitations - WireGuard" (in en). https://www.wireguard.com/known-limitations/. 
  7. 7.0 7.1 Donenfeld, Jason A.. "Protocol & Cryptography - WireGuard" (in en). https://www.wireguard.com/protocol/. 
  8. Lipp, Benjamin; Blanchet, Bruno; Bhargavan, Karthikeyan (2019), A Mechanised Cryptographic Proof of the WireGuard Virtual Private Network Protocol, Research Report RR-9269, Paris: Inria, p. 49, hal-02100345, https://hal.inria.fr/hal-02100345 
  9. Donenfeld, Jason (May 2, 2021). "WireGuard: Next Generation Kernel Network Tunnel". https://www.wireguard.com/papers/wireguard.pdf. 
  10. 10.0 10.1 Donenfeld, Jason A.. "Known Limitations - WireGuard" (in en). https://www.wireguard.com/known-limitations/. 
  11. Titz, Olaf (2001-04-23). "Why TCP Over TCP Is A Bad Idea". http://sites.inka.de/bigred/devel/tcp-tcp.html. 
  12. Honda, Osamu; Ohsaki, Hiroyuki; Imase, Makoto; Ishizuka, Mika; Murayama, Junichi (October 2005). "Understanding TCP over TCP: effects of TCP tunneling on end-to-end throughput and latency". in Atiquzzaman, Mohammed; Balandin, Sergey I. 6011. doi:10.1117/12.630496. Bibcode2005SPIE.6011..138H. 
  13. Donenfeld, Jason A.. "WireGuard: Next Generation Kernel Network Tunnel". https://www.wireguard.com/papers/wireguard.pdf. 
  14. 14.0 14.1 Donenfeld, Jason A. (December 11, 2017). "[WireGuard Header / MTU sizes for Wireguard"]. https://lists.zx2c4.com/pipermail/wireguard/2017-December/002201.html. 
  15. Wireguard Dynamic IP Configuration Tool, WireGuard, 2023-05-14, https://github.com/WireGuard/wg-dynamic/blob/20428bc5d6923d1531bf0b2409fe3f9a5538ecd4/docs/idea.md, retrieved 2023-05-14 
  16. Salter, Jim (26 August 2018). "WireGuard VPN review: A new type of VPN offers serious advantages". https://arstechnica.com/gadgets/2018/08/wireguard-vpn-review-fast-connections-amaze-but-windows-support-needs-to-happen. 
  17. "Building a more secure, accessible and resilient WireGuard VPN protocol.". https://www.opentech.fund/results/supported-projects/wireguard/. 
  18. "Donations". WireGuard. https://www.wireguard.com/donations/. 
  19. "OVPN donates to support WireGuard". 23 March 2020. https://www.ovpn.com/en/blog/ovpn-donates-to-support/. 
  20. "US Senator Recommends Open-Source WireGuard To NIST For Government VPN". Phoronix. 30 June 2018. https://www.phoronix.com/scan.php?page=news_item&px=WireGuard-Senator-Recommends. 
  21. Donenfeld, Jason (2019-06-07). "WireGuard: fast, modern, secure VPN tunnel". https://www.wireguard.com/#source-code. 
  22. Krasnov, Vlad (2018-12-18). "BoringTun, a userspace WireGuard implementation in Rust" (in en-US). https://blog.cloudflare.com/boringtun-userspace-wireguard-rust/. 
  23. "CloudFlare Launches "BoringTun" As Rust-Written WireGuard User-Space Implementation". https://www.phoronix.com/scan.php?page=news_item&px=CloudFlare-BoringTun-WireGuard. 
  24. Johansson, Janne (2020-06-21). "WireGuard imported into OpenBSD". https://undeadly.org/cgi?action=article;sid=20200622052207. 
  25. "wg(4) - NetBSD Manual Pages". 2020-08-20. https://man.netbsd.org/wg.4. 
  26. 26.0 26.1 "Import kernel WireGuard support". https://svnweb.freebsd.org/base?view=revision&revision=368163. 
  27. "WireGuardNT, a high-performance WireGuard implementation for the Windows kernel". 2021-08-02. https://lists.zx2c4.com/pipermail/wireguard/2021-August/006887.html. 
  28. "Index of /Monolithic-historical/". https://download.wireguard.com/monolithic-historical/. 
  29. Mason, John (13 February 2019). "Mullvad Review". https://thebestvpn.com/reviews/mullvad-vpn/. 
  30. Mason, John (19 February 2019). "AzireVPN Review". https://thebestvpn.com/reviews/azirevpn/. 
  31. Pestell, Nick (11 December 2018). "Introducing Wireguard". https://www.ivpn.net/blog/introducing-wireguard-fully-automated. 
  32. "WireGuard support added!". 5 April 2019. https://cryptostorm.is/blog/wireguard-support-added. 
  33. "e7096c131e5161fa3b8e52a650d7719d2857adfd - pub/scm/linux/kernel/git/davem/net-next - Git at Google". https://kernel.googlesource.com/pub/scm/linux/kernel/git/davem/net-next/+/e7096c131e5161fa3b8e52a650d7719d2857adfd. 
  34. "LKML: David Miller: Re: [PATCH net-next v2 net: WireGuard secure network tunnel"]. https://lkml.org/lkml/2019/12/8/257. 
  35. "[ANNOUNCE WireGuard merged to net-next, on its way to Linux 5.6"]. 9 January 2020. https://lists.zx2c4.com/pipermail/wireguard/2019-December/004704.html. 
  36. Torvalds, Linus. "index : kernel/git/torvalds/linux.git". Kernel.org. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bd2463ac7d7ec51d432f23bf0e893fb371a908cd. 
  37. "drivers/net: Enable WIREGUARD as module". 21 March 2020. https://salsa.debian.org/kernel-team/linux/-/commit/9d60411cee4c646fe5006dcd57a1709d0377aaa6. 
  38. "ANDROID: GKI: enable CONFIG_WIREGUARD". https://android.googlesource.com/kernel/common/+/99761f1eac33d14a4b1613ae4b7076f41cb2df94%5E%21. 
  39. "merge branch 'bg/wireguard' (d321d0df) · Commits · GNOME / network-manager-applet" (in en). 22 April 2020. https://gitlab.gnome.org/GNOME/network-manager-applet/-/commit/d321d0dffa4fd872f7b39b8ca108f377cd80a12d. 
  40. "WireGuard for OpenBSD Kernel Patches Posted". 12 May 2020. https://lists.zx2c4.com/pipermail/wireguard/2020-May/005427.html. 
  41. "add wg(4), an in kernel driver for WireGuard vpn communication". https://marc.info/?l=openbsd-cvs&m=159274150512676. 
  42. "[ANNOUNCE WireGuard for Windows 0.3: ARM support, enterprise features, & more"]. 23 November 2020. https://lists.zx2c4.com/pipermail/wireguard/2020-November/006075.html. 
  43. "WireGuard for pfSense Software". https://www.netgate.com/blog/wireguard-for-pfsense-software.html. 
  44. Anderson, Tim (2021-03-23). "FreeBSD 13.0 to ship without WireGuard support as dev steps in to fix 'grave issues' with initial implementation". The Register (Situation Publishing). https://www.theregister.com/2021/03/23/freebsd_130_no_wireguard/. 
  45. Thompson, Jim (2021-03-18). "WireGuard Removed from pfSense® CE and pfSense® Plus Software" (in en). Rubicon Communications. https://www.netgate.com/blog/wireguard-removed-from-pfsense-ce-and-pfsense-plus-software.html. 
  46. Long, Scott (2021-05-05). "pfSense: WireGuard returns as an Experimental Package" (in en). https://www.netgate.com/blog/pfsense-wireguard-returns-as-an-experimental-package.html. 
  47. Paxson, Audian (2021-01-19). "WireGuard for pfSense Software" (in en). https://www.netgate.com/blog/wireguard-for-pfsense-software.html. 
  48. "wireguard-freebsd - WireGuard implementation for the FreeBSD kernel". https://git.zx2c4.com/wireguard-freebsd/. 
  49. Pingle, Jim (2021-06-02). "pfSense Plus 21.05-RELEASE Now Available" (in en). https://www.netgate.com/blog/pfsense-plus-21-05-release-now-available.html.