When a packet arrives at your computer (IP address), how does the operating system know if it belongs to Chrome, Spotify, or Zoom? The answer is Ports. An IP Address connects two computers. A Port connects two programs running on those computers.
The socket
A network connection is defined by a socket pair:
{ClientIP:ClientPort} <-> {ServerIP:ServerPort}
Example: 192.168.1.50:54321 <-> 142.250.190.46:443.
Your browser picked a random port (54321) to talk to Google's standard port (443).
1. The 3 Ranges (IANA)
There are 65,535 possible ports (16-bit number).
| Range | Type | Description |
|---|---|---|
| 0 - 1023 | Well-Known | Reserved for system services (Root usually required). Web, Mail, SSH. |
| 1024 - 49151 | Registered | Assigned to specific software (Microsoft SQL, Minecraft, Steam). |
| 49152 - 65535 | Dynamic / Ephemeral | Used by client applications for temporary connections. |
2. Critical Ports to Know (Memorize This)
If you work in IT, these numbers must be second nature:
- 21 (FTP): File Transfer (Insecure).
- 22 (SSH): Secure Shell (Remote Administration).
- 23 (Telnet): Remote Admin (Insecure - Do not use!).
- 25 (SMTP): Sending Email.
- 53 (DNS): Domain Name System.
- 80 (HTTP): Unencrypted Web.
- 443 (HTTPS): Encrypted Web.
- 3389 (RDP): Windows Remote Desktop.
3. Port Forwarding
Your router has a firewall. By default, it blocks all incoming traffic initiated from the outside.
If you host a Minecraft server on your PC (port 25565), your friends can't connect.
Port Forwarding tells the router: "If anyone knocks on the router's Port 25565, send them to my PC's internal IP (192.168.1.10) on port 25565."