Summary

  • RFC 6335, August 2011, a Best Current Practice numbered BCP 165, defines the procedures IANA uses for the service name and transport protocol port number registry, replacing the older UDP and TCP procedures from the IANA Allocation Guidelines.
  • It fixes the three ranges: System Ports, also called Well Known, from 0 to 1023; User Ports, also called Registered, from 1024 to 49151, assigned by IANA; and Dynamic Ports, also called Private or Ephemeral, from 49152 to 65535, never assigned.
  • The document counted its own resource: about 9% of the User Port space was assigned, at roughly 400 assignments per year, a rate steady for eight years — enough, it said, to sustain another 85 years of assignment. It then recommended that new protocols prefer service names looked up in the DNS over a fixed port whenever possible.

A registry older than the web

The port number registry is one of the oldest continuing jobs in the internet's administrative record. Its lineage runs through the Assigned Numbers documents, and the job it does is unglamorous: give a number to a service so that two machines can agree which conversation is which.

The 2011 document is the moment the arrangement was written down as a procedure rather than a custom. It divides the space into three bands with different authority over each, and it names the authority precisely: the first band is controlled through IETF processes, the middle band through expert review of individual requests, the last band not at all.

The arithmetic of 2011

RFC 6335 states the conservation argument in one paragraph: the port number space is finite, so conservation matters, so an application should use service names and SRV records instead of a fixed number when it can.

Then it does something rare in a standards document. It publishes the arithmetic. Only about 9% of the User Port space was assigned. Assignment ran at about 400 ports per year and had been steady for eight years. At that rate, the document said, the resource would sustain another 85 years "without the need to resort to reassignment of released values or revocation".

Read that as a verdict on scarcity. IPv4 ran out under pressure; the port registry is not running out, is not likely to, and has spent forty years issuing numbers to services that mostly stopped needing them.

The rules that keep the queue slow

The document's principles are conservation rules, and they are strict about naming. IANA strives to assign one port per service, and one port for all variants of a service, so a version two does not get version two of the number. Port numbers "are expected to encode as little information as possible", which is why a service that needs richer demultiplexing is supposed to do the demultiplexing itself.

One note in the text dates the document to a specific moment of disagreement: at the time of writing there was "no IETF consensus on when it is appropriate to use a second port for an insecure version of a protocol". The registry's job is to hold a number, not to settle an argument.

The advice to need fewer ports

The recommendation is unusual for a registry: protocols should avoid a fixed port when a service name would do. That shifts discovery into DNS, where a service record can carry the port dynamically, and it keeps the number space from carrying weight it was not designed for.

There is a self-interested edge to the argument. Service names have a much larger namespace, which the document notes "allows for simpler management procedures". A registry that owns the smaller space is telling protocol designers to use the larger one, which is either humility or good housekeeping.

Who wrote the rules

The author list is worth reading: one from ICANN, which operates the registry, one from Nokia, one from USC's Information Sciences Institute, one from Ericsson, one from Apple. The party that answers the requests co-authored the document that sets the bar for them, and the other authors are the implementers who have to live with the answer.

That is the ordinary shape of infrastructure governance, and it explains the document's tone. It is not a manifesto about scarcity. It is an operating manual that says, in numbers, how long the machine can keep running and asks the next protocol to need it less.

A port number is permanent, public, and cheap to obtain once an expert agrees. That permanence is the whole value, and it is why the registry can afford to be slow, generous and a little disappointed in its own users.