In the third part of this series we will look at how we can take on subnet block and divide it into a range of subnets of differing size based on our requirements. If you need a refresher on the basics of SLSM then check out the first part of this series here.
Variable Length Subnet Masks (VLSM) is one of the more complicated aspects of subnetting to understand. With VLSM we take a network block and subdivide into a number of smaller networks.
We start off with the standard concepts for SLSM, and once we know the shortest prefix length and from there we can start to subdivide based on our requirements.
The process is as follows:
1: Find the shortest prefix length that will cover all of our required subnets.
2: Divide the available address block into prefixes of equal size based on step 1.
3: Knowing the subnets we need we allocate these to the beginning of the address block, leaving equal-sized address blocks at the end of the original block.
4: The first unallocated address block will then be subdivided by repeating steps 1 - 3, using the shortest requires prefix length for the remaining subnets.
5: If we need to allocate very small address blocks (say router to router i.e. /30) this should be done at the very end of the address range, which gives us some scope for future usage if requirements change later.
Confused yet? Imagine it as a funnel, with our assigned address block at the top, and as we assign subnets we start to reach the end of the funnel.
Again I will use the same IP's used in the Odom book, and if you havn't already got the book then you should go and buy it.
So we have an assigned address range of 172.31.28.0/23. This will cover 172.31.28.0 to 172.31.29.255. Here we have one clearly defined summarized route, but our requirements are to split this as follows:
3 /25's
2 /27's
3 /30's
We can divide this into four blocks, which gives us four /25 subnets, and here we are using the same math as we used in part one with SLSM:
172.31.28.0/25 (172.31.28.1 - 172.31.28.128)
172.31.28.128/25 (172.31.28.129 - 172.31.28.254)
172.31.29.0/25 (172.31.29.1 - 172.31.29.128)
172.31.29.128/25 (172.31.29.129 - 172.31.29.254)
This takes care of the first requirement (3 lots of /25's). Now using the last subnet (172.31.29.128/25) we can start allocating the /27's.
These will be
172.31.29.128/27
172.31.29.160/27
172.31.29.192/27
172.31.29.224/27
We stop at 172.31.29.224 because as we are incrementing by 32 the next subnet in the range would be 172.31.29.256 which is an invalid subnet. The first two subnets will take care of the second requirement (2 lots of /27's), and we have two blocks left over. As per step 5 we know that the the final requirement is for 3 lots of /30's so we leave the third subnet unallocated, which we can use at a later stage, instead we will focus on the 172.31.29.224/27 subnet instead.
The available address range for this subnet is 172.31.29.225 - 172.31.29.254. This can be divided into our /30's with a large number of blocks remaining, in fact we end up with eight blocks. A /30 subnet has four IPs in it, with two usable, so we just increment by 4 to find the underlying subnets.
We end up with the following subnets:
172.31.29.224/30
172.31.29.228/30
172.31.29.232/30
172.31.29.236/30
172.31.29.240/30
172.31.29.244/30
172.31.29.248/30
172.31.29.252/30
This gives us plenty of scope to have the final requirement (3 /30's) which will be the final three subnets in the list (remembering step 5 to use the end of the block, and leave the beginning of the block unallocated for future usage).
And there we have VLSM. It's really not that scary.
Our final post in this series will cover route summarization, and I will post some more examples of SLSM, VLSM, Route summarization and how to find all the subnets within a given network subnet in the resources section later.