← All articles
technologywhat is a VPNvirtual private networkVPN encryptionAugust 17, 20268 min read

What Is a VPN? How a Virtual Private Network Protects Traffic

By the BrainSnail editorial team. How these articles are written and checked, and how to tell us when one is wrong.

A VPN, or virtual private network, creates an encrypted connection between your device and a VPN server, then sends your internet traffic through that server. It can protect data on the local network and change the public IP address that websites see, but it does not make you invisible online.

What happens when you connect

Without a VPN, your device usually sends internet traffic through your local network and internet service provider toward the sites and services you use. Many modern websites already encrypt their own traffic with HTTPS. A VPN adds another encrypted layer between your device and the VPN server, so people on the same local network cannot easily read the contents travelling through that tunnel.

After traffic reaches the VPN server, it continues toward its destination. The website sees a request coming from the VPN server's public IP address rather than directly from your home connection. This is why location-sensitive services may appear to see the server's region instead of your actual network location.

The central idea in a VPN is therefore routing plus encryption. Your traffic takes a different first leg and that leg is protected by the VPN protocol. The exact protocol can vary, but the goal is to create an authenticated, encrypted tunnel that carries data securely between endpoints.

A VPN improves privacy in some places, not everywhere

A VPN can be useful on an untrusted network because it reduces what local network operators or nearby attackers can observe about the traffic inside the tunnel. It can also stop your internet service provider from seeing the specific websites reached through the VPN connection in the ordinary way, although the provider can still see that you are exchanging data with a VPN server.

However, a VPN is often explained too broadly in advertising. A VPN does not automatically block malware, stop phishing, erase cookies, or prevent websites from identifying you when you sign in. If you log into an account, the service still knows which account is active. Browser fingerprinting and tracking technologies can also work independently of your IP address.

Trust is shifted rather than removed. Your VPN provider may be able to observe connection information or traffic leaving its server, depending on the service, encryption used by websites, and logging practices. That makes provider choice important. Security depends on software quality, account protection, policies, and technical design, not just the presence of a VPN icon.

When a VPN is useful

Organisations often use VPNs to let employees securely reach internal systems from outside the office. Individuals may use them to protect traffic on shared networks, reduce exposure of their home IP address, or connect to a network in another location. These are practical networking functions rather than a guarantee of total anonymity.

To remember how a VPN works, use the picture of a protected tunnel between your device and one server. The tunnel hides the contents of that first part of the journey from local observers, but once traffic reaches other services, normal web security and privacy rules still apply.

Leaks and the kill switch

A VPN only protects traffic that actually goes through the tunnel, and some can slip around it. One common example is a DNS leak. Before your device connects to a website, it usually asks a DNS server to translate the site's name into an IP address. If those lookups still go to your internet provider's DNS server instead of through the VPN, the provider can see which sites you are looking up, even though the page traffic itself is tunnelled. Browsers can also reveal addresses through features designed for real-time communication, such as video calls.

Another weak point is the moment a connection drops. If the VPN disconnects briefly, perhaps when you move between Wi-Fi networks, your device may carry on sending traffic over the ordinary connection without warning you. Many VPN apps include a setting usually called a kill switch, which blocks internet access whenever the tunnel is down so nothing travels unprotected. A practical check is to connect to your VPN and visit a reputable leak-testing website, which shows the IP address and DNS servers your traffic appears to use. If your home provider's details appear, the setup needs fixing before you rely on it.

Inside the tunnel: protocols and split tunnelling

A VPN tunnel is built with a protocol, a set of rules for how the two ends prove who they are and encrypt traffic. The process usually begins with a handshake that uses public key cryptography, so your device and the server can agree on fresh secret keys without sending them openly. After that, each packet is protected with fast symmetric encryption. Protocols vary in quality. PPTP, popular in the 1990s, has well-known weaknesses and should be avoided. IPsec and OpenVPN are long established, while WireGuard is a newer design with a deliberately small codebase that was added to the Linux kernel in 2020.

Many VPN apps offer split tunnelling, which lets you choose which apps or destinations use the tunnel and which go over your ordinary connection. You might send your web browser through the VPN on cafe Wi-Fi while letting a video call or a home printer use the normal network for speed. Workplaces often use the idea the other way round, sending only traffic for internal company systems through the corporate VPN so that everyday browsing does not overload the office connection. The trade-off is simple: anything outside the tunnel gets none of its protection, so the settings deserve a careful look.

How a VPN compares with a proxy and Tor

A simple web proxy also forwards your requests so that websites see its address instead of yours, but many proxies work only for one browser or app, and some do not encrypt the link between you and them. A VPN usually covers all of a device's traffic and encrypts that first leg. Both share one weakness: a single operator sits in the middle and could, in principle, link who you are with where you go. Choosing either one means trusting that operator's honesty, competence and security, because nothing in the design stops a dishonest provider from keeping records.

Tor, a free system that grew out of onion routing research at the US Naval Research Laboratory in the 1990s, is designed to avoid that single point of trust. Your traffic is wrapped in several layers of encryption and passed through three volunteer-run relays. The first relay knows your address but not your destination, while the last, the exit relay, knows the destination but not who you are. No single relay normally sees both. The cost is speed, because traffic takes a longer path, and the exit relay can still read anything not protected by HTTPS. Each tool suits a different threat.

The takeaway

A VPN is a virtual private network that encrypts traffic between your device and a VPN server and routes your internet connection through that server. It can improve privacy and security in specific situations, but it does not make every online action anonymous. Think of a VPN as one security layer, not a complete privacy shield.

Practise this

Questions from Networks and the Internet

Reading about something is not the same as being able to recall it. These are real questions from the Networks and the Internet unit in our Technology track, answers and explanations included. The unit has 120 in total across 23 steps.

  • Fill the blankLevel 1

    1. A ____ directs data between devices so it reaches the right place.

    • routercorrect
    • printer
    • monitor
    • speaker

    A router routes data to the correct device.

  • Fill the blankLevel 3

    2. The World Wide Web is one ____ that runs on the internet.

    • servicecorrect
    • cable
    • battery
    • planet

    The web is a service that runs on top of the internet.

  • Choose all that applyLevel 2

    3. Which of these usually connect using wifi? Choose all that apply.

    • A smartphonecorrect
    • A laptopcorrect
    • A smart TVcorrect
    • A wooden spoon
    • A pencil

    Phones, laptops and smart TVs commonly join a network over wifi; everyday objects like spoons do not.