Understand IPv6 Addresses - Page 2
Let's take another look at our example IPv6 address:
2001:0db8:3c4d:0015:0000:0000:abcd:ef12 ______________|____|___________________ global prefix subnet Interface ID
The prefix identifies it as a global unicast address. It has three parts: the network identifier, the subnet, and the interface identifier.
The global routing prefix comes from a pool assigned to you, either by direct assignment from a Regional Internet Registry like APNIC, ARIN, or RIPE NCC, or more likely from your Internet service provider. The subnet and interface IDs are controlled by you, the hardworking local network administrator.
Eight blocks of 16 bits each are required in an IPv6 address. The IPv4 address occupies 32 bits, so that is why there are only seven colon-delimited blocks.
The localhost address is 0000:0000:0000:0000:0000:0000:0000:0001.
Naturally we want shortcuts, because these are long and all those zeroes are just dumb-looking. Leading zeroes can be omitted, and contiguous blocks of zeroes can be omitted entirely, so we end up with these:
2001:0db8:3c4d:0015:0:0:abcd:ef12 2001:0db8:3c4d:0015::abcd:ef12 ::192.168.1.25 ::1
I usually end up counting on my fingers, which is probably not the best method. ipv6calc is invaluable for checking your work. Suppose you're not sure if your compressed notation is correct. ipv6calc displays the uncompressed notation:
$ ipv6calc --in ipv6addr --out ipv6addr --printuncompressed ::1 0:0:0:0:0:0:0:1 $ ipv6calc --in ipv6addr --out ipv6addr --printfulluncompressed 2001:0db8:3c4d:0015::abcd:ef12 2001:0db8:3c4d:0015:0000:0000:abcd:ef12
Next week we'll get to the fun part: setting up a local IPv6 network, connecting to a public IPv6 network and learning how to calculate and assign IPv6 addresses.