How VPNs really work

I got asked an interesting question I thought I’ll explore it here






There are many explanations of VPN as a magical tunnel that protects your identity. These descriptions, however, are very vague and often misleading. I am not an expert in networking, but know how to explain what occurs under the hood when a VPN is enabled. So, I suppose I'm talking to software engineers. They are my audience after all. It is a simple example, using the HTTP server, of how VPN works. .

 Let's say your source IP is 6.6.6.6., so let's suppose you want to join Google using an IP 1.2.3.4 port 80 then we need to make sure our source IP is 6.6.6.6. That is your public IP router, not your personal laptop's private IP, so for simplicity I will skip NAT.

 Normally with no VPN, your client sends a SYN segment to port 80 that goes into an IP packet with a destination IP 1.2.3.4 and source ip 6.6.6.6 and google replies back directly to you with a SYN/ACK destination IP 6.6.6.6 and and the source IP 1.2.3.4, and so on. 
The IP packet you are sending back and forth to 1.2.3.4 is visible to your ISP. When using plaintext HTTP (port 80),
they (the ISP and essentially anybody in between) have the option to deeply analyse it and view the content, but they are not able to do so when using HTTPS (port 443).

Let's imagine you set up an UDP-based VPN and connect to a VPN server with IP 3.3.3.3. The VPN client then grabs the IP packet, encrypts it, and puts it on a new UDP datagram with VPN information. This UDP goes into a new IP packet with a target IP of 3.3.3.3. The client continues to make SYN IP packets with destination IPs of 1.2.3.4 and 6.6.6.6. The VPN server, which recognises that this packet needs to reach you (6.6.6.6), responds to 3.3.3.3 with SYN/ACK. As a result, it generates a new IP packet with the SYN/ACK and the source IP address as 3.3.3.3 and the destination IP as 6.6.6.6. 

 In conclusion, the VPN just passes the SYN through, allowing you to establish an end-to-end TCP connection with Google over this encrypted tunnel, rather than terminating the TCP. Keep in mind that when you utilise TLS, the TLS client greeting is sent across the VPN to Google in the same manner as any other packet. Because of this, you also have end-to-end encryption, and HTTPS traffic cannot be read by the VPN.

Comments

Popular posts from this blog

"Top 5 Reasons to Learn Python in Today's Tech World" Its Technology Applications"

Motivation Comes From Action