your router uses a thing called Network Address Translation (NAT). https://en.wikipedia.org/wiki/Network_address_translation
it keeps a list of all the devices on your network and their private internal ip, then when one of them sends a message to the internet, the router takes the message and swaps the private ip for the public ip, and sends it out on the internet. it also changes the “reply to this port” field (each IP has like 60000 different ports it can use to get messages).
it then keeps a table of which port is expecting a reply, and what the original private ip and port were, then when the router gets a reply on that port, it again swaps out the informztion for the original and sends the packet to the private ip internally.
Latest Answers