Common TCP & UDP Ports
Nerd Caf
Lesson Objectives
By the end of this lesson, you will:
Understand the importance of TCP & UDP ports in networking.
Learn the common TCP and UDP port numbers.
Differentiate between well-known, registered, and dynamic ports.
Perform practical exercises using command-line tools to check open ports and active connections.
1. Understanding TCP and UDP Ports
What is a Port?
A port is a virtual endpoint for communication in a network.
Ports allow multiple services to run on a single device using different identifiers.
Every port is associated with an IP address and a specific transport protocol (TCP or UDP).
What is the Difference Between TCP and UDP?
Connection
Connection-oriented (requires handshake)
Connectionless (no handshake)
Reliability
Reliable (ensures data delivery)
Unreliable (no guarantee of delivery)
Speed
Slower (due to error checking)
Faster (less overhead)
Use Cases
Web browsing, email, file transfer
Streaming, VoIP, gaming
2. Well-Known TCP & UDP Ports
Ports 0 – 1023 (Well-Known Ports)
These are assigned by the Internet Assigned Numbers Authority (IANA) for common services.
20 & 21
TCP
FTP
File Transfer Protocol (Data & Control)
22
TCP
SSH
Secure Shell for remote login
23
TCP
Telnet
Unsecure remote access
25
TCP
SMTP
Simple Mail Transfer Protocol (Email sending)
53
UDP/TCP
DNS
Domain Name System (Name resolution)
67 & 68
UDP
DHCP
Dynamic Host Configuration Protocol
69
UDP
TFTP
Trivial File Transfer Protocol
80
TCP
HTTP
Hypertext Transfer Protocol (Web browsing)
110
TCP
POP3
Post Office Protocol (Email retrieval)
143
TCP
IMAP
Internet Message Access Protocol
161-162
UDP
SNMP
Simple Network Management Protocol
443
TCP
HTTPS
Secure Web Browsing
3389
TCP
RDP
Remote Desktop Protocol
Ports 1024 – 49151 (Registered Ports)
Used by software applications (e.g., database servers, proprietary apps).
Examples:
1433: Microsoft SQL Server
1521: Oracle Database
3306: MySQL Database
5060: SIP (VoIP)
Ports 49152 – 65535 (Dynamic/Ephemeral Ports)
Assigned dynamically by the OS for client connections.
Used temporarily during communication.
3. Practical Exercises
Let's use real-world commands to identify and manage ports.
Exercise 1: Checking Open Ports on Your System
Windows:
Open Command Prompt (
cmd
) as Administrator.Run:
This will show active listening ports.
Linux/macOS:
Open Terminal.
Run:
This will list open ports and associated services.
Exercise 2: Checking a Specific Port
Windows (PowerShell):
To check if port 80 (HTTP) is open:
Linux/macOS:
If the port is open, you will get a successful connection message.
Exercise 3: Scanning for Open Ports
Using Nmap (Install Required)
Install Nmap:
Linux/macOS: Use:
Scan a network for open ports:
This checks for open ports on a local network device.
4. Key Takeaways
TCP is reliable but slower; UDP is faster but less reliable.
Well-known ports (0-1023) are assigned for critical services.
Use
netstat
andnmap
for port analysis.Security tip: Close unnecessary ports to reduce vulnerabilities.
Keywords
TCP ports
, UDP ports
, well-known ports
, registered ports
, dynamic ports
, netstat
, nmap
, network security
, port scanning
, SSH
, FTP
, HTTP
, HTTPS
, SMTP
, DNS
, DHCP
, SNMP
, Telnet
, RDP
, firewall
, نتورک پلاس
Last updated