John Hwang
John Hwang

Reputation: 85

On the linux network socket server machine, what happens when all network ports are allocated for clients

On the linux network socket server machine, what happens when all network ports are allocated for clients? If it happens, the connection request from clients are denied, or delayed? If that's right, is it right to think that one linux machine can serve at most the number of open ports simultaneously? (under assumption that all other resources are enough)

Upvotes: 0

Views: 42

Answers (1)

Nemanja Boric
Nemanja Boric

Reputation: 22157

If that's right, is it right to think that one linux machine can serve at most the number of open ports simultaneously?

No, the port is not the limiting factor here. TCP connected socket is actually a quintuple (src_port, src_address, dest_port, dest_address, protocol).

So, for every server listening on one port, every client will be able to make whatever is set in ip_local_port_range connections using the same protocol.

However, you can work around this - if you have more IP addresses (you could use IP aliasing for this, even if you don't have more than one interface), or if your server is listening on more than one port, the number of possible connections goes up.

Resources:

Upvotes: 2

Related Questions