IPv6 Subnetting

Before you start it is recommended to go through the article first: IPv6 Address Representation

IPv6 subnetting is similar to IPv4. However, people sometimes get confused due to the hex representation of IPv6 address. I’ll show you some examples of IPv6 subnetting and will explain why it is better to subnet on a Nibble bit boundary.

But before that, we need to understand what is a “Nibble”. One hexadecimal digit represents a nibble (4 bits), which is half of an octet or a byte (8 bits).

Example 1:

Let’s identify how many /36 subnets are there in 2001:DB8::/32 and what are they.

Step 1: Identify the “Subnetting Boundary” and the “Interesting Nibble”.

Interesting Nibble is the hex digit in the IPv6 address that contains the Subnetting Boundary. It can be multiple Interesting Nibbles depending on the Subnetting Boundary. Remember, in this example, we have to identify the /36 subnets out of a /32 prefix. So the Subnetting Boundary is between the binary bit number 32 and 36. Therefore, for this example, the Interesting Nibble is the hex digit that contains the binary bits from 32 to 36. So, the first thing we know that we have four binary bits (32∼36=4) for subnetting, hence, there are 2^4=16 possible /36 subnets in a /32 prefix. Now, for the ease of calculation 2001:DB8::/32 can be rewritten as 2001:DB8:0000::/32. Hence, the Interesting Nibble is shown below:

Step 2: Represent the “Interesting Nibble” in binary bits to identify “Subnetting Boundary”.

Now, if we expand the Interesting Nibble in binary bits, the Subnetting Boundary will look like this:

 

Step 3: Write down the binary numbers sequentially within the “Subnetting Boundary”.

As we have 4 binary digit as our Subnetting Boundary, we can have 16 sequential numbers shown below:

Step 4: Re-write the binary numbers back to their equivalent Nibble bit or Hex digit.

Our 16 sequential binary number combination can be re-written to their equivalent Nibble as below:

Step 5: Put each Nibble bits to complete the subnet and change the prefix length of each subnet.

Finally, each subnet is identified by placing the Nibble bits back to its respective place. Don’t forget to change the prefix size, in our case it is /36. Let’s have a look at the subnets:

Example 2:

Identify the first four /38 subnets in 2001:DB8::/32.

Let’s follow the same steps as explained in Example 1.

Step 1: Identify the “Subnetting Boundary” and the “Interesting Nibble”.

In this example, our Subnetting Boundary is between 32 and 38 (so there are 32∼38=6 binary bits for subnetting which would give us a total of 2^6=64 subnets). Therefore, we got two Interesting Nibbles reside between 32 and 38 bits.

Step 2: Represent the “Interesting Nibble” in binary bits to identify “Subnetting Boundary”.

See carefully that bit number 39 and 40 are included in the Interesting Nibble but not in the Subnetting Boundary.

Step 3: Write down the binary numbers sequentially within the “Subnetting Boundary”.

So, we write down binary bits sequentially within the Subnetting Boundary. Last two bits (39 and 40) are not included even though its within the Interesting Nibble.

Step 4: Re-write the binary numbers back to their equivalent Nibble bit or Hex digit.

When we re-write the binary bits back to its equivalent hex digit or Nibbles, we need to count bit number 39 and 40 as its part of the Nibble.

Step 5: Put each Nibble bits to complete the subnet and change the prefix length of each subnet.

Note

If you compare the above two examples, the first one gives subnets within the Nibble bit boundary (/36) whereas the second one is not (/38). If the subnet’s prefix length is a multiple of 4 then the addressing becomes easier. In Example-1, the subnet size is 36 which is a multiple of 4. That actually gives us the subnets as 2001:DB8:0000::/36, 2001:DB8:1000::/36, 2001:DB8:2000::/36 and continues up to 2001:DB8:F000::/36. That means every hex digit in the Interesting Nibble could be utilised to create new subnets. On the other hand, in Example-2, the subnet size is 38 which is not a multiple of 4. That gives us the subnets as 2001:DB8:0000::/38, 2001:DB8:0400:/38, 2001:DB8:0800::/38 and continues up to 2001:DB8:FC00::/38. Now, if you look closely, 2001:DB8:0100::/38 or 2001:DB8:0200::/38 or 2001:DB8:0300::/38 are not separate subnets rather they are all in the same subnet which is 2001:DB8:0000::/38. You may suddenly think that 2001:DB8:1300::/38 and 2001:DB8:1400::/38 are in the same subnet but actually they are not. It’s because all the hex digits in the Interesting Nibble could not be used as the subnet size is not a multiple of 4. It is cumbersome from the perspective of IP address management. Hence, it is recommended to subnet in Nibble bit boundary.

2 replies on “ IPv6 Subnetting ”

Leave a Reply