IPv6 Subnetting

Subnetting IPv6 is just like IPv4, that is it uses the powers of two to determine the subnet mask. IPv6 doesn’t use a subnet mask, per say. Instead it uses slash notation. For example /64, /48, etc. The slash notation is known as a prefix.

IPv6 has 8 x 16 bit, colon (:) separated addresses that are 128 bits in length. In IPv6, if a 16 bit field has leading zeros, the leading zeros are dropped from the address. Also, if a 16 bit field has all zeros, then all the zeros can be dropped from the address and will be represented as with a double colon (::). However, the double colon can only occur once. If there are multiple fields that contain all zeros, then one field can be represented with the double colon (::), while the remaining fields will be represented with a single zero (:0:) Another thing to notice is that IPv6 uses Hexadecimal addresses, rather than plain decimal.

For instance, the example below has a leading zero in the second 16 bit field.


Another way to write that network out is to drop the leading zero:


However, if the last two fields contained all zeros. The second field could be represented with the double colon (::), while the third field could be represented with a single 0.


Easy, right? Now, I know what you’re thinking. You’re thinking, “James, didn’t you say that IPv6 Addresses contained 128 bit addresses? I only see 48 bits.”

You’re correct. The difference is the prefix, or slash notation at the end of the address. The address 2001:470:1f0f/48 represents a network and not a complete address. The equivalent, in IPv4, would be That also represents a network and could tell a network engineer what the usable IP Address range is. IPv6 isn’t different, except we do not have to list out the remaining address space for the host bits. However, we could do that by doing 2001:470:1f0f::0:0:0:0/48, which has a usable host IP Address range of 2001:470:1f0f:0:0:0 – 2001:470:1f0f:ffff:ffff:ffff:ffff.

Now again, I know what you’re thinking. “How many addresses does that represent”. The answer is 2^80 or 1.2089258e+24.

Now consider that the IPv4 address space has approximately 4.3 billion addresses (2^32 = 4,294,967,296). Out of those, only about 250 million addresses are usable. That’s because the address space has been broken up into smaller chunks, and as you know, each subnet has a network address and a broadcast address that can be assigned to computers. There is also private address ranges (RFC 1918 –,, and which can’t be routed through the Internet, but only reside on private LAN’s and only access the Internet through NAT. There is the network used for loop back addresses, Class D networks which is used for multicast, and Class E which is ‘experimental’ and isn’t used. That’s a whole lot of wasted address space.

IPv6 on the other hand is a lot more efficient with address space and there is more address space than any one person will ever need. In fact, every single individual can have an entire Internet worth of address space, in IPv6, and everybody will still have unique addresses. Even better, there will be room to spare. For reference, the IPv6 Address space is 2^128 or 3.4028237e+38. I can’t even count that high. :)

So, enough rambling. How do you subnet the darn things? Simple.

Let’s pretend that your ISP assigns you, 2001:470:1f0f/48. Great! You have more addresses than you’ll ever need, but I hope that you’re network is layer two only, as that doesn’t help you much. :)

Right now, it’s a common practice for your ISP to hand you a /48 prefix, and then you can take that and break it down to /64 prefixes.

Let’s do this.


The /64 prefix would pertain to the fourth 16 bit field, or the first zero, colon separated field in the example above. 48 + 16 = 64, after all. :) Breaking the /48 prefix into multiple /64 prefixes will allot you 65536 networks, each network will provide you with 1.8446744e+19 address. Do you think that you can manage? :)

Let’s list a few of those networks out:



Get the idea? You can also break that out into even smaller networks by going to the next 16 bit field separator, like /80 or /96 or /112

A /80 prefix, out of a /48 will allot you 4294967296 networks with a total address space of 2.8147498e+14 addresses.

A /96 prefix, out of a /48 will allot you 2.8147498e+14 networks with a total address space of 4294967296 addresses

And a /112 prefix, out of a /48 will allot you 1.8446744e+19 networks with a total address space of 65536 addresses.

Tell me, how could you possibly run out of addresses?

I hope that you’re getting the grasp of this. However, let me try to break this down even further. Let’s go back to our taking a/48 prefix and breaking it down int /64 prefixes.


I’ve broken the above address into three colors. The first color is orange and consists of 2001:470:1f0f, the second color is green and consists of the first colon separated 0, and the third color is yellow and consists of the remaining colon separated zeros.

The first section consists of the global prefix. This section of the address space is called a global prefix and is the network space that your ISP provides to you as the /48 prefix. Now, if your ISP provided you with a /64, the global prefix would be 2001:470:1f0f:0 and the same shift would occur for a /80, a /96, and a /112, etc, but we’re focused on a /48 prefix.

The second field, is the subnet. and this number will increment from 0 – ffff (remember hexadecimal numbers instead of binary). This is the field that you will use to define your networks with layer three boundaries. You can compare this to IPv4 networks, like and are two different networks that are separated by layer three boundaries. To make the networks communicate with each other, you’ll need to add a router to the mix.

Lastly, the remaining address space, in yellow, is dedicated to host addresses. 0:0:0:0 – ffff:ffff:ffff:ffff is the usable host range. IPv6 has a really cool feature, that will most likely replace DHCP (even though there is DHCPv6 for IPv6 networks), called Autoconf. Autoconf allows automatic allocation of IPv6 Addresses and the host portion of the IPv6 address will be your computers mac address. Each mac address is unique to each computer, which is perfect! For example, if my mac address is 123:456:789:0ab, then my IPv6 address via autoconf would be 2001:470:1f0f:0:123:456:789:ab, assuming that my subnet was 0. If you’ve been around the IT industry long enough to remember IPX/SPX from the novel days, then this should be a familiar concept to you.

Whoo…. That was a lot of rambling. I’m sure that I’ll come back and edit this soon, as I just did this off the top of my head and I’m sure that there are some errors. If you have any questions, please ask and I’ll attempt to clarify. :)

October 30, 2012

Posted In: IPv6, Subnetting

IPv4 Subnetting Made Easy

Many people are intimidated by the idea of subnetting a block of IP Addresses. In reality, it’s much easier than what it appears and with some practice it can be easily done in a persons head, on the fly.

There are two things that a person needs to know, so that they understand how the process works. Those two things are binary and the powers of two. We use binary and the powers of two to calculate the block size of a subnet, the number of hosts a subnet will have, and the number of subnets that a sub-network can accommodate.

An IP Address of made up of four numbers, separated by a period. Each number represents an octet, which is one byte long. Eight bits make up a byte. Binary is a computer language that has two functions; on or off. The “1” in binary is “on” and the “0” is “off”. These binary digits are counted from right to left to determine what an decimal number value is of an octet.

Each byte can have a value of up to 255, starting with zero. Counting in binary goes against logic to those of us who were taught that we read left to right. Counting in binary is done right to left.

As an example, 00110000 has a decimal value of 48. Starting at the 0 on the right, you count 1, 2, 4, 8, 16, 32, 64, 128. Or if you want to go backwards (left to right), 128, 64, 32, 16, 8, 4, 2, 1 See what I mean with the powers of two? Now, the only binary digits that you count are the 1’s. You take the binary digits and add them together. In this example, binary digits in position 32 and 16 are turned on (1) and the remaining digits are turned off (0). So, add 32 and 16 together to get the value of 48.

Let’s write out a subnet mask in binary format.


In this example, the decimal format for the subnet mask is:

Now let’s  look at the last octet to determine:

  1. How we determine the subnet mask
  2. 1 bits on, 6 bits off
  3. Block size, that is the size of a subnet
  4. Number of subnets and hosts.

We determined the subnet mask by looking at the octet that has off (0) bits, which is the last octet.


Counting the on bits, 128 + 64 = 192.

Now, to determine how many the size of a subnet (block size), we’ll use the powers of two and count the off bits.


2^6 (or 1,2,4,8,16,32) The block size in this case is 32.

To determine the number of subnets, you have to use the powers of two and count the on bits.

2^2 = 4. So the number of subnets is 4.

Which IPv4 IP Addresses, each subnet has a network address (the first address in a subnet and defines the start position of a network) and a broadcast address (the last address in a subnet and is used for broadcasting in a network). These addresses can not be assigned to computers.

For instance:, The network address is, while the broadcast address is This means that the only addresses that are able to be assigned to computers are – The network address and broadcast address are determined by the subnet mask.

Class A and B networks are subnetted the exact same way. The difference is that you will also utilize the trailing octets in your calculations for the block size and usable number of hosts (computer assignable addresses).

For instance,


The decimal notation for this subnet mask is

It’s block size is 4096. The number of subnets available are 16 and the usable hosts per subnet are 4094 addresses.

October 30, 2012

Posted In: CCNA Study Notes, IPv4, Subnetting