Skip to main content
edited tags
Link
Zac67
  • 88.1k
  • 4
  • 73
  • 137
Source Link
X Y
  • 103
  • 1

Two PC on the same LAN, communicating the same Server

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?