2

The loopback IP address in IPv6 format is: 0000:0000: 0000:0000: 0000:0000: 0000:0001

which is shortened to: 0:0: 0:0: 0:0: 0:1

which is then shortened to (keep last 2 words, ie. 4 bytes, to match IPv4): :0:1 (But I still don't know why it's double colons instead of single colon before 1, maybe for implying that there are 4 bytes here)

and simplified as: ::1

Expand ::1 into IPv4 format, it is: 0.0.0.1

But this is not the same as 127.0.0.1, where's the number 127?

Dee
  • 7,455
  • 6
  • 36
  • 70

1 Answers1

5

First, :0:1 is not a valid IPv6 address. I'll explain why:

IPv6 address are 128 bit addresses written as eight hexadecimal parts separated by colons. Because this can be quite tedious to write, and because many IPv6 address (like 0:0:0:0:0:0:0:1) contain many parts that are zero, it's allowed to replace one sequence of zeroes with two colons. The full address is still the same. It's just easier to write :: than 0:0:0:etc.

IPv4 and IPv6 are two different protocols. You cannot compare the IPv4 loopback address 127.0.0.1 with the IPv6 loopback address ::1. They are completely unrelated. Both of them just happen to end with the same digit.

Sander Steffann
  • 9,509
  • 35
  • 40
  • 5
    Yes, they are so unrelated that the IPv4 loopback is really an entire network (`127.0.0.0/8`), and the IPv6 loopback is a single address. This has has created problems for some programmers who have relied on using multiple loopback addresses for IPv4 when they are trying to convert an application to IPv6. – Ron Maupin May 12 '18 at 16:02