Quick Explainer
IPv6 took me longer than expected to wrap my head around and implement. I went in expecting just IPv4 with 128-bit IP addresses but it turned out to be a little bit bigger of a change. Although it was a little confusing originally I think I have a better handle on it now and can explain some of the changes from IPv4.
A New Look
IP addresses are no longer 32-bit and represented in decimals in a dotted quad notation like 10.0.4.1
. They're now 128-bit and represented in 32 hexadecimal characters broken down into 8 groups and look like 2001:db8:2458:a2b2:cd47:8abb:8844:1
. These groups are sometimes called hextets. They can be a little scary to look at but the basic concepts are the same. There are two tricks to writing them to simplify them a little.
- Leading zeros in any hextet can be dropped. So
0db8
could be shown as justdb8
- If there are multiple hextets that are empty like
2001:db8:0000:0000:0000:0000:abcd:1
they can be shortened to an empty syntax of::
. So that address could be shown as2001:db8::1
. The only gotcha is that you can only do this once in an address, so if there are two sections with hextets of0000
you can only shorten one of them. I thought this would be annoying but I literally haven't run into a situation where that would have been needed.