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

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.