Reputation: 278
TCP and UDP protocols have 16-bit port field. Therefore operating systems network stacks, functions and structures have 16-bit values for the port. But is it possible situation, when operating system has more than 65535 ports?
Upvotes: 0
Views: 1037
Reputation: 2912
But is it possible situation, when operating system has more than 65535 ports?
Not with any protocol that uses a 16-bit field for the port number. It's not up to the operating system since it's part of the protocol and you cannot change that without changing all existing hosts.
As Ron Maupin has pointed out, that isn't normally a practical limitation since an application can use a single port to communicate with an arbitrary number of hosts. A socket is defined by the tuple source IP, destination IP, L4 protocol, source port, destination port. As long as that tuple is unique, the socket is unambiguously defined.
The number of L4 ports may become a bottleneck with network address (port) translation (NAPT) but business-grade NAT routers usually support using a pool of public IP addresses instead of just a single one.
What if "extended port number" exists only inside OS network stack for multiplex to isolated environments?
If you define your own transport-layer protocols you can make that field 128 bit if you wish. Practically, there's no need to do so.
Upvotes: 1