I am looking for some info on how VPN's (Virtual Private Network) forward network traffic through its VPS (Virtual Private Server).
Take an example where you are connected to a VPN. You make a request to a website, which then makes its way down the network stack to Layer 3.
We have an IP packet - it has got its headers, including its destination address, and a payload.
If you change the destination address of the IP packet to the ip address of the VPS, how does the server forward the request to the original destination address?
The only thing I can think of is that at Layer 3 (the IP Layer), the header's destination address is changed to the ip address of the VPS, and then the original destination address is appended to the payload of the packet?
Does this not mean the length of the packet and the checksum header of the packet would then need to be recalculated and the IP packet again modified?
And then the VPS does the inverse mapping of the packet to assemble and make the original request on the server.
This seems like there would be a high latency time associated with it?
Perhaps I am missing some technical aspect of how this works, can anyone else explain it?