• Laser@feddit.org
    link
    fedilink
    English
    arrow-up
    1
    ·
    16 days ago

    There are also differences in how the collapse white space, primarily in that IPv6 can collapse multiple zero sections

    What do you mean by that? The example did collapse multiple zero sections for IPv4 as well (127.69), and IPv6 can also only collapse one block, namely the longest one, otherwise it’d be ambiguous as to how to pad each. Or am I misunderstanding?

    • Taldan@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      edit-2
      16 days ago

      In IPv4, there is no way to indicate which octet is being skipped. Think of the address 127.0.69.69, which we’ll use the equivalent of 1270:0000:0000:0000:0000:0000:0000:6969:6969 in IPv6 (yes, I realize that address space doesn’t make sense. It’s just for illustration)

      In IPv4, you cannot shorten 127.0.69.69 to 127.69.69. The assumption with 3 octets is that the last two have been merged into one. 127.69.69 would be equivalent to 127.69.0.69

      In IPv6, this ambiguity is removed. Double colons are used to indicate missing zeros. 1270::6969:6969 is equivalent to the above IPv6 address. Double colon simply pads out the address at that point until it is the correct length. I seem to recall some other interesting features of it, but I don’t use IPv6 enough to remember them exactly

      Ninja edit: There is also a bit of weirdness in IPv4 because it’s not technically white space expansion as (I think) it is in IPv6. It’s just putting multiple bytes into a single octet. That’s why 127.257 or 127.0.257 would both resolve to 127.0.1.1

    • partial_accumen@lemmy.world
      link
      fedilink
      English
      arrow-up
      1
      ·
      16 days ago

      The example did collapse multiple zero sections for IPv4 as well (127.69), and IPv6 can also only collapse one block, namely the longest one,

      The IPv4 example collapsed two “blocks”, “.000.000.”, or rather octets, and could do so because they were next to one another, which looks to behave the same way IPv6 does. In IPv6 the largest number of all zero hextets can be removed and replaced with double colons. So multiple hextets ( .0000) can be removed in shortening as long as they are next to one another in the IP address.