Comment on How does a game server differentiate between multiple clients on the same network? Do they even?

dhork@lemmy.world ⁨3⁩ ⁨days⁩ ago

A lot of good answers here, talking about the IP/port combinations used to identify both sides of a connection. But a key thing to understand is that both ports don’t need to be the same. On the Client side, the port number is often assigned just for that connection. (The standards call those “ephemeral” ports.) So, two independant connections from the same IP are differentiated by their client side IP ports.

It should also be noted that NAT works by translating both IP addresses and ports. So if those two connections are coming from behind the NAT and have different internal IPs but the same port, the NAT will translate that to two different ports from the public IP.

source
Sort:hotnewtop