2

I have been compressing IPv6 addresses but for some reason I can't compress this one:
2​b​0​6​:​0​0​0​0​:​0​0​0​0​:​1​f​2​b​:​d​7​7​f​:​0​0​0​0​:​0​0​0​0​:​8​9​c​e​

This is what I compressed it too: 2b06::1f2b:d77f::89ce

But this is not working, and I wonder, why.

3 Answers 3

6

This is the correct way to do it: 2b06::1f2b:d77f:0:0:89ce
You can't have :: more than once in one address.

This 2b06::1f2b:d77f::89ce would be ambiguous, as it could expand to
2b06:0000:1f2b:d77f:0000:0000:0000:89ce,
2​b​0​6​:​0​0​0​0​:​0​0​0​0​:​1​f​2​b​:​d​7​7​f​:​0​0​0​0​:​0​0​0​0​:​8​9​c​e, or
2​b​0​6​:​0​0​0​0​:​0​0​0​0​:0000:​1​f​2​b​:​d​7​7​f​:​0​0​0​0​:​8​9​c​e.

Sign up to request clarification or add additional context in comments.

Comments

0

The Standards Track RFC 5952, A Recommendation for IPv6 Address Text Representation explains:

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.

Comments

-1

You can have more than :: in one address

the correct answer is 2b06::1f2b:d77f:0:0:89ce

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.