When my PC sends a request to a server, the transmitted IP address is the one of my private network. When the server responds to the request, how does the router know to which PC in the network to send the response?
Asked
Active
Viewed 1,369 times
1 Answers
4
The NAT process maintains the translations tables. When the client sends to the server, NAT creates a table entry which saves the fact that the client IP address and port sent something to the server IP address address and port. When something comes back from the server address and port to the public address and NAT selected port, NAT looks it up and sees that it should go to the client address and port.

Ron Maupin
- 99,565
- 26
- 120
- 195
I'll set some terminology (because I don't know what they're called yet) client = my pc or phone router = the device that has a WAN ip and connects to internet destination = another WAN ip like google.com
When the
destination
responds, it will address that to the router's WAN address + client's assigned ephemeral port (CAEP). The NAT knows what client it belongs to because of the CAEP.Now, I think what @Lou is asking, who assigns that CAEP?
– Hunkoys Dec 15 '23 at 23:41Given:
How does NAT know which client to forward the response to if it got a reponse from google to 123.123.123.123:10000?
– Hunkoys Dec 15 '23 at 23:55