0

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

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 216.33.23.5, because 192.168.1.5 and 192.168.1.6 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 : (216.33.23.5, 3455) and (216.33.23.5, 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

1

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).

0

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.