Network Basics: Networking Port Overview
In TCP/IP and UDP networks, a port is an endpoint to a logical connection. The port number identifies what type of port it is. For example, port 80 is used for HTTP traffic. If you use a command, such as netstat -n on Microsoft Windows or Linux, you see a listing of the local addresses (and ports) and the foreign addresses (and ports) to which they are connected.
The three categories of TCP and UDP ports are
Well-known ports: When IP was being implemented, there was a slow start of assigning services that needed to use specific ports. The ports were initially assigned from the lowest port number and worked their way up.
Ports 0–1023 are considered well-known ports because they were used by many of the core services on the Unix servers, and most required privilege permissions on the server to implement. Telnet (23) and Simple Mail Transport Protocol (SMTP) (25) are two examples of these services.
Registered ports: The Internet Assigned Numbers Authority (IANA) keeps the list of all services that run on both the well-known ports and on all registered ports. The registration process puts a permanent association in place with the port number and the service.
These services are all long-running services and would be assigned to ports between 1,024 and 49,151. The Microsoft Remote Desktop Protocol (RDP) (3389) and Network File System (NFS) (2049) are two examples of registered ports.
Dynamic and/or private ports: All other ports, from 49,152 to 65,535, are referred to as dynamic, or private ports. These ports are not permanently associated to any service.
If you write your own service, you can configure it to use any dynamic port that you want, but someone else may write his own service and use the same port. This will not cause any issue until you install both services on the same IP host because they are both going to want to use the same port, and that is just not possible.
It would be like two people having their phones hooked up to the same plug and receptacle at the operator’s office; it is not possible. This problem should not happen, though, if you have a registered port to work with because the other developer cannot use the same service.