3

rfc5952, section 4.2.2 "Handling One 16-Bit 0 Field" goes:

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.

The kawamura-03 draft has a hint as to why:

4.2.2. One 16 bit 0 Field

"::" should not be used to shorten just one 16 bit 0 field for it would tend to mislead that there are more than one 16 bit field that is shortened.

But I'm not sure I follow the rationale here. Wouldn't it be simpler to understand if :: always expanded to the maximum allowed amount of zeros?

  • Why would human understanding be relevant, particularly is that would mean telling someone i.e. more details on a phone line to enter. There is no need to "understand" for a human. – TomTom Aug 07 '21 at 19:22
  • I have yet to see a parser that accepts it yet does anything other than exactly what you suggest: storing the maximum allowed amount (one) of all-zero blocks at the location of `::`. – anx Aug 07 '21 at 19:51
  • 2
    @anx Indeed, and the spec is clear about what is expected from a parser (it *must* do what you said, regardless whether the input is in the canonical form or not), but the question is about why this rule exists for generating the canonical text representation of an address. – Håkan Lindqvist Aug 07 '21 at 20:28
  • 3
    @TomTom The concern expressed in the second quote (from the draft) is clearly about not confusing humans, and I suppose even bothering with defining this canonical text representation in the first place is largely about making things easier for humans. Also, the specific case that this question is about does make the canonical text representation ever so slightly longer in the particular case where it is relevant. – Håkan Lindqvist Aug 07 '21 at 20:48
  • As for "Wouldn't it be simpler to understand if :: always expanded to the maximum allowed amount of zeros?", that is indeed how it works. – Håkan Lindqvist Aug 07 '21 at 21:55
  • 1
    It's a good question, but whatever discussion took place in the WG about this was likely in 2009 or earlier, and as far as I can tell, not online. I think it is unlikely you will ever get an answer beyond "this representation is designed for use by humans". – Michael Hampton Aug 11 '21 at 19:09

0 Answers0