Reputation: 135
I know that TCP/UDP socket identified by 5-tuple, (protocol, src IP, src PORT, dst IP, dst PORT).
I thought that, theoretically, two TCP client socket on same src IP:src PORT can exist if dst IP:dst PORT differ.
So, out of curiosity, I did a simple test:
Server return message every second for 10 seconds for keeping connection.
Both client are bind()
ed manually, set SO_REUSEADDR
.
Because it cannot be decided which process to send each packet to, I expected the output of the returned message to be messed up in each client process. But the message was sent correctly to each of the clients who made the request.
I can't understand how it worked. What am I missing?
Upvotes: 0
Views: 77
Reputation: 203419
You actually answered your own question:
I know that TCP/UDP socket identified by 5-tuple, (protocol, src IP, src PORT, dst IP, dst PORT)
The first client's 5-tuple differs from the second client's 5-tuple because the "dst PORT" is different.
Upvotes: 1