Assume that we have 2 pc on the same LAN, local IP of pc1: local IP of pc2:

Now suppose that both pc1 and pc2 wants to connect to a server on the internet, we all know that the server will receive 2 requests from the same IP which is the public IP (let us say it is, because and are private, and for that, we have port numbers.

So the server will receive 2 combinations of (IP, source port number);

let us say they are : (, 3455) and (, 4666)

Now the question is, what will guarantee that pc1 and pc2 will not use the same source port number, then the server will get confused?

2 Answers 2


Short answer: the NAT router.

The NAT router needs to keep track of its translations, so it'll use distinct L4 port numbers for different connections. For source NAT, a NAT router doesn't normally re-use the client's source port but takes one from its own pool and translates that as well (NAPT).


No it will not use same source port. Beacuse natting algorithm is designed in such a way different source ports are generated randomly and will allocate as source ports while internal pc or servers are communicating for internet access . Internal ip will souce natted with isp public ip in this process source port is allocated by layer3 devices and this souce Port can seen in nat table ..

Generally souce Port is randomly generated by router or firewall to keep track of connection or session established for both inbound and outbound traffic . Source port is visible in NAT table

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.