If an IP address is a building, ports are its doors. Each service listens on a port number: web servers on 80/443, SSH on 22, and so on.
The numbers
TCP and UDP each have 65,535 ports (1–65535). Every device has both sets.
| Port | Service |
|---|---|
| 21 | FTP |
| 22 | SSH |
| 25 | SMTP (mail) |
| 53 | DNS |
| 80 / 443 | HTTP / HTTPS |
| 445 | SMB (Windows file sharing) |
| 3389 | RDP (Windows remote desktop) |
What Nmap scans by default
Scanning all 65,535 ports on every host is slow, so by default Nmap checks the top 1,000 most common TCP ports.
nmap 10.0.2.5 # top 1,000 TCP ports
nmap -F 10.0.2.5 # top 100, faster
nmap -p- 10.0.2.5 # all 65,535 TCP ports
sudo nmap -sU --top-ports 20 10.0.2.5 # UDP is separate and slower
A service on an unusual port (say SSH on 2222) can be missed by a default scan. That's why -p- matters on real tests.
Reference: Ports and protocols explained.