In this video from ITFreeTraining I will look at how to manually perform IPv6 subnetting.
If you have not watched our previous video on IPv6 subnetting, I would suggest starting
with this video to teach you the basic concepts. By the end of this video, you will understand
how to calculate IPv6 subnets and implement them in your organization.
To understand the basics of how IPv6 subnetting works, I will first look at an example IP
Address that an ISP might allocate to a customer.
The ISP will generally allocate the first 48 bits of the IP address. The next 16 Bits
of the IP address are the subnet ID. The idea behind the original allocation of IPv6 addresses
was the customer would have the full 16 bits to allocate as they see fit. In some cases,
the ISP might use some of the 16 bits rather than allocate all 16 bits to the customer.
In this example, we’ll assume that the ISP has given us the entire 16 bits to allocate
for ourselves.
For the sake of completeness, we’ll show the Interface ID which will complete the 128-bit
IP address. The focus of this video is on the subnet ID and the mathematics of dividing
up the IP address into different subnets, so the interface ID is irrelevant.
So, let’s start to understand some of the basic principles and mathematics behind IPv6
subnetting and how it is accomplished. You can see in this case there are 16 bits that
can be allocated by the customer. In some cases, some of the bits of the subnet ID may
have been allocated. For example, the ISP may have allocated some of the bits between
different customers or the customer may have allocated some of the bits to different networks.
If some of the bits have been allocated, in the upcoming formulas, we will use ‘f’
to indicate fixed. This is the portion of the Subnet ID that is already sub netted and
thus cannot be sub netted again. In our example, we will start with all 16 bits being available
for sub netting and thus ‘f’ will equal zero. As we move through the video, bits of
the subnet ID will be allocated and thus the value for ‘f’ will increase.
The next part we’re going to take a look at is ‘S’ for subnet. This is how many
bits we want to allocate to new subnets. The larger the value of ‘S’, the larger the
amount of subnets that are created.
The final section of the Subnet ID will be represented by ‘r’ which is the ‘remaining’
portion. This is the part of the Subnet ID that has not been allocated as of yet. With
IPv6, it is possible to create hierarchies of networks. The ‘r’ value is how many
bits are left that can be used later on to create additional levels of subnets.
The important point to remember is that ‘f + s + r’ equals 16 bits. If the values ‘f
+ s + r’ does not add up to 16, a mistake has been made. For an example of how to break
an IP Address into different subnets, I will start by looking at how the subnet ID can
be broken down into different countries.
Whenever you as an administrator begin to develop a plan for your subnets and begin
allocating subnet IDs, you’re going to want to leave enough room for expansion. So, in
our example, consider we have locations in the US, Canada and England. Furthermore, we’ll
assume the company is not expanding to any more countries. To determine how many bits
we’ll need, we’re going to take a look at the ‘Powers of 2’ table. This table
lists all of the powers of 2 from 1 through 16. As it goes up, it allows more networks
to be created. In this example, we have three countries so at least 3 networks are required.
So if we look at the ‘Powers of 2’ table, you can see that in order to get 3 subnets
we need 2 to the power of 2, which is 4. This means 2 bits are required, which gives us
4 subnets. Now that we know how many bits are required, the next step is to break the
original address down into subnets.
To create a different network for each country, I will first take the IPv6 address given to
me by my ISP. So far, no bits of the subnet ID have been allocated, so this essentially
means that f for fixed is equal to zero. This leaves the 16 bits of the subnet ID available
for allocation to networks.
The next step is to allocate some of the bits for the subnet ID. Since 3 networks are
required, one for each country, the power of 2 table told us that two bits a required.
This will give a total of 4 networks. So, to account for this, I will allocate 2 bits
of the 16. This leaves 14 bits of the subnet ID unallocated.
The next step is to start working out the addresses of each network. That is, the address
that will be used for each country. Networks in IPv6 are often referred to as hierarchies,
thus the first set of hierarchies will be referred to as the first level of subnets.
The first subnet is simple to work out, all I need to do is use the address the ISP gave
me and change the prefix length. This will be the old prefix length plus the number of
bits used in the subnet ID. So essentially it will be 48 plus 2 giving a result of 50.
The address of the next subnet is a little harder to work out. In order to work this
out, first an increment value needs to be calculated. This value is added to the previous
address to work out the address of the next subnet. Let’s have a look at how this is done.
To work out the increment value, this equation is used. It is just a matter of adding the
values that we know into the equation. No bits have been allocated so far from the subnet
ID so f is zero. S is the number of bits that we want to allocate from the subnet ID. From
the power of 2 table, this value was found to be 2. This gives 2 to the power of 14.
Which is 16384 or 4000 in hexadecimal.
To make things simple, I will open Windows Calculator and use it for the math. First,
I will select the view menu and select the option “Scientific”. Different options
are found in different parts of Windows Calculator, so sometimes you need to change views to get
what you need.
To work out the increment value in the calculator, I will enter in 2, then press the power to
y button and then enter in 14. This gives me the value of 16384. The next step is to
change this to hexadecimal. To do this, I will select the view menu and then select
the option “Programmer”. I will next enter in 16384 and then select the button “Hex”.
You can see the number changes to 4000 in hexadecimal.
To work out the next subnet it is a matter of adding this value to the previous value.
In this case the value is zero so it is simply the increment value in this case. To work
out the next subnet, I will add the increment value of 4000 in hexadecimal giving a value
of 8000 in hexadecimal. This will be the next subnet. You can see how the increment value
is used to find the next subnet. We only required 3 subnets in this example out of the 4 available.
If you want to find out the address of the last subnet, add 4000 in hexadecimal and this
will give the value of c000. This will be the value of the last subnet. Now that all
the subnets addresses have been worked out, the next step is to allocate these subnets
to different countries.
Shown here are the 3 subnets that have been allocated using the first 2 bits of the subnet
ID. There are four subnets created, but we’ll only need to utilize three to meet our requirements.
The fourth will be available for use if it is ever needed. Now it is time to allocate
them to the specific countries, so we’ll set the first to the US, the second to Canada
and the third to England. So, from a hierarchical level, now we can see that any traffic with
the cad:0000 address is from the United States, and that any traffic with the cad:4000 address
is from Canada and so on.
Now that a subnet has been allocated to each country, we’ll next allocate subnets to
be used for States/Provinces/Territories that each country may have. In order to do that,
we need to evaluate how many networks our company will require for regional subnets.
In our example, we’ll assume that the most we need is 60. We’ll be heading back to
the ‘Powers of 2’ table again. Look at the table, we can see that for 60 networks
we would want to use 6 bits, which in the table shows 2 to the power of 6 is 64. Now
that we have the number of bits required, let’s have a look at what is required to
breakdown the address in a 2nd level of subnets.
Taking the address for Canada, the next step is to work out the subnet address for provinces
and territories in Canada. Remember that 2 bits of the subnet ID have been allocated.
From the powers of 2 table, it was worked out that having 60 networks would require
6 bits, so an additional 6 bits from the subnet ID will be allocated. This leaves 8 bits that
have not been allocated.
To work out the second level subnet addresses, the process is the same as before. For the
first subnet address, the address that was allocated to the Canada network is copied.
Notice that the prefix length has changed. Since 6 more bits of the subnet ID have been
used, these are added to the prefix length of 50 that was allocated to Canada to give
56.
The next step is to work out the increment value. Like before, it is a matter of putting
the value into the equation. The value of f will be 2 since 2 bits of the subnet ID
were allocated to countries previously. Since an additional 6 bits of the subnet ID will
be used for states, provinces or territories, the value for s will be 6.
Once the values have been put into the formula, it is a simple matter to work out the increment
value. This gives the value of 256 or 100 in hexadecimal. I will now open Windows calculator
and have a look at how to calculate the increment value.
First I will change the view to scientific. Enter 2 into the calculator and raise it to
the power of 8. This will give the result of 256. I will now change the view to “Programmer”.
The calculator is still displaying hexadecimal values, so I will press the “Dec” button
to change it to decimal. Once changed, I will enter in 256 and then press the “Hex”
button to convert it to hexadecimal. Notice the result is 100 in hexadecimal.
To work out the next subnet, I will add the value 4000 and 100 in hexadecimal giving a
value of 4100 in hexadecimal. To work out the next subnet, simply add 100 in hexadecimal
giving the value of 4200 in hexadecimal.
The process is the same to work out the other 64 addresses. In this case, I will skip a
few addresses and go to the last address. Now that the address breakdown is complete,
these addresses can be allocated to networks and broken down further if required. In this
example, the address will be broken down one last time.
For the final breakdown, we’re going to allocate some bits to the offices in each
region. We’ve determined that we’ll have no more than 10 offices in each region. So
now we’re going to use the powers of 2 table again. To get ten offices, we need 2 to the
power of 4 giving us 16. Now that we know that we require 4 bits, the next step is to
perform the breakdown of the address.
I will now take one of the addresses from Canada, and add another level of networks
for the offices in that region. For these networks, I will allocate 4 bits of the subnet
ID. This leaves 4 bits of the subnet ID for future expansion. This does sound good, however,
remember if you wanted to add more countries later on, this would mean changing the address
of every network. For this reason, if you have some spare bits left over, it is worth
considering using them to add additional networks for future expansion. In this example, there
are 4 networks allocated to countries, adding just a single bit would double it to 8 networks
for countries. However, having some free subnet bits also means another level of networking
can be added later on if required.
The next step is to work out the addresses for each of the networks. Like before, the
first network is easy, copy the previous network and change the network prefix. The previous
network prefix was 56, 4 more bits were allocated from the subnet ID for office networks. This
gives a network prefix of 60.
The next step is to work out the increment value. Just like before, the same equation
is used. The value of 8 is used for f and the value of 4 is used for s. Once these values
have been put into the equation, it is a simple matter to work out what the result is. This
gives a value of 16 or 10 in hexadecimal. I won’t worry about working this out using
the calculator as the value is small and easy to work with.
To work out the second network, simply add 10 in hexadecimal to the last network address.
The same process is done for the next network. This is repeated until the last network is
worked out. You can see that there is some math involved in working out IPv6 subnets.
However, in my opinion, once you get used to it, subnetting in IPv6 is easier than IPv4.
This concludes this video on IPv6 subnetting. I hope you have enjoyed the video and found
it useful. Until the next video, I would like to thank you for watching.