It is because you cannot determine how many sets of zero fields each ::
represents if there are more than one in an address text representation.
For example, the address:
2001:db8:0000:0000:1234:0000:0000:0000
written as:
2001:db8::1234::
is ambiguous, and it could be interpreted in various ways:
2001:db8:0000:1234:0000:0000:0000:0000
2001:db8:0000:0000:1234:0000:0000:0000
2001:db8:0000:0000:0000:1234:0000:0000
2001:db8:0000:0000:0000:0000:1234:0000
Where RFC 4291, IP Version 6 Addressing Architecture defined three valid test representations for IPv6 in Section 2.2, Text Representation of Addresses,
RFC 5251, A Recommendation for IPv6 Address Text Representation takes it a step further in Section 4, A Recommendation for IPv6 Text Representation:
4. A Recommendation for IPv6 Text Representation
A recommendation for a canonical text representation format of IPv6 addresses is presented in this section. The recommendation in this document is one that complies fully with RFC4291, is implemented by various operating systems, and is human friendly. The recommendation in this section SHOULD be followed by systems when generating an address to be represented as text, but all implementations MUST accept and be able to handle any legitimate RFC4291 format. It is advised that humans also follow these recommendations when spelling an address.
4.1. Handling Leading Zeros in a 16-Bit Field
Leading zeros MUST be suppressed. For example, 2001:0db8::0001
is not acceptable and must be represented as 2001:db8::1
. A single 16-bit 0000
field MUST be represented as 0
.
4.2. "::
" Usage
4.2.1. Shorten as Much as Possible
The use of the symbol "::
" MUST be used to its maximum capability. For example, 2001:db8:0:0:0:0:2:1
must be shortened to 2001:db8::2:1
. Likewise, 2001:db8::0:1
is not acceptable, because the symbol "::
" could have been used to produce a shorter representation 2001:db8::1
.
4.2.2. Handling One 16-Bit 0
Field
The symbol "::
" MUST NOT be used to shorten just one 16-bit 0
field. For example, the representation 2001:db8:0:1:1:1:1:1
is correct, but 2001:db8::1:1:1:1:1
is not correct.
4.2.3. 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 (i.e., the sequence with three consecutive zero fields is shortened in 2001:0:0:1:0:0:0:1
). When the length of the consecutive 16-bit 0
fields are equal (i.e., 2001:db8:0:0:1:0:0:1
), the first sequence of zero bits MUST be shortened. For example, 2001:db8::1:0:0:1
is correct representation.
4.3. Lowercase
The characters "a
", "b
", "c
", "d
", "e
", and "f
" in an IPv6 address MUST be represented in lowercase.