A port is a logical construct that serves as a communication endpoint in a computer network's transport layer. It is identified by a 16-bit unsigned integer, ranging from 0 to 65535, embedded in the headers of TCP and UDP packets. This mechanism allows a single IP address to host multiple independent services simultaneously by multiplexing the traffic.
The operating system uses the port number to route incoming network packets to the correct application or process. Ports are categorized into Well-Known Ports (0–1023), Registered Ports (1024–49151), and Dynamic or Private Ports (49152–65535). Well-known ports are assigned by IANA for core network services and usually require elevated privileges to bind a process to them.
Usage
Networking professionals use ports to manage service accessibility and security. Common examples include 22 for SSH, 53 for DNS, and 3306 for MySQL. Firewalls filter traffic based on these numbers to block unauthorized access or redirect traffic via NAT. Commands like ss -lntp or nmap are standard tools for identifying which ports are listening for incoming connections on a host.