100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace

What Are Well-Known Ports?

Learn what well-known ports are, the 0-1023 range, common examples like 80 and 443, and how they differ from ephemeral ports.

easyQ181 of 224 in Computer Networks Est. time: 5 minsLast updated:
Open Code Lab

Expected Interview Answer

Well-known ports are the reserved TCP/UDP port numbers from 0 to 1023, assigned by IANA to specific standard services, such as 80 for HTTP, 443 for HTTPS, 22 for SSH, and 53 for DNS, so that clients can find a server’s listening service without prior negotiation.

Because both client and server must agree on a port before communication can start, well-known ports act as a fixed, published convention: a server process binds to its assigned port and listens there indefinitely, while any client on the internet can connect to that port number and expect to find the matching service. On most operating systems, binding to a port below 1024 requires elevated privileges, which historically served as a weak trust signal that the process was administrator-approved. Above well-known ports sit registered ports (1024-49151), assigned to specific applications by request but not requiring root privileges, and then the dynamic/ephemeral range (49152-65535) used for transient client-side connections. Firewalls and security groups commonly write rules in terms of well-known ports because they map directly to recognizable services.

  • Gives every standard service a predictable, discoverable port number
  • Lets clients connect without prior configuration or negotiation
  • Forms the basis for readable firewall and security-group rules
  • Distinguished from registered and dynamic/ephemeral port ranges

AI Mentor Explanation

A well-known port is like the standardized gate number every stadium in a league agrees to use for media entry, say Gate 1 for the press box at every ground in the country. A journalist arriving at any stadium in the league already knows exactly where to go without asking, because the convention is fixed across venues. A random storage gate, by contrast, might be numbered differently at every ground. This universally agreed, fixed numbering is exactly what a well-known port like 80 for web traffic provides across every server on the internet.

Step-by-Step Explanation

  1. Step 1

    IANA assignment

    IANA reserves ports 0-1023 for standard services (e.g., 80 HTTP, 443 HTTPS, 22 SSH, 53 DNS).

  2. Step 2

    Server binds

    The service process binds and listens on its assigned well-known port, typically requiring elevated privileges below 1024.

  3. Step 3

    Client connects

    A client connects to the destination IP on that fixed port without needing to discover it first.

  4. Step 4

    Higher ranges

    Registered ports (1024-49151) and dynamic/ephemeral ports (49152-65535) handle everything else.

What Interviewer Expects

  • Knows the well-known range is 0-1023 and cites concrete examples
  • Explains why fixed ports remove the need for service discovery
  • Understands the distinction from registered and ephemeral ranges
  • Aware that binding below 1024 typically requires elevated privileges

Common Mistakes

  • Confusing well-known ports with ephemeral (client-side) ports
  • Misremembering the range boundaries (0-1023 vs 1024+)
  • Thinking any process can bind to port 80 without privileges by default
  • Not being able to name common examples (HTTP, HTTPS, SSH, DNS, FTP)

Best Answer (HR Friendly)

Well-known ports are the standard, agreed-upon door numbers every server uses for common services, like port 80 for regular web traffic and port 443 for secure web traffic. Because everyone agrees on these numbers in advance, your browser can connect to any website without first asking which port to use.

Code Example

Looking up and testing well-known ports
# Look up a service name for a well-known port
grep -w 443 /etc/services
# https		443/tcp

# Confirm a server is listening on a well-known port
nc -vz example.com 443
# Connection to example.com 443 port [tcp/https] succeeded!

# Show which local process is bound to port 80 (needs privileges below 1024)
sudo ss -tlnp 'sport = :80'

Follow-up Questions

  • What is the difference between well-known, registered, and dynamic ports?
  • Why does binding to a port below 1024 usually require root privileges?
  • What well-known port does DNS use, and for which transport protocols?
  • How do firewalls typically write rules in terms of well-known ports?

MCQ Practice

1. What is the well-known port range?

IANA reserves ports 0-1023 as well-known ports for standard services.

2. Which port is conventionally used for HTTPS?

Port 443 is the well-known port for HTTPS (HTTP over TLS).

3. What typically restricts binding to well-known ports on Unix-like systems?

Binding to ports below 1024 traditionally requires root or an equivalent elevated capability.

Flash Cards

Well-known port range?0-1023, reserved by IANA for standard services.

HTTP vs HTTPS ports?HTTP uses port 80; HTTPS uses port 443.

SSH default port?Port 22.

What comes after well-known ports?Registered ports (1024-49151), then dynamic/ephemeral ports (49152-65535).

1 / 4

Continue Learning