Skip to main content

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 just db8
  • 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 as 2001:db8::1. The only gotcha is that you can only do this once in an address, so if there are two sections with hextets of 0000 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.

Terminology

Along with the larger addresses there is some new terminology to get comfortable with. I'll go through the new relevant terms.

Prefixes

IPv6 is all about Prefixes serve as a very similar role to subnet masks in IPv4. It is represented in a similar way to IPv4 CIDR notation.

In IPv6 address 2001:0DB8:0000:000b:0000:0000:0000:001A/64, 2001:0DB8:0000:000b::/64 represents the network prefix and the possible IPv6 addresses ranges from 2001:0DB8:0000:000b:0000:0000:0000:0001/64 to 2001:0DB8:0000:000b:ffff:ffff:ffff:ffff/64.

What is IPv6 Network Prefix