In recent months, the army of VPN users has grown significantly. And we are not talking about those who like to bypass blocks and visit prohibited sites, but about those who use VPN for secure work (yes, remote work). This is a reason to take another look at the arsenal of available protocols and compare them from a security perspective.
To begin with — some general provisions about VPN. VPN usage scenarios can be different, the most popular ones being:- building a secure channel between two or more remote network segments (for example, between offices in Moscow and Nizhny Novgorod);
- connecting a remote worker to the corporate network (now almost every office worker knows about this);
- virtual location change using VPN Provider services (requires the least effort to set up, however, all your traffic will pass through someone else's server).
To implement these scenarios, there are various types of VPN protocols — for communication, for traffic encryption, and others. And based on a suitable protocol, you can "build" your solution. The two most well-known and widely used protocols are OpenVPN and IPSec, and relatively recently WireGuard appeared, causing some controversies. There are other alternatives, already outdated, but quite capable of solving certain tasks.
The advantage of one VPN protocol over another depends on a number of factors and usage conditions:
Devices — different devices support different protocols.
Network — if certain services are not available in your location, some protocols may not be suitable. For example, there are VPN Providers that work in China, whereas most existing providers are blocked.
Performance — some protocols have greater performance, especially on mobile devices. Others are more convenient for use in large networks.
Threat model — some protocols are less secure than others, so attackers can impact them differently.
So, we have finished with the general part, now let us move on to a detailed description and comparison of protocols.
PPTP
Point-to-Point Tunneling Protocol (PPTP) — one of the oldest VPN protocols still in use, originally developed by Microsoft.
PPTP uses two connections — one for control, another for data encapsulation. The first works using TCP, with server port 1723. The second works using the GRE protocol, which is a transport protocol (i.e., a replacement for TCP/UDP). This fact prevents clients behind NAT from establishing a connection with the server, as establishing a point-to-point connection is not possible for them by default. However, since the GRE protocol used by PPTP (namely enhanced GRE) has a Call ID header, routers performing NAT can identify and map GRE traffic going from the local network client to the external server and vice versa. This allows clients behind NAT to establish a point-to-point connection and use the GRE protocol. This technology is called VPN PassThrough. It is supported by a large amount of modern client network equipment.
PPTP is natively supported on all versions of Windows and most other operating systems. Despite relatively high speed, PPTP is not very reliable: after a connection break, it does not recover as quickly as, for example, OpenVPN.
Currently, PPTP is essentially obsolete and Microsoft recommends using other VPN solutions. We also do not recommend choosing PPTP if security and confidentiality are important to you.
Of course, if you just use VPN to unblock content, PPTP has a place, however, let us repeat: there are more secure options worth paying attention to.
SSTP
Secure Socket Tunneling Protocol (SSTP) — a proprietary product from Microsoft. Like PPTP, SSTP is not very widely used in the VPN industry, but unlike PPTP, it has no diagnosed serious security issues.
SSTP sends traffic over SSL via TCP port 443. This makes it useful for use in restricted network situations, for example, if you need a VPN for China. Despite the fact that SSTP is also available on Linux, RouterOS and SEIL, for the most part it is still used by Windows systems.
From a performance perspective, SSTP works quickly, stably and securely. Unfortunately, very few VPN providers support SSTP.
SSTP can help if other VPN protocols are blocked, but again OpenVPN would be the best choice (if available).
IPsec
Internet Protocol Security (IPsec) — this is a set of protocols for ensuring the protection of data transmitted over an IP network. Unlike SSL, which works at the application layer, IPsec works at the network layer and can be used natively with many operating systems, which allows using it without third-party applications (unlike OpenVPN).
IPsec has become a very popular protocol for use in conjunction with L2TP or IKEv2, which we will discuss below.
IPsec encrypts the entire IP packet using:
- Authentication Header (AH), which puts a digital signature on each packet;
- Encapsulating Security Protocol (ESP), which ensures confidentiality, integrity and authentication of the packet during transmission.
A discussion of IPsec would be incomplete without mentioning the leak of a presentation by the US National Security Agency, which discusses IPsec protocols (L2TP and IKE). It is difficult to come to unambiguous conclusions based on vague references in this presentation, but if the threat model for your system includes targeted surveillance by curious foreign colleagues, this is a reason to consider other options. And yet, IPsec protocols are still considered secure if they are properly implemented.
Now we will look at how IPsec is used in conjunction with L2TP and IKEv2.
L2TP/IPsec
Layer 2 Tunneling Protocol (L2TP) was first proposed in 1999 as an update to L2F (Cisco) and PPTP (Microsoft) protocols. Since L2TP itself does not provide encryption or authentication, IPsec is often used with it. L2TP paired with IPsec is supported by many operating systems and is standardized in RFC 3193.
L2TP/IPsec is considered secure and has no serious identified issues (much safer than PPTP). L2TP/IPsec can use 3DES or AES encryption, although, given that 3DES is currently considered a weak cipher, it is rarely used.
The L2TP protocol sometimes has problems due to the default use of UDP port 500, which is known to be blocked by some firewalls.
The L2TP/IPsec protocol allows ensuring high security of transmitted data, is easy to configure and is supported by all modern operating systems. However, L2TP/IPsec encapsulates transmitted data twice, which makes it less efficient and slower than other VPN protocols.
IKEv2/IPsec
Internet Key Exchange version 2 (IKEv2) is an IPsec protocol used to perform mutual authentication, create and maintain Security Associations (SA), standardized in RFC 7296. It is as protected by IPsec as L2TP, which may indicate their same level of security. Although IKEv2 was developed by Microsoft together with Cisco, there are open source implementations of the protocol (for example, OpenIKEv2, Openswan and strongSwan).
Thanks to support for Mobility and Multi-homing Protocol (MOBIKE), IKEv2 is very resistant to network changes. This makes IKEv2 an excellent choice for smartphone users who regularly switch between home Wi-Fi and mobile connections or move between access points.
IKEv2/IPsec can use a number of different cryptographic algorithms, including AES, Blowfish and Camellia, including with 256-bit keys.
IKEv2 supports Perfect Forward Secrecy.
In many cases, IKEv2 is faster than OpenVPN, as it is less resource-intensive. From a performance perspective, IKEv2 can be the best option for mobile users because it reconnects well. IKEv2 is natively supported on Windows 7+, Mac OS 10.11+, iOS, as well as on some Android devices.
OpenVPN
OpenVPN — this is a universal open source VPN protocol developed by OpenVPN Technologies. Today, it is perhaps the most popular VPN protocol. Being an open standard, it has undergone more than one independent security review.
In most situations where a VPN connection is needed, OpenVPN is likely to be suitable. It is stable and offers good data transfer speed. OpenVPN uses standard TCP and UDP protocols and this allows it to become an alternative to IPsec when the provider blocks some VPN protocols.
OpenVPN requires special client software, not the one that works out of the box. Most VPN services create their own applications to work with OpenVPN, which can be used in different operating systems and devices. The protocol can work on any TCP and UDP port and can be used on all major platforms through third-party clients: Windows, Mac OS, Linux, Apple iOS, Android.
But if it does not suit your situation, it is worth paying attention to alternative solutions.
WireGuard
The newest and least explored VPN protocol is WireGuard. It is positioned by developers as a replacement for IPsec and OpenVPN for most cases of their use, while being more secure, more productive and easier to use.
All IP packets arriving at the WireGuard interface are encapsulated in UDP and securely delivered to other peers. WireGuard uses modern cryptography:
- Curve25519 for key exchange,
- ChaCha20 for encryption,
- Poly1305 for data authentication,
- SipHash for hash table keys,
- BLAKE2 for hashing.
The WireGuard code looks much more modest and simpler than the OpenVPN code, as a result of which it is easier to investigate for vulnerabilities (4 thousand lines of code versus several hundred thousand). Also, many note that it is much easier to deploy and configure.
Performance test results can be seen on the official website (as you might guess, they are good). It is worth noting that WireGuard will show the best results on Linux systems, because there it is implemented as a kernel module.
Very recently, WireGuard 1.0.0 was presented, which marked the delivery of WireGuard components in the main Linux kernel 5.6. The code included in the Linux kernel underwent an additional security audit performed by an independent firm, which did not reveal any problems. For many, this is great news, but whether WireGuard can become a worthy replacement for IPsec and OpenVPN will be shown by time and independent security research.
We tried to characterize the most popular VPN protocols, we hope the review was useful for you. As a summary, we provide a comparison table, which once again indicates the important, in our opinion, indicators.
| PPTP | SSTP | L2TP/IPsec | IKEv2/IPsec | OpenVPN | WireGuard | |
|---|---|---|---|---|---|---|
| Developer | Microsoft | Microsoft | L2TP — joint development by Cisco and Microsoft, IPsec — The Internet Engineering Task Force | IKEv2 — joint development by Cisco and Microsoft, IPsec — The Internet Engineering Task Force | OpenVPN Technologies | Jason A. Donenfeld |
| License | Proprietary | Proprietary | Proprietary | Proprietary, but there are open source implementations of the protocol | GNU GPL | GNU GPL |
| Deployment | Windows, macOS, iOS, at one time GNU/Linux. Works “out of the box”, without requiring additional software installation | Windows. Works “out of the box”, without requiring additional software installation | Windows, Mac OS X, Linux, iOS, Android. Many OS (including Windows 2000/XP +, Mac OS 10.3+) have built-in support, no need to install additional software | Windows 7+, macOS 10.11+ and most mobile OS have built-in support | Windows, Mac OS, GNU/Linux, Apple iOS, Android and routers. Installation of specialized software supporting work with this protocol is required | Windows, Mac OS, GNU/Linux, Apple iOS, Android. Install WireGuard itself, then configure according to the guide |
| Encryption | Uses Microsoft Point-to-Point Encryption (MPPE), which implements RSA RC4 with a maximum of 128-bit session keys | SSL (all parts are encrypted except TCP and SSL headers) | 3DES or AES | Implements a large number of cryptographic algorithms, including AES, Blowfish, Camellia | Uses OpenSSL library (implements most popular cryptographic standards) | 1-RTT key exchange, Curve25519 for ECDH, RFC7539 for ChaCha20 and Poly1305 for authenticated encryption, and BLAKE2s for hashing |
| Ports | TCP port 1723 | TCP port 443 | UDP port 500 for initial key exchange and UDP port 1701 for initial L2TP configuration, UDP port 5500 for NAT traversal | UDP port 500 for initial key exchange, and UDP port 4500 — for NAT traversal | Any UDP or TCP port | Any UDP port |
| Security flaws | Has serious vulnerabilities. MSCHAP-v2 is vulnerable to dictionary attack, and RC4 algorithm is subject to Bit-flipping attack | No serious security flaws have been identified | 3DES is vulnerable to Meet-in-the-middle and Sweet32, but AES has no known vulnerabilities. However, there is an opinion that the IPsec standard has been compromised by the US NSA | No information on existing security flaws was found, except for the incident with the leak of NSA reports regarding IPsec | No serious security flaws have been identified | No serious security flaws have been identified |
English
Русский