Skip to content

When you connect to a VPN, your device builds an encrypted tunnel to a VPN server, and from then on your internet traffic travels inside that tunnel to the server before going out to the wider internet. Websites see the server, not you. The local network sees a single encrypted connection, not a list of sites.

That sentence hides a few steps. This article follows a single web request from start to finish so you can see what is encrypted, where, who sees what, and why a VPN can change both your apparent location and your speed. If you are new to the idea, start with what a VPN is and come back.

Without a VPN: the normal path

Without a VPN, opening a website works like this:

  1. Your browser asks a DNS resolver, usually run by your internet provider, to turn a name such as example.com into an IP address. See how DNS works.
  2. Your device sends packets to that address through your router and your internet provider.
  3. The website replies to the public IP address your internet provider assigned to you.

Along this route, your internet provider and the Wi-Fi operator can see the destination addresses and DNS lookups. If the site uses HTTPS, they cannot read the page contents, but they can still see which site you are talking to. The website sees your provider-assigned public IP address.

What is a VPN server and what is a VPN tunnel?

Two terms appear in almost every VPN explanation, and they describe different things. One is a place, the other is a path. Knowing the difference makes the rest of the article much easier to follow.

What is a VPN server?

A VPN server is a computer, usually in a data centre, that runs VPN software and has a fast connection to the internet. It is the far end of your VPN connection. Its main jobs are:

  • accepting connections from VPN apps and checking that the person connecting is allowed in;
  • decrypting the traffic it receives from you and forwarding it to the real destination, using its own public IP address;
  • receiving the replies, encrypting them and sending them back down the tunnel;
  • in many setups, answering DNS lookups so that they do not leave through your local network.

One server is shared by many users at the same time, so they all appear to websites under the same public address. That is why a website cannot tell one user of a server from another by IP address alone. Servers sit in different cities and countries, and which one you pick changes the distance your data travels, how busy the machine is and where websites think you are. Your VPN app or account page shows the locations on offer.

A server is also just a machine run by a company. It needs updates, enough capacity and careful administration, and it is the point where your traffic is decrypted. That is why the quality and honesty of the provider matter as much as the technology.

What is a VPN tunnel?

A VPN tunnel is the protected path between your device and the VPN server. The word is a metaphor. No private cable is laid underground. Your packets still cross the same public internet cables and routers as everyone else's. What makes it a tunnel is that each packet is wrapped inside another packet, and the contents are encrypted and authenticated, so the networks on the way can carry it but cannot read or quietly change it.

A helpful picture is a sealed envelope placed inside a courier's outer envelope. The courier network only reads the outer address, which is the VPN server. At the server, the outer envelope is removed, the inner letter is opened and sent on its way.

Some points that clear up common confusion:

  • Wrapping alone is not enough. Some tunnelling methods only encapsulate packets without encrypting them. A VPN tunnel adds encryption and authentication on top.
  • Both ends have a tunnel address. Inside the tunnel, your device and the server use private addresses, separate from your Wi-Fi address and from the public address websites see.
  • Tunnels can break. Moving from Wi-Fi to mobile data, or a weak signal, can interrupt the link. Protocols differ in how quickly they rebuild it, and a kill switch decides what happens to your traffic in the meantime.
  • Full or partial. In a full tunnel, almost all traffic goes through the VPN. With split tunneling, only chosen apps do.

Following one request through the tunnel

Now that the two pieces are clear, here is the whole journey in five steps.

Step 1: the VPN app sets up the tunnel

When you press connect, your VPN app contacts the VPN server and the two run a handshake. In this handshake they:

  • Authenticate each other. The server checks that you are an allowed user, using login details or keys. Your app checks that it is really talking to the server it expects.
  • Agree on keys. Using public-key cryptography, they work out shared secret keys without sending those keys across the network. These keys protect everything that follows.
  • Agree on settings. This includes the cipher used for encryption and the virtual IP address your device will use inside the tunnel.

The rules for this process are called a VPN protocol. Examples include WireGuard, OpenVPN, and IPsec with IKEv2 (the IPsec architecture is described in RFC 4301). You can read more in what a VPN protocol is.

Step 2: your device creates a virtual network connection

Once the handshake finishes, your operating system gets a virtual network adapter. You can think of it as a second, software-only network card that leads to the VPN server instead of your router. The system then changes its routing table so that most traffic goes through this adapter.

This is why VPN apps often ask for permission to add a VPN configuration to your phone or computer. They are adding that virtual adapter and rewriting the routes. Some VPNs also allow exceptions, so chosen apps bypass the tunnel. That feature is called split tunneling.

Step 3: packets are wrapped and encrypted

Take a single request, for example your browser fetching a page. The browser creates a packet addressed to the website. The virtual adapter then does something called encapsulation:

  1. The original packet, including its destination address, is encrypted. Authentication data is added so tampering can be detected.
  2. The encrypted blob is placed inside a new outer packet addressed to the VPN server.
  3. The outer packet goes out through your normal connection, whether that is Wi-Fi, mobile data or Ethernet.

To the Wi-Fi operator and internet provider, the visible traffic is a stream of packets between your device and the VPN server's address. The real destinations are inside the encrypted part. The outer addressing follows the ordinary rules of the Internet Protocol (RFC 791).

Step 4: the VPN server unwraps and forwards

The VPN server receives the outer packet, decrypts it with the shared key, and recovers your original request. It then sends that request on to the website, using the server's own public IP address as the source. From the website's point of view, the visitor is the VPN server. If many users share that server, their requests all appear to come from the same address.

If the VPN also handles DNS, which a well-configured one should, the server or a resolver linked to it answers your name lookups, so they are not exposed on your local network. When this fails and lookups slip out through your normal connection, that is a DNS leak.

Step 5: the response travels back

The website replies to the VPN server's address. The server takes the reply, encrypts it with the session keys, wraps it in a new packet addressed to your device's tunnel address, and sends it through the internet to you. Your VPN app decrypts the packet and hands the original reply to your browser, which shows the page.

Everything repeats for every packet, many times per second, though in modern protocols the work is light enough that phones handle it comfortably.

Who can see what

Party Without VPN With VPN
Wi-Fi operator or local network Destination addresses and DNS lookups, plus unencrypted content One encrypted connection to the VPN server, and how much data flows
Your internet provider Same as above Same as the row above: the VPN server address and traffic volume
The website Your provider-assigned public IP address The VPN server's public IP address
The VPN provider Nothing Your real IP address, the destinations you connect to, and when
Content of HTTPS pages Visible only to your browser and the site Still visible only to your browser and the site

The last two rows matter. A VPN does not remove the observer. It moves the vantage point from your local network and internet provider to the VPN provider, and so the question of who you trust becomes the key one.

Why a VPN affects speed and location

Speed. Your data now takes a detour through the server, which adds distance and a little processing for encryption. If the server is close and not overloaded, the difference may be small. If it is far away or busy, it can be noticeable. Occasionally a VPN seems faster because it takes a better route than your provider's default.

Apparent location. Websites estimate your location partly from your IP address. When you use a VPN server, they see that server's address and often guess a location near it. Many other signals, such as your account profile, device language settings and GPS permission in apps, can still reveal where you really are.

How it plays out in everyday life

In a café. You join the café Wi-Fi and your VPN app builds a tunnel to its server. The café's router now carries only an encrypted stream to one address. Other customers on the same network, and the café owner, no longer see which sites you open. They can still see that you are using a VPN and roughly how much data you move.

While travelling. At a hotel you check your bank app. The tunnel protects the hotel Wi-Fi stretch of the journey. The bank still sees a connection from the VPN server's address, which may be in a different place from where you normally log in. Some banks react to an unfamiliar address with an extra verification step. That is normal and is a good reason to keep two-factor authentication ready.

In a shared flat or a dorm. Everyone shares one internet connection, and the network owner can see the destinations of unencrypted lookups and connections. With a VPN connected, the owner sees only the link to the server. The house rules and the network's acceptable-use policy still apply, and the VPN does not change them.

Working remotely. A consumer VPN like this protects the route between your laptop and the VPN server. It is not the same as a company's own VPN that connects you to an office network. If your employer gives you access rules, follow them rather than swapping one for the other.

What to watch for

  • Make sure the tunnel is up. Apps usually show a connected indicator, and on phones a key or VPN icon appears. If the connection drops silently, traffic may go out unprotected unless a kill switch blocks it. Read about the VPN kill switch.
  • Check for leaks after setup. A short test confirms that your visible IP address and DNS requests match the VPN rather than your provider.
  • Use HTTPS as well. Inside the tunnel, traffic is protected until it leaves the server. From there to the website, protection depends on the site using HTTPS.
  • Remember the endpoint. The VPN server sees your traffic in decrypted form between decryption and forwarding, subject to HTTPS on top.
  • Expect some change in speed. A close, quiet server usually feels almost the same as no VPN. A distant or crowded one can feel slower. Trying another location offered in your account is a reasonable first fix.
  • Do not confuse a tunnel with anonymity. Logging in to your accounts, cookies and device settings still identify you to the sites you use.

Summary

A VPN works by performing a handshake with a server, creating a virtual network adapter on your device, encrypting each packet and wrapping it in an outer packet to the server, and then having the server decrypt and forward it using its own IP address. Replies take the same route in reverse. The result is that your local network sees only an encrypted link, and websites see the server's address, while the VPN provider itself becomes the party that can see your traffic destinations.

If you are ready to pick a pass, the pricing page shows how XPASS offers them.

Frequently asked questions

What is a VPN server?

A VPN server is a computer run by the VPN provider that accepts your encrypted connection, decrypts your traffic and forwards it to its destination using the server's own public IP address. Many users share the same server at the same time.

What is a VPN tunnel?

A VPN tunnel is the encrypted connection between your device and the VPN server. Your normal traffic is wrapped inside it, so networks along the way only see encrypted data going to the server.

Does a VPN change my IP address?

It changes the public IP address that websites see, replacing the one from your internet provider with the VPN server's address. Your device still has its own local address on your home or Wi-Fi network.

Why can a VPN slow my connection down?

Your traffic takes a longer path through the VPN server and must be encrypted and decrypted. The effect depends on distance to the server, server load and your base connection, so it varies.

Can the VPN provider see my traffic?

The provider's server decrypts your traffic to forward it, so it can technically see which destinations you connect to. Contents of HTTPS pages stay encrypted between your browser and the site.

About the author

Bob Kanokphon Thongdee, founder of XPASS VPN

Bob Kanokphon Thongdee

  • Founder of XPASS VPN
  • Co-founder of eSIMonline.asia
  • More than 7 years in online marketing
  • Founder of Cojourney Visa and Cojourney Travel

Need a VPN for a short trip or a busy month?

XPASS sells prepaid passes for a set number of days. You pay once and nothing renews automatically.

See passes

Keep reading

VPN Security

What Is VPN Encryption?

VPN encryption scrambles your data between your device and the VPN server. Here is how keys, ciphers and the handshake work, and what encryption cannot do.

10 min read

VPN Basics

What Is a VPN Protocol?

A VPN protocol sets the rules for how your device and a VPN server connect and protect traffic. Here is what that means in plain language, with the main trade-offs.

9 min read

VPN Basics

What Is a Public IP Address?

Your public IP address is the address websites see when you connect. This guide explains how it is assigned, how it differs from the private address on your home network, and what it does and does not reveal.

9 min read