CCNA Prep: Variable Length Subnet Masking (VLSM)
In my previous articles on Subnet Masks, I have given a detailed idea about Subnet Masking. All network engineers, from novices to experts, need to master IP addressing and subnet masks in order to perform their job. For the CCNA to CCIE examination, you need to have the skills to be able to play with subnet mask. In this article, I am going to show how you can use Variable Length Subnet Mask (VLSM) in your network design and implementation.
What is VLSM and why do we use it?
Variable Length Subnet Masking (VLSM) is the more realistic way of subnetting a network to make for the most efficient use of all the bits, allowing you a much tighter control over your addressing scheme.
Remember that when we perform class full subnetting, all subnets have the same number of hosts because they all use the same subnet mask. This leads to inefficiencies it means lots of hosts are wasted. For example, if you borrow 4 bits on a Class C network, you end up with 14 valid subnets of 14 valid hosts. A serial link to another router would only need 2 hosts, but with classic subnetting, you end up wasting 12 of those hosts.
Also, if you use a class C address with a default subnet mask, you end up with one subnet containing 256 addresses. By using VLSM, you can adjust the number of subnets and the number of addresses depending on the specific needs of your network. The same rules apply to a class A or B addresses. That is why VLSM is used. To put it simply, it is the process of “subnetting a subnet” and using different subnet masks for different networks in your IP plan.
What you have to remember is that you need to make sure that there is no overlap in any of the addresses. VLSM is supported by Cisco and vendor independent routing protocols like RIPv2, OSPF, Dual IS-IS, BGP-4, and Cisco proprietary EIGRP. You need to configure your router for Variable Length Subnet Masking by setting up one of these protocols. Then configure the subnet masks of the various interfaces in the IP address interface sub-command. To use supernet you must also configure IP classless routes.
Classful & Classless Routing:
- Classful (basic subnetting)
Classful routing protocols require that a single network use the same subnet mask.
- Classless (uses FLSM & VLSM)
VLSM allows a single autonomous system to have networks with different subnet masks. This is often referred to as “subnetting a subnet.”
Problem with FLSM:
There are two problems with using FLSM:
It wastes addresses if the number of hosts on the subnets varies in size.
It forces the routers that talk to these subnets to process too much information.
If we use a subnet mask that provides enough interface addresses for the three networks with 30 hosts, then we waste 28 addresses on all three of the 2 interface networks.
Further, the upstream router must maintain six separate network addresses in its routing table.
But the alternative is to use VLSM:
In this method (VLSM)m an existing subnetwork is further subnetted.
The resulting subnets of the subnet are all of a size that best fits the networks in question.
If the router on the far left of the diagram on the slide that follows has been assigned the 172.16.32.0/20 network, this network can be further subdivided so as to introduce better IP address utilization and fewer routes in the far left router’s routing table.
Notice that the /30 is formed from the space left after the /20 has been formed.
In other words if we count from the far left of the available 32 bits, 20 bits, this is where the far left router’s network stops.
The remaining 12 bits are meant to be used for interface addresses.
Instead we can use part of this 12 bit space to create new subnets.
In this example we first subnet at the /26 line, then take one of these /26 networks and subnet it at the /30 line.
VLSM can be applied on any class of network which may be class A, B or C. Honestly, I can say that, overall, subnetting is very confusing. Many network administrators with extensive hands on experience in network engineering might not be able to design a network with VLSM so quickly because it involves many fundamentals like private/public classes, their respective ranges, and many other things considered when one applies VLSM on a network.
The tables below may help you visualize the world of VLSM so you can be comfortable with VLSM for all classes:
When to use VLSM? Why to use VLSM? What is the need of VLSM?
These types of questions come to mind, so we’ll take a quick look on the following scenario to answer these questions. In the following scenario, we see that we have a class C
pool of IP addresses, i.e. 192.168.1.0/24, and we subnetted the given network according to our requirements as described below. Go through the whole scenario then read the next line and look at the IP’s private or public. If you want in-depth classification, you can read my previous article on IPv4.
After brief examination, I know you will say that there is so many IP addresses made useless or wasted. Where we need only 2 hosts there are 30 hosts available, a clear waste of 28 hosts.
In FLSM, all the subnets should be the same and in the given scenario, the network is subnetted by /27. The described scenario is so small because a class C network only has 254 valid hosts and you can calculate total wastage of IP’s – approximately 140 hosts out of 210 valid hosts.
Imagine a bigger scenario with the IP range of class A and you’ll realize how many IPs are wasted using FLSM. Now maybe you got the answers for all the questions above, and it should be clear that the solution to FLSM’s IP wasting is VLSM.
Now we take a look at another scenario with a VLSM subnetted network which represents the same scenario as we discussed earlier, with the only difference being the subnetting technique we used here for VLSM. If you compare fig.1 with fig.2 (FLSM scenario with VLSM scenario) wastage of IP is decreased by about 90%, though this may vary per specific scenario.
Tips for CCNA Exams:
To pass the CCNA examination, you need to be able to answer the following: Why is VLSM used in your network? What is the required technique to use VLSM? What are the differences between VLSM and FLSM?
I hope my article clears all the doubt about VLSM and makes you confident in the deployment of VLSM. To master the topics on IPv4 addressing and subnetting, please read all my articles on it and try to practice using it.
If you have any query on these topics, please comment below. I will try to solve all your queries as soon as possible. Best of luck with your exams and in choosing a career in Cisco Technology.
Guide to Cisco Certified Network Associate certification by Todd Lamlee, Sybex press.
Guide to Cisco Certified Network Associate by Richard Deal.
Cisco Certified Network Professional-Route by Wendell Odom, Ciscopress.com
CCNP- Route Quick reference by Denis Donohue, Ciscopress.com
Cisco Certified Internetwork Expert by Wendell Odom and others, Ciscopress.com
Cisco Certified Internetwork Expert Quick reference by Brad Ellis, Ciscopress.com