How can Pornhub send network packages to your private IP on your home network, instead of sending them to your sister's iPhone on same network
Last day you visited PornHub and opened Chrome, making for the first time full use of the 16 GB of RAM you paid for.
Your PC sent a request to the 443 of the Pornhub IP, which is public.
How can PornHub reach the internal IP where your PC sits?
Oh dear, you thought you knew something about network since you configured the nginx firewall rule of your client, but you don't know shit.
When you visit Pornhub, the source IP is changed to the private IP of your PC, to the one of your router, which has a public IP, but also the source port changes to a random one, for example 64321. The router keeps track of this mapping, so when Pornhub reaches the router again to show your selected content, it sends its packages to the 64321 port of the router public IP, which it associated to your internal IP.
This is called Port Address Translation, which is a special case of Network Address Translation aka NAT. NAT can also be implemented using different public IPs, instead of different ports like PAT, but you know IPv4 slots are exhausting.
PAT happens at TCP level, cause IP protocol doesn't know what a port is.













