A port is a virtual communication endpoint that allows multiple services to operate simultaneously on the same IP address. When your computer sends a request to a server, the server uses the IP address to find the machine and the port number to route the request to the correct service.
Port Numbers
Port numbers range from 0 to 65535:
- Well-known ports (0–1023) — Assigned to standard services by IANA.
- Registered ports (1024–49151) — Used by applications (databases, custom software).
- Dynamic/ephemeral ports (49152–65535) — Assigned temporarily by the OS for outgoing connections.
Common Well-Known Ports
- 21 — FTP
- 22 — SSH
- 25 — SMTP (email)
- 53 — DNS
- 80 — HTTP
- 443 — HTTPS
- 3306 — MySQL / MariaDB
- 1433 — SQL Server
- 6379 — Redis
- 27017 — MongoDB