## What is a VPN? - **Virtual Private Network (VPN)** creates a secure tunnel between two endpoints over an untrusted network (e.g., the internet). - **Main Functions**: - **Encryption**: Secures data against eavesdropping. - **Authentication**: Verifies identities of endpoints. - **Tunneling**: Allows devices to communicate as if they are on the same local network. ---
## Comparison of VPN Protocols | Protocol | Security | Performance | Complexity | Codebase Size | |----------------|--------------------|--------------|--------------|---------------| | **WireGuard** | Modern (Curve25519, ChaCha20) | High (Kernel-level) | Simple | ~4,000 lines | | **OpenVPN** | Strong (AES-256) | Moderate | High | ~50,000 lines | | **IPsec** | Strong (AES-256, RSA) | Moderate | High | ~100,000 lines | | **PPTP** | Weak (MPPE) | High | Low | ~20,000 lines | | **L2TP** | Moderate (IPsec) | Moderate | High | ~50,000 lines | ---
- **Benchmarking Results**: - **WireGuard** can achieve speeds of up to **10Gbps** in real-world tests, much higher than **OpenVPN**'s typical **1-2Gbps** limit on the same hardware.
- **Hub**: WireGuard server with a static IP (`10.0.0.1`). - **Spokes**: Clients that connect to the hub (`10.0.0.2`, `10.0.0.3`). - **Mesh**: Certain clients directly connect to each other for peer-to-peer communication.