Summary

  • RFC 5952, August 2010, opens with a plain observation — "a single IPv6 address can be text represented in many ways" — and then lists seven spellings of the same address.
  • It defines a canonical writing form and nothing else. It "does not define a format for internal storage", and "all implementations must accept and be able to handle any legitimate RFC 4291 format".
  • The rules are mechanical: "leading zeros MUST be suppressed", "::" is used "to its maximum capability", it "MUST NOT be used to shorten just one 16-bit 0 field", the longest run of zeros wins, ties go to the first run, and hex digits are lowercase.

Same address, many texts

An address is a number. A log line, a config file, a blocklist entry and a firewall rule are strings. Between the two sits a formatting decision, and before 2010 every program made that decision for itself.

The RFC's opening example is one address with seven legal spellings. Same bits, same route, same host — seven different strings that a naive comparison treats as seven different things. Two tools could look at two lines, disagree about whether they described the same machine, and both be right. That is not a bug in either tool. It is a missing convention.

Why the text matters

Comparison is the whole reason. A filter that matches a prefix as a string fails the moment the same address arrives spelled differently. A log search misses an entry. A blocklist entry and a packet pass each other like strangers.

Deduplication, rate limiting, audit, debugging, billing, abuse handling — all of it runs on text. None of it cares about bits. All of it breaks when the same bits have more than one spelling. The address was never the problem. The string was.

Write strictly, read generously

The interesting part is the asymmetry. Systems should emit the canonical form and must accept every legitimate one. That is the robustness principle applied to a representation rather than a protocol: be liberal in what you accept, because old senders exist and will not be re-educated; be conservative in what you emit, because your output is somebody else's input.

The RFC does not ask anyone to forget the old spellings. It asks everyone to stop inventing new ones. That is a smaller ask than it sounds, and a harder one than it looks.

The zeros rule and why it is arbitrary

Fewest characters is the stated goal, which explains suppressing leading zeros and squeezing the double colon for all it is worth. What it does not explain is the ban on using "::" for a single zero field, or the tie-break that shortens the first run when two runs are equally long.

Those are conventions, not discoveries. Any consistent choice would do. The value lies in everyone choosing the same one, not in the choice being optimal. Half of interoperability is arbitrary, and the arbitrariness is the point.

What canonical form does not fix

It does not make the address resolvable, routable or meaningful. It says nothing about internal storage. And it cannot fix a system that compares texts without normalising them first.

That last gap is where the document's limits show. A canonical form is only useful to code that applies it on both sides of a comparison. The RFC can mandate the spelling. It cannot mandate the discipline. A parser that ignores the rule is not violating a law of mathematics. It is just wrong in a way that only shows up when two systems disagree.

The lesson about representation

A short text form is a public interface whenever humans or logs touch it, and interfaces need one spelling. Choosing it is cheap. Agreeing on it is not.

It is the smallest version of a much larger design problem: how independent actors agree on a common rule without handing anyone permanent authority over the rest. Decide the canonical form early, write the arbitrary parts down as conventions, require every writer to use it, and keep every reader accepting the rest.

The address was never ambiguous. The text was. Fixing the text took an RFC and a rule that survives only because parsers keep enforcing it.