Port Numbers - The Internet's "Room Numbers"

If an IP address is a building's street address, then a port number is the room number within that building. A single server can simultaneously provide web pages, email, SSH, databases, and other services because each service is separated by a different port number. To understand how the "street address" part works, see our guide on what an IP address is.

Port numbers are integers from 0 to 65535, totaling 65,536. Hidden within these numbers are stories of internet history, engineer humor, and surprising origins.

Well-Known Ports (0-1023) - The Internet's "Prime Real Estate"

Port numbers 0 through 1023 are called "Well-Known Ports" and are assigned to specific services by IANA. On Unix-like operating systems, root privileges are required to use these ports.

Port 80 (HTTP) and 443 (HTTPS)

The standard ports for the web. When you enter a URL in your browser, http:// connects to port 80 and https:// connects to port 443. You can omit the port number because browsers automatically fill in the default port based on the protocol.

Why 80? When Tim Berners-Lee designed HTTP in 1991, port 80 was still unassigned. It was a round number, easy to remember, and the convention at the time was simply to "use an available number." Port 443 was the next number assigned after HTTP.

Port 22 (SSH)

SSH (Secure Shell) creator Tatu Ylönen developed SSH at Helsinki University of Technology in Finland in 1995. As Ylönen himself recounted, he chose port 22 because "the space between 21 (FTP) and 23 (Telnet) was open." Both FTP and Telnet are older, unencrypted protocols, and SSH was designed as their secure replacement. Port 22, sitting between 21 and 23, was a perfect choice both symbolically and practically.

Port 25 (SMTP)

The port for the email sending protocol SMTP. Defined by Jon Postel in RFC 821 in 1982. Today, many ISPs block external connections on port 25 as an anti-spam measure, and port 587 (Submission) is recommended for email sending.

Port 53 (DNS)

The port for DNS. When a browser accesses a website, it first queries a DNS server on port 53 to translate the domain name into an IP address. DNS over HTTPS moves this communication to port 443 (HTTPS), enabling encryption of DNS queries.

Registered Ports (1024-49151) - "Semi-Prime Real Estate" Available by Application

Ports 1024 through 49151 are "Registered Ports" that can be assigned to specific services by applying to IANA. They can be used without root privileges.

Port 3306 (MySQL)

MySQL's default port. Why 3306? According to MySQL co-founder Michael "Monty" Widenius, there was no particular deep reason - it was simply "an available number."

Port 5432 (PostgreSQL)

PostgreSQL's default port. Like MySQL, there's no special origin story - the number chosen during development simply stuck.

Port 8080

Widely used as an alternative HTTP port. When starting a web server in a development environment, port 80 requires root privileges, so 8080 is used instead by convention. The number choice makes it immediately obvious that it's "an alternative to 80."

Ports 6666-6669 (IRC)

The default port range for IRC (Internet Relay Chat). The number 6666 evokes "the number of the beast" (666), but the reason IRC developer Jarkko Oikarinen chose this number is unknown. IRC was developed in Finland in 1988 and was the center of real-time communication in the early internet.

Dynamic Ports (49152-65535) - Temporary "Lodgings"

Ports 49152 through 65535 are "Dynamic/Ephemeral Ports" that the OS temporarily assigns for client-side communications. When a browser connects to a web server, the server side uses port 443, but the client side uses a dynamic port automatically assigned by the OS (e.g., 52847).

When the communication ends, the dynamic port is released and can be reused for other connections.

Port Number Trivia

Port 0 - It Exists but Can't Be Used

Port 0 is reserved as a "wildcard." When a program binds to port 0, the OS automatically assigns an available dynamic port. This is useful when you want "any available port" during testing or debugging.

Port Scanning - Looking for Open Doors

When attackers look for server vulnerabilities, port scanning is the first step. Tools like nmap scan all ports to investigate which services are running. Closing unnecessary ports and allowing only required ports through a firewall is the foundation of server security.

Why 65535?

Port numbers go up to 65535 because 16 bits are allocated for port numbers in TCP/UDP headers. 2^16 = 65,536, and including 0, the range is 0-65535. This design was established in the 1981 TCP specification (RFC 793).

Summary

Port numbers are a fundamental element of internet communication alongside IP addresses. Port 80 and 443 power the web, 22 provides secure remote access, and 53 handles name resolution. Each of these numbers carries a piece of internet history and design philosophy.

Beyond the IP address you can check on IP Check-san, countless services are running, separated by port numbers. Next time you open a website in your browser, remember that the communication is passing through port 443.

Related Terms

IP Address Combined with port numbers to identify communication endpoints. IP address is the "street address," port number is the "room number." HTTPS An encrypted communication protocol using port 443. The standard for web traffic. DNS The domain name resolution system operating on port 53. DNS over HTTPS migrates to port 443. Firewall A security device that allows or denies traffic based on port numbers. Closing unnecessary ports is a fundamental countermeasure. SSH An encrypted remote access protocol operating on port 22. Developed in 1995 as a secure replacement for Telnet.