How VPNs Work - Part 1: Overview
11,466 Total views across this article’s versions; includes the historical baseline where available.
This article is Part 1 in a 3-part series on how Virtual Private Networks (VPNs) work. Part 1 delves into the nuances of VPNs at a high-level, scratching the surface on the inner workings of VPN services. Part 2 (VPN Protocols) dives deeper into VPN protocols (platforms) and their differences, and part 3 (VPN Encryption and Authentication) goes a bit deeper into encryption and cryptography, and how security concerns may influence your choice in VPN protocols and/or services.
A goal of this website is to make complex technologies easier to grasp without diluting the importance of nuances that distinguish products or methods from one another. VPN protocols are a good example of an important subject that is rarely explained well (if at all). Other than touting the myriad of protocols or services they support, most VPN provider and provider service reviews gloss over the subject as if merely mentioning keywords and names is sufficient to establish credibility. It’s a subject that is rarely discussed in any meaningful detail, yet an end user or system administrator’s choice can have a profound impact, whether they realize it or not.
If one places a high enough value on security, privacy, and data exchange integrity to consider a VPN in the first place, why not closely examine every aspect of the VPN that will ostensibly protect your values? Whether your goal is evading censorship, circumventing geographic content restrictions, or simply protecting yourself from potential malicious third-party monitoring of your internet traffic, your choices in every aspect of selecting a VPN are critical to a successful outcome of your goals.
Terminology
First things, first. Let’s clarify what some of the terms used in these articles mean.
- Protocol - A VPN Protocol is a technical methodology that defines the constructs of a VPN, such as secure key exchange and encryption methods. You may liken it to a service platform.
- Service - A VPN Service is an application that establishes and operates a VPN using one or more VPN protocols.
- Provider - A VPN Provider is an organization that provides one or more VPN services and makes them available to the public, potentially for a fee.
Overview
A VPN joins devices or networks across another network. A tunnel has endpoints, but a VPN deployment may have many clients, gateways and tunnels. Point-to-point describes a relationship between two endpoints; it does not require a dedicated physical cable, and P2P can also mean peer-to-peer.
An encrypted VPN protects traffic on the path between its peers. It does not make eavesdropping impossible under every circumstance: endpoint compromise, configuration errors and unencrypted traffic after the exit still matter. This article covers encrypted remote-access VPNs, with these concepts in mind:
- Interface and forwarding modes
- Endpoint, tunnel and exit IP addresses
- Protocols and implementations
- Simultaneous sessions
- NAT and ports
- Encryption boundaries
For the introductory explanation, see What Is a VPN?.
Operating Modes
In OpenVPN, TUN and TAP describe virtual network interfaces. Routing and bridging describe how traffic is forwarded. IPsec uses the separate terms tunnel mode and transport mode. These are related networking concepts, not interchangeable names for three universal VPN modes. IPsec architecture.
Routed IP Interfaces (TUN)
A TUN interface passes IP packets between the operating system and a userspace program. It is a layer 3 interface suitable for routed IPv4 and IPv6 VPNs. OpenVPN supplies the encapsulation and cryptographic protection; the TUN interface itself does not encrypt traffic or imply SSL. Linux TUN/TAP documentation.
Ethernet Interfaces (TAP)
A TAP interface passes Ethernet frames and can carry IP as well as other Ethernet payloads. It operates at layer 2 and can participate in an Ethernet bridge. TAP does not mean IPsec transport mode, nor is site-to-site networking limited to TAP: a site-to-site VPN can route IP through TUN. TUN/TAP interface semantics.
Bridge Networks
An OpenVPN Ethernet bridge can join a TAP interface to a physical Ethernet interface, extending a broadcast domain through the VPN. Bridging introduces broadcast traffic and addressing considerations. It is one deployment choice, not a requirement for all site-to-site VPNs. Other technologies can implement layer 2 tunnels without OpenVPN TAP interfaces.
Which VPN Mode Do I Need?
For ordinary routed Internet access or access to another IP subnet, TUN is generally sufficient. Choose TAP when you specifically need to carry Ethernet frames or extend a layer 2 network and both implementations support it.
Web browsing and streaming can work over either interface when IP addressing, routes, DNS and firewall rules are correct. TAP carries Ethernet frames that can themselves contain TCP or UDP traffic; it does not prevent those applications from working. TCP is one transport protocol carried by IP, not a synonym for IP.
| Interface | Payload | Typical forwarding |
|---|---|---|
| TUN | IPv4/IPv6 packets | Routing between IP networks |
| TAP | Ethernet frames | Bridging or other layer 2 processing |
Neither choice guarantees arbitrary frame sizes; the tunnel and underlying path still impose MTU limits.
Classifying VPNs by IP Address Type
Distinguish three roles when discussing VPN addresses:
- Transport endpoint: the public address and port used to reach the VPN peer.
- Tunnel address: an address assigned to a virtual interface or used inside the VPN.
- Internet exit address: the source address destinations see for traffic leaving through a VPN gateway, often after source NAT.
These addresses can coincide in some roles or differ. A server is not restricted to exactly two addresses; it may have multiple interfaces, address families and public addresses. Some private-network VPNs have no Internet exit at all.
Static and dynamic describe whether an address assignment stays fixed or changes. Shared and dedicated describe whether multiple customers use an exit address. Specify which role you mean rather than assuming a universal VPN “type.” A hostname can also resolve to changing or multiple endpoint addresses.
The original process sketch separates a VPN entry from an exit. It is schematic, not a requirement for exactly two distinct server addresses. Its numbers are illustrative public addresses, not configuration values; use the documentation-address example in the encryption section for a worked description.
Protocols
VPN products use different protocols and combinations of protocols. Both peers need compatible implementations and configurations; simply supporting encryption is not enough. Remote-access services often use a client/server arrangement, while other VPNs use peer relationships.
OpenVPN uses its own VPN protocol with a TLS control channel in TLS mode. IPsec supplies network-layer security; IKE negotiates keys and security associations. L2TP tunnels traffic but needs another mechanism, commonly IPsec, for confidentiality. TLS is also used by other VPN designs; obsolete SSL is not a recommendation.
For the detailed comparison, see How VPNs Work — Part 2: VPN Protocols.
PPTP [Point-to-Point Tunneling Protocol]
PPTP is a tunneling protocol: it carries PPP using an enhanced GRE mechanism and a separate control connection. Its historical Windows authentication/encryption combinations have serious security weaknesses. Avoid choosing it for a new secure VPN. PPTP specification.
L2TP [Layer Two Tunneling Protocol]
L2TPv2 carries PPP sessions over a packet network; it combines ideas from PPTP and Cisco L2F. It does not by itself encrypt user payloads. Its “Layer Two” name is not a TUN-only classification. L2TPv3 also supports layer 2 pseudowires, and is not simply a drop-in upgrade for every L2TP/IPsec remote-access deployment. L2TP specification.
L2TP/IPsec
L2TP/IPsec uses IPsec to protect the L2TP traffic. RFC 3193 requires implementations to support IPsec transport mode and permits tunnel mode; it does not prohibit tunnel mode. ESP can supply confidentiality, integrity, origin authentication and replay protection according to the negotiated policy. Those properties cannot be inferred from L2TP alone. Securing L2TP using IPsec.
SSTP [Secure Socket Tunneling Protocol]
Microsoft’s SSTP carries PPP traffic over HTTPS. It is not restricted to SSL 3.0: its security depends on the TLS version, certificate validation and authentication configuration actually used. Platform availability depends on the client implementation. Unencrypted L2TP is not a substitute for a secure SSTP connection. Microsoft SSTP specification.
IKE [Internet Key Exchange]
IKE establishes authenticated security associations and keying material for IPsec. IKEv1’s Phase 1/Phase 2 vocabulary should not be used as the exchange model for IKEv2, which begins with IKE_SA_INIT and IKE_AUTH and uses CREATE_CHILD_SA for additional or renewed associations. IPsec protects the traffic; IKE is not itself the user-data tunnel. IKEv2 specification.
The optional MOBIKE extension lets IKEv2 peers update addresses as connectivity changes, such as moving between Wi-Fi and cellular service. Both implementation support and configuration matter. It does not promise uninterrupted service under every network failure. MOBIKE.
OpenVPN v2
OpenVPN Community Edition 2.x provides client and server functionality. It can use routed TUN or bridged TAP configurations, subject to platform support. In TLS mode it uses TLS for authentication and key establishment, with a separately protected data channel. OpenSSL is a cryptographic library, not a claim that obsolete SSL protocols are in use.
Its flexibility and broad platform support are useful, but no implementation is inherently the most secure or fault tolerant in every deployment. Evaluate maintained versions, authentication, configuration and the complete traffic path.
OpenVPN v3
OpenVPN 3 is a separate C++ client library compatible with the OpenVPN 2.x protocol. It is used in production OpenVPN Connect clients; it is not merely an experimental replacement for the Community Edition server. The library does not implement server functionality. OpenVPN 3 project.
OpenVPN 3 Linux is a client platform built around that library and D-Bus services, with configuration/session management and privilege separation. It supports routed TUN configurations, not TAP bridging. These Linux-specific components should not be attributed to every OpenVPN 3 client. OpenVPN 3 Linux project.
WireGuard
WireGuard carries IP packets over UDP with a deliberately small, fixed cryptographic design. It is a layer 3 VPN and does not provide a native TAP/Ethernet mode. The original article’s experimental, Linux-only assessment dates from 2019. WireGuard reached Linux 5.6 in 2020 and has implementations for multiple operating systems. WireGuard project.
Its smaller protocol surface is a design choice, not a guarantee of privacy or superiority in every use case. Address management, peer keys, routing and provider practices still matter. See the related protocol comparison for the tradeoffs.
Device Connections: What Is a “Connection?”
A provider’s simultaneous-connection limit is a service policy, commonly measured as active VPN sessions. Read its definition: accounts, devices, profiles and sessions are not necessarily equivalent. A virtual interface is not a universal billing unit. For example, an OpenVPN server’s single TUN interface can serve many clients.
Multiple Device Connections
A physical device may run multiple VPN sessions if its client software and operating system support that arrangement. Each session still needs suitable interfaces, routes, DNS handling and firewall policy. Overlapping routes or competing default-route changes can produce unexpected results.
Windows is not inherently limited to one OpenVPN session. The older Community Edition setup described in the documentation uses separate TAP-Windows adapters and non-conflicting interface, address and port settings. OpenVPN 2.7 creates Windows adapters on demand, so manually creating an adapter for every session is not a requirement shared by all releases. 2.7 Windows adapter changes. Individual applications may impose their own restrictions. OpenVPN multiple-instance configuration.
Check the provider’s session policy separately from what the software can do.
Examples
Let’s say you want to connect the following devices to a VPN, using a single license:
- Desktop computer at home
- Laptop connected to a shared cellular-based WiFi hotspot
- Mobile phone
- Another laptop located in another country
So, how many VPN connections is that if they are all connected to the same VPN service provider, at the same time, using the same license? Four (4).
Now, take that same scenario, but presume everyone is behind the same router, the mobile phones are connected to the Internet via WiFi, and the WiFi router is behind your primary router. How many connections is that? If you’re familiar with networking, you might be thinking one (1) is the answer, but you’d be wrong. It’s still four (4) devices. Why? Each device is establishing a separate VPN session.
So, what can you do if you are constrained because the maximum number of devices allowed by your VPN license is less than the number of devices you want to connect to it? The answer is: it depends. One option is to consolidate your connections as much as possible, by running the VPN client on a router, where a number of devices are on a network behind that router.
Understanding Slow VPN Connections
VPN throughput depends on cryptographic processing, implementation, server load, path latency/loss, MTU, encapsulation and congestion. OpenVPN itself can be a bottleneck in some configurations; it should neither be blamed automatically nor ruled out without measurement. A faster protocol is not necessarily less secure.
For example, I have experienced OpenVPN server connections with over 90% throughput compared with my non-VPN fixed wire speed. That is an observation from my own connections, not a guaranteed result for other hardware, servers or paths.
Compare the same endpoints and conditions, and measure CPU use, latency, loss and throughput. Review sites can help identify questions to test, but provider counts and rankings in older reviews should be read in their historical context.
Consolidating Connections Behind a Router
A router can run one VPN client session and forward traffic for several local devices through it. That differs from each device establishing its own session. Provider terms determine how this is counted.
Forwarding requires routes and firewall permission; source NAT is often used for consumer VPN services but is not mandatory when both sides have appropriate return routes. The VPN provider may still infer information about devices behind the gateway.
Traffic policy can cover all destinations, selected source devices, selected destinations or selected traffic classes. Port-based classification may feed policy routing or firewall marks; it is not the same operation as inbound port forwarding. MAC addresses have only local-link significance and cannot generally identify a host across routed networks.
Account for IPv4, IPv6, DNS and what happens when the tunnel fails. Multiple or overlapping routes can be legitimate; they need explicit selection rules, not a blanket ban on duplicates. A full-tunnel configuration also needs a working path to the VPN transport endpoint outside its own tunnel.
NAT
NAT changes IP addresses, and NAPT can also change transport ports while tracking mappings. Sharing one public address is a common application. Routing and NAT are separate functions: a router can forward between networks without translating addresses. Traditional NAT.
IPsec NAT traversal detects NAT on the path and carries ESP inside UDP so it can pass through suitable NAT devices. That is different from translating addresses for several clients behind a VPN router. NAT-T can matter to a single remote client, and connecting two networks does not always require it. UDP encapsulation of ESP.
Network Ports
TCP and UDP have separate 16-bit port-number spaces, with values 0–65535. A port identifies a transport endpoint, not a NAT mapping or a physical opening. Whether traffic is accepted also depends on a listening process and firewall policy.
OpenVPN commonly uses server port 1194, but it is configurable. A client’s local port need not be 1194; nobind lets the operating system choose an available source port. Connections are distinguished by protocol and local/remote addresses and ports, with binding rules affecting which processes can share a local endpoint.
These principles apply to both Windows and Linux. Reusing the same remote server port does not by itself limit a machine to one VPN connection. OpenVPN port and binding options.
Encryption: Smoke and Mirrors
A VPN encrypts traffic between its tunnel peers. At the exit, the peer removes the VPN protection and forwards the inner traffic. If that traffic has no independent encryption, the VPN operator can read it. A privacy policy is a promise about handling data, not a cryptographic inability to inspect it.
For a typical routed consumer VPN, the outer packet carries the transport endpoint addresses. The inner packet carries the application destination and a source address appropriate to the tunnel; that source need not be the client’s public ISP address. The exit may apply source NAT before sending the packet onward. Return traffic follows the corresponding forwarding/NAT state and is encrypted back through the tunnel.
For example, a client might reach a VPN peer at 198.51.100.10, use tunnel address 10.8.0.2, and contact an application at 203.0.113.20. The VPN exit may use 198.51.100.20 as the Internet-facing source. These are illustrative documentation addresses, not a service configuration.
The destination commonly sees the exit address, but that does not guarantee anonymity. Accounts, cookies, browser identifiers, application data and traffic correlation can identify or link activity. Applications may also detect network changes or inspect interfaces; they are not necessarily unaware of the VPN.
Double Wrapping (Dual Encryption)
HTTPS and a VPN protect different portions of the path. With correctly authenticated HTTPS, the application payload remains encrypted between the browser and the HTTPS endpoint after the VPN layer is removed. The VPN operator can still observe metadata such as traffic timing, volume and destination addresses.
This independent protection is valuable: a VPN is not a replacement for HTTPS. If traffic bypasses a failed tunnel, HTTPS can still protect its payload, but it does not conceal the client’s public address or all connection metadata. Neither layer protects against every compromised endpoint or authentication failure. TLS 1.3 security model.
Footnotes
1 Default Encryption Settings for the Microsoft L2TP/IPSec Virtual Private Network Client. (17 April 2018). Microsoft.