ShareYourGroupShareYourGroupSubnet and Ports

What is a port number? System, user and dynamic ports

An IP address finds a device. A port number finds the program on that device. Together they identify one conversation.

What a port is

A computer runs many network programs at once: a browser, a mail program, a game, a server. Each connection over TCP or UDP uses a 16-bit number, the port, from 0 to 65,535, so that the data goes to the right program. The IP address says which computer, the port says which program.

The three ranges

RFC 6335, which describes how IANA manages the port registry, divides the numbers into:

RangeNameMeaning
0 to 1023System Ports (Well Known Ports)Assigned to standard services: 80 for web, 22 for SSH
1024 to 49151User Ports (Registered Ports)Assigned on request to applications: 3306 for MySQL
49152 to 65535Dynamic Ports (Private or Ephemeral)Never assigned; used temporarily by clients

How a connection uses ports

When your browser opens https://example.com, it connects to port 443 on the server (the destination port). Your computer picks a free dynamic port for itself, such as 53012 (the source port). The pair of addresses and ports, source and destination, identifies this connection. If you open two tabs to the same site, they use two different source ports.

TCP and UDP have separate port spaces

TCP port 53 and UDP port 53 are different. The IANA registry lists a service for each protocol it is registered for. Many services (such as DNS) are registered for both.

What the registry means

A registered name is a hint, not a law. A web server can listen on port 8080 or 2222 if you configure it. The registry tells the world what is *normally* expected. Security tools use the numbers to guess what runs, but a program can use any port, so a number alone does not prove what is behind it.

Why ports matter for security

Each open port is a way in. Servers should listen only on ports that are needed, firewalls should block the rest, and services that carry passwords (like Telnet) should be replaced by encrypted ones (SSH). The port topic pages on this site explain the common ones.

Common mistakes

  1. Saying "port 80 is HTTP" as if it were a rule. It is the default; configurations differ.
  2. Forgetting that firewalls filter by protocol as well as port.
  3. Opening a port for the whole internet when only one address needs it.
How many ports are there?

65,536 numbers (0 to 65,535) for each of TCP and UDP.

What is port 0?

It is reserved and not used for normal connections.

Sources

  • RFC 6335, Internet Assigned Numbers Authority (IANA) Procedures for the Management of the Service Name and Transport Protocol Port Number Registry (read 14 November 2026)

This is an independent guide. It is not connected with IANA, the IETF or any network equipment maker. Address and port data come from the IANA registries as fetched on 14 November 2026; RFC texts were read from rfc-editor.org. Check the originals for anything you rely on.