Network Port Fundamentals
What is a Network Port?
A network port is a virtual point where network connections start and end. Ports are software-based and managed by the operating system, allowing different network services and applications to communicate over a network.
Port Numbering System
Ports are identified by 16-bit numbers, ranging from 0 to 65,535, which are divided into three categories:
Port Range |
Category |
Description |
0-1023 |
Well-known Ports |
Reserved for standard system services |
1024-49151 |
Registered Ports |
Used by specific applications |
49152-65535 |
Dynamic/Private Ports |
Temporarily assigned for client-side connections |
Common Port Examples
graph TD
A[Port 80] --> HTTP
B[Port 443] --> HTTPS
C[Port 22] --> SSH
D[Port 25] --> SMTP
E[Port 53] --> DNS
Port Communication Protocols
Network ports operate using two primary transport layer protocols:
-
TCP (Transmission Control Protocol)
- Reliable, connection-oriented
- Ensures data delivery
- Used for web browsing, email, file transfer
-
UDP (User Datagram Protocol)
- Connectionless
- Faster but less reliable
- Used for streaming, online gaming
Practical Port Identification in Ubuntu
To view open ports on your system, you can use the following commands:
## List all listening ports
sudo netstat -tuln
## Alternative method using ss command
ss -tuln
## Scan specific ports using nmap
sudo nmap localhost
Port Security Considerations
Understanding ports is crucial for network security. Each open port represents a potential entry point for cyber attacks, making port management and monitoring essential.
At LabEx, we recommend regularly auditing and securing network ports to maintain robust cybersecurity infrastructure.