A port is a logical address that is assigned to a specific service or running application on the computer. It is a connection endpoint ( a docking point) that channels traffic to/from a specific service. Similar to physical sea ports that were used for ships to dock and allow for transportation to and from a country
Today all computers have to communicate with the other systems over the network locally or over the internet to access services or share information, before passing this information these systems first establish a connection each end of which is a socket, to make sure the information flows remains specific to that request and reaches the right system and service running on the system. A socket is a combination of transport protocol (TCP or UDP), an IP Address, and a Port.
The term port here should not be confused with physical ports on network devices, ethernet cards etc, to connect cables or establish connectivity, here it refers to a part of the logical address as explained above.
Referring to OSI model, ports are a transport layer (layer 4) concept. Only a transport protocol such as the Transmission Control Protocol (TCP) or User Datagram Protocol (UDP) can indicate which port a packet should go to.
Port Number Ranges
Service names and port numbers are used to differentiate between the various services that execute over transport protocols, such as TCP or UDP.
Internet Assigned Numbers Authority (IANA) is responsible for assigning service names and port numbers and maintains the registries which store service names and port numbers. Port Number is a 16-bit numerical value that ranges from 0 to 65535 and the port registries for transport protocols are divided into three number ranges.
System Ports (0-1023)
User Ports (1024-49151)
Dynamic / Private Ports (49152-65535)
Default Ports for Common Services
The system ports reserved for specific applications are referred to as well-known ports or default ports, for example FTP uses 21, HTTP uses 80, and DNS uses 53.
This default port on which the application works can be modified as per our requirements by editing the configuration file for the specific services for example httpd.conf, named.conf etc.
We can find the details of the well-known ports in the /etc/services file, The /etc/services file is used by applications to translate human readable service names into port numbers when connecting to a machine across a network. The file will typically include the service name, port/protocol, any aliases, and comments.
The /etc/services file should not be modified. The file is also a good resource to see which services use which port numbers and the protocols that are specified to work. 1
Some well-known ports
20
FTP Data (For transferring FTP data)
21
FTP Control (For starting FTP connection)
22
SSH
23
Telnet
25
SMTP
53
DNS
67
BootP
69
TFTP
80
HTTP
110
POP3
123
NTP
389
LDAP
443
HTTPS
Note : On Windows machines, the service names, port numbers and protocols can be found in the C:windows\system32\drivers\etc\services file.
The Technical Significance of Network Ports in IT Troubleshooting
Network troubleshooting requires isolating issues across different layers of the OSI model.
While at Layer 3 i.e., network-layer utilities verify basic host reachability (using ping command) transport-layer diagnostics rely on identifying the state of ports.
A successful ping confirms that the network layer is functional and the host is reachable. However, it does not guarantee that the application layer is accessible.
Analyzing port states allows network administrators to differentiate between infrastructure failures, application crashes, and security policy blocks.
Diagnosing Port States and System Behaviors
When troubleshooting issues when application or service is not reachable, we run port scan test, the returned state provides immediate diagnostic data which allows us to isolate network issue from applicatoin issue.
Open: The host is online, and a local process is actively listening on the target port. If communication fails despite an open port, the issue lies in application-level misconfigurations, authentication errors, or data corruption.
Closed: The host is online and actively rejects the connection. This indicates that the network path is clear, but the target application or daemon is either stopped, crashed, or not configured to listen on that network interface.
Filtered: The connection attempt receives no response and eventually times out. This state confirms the presence of a security device—such as a firewall, network access control list (ACL), or security group—that is actively dropping the packets before they reach the destination host.
Essential Commands to diagnose port issues
We can use following command line utilities to audit local and remote port states during an active incident:
netstat / ss : Displays all active sockets, routing tables, and interface statistics.
lsof -i: Maps open network sockets directly to their corresponding Process IDs (PIDs). This allows engineers to identify resource conflicts where two applications attempt to bind to the same port.
nc -zv [host] [port] / Test-NetConnection: Performs direct TCP handshakes against remote hosts to verify outbound network paths and rule out local firewall restrictions.
Author Nikhil Kumar Ahluwalia Founder Upspir
Nikhil has over 16 years of experience in the tech industry, before starting UPSPIR he was Vice President – Support and Delivery at Ameyo/Exotel. Nikhil has a vast experience in leading technical support and delivery teams. By building strong processes around training, mentoring and development of people he was able to create high performing support, delivery and professional services organizations in Ameyo, He is passionate about developing people, which motivated him to start Upspir. With Upspir he aims to take his passion next level by sharing his experiences and learning with those who want to build their career in the technical support domain.