NAT
If you are using static (one-to-one) NAT, the router will assign the 11.2.10.172
public IP to the first PC ( for example 192.168.1.101
) trying to reach google.com. In this case, the two PC will not be able to communicate with google.com at once, because the only available public IP is already distributed.
The NAT table in the router:
11.2.10.172 -> 192.168.1.101
PAT
In your case PAT ( NAT overloading ) is the solution.
With PAT, multiple addresses can be mapped to one private IP. When a device initiates a TCP/IP session, it generates a TCP or UDP source port number to uniquely identify the session. When the router receives this packet it uses that source port number to uniquely identify the translation.
Example
PC1 (192.168.1.101
) makes an HTTP request to google.com (64.233.161.1
) with a random source port number (1444). PC1 will send a packet with DA: 64.233.161.1:80 | SA: 192.168.1.101:1444
. When the router receives this packet it inserts 11.2.10.172:1444 -> 192.168.1.101:1444
to the NAT table then changes the L3 addressing of the packet to DA: 64.233.161.1:80 | SA: 11.2.10.172:1444
and forwards it to google.com.
Google responds with DA: 11.2.10.172:1444 | SA: 64.233.161.1:80
. The router receives this packet and translates it to DA: 192.168.1.101:1444 | SA: 64.233.161.1:80
then forwards it to PC1.
If PC2 (192.168.1.102
) sends a packet with the same source port number as PC1 did , the router simply increases the port number by 1. In that case the NAT table would look like this
11.2.10.172:1444 -> 192.168.1.101:1444
11.2.10.172:1445 -> 192.168.1.102:1444
I hope it helps a bit.
UPDATE
As @CraigConstantine noticed, 10.2.10.172
is still in the private address space so I have changed it to 11.2.10.172
.