Port numbers

TCP/IP provides a set of 16-bit port numbers within each host. Because each host assigns port numbers independently, ports on different hosts can have the same number.

When a client process requires a particular service at a host, the client process sends a service request. This is sent to the socket address for the host port.

If a process on the host is listening, then the server process does one of:

  • Services the request using the port.
  • Transfers the connection to another port that is temporarily assigned for the duration of the connection to the client.

Using temporarily assigned, or secondary, ports frees the original port for the host port to concurrently handle additional requests.

This table shows the port number services:

Port range Services
0 to 023 Reserved for root processes.
0 to 255 Reserved for official Internet services.
256 to 1023 Reserved for common Internet network services. The /etc/services file lists the common port numbers.
1024 + Used by processes requiring a temporary port after an initial service request is received.
5000 + Suggested port numbers for users.
10300 The TCP/IP port number of the GDBM server listening port.