TCP ports and sockets
Three categories of ports
Ports have been divided into three categories by the Internet Assigned Numbers Authority (IANA): System Ports, User Ports, and Ephermeral Ports
- System Ports are identified as ports 1 through 1023. System ports are reserved for common applications like FTP (port 21) and Telnet over TSL/SSL (port 992). Many still are not assigned. Note: Modern operating Systems do not use system ports for outbound traffic.
- User Ports are identified as ports 1024 through 49515. Vendors register user ports for their specific server applications. The IANA has officially registered some but not all of them.
- Ephemeral Ports (Dynamic or Private Ports) are identified as ports 49152 through 65535. Ephemeral Ports are used as temporary ports for private transfers. Only clients use ephemeral ports.
Not all operating systems follow the port recommendations of the IANA, but the IANA registry of assigned port numbers is the most reliable for determining how a specific port is being used.