There’s a new IETF document published today, RFC 5952 “A Recommendation for IPv6 Address Text Representation”. It does us the favor of standardizing the text representation of IPv6 addresses, which is otherwise subject to various syntactically-correct yet inconsistent shorthands. To summarize the recommendation:
- Handling Leading Zeros in a 16-Bit Field – Leading zeros MUST be suppressed.
- Shorten as Much as Possible – The use of the symbol “::” MUST be used to its maximum capability.
- Handling One 16-Bit 0 Field – The symbol “::” MUST NOT be used to shorten just one 16-bit 0 field.
- Choice in Placement of “::”
- When there is an alternative choice in the placement of a “::”, the longest run of consecutive 16-bit 0 fields MUST be shortened.
- When the length of the consecutive 16-bit 0 fields are equal, the first sequence of zero bits MUST be shortened.
- Lowercase – The characters “a”, “b”, “c”, “d”, “e”, and “f” in an IPv6 address MUST be represented in lowercase.




