This question already has an answer here:
I seem to get different answers from different people depending on the topic at hand. I'd like to actually understand how routers forward traffic to external networks using a single IP Address. I'm asking the following question: How does a router with a single IP Address forward requests from the multitude of clients behind it and when those request arrive back to itself, how does it know who requested it? I often get the contradictory answers of either NAT or PAT. But which is correct? Are they used in conjunction and why is that conjunction required?
Let's say I have a small network. Single router with IP Address of 10.0.0.1. Behind that I have 2 clients using the 192.168 address space. Client 1 attempts to connect to Google. When this happens, the packet reaches the router. The router substitutes it's public IP Address for the source IP, replacing the local 192 Address of the local packet. When that packet returns from Google, how does the router know which client requested the packet? At this point, is PAT being used?
It would seem to me that the router would have a memory of which packets it's forwarded and where they originally came from. It would then use this memory to forward the packet from Google back to the original requesting client. Does this happen at all? Or is this so called "memory" non existent?
Are PAT and NAT used in conjunction on every modern router?
How does this process truly work?