How does Google know my Public IP if my packets are modified by ISP’s NAT?

184 views

So if my router’s packets are sent through the ISPs routers, then isn’t the source IP of that packet changed when it gets modified by ISP’s NAT? Shouldn’t that mean Google sees the source IP of that packet as the same as the last router’s IP? How does it know my personal router’s public IP?

In: 1

6 Answers

Anonymous 0 Comments

Routing and NAT is not the same.

NAT changes the IP addresses from one internal to one external, the device that does that needs to remember how it do that. It is usually only done by the router you have at home.

Router out on the internet do just forward the packet toward the destination. The part that requires some work it to know in what direction it should forward the packet. If it is connected to five other routers need to forward it in the right direction. The packet is not changed. The router does not need to remember what packets have forward at all.

If your router has a public IP then by definition it will be the one that is in a packet that all computers you connect to receive. If the IP is changed with NAT it is a private IP. All IP packets contain both the source and destination IP and the source and destination port. The computer on the other end knows to what program in the computer should get the data by looking at that.

You are viewing 1 out of 6 answers, click here to view all answers.