IPv6 Subnetting Explained

IPv6 was designed to replace IPv4. The simple reason is that the IPv4 address space is running out. The world has reached the point where there are not enough 32-bit addresses to link every device which wants to connect to the Internet. IPv6 uses 128 bits. So how large is the IPv6 address space? Intuitively, it might seem like it’s 4 times bigger (128 compared to 32 bits), but it’s larger than that. Much much larger. Each additional bit adds an additional ‘power of 2’ to the address space. IPv6 allows almost 8*1028 times as many addresses as IPv4. Basically, a number too large for the human mind to grasp. Because of the enormity of the address space, IPv6 subnetting design follows different best practices.

Most experienced network engineers have become conditioned to using CIDR, VLSM, NAT, and private addresses to conserve IPv4 space. With IPv6, conserving addresses is no longer a concern. The subnet mask recommended for end host use in IPv6 is always a /64. This means that even if you have 200 devices on a single /64 network prefix, you still have 264-200 unused address spaces. This can be a little hard to accept if you’re used to subnetting to conserve IPv4 addresses, but you need to change your mindset when working with IPv6 and realize that there is absolutely no need to worry about wasting addresses.

Rather the concern is how many subnets fit within a certain network. If you’ve been assigned a /48, how many /64s can you place inside it? These are the questions that IPv6 subnetting asks. You can get try it out with our IPv6 subnetting practice.

IPv6 is written in hexadecimal, using the digits 0-9 and a-f. A hexadecimal digit represents 4 bits or 16 decimal units. Eight groups of four hexadecimal digits represent each IPv6 address. Colons separate these groups. An example is: 2001:0db8:2231:aaec:0000:0000:4a4a:2100. You can use our Binary Decimal Hexadecimal Calculator to convert between the different values.

Even though IPv6 addresses are written in hexadecimal units, they are still large and cumbersome. There are a couple of ways to shorten them. One or more leading zeros from each group can be dropped. A consecutive set of groups with only zeros can be replaced with double colons “::“. Putting this into practice, the above address can be written as 2001:db8:2231:aaec::4a4a:2100.

Note that the :: cannot be used on more than one section of zeros but only once per address. 2001::ab32:: is not a valid address because we do not know how many sets of zeros are in each :: group. The address could be 2001:0000:0000:ab32:0000:0000:0000:0000, or it could be 2001:0000:0000:0000:0000:ab32:0000:0000.

Correct IPv6 Notation

IPv6 addresses should be written a certain way. This will make interpreting the addresses faster and easier for humans and computer programs.

  • Leading zeros should be removed. 2001:0db8::0001 should be written as 2001:db8::1.
  • “::” must be used to represent the largest number of 16-bit sets of zero as possible.
  • If there are multiple places where “::” can be used, and the numbers of zeros are the same, use “::” on the leftmost set of zeros.
  • “::” cannot be used to shorten a single 16-bit set of zeros.
  • Letters in an IPv6 address should be written in lowercase.
  • To represent port numbers, wrap an IPv6 address in square brackets then, followed by a colon and the port number as [2001:db8::1]:80
  • For more information, see RFC5952.

Though the representation of the numbers is different, the computer still uses binary to do the actual subnetting. The binary math is the same. It’s just using larger numbers. There is still a network portion and a host portion of every address.

IPv6 does not use broadcast addresses. However, the broadcast address effect can be achieved by sending multicast to ‘all hosts’.

We also do not use dotted decimal subnet masks for IPv6. Everything is written in slash notation. In IPv6, the first 48 bits are used to define the network ID for networking and routing. The next 16 are used to define the subnet ID. The last 64 are used to identify host addresses.

A feature of IPv6 is that every device can create a unique link-local address based on the MAC address of the device. It works by inserting 0xFFEE into the middle of the MAC address. This changes the MAC address to 64 bits from 48 bits. The other thing that needs to happen is to flip the 7th bit.

  • fe80::/10 is a link-local unicast address
  • ::1/128 is the loopback address.
  • ::FFFF:0:0/96 are the IPv4-mapped addresses.
  • fe80::/10 are the link-local unicast addresses.
  • 2001:db8::/32 are the documentation addresses.
  • ff00::/8 are multicast addresses.

Subnetting IPv6

The number of subnetting bits is the new prefix length minus the original prefix length. So there are 4 subnetting bits when a /48 is broken into /52s (52-48 = 4).

The number of subnets possible with n subnetting bits is 2n. So if we have 4 subnetting bits, we can create 24 = 16 new subnets.

It’s common for an organization to be assigned a /48, which they can then allocate to their internal networks following the best practice of always using /64 for subnets with end hosts.

Each portion of an IPv6 address is 16 bits long, so a /48 falls on the boundary between the 3rd and 4th portions.

Let’s say the organization has been assigned 2001:db8:1::/48 for our example.

They can now assign the 65536 available associated /64 subnets to their internal networks:

  • 2001:db8:1:0::/64
  • 2001:db8:1:1::/64
  • 2001:db8:1:2::/64
  • 2001:db8:1:3::/64
  • 2001:db8:1:4::/64
  • Etc., all the way up to 2001:db8:ffff::/64

You can see that real-world IPv6 subnetting and address planning is very easy and intuitive. When an organization is assigned a /48, all of the internal networks start with the same value for the first 3 portions of their IP addresses (2001:db8:1 in our example), and each internal subnet has a different value for the 4th portion (2001:db8:1:0, 2001:db8:1:1, etc., in our example). It’s very simple to understand and work with.

You can use our IPv6 subnet calculator if you need to figure out a more complicated example.

Download our Subnet Cheat Sheet for all the essential information you need to quickly perform subnet calculations in your head.If you want to learn more about networking and get the Cisco CCNA certification, we highly recommend the Cisco CCNA Gold Bootcamp as your CCNA training course. The CCNA is by far the most in-demand networking certification by employers, and the Gold Bootcamp is the highest rated Cisco course online. It has an average rating of 4.8 from over 30,000 public reviews:
Cisco CCNA Gold Bootcamp training course