VPN
A VPN builds an encrypted, private tunnel over an untrusted network like the internet. The name is the definition: virtual (no physical line), private (encrypted), network (it connects two ends).
[Your PC] ══════════════════════════ [Company network]
Encrypted tunnel (VPN)
across the internet
01What is a VPN used for?
1. Remote access
Home worker → VPN → company network
A computer at home reaches internal resources as if it were inside the office.
2. Site-to-site
Branch A → VPN tunnel → headquarters
Two offices talk as if a leased line ran between them.
3. Privacy
You → VPN server → internet
Sites you visit see the VPN server's IP, not yours.
4. Bypassing geo-restrictions
Home → US VPN → US catalog
Traffic appears to originate from another country.
02VPN protocols
| Protocol | Security | Speed | Use |
|---|---|---|---|
| WireGuard | High | Very high | Next generation, the modern pick |
| OpenVPN | High | Medium | Most common, battle-tested |
| IPSec | High | Medium | Enterprise site-to-site |
| L2TP/IPSec | Medium | Low | Legacy systems |
| PPTP | Low | High | Broken — never use it! |
03How does a VPN work?
1. Authentication
Client → username/password or certificate → VPN server
2. Tunnel setup
The original packet is encrypted and placed inside a new packet:
Original:
[IP Header][TCP][Data]
↓ encrypt and wrap
VPN packet:
[New IP][VPN Header][ encrypted(IP+TCP+Data) ]
Routers along the way only see the outer envelope; they can't read the contents. It's the Level 2 encapsulation idea — with encryption.
3. Data flow
Encrypted data → internet → VPN server → decrypted → onward to target
04VPN types
| Remote Access | Site-to-Site | |
|---|---|---|
| Connects | One user to a network | Two networks to each other |
| Typical scenario | Working from home | Between branches |
| Common tech | SSL VPN, WireGuard | IPSec |
05Split tunneling
Full tunnel: all traffic goes through the VPN — secure, but slower and heavy on the server.
Split tunnel: only company traffic enters the VPN; YouTube goes direct — fast, but possibly against company policy.
06What a VPN does and doesn't give you
It provides:
- Encryption — nobody on the path can read your data
- Authentication — both ends of the tunnel are verified
- IP masking — target sites don't see your real IP
It does not provide:
- Anonymity — the VPN provider can see your traffic
- Malware protection — viruses travel through encrypted tunnels just fine
- Legal invisibility — the provider may be keeping logs
07Summary
- VPN = an encrypted tunnel over an untrusted network
- Remote access and site-to-site are the two big scenarios
- Modern picks: WireGuard or OpenVPN; stay away from PPTP
- It gives encryption, it does not promise anonymity