Variable Length Subnet Mask

Publish Date: June 22, 2015

Variable Length Subnet Mask (VLSM)

Variable Length Subnet Mask or VLSM is the way to take one network and create many networks using subnet masks of different lengths.

In previous section of Subnetting, we have discussed what is known as Fixed-Length Subnet Mask (FLSM) which means which basically creates the subnet mask of same length (size) for all network segments. In other words, you can say that, using FLSM we have to assign same subnet mask to all network segments. But what about the Networks where some subnets need many hosts and some need fewer, FLSM results in some subnets having many wasted addresses, or some sets of hosts being too big to fit into a subnet. This is where VLSM comes into play.

Before diving deep into VLSM, I just wanted to make you familiar with a concept which is resulted by VLSM. This concept is classful and classless routing. You will better understand it when you will read Dynamic Routing Protocols section in Routers.

Classful routing means that some routing protocols does not have a field for advertising the subnet information, so the subnet information gets dropped. It means if a router running RIPv1 or iGRP (type of routing classful protocols) has a subnet mask of a certain value, it assumes that all interfaces within the classful address space have the same subnet mask. This is called classful routing. If you mix the networks of same subnet masks and the different length subnet masks with routers running RIPv1, the network will not work at all.

Classless routing is done by classless routing protocols such as RIPv2, EIGRP and OSPF have a field which support the advertisement of subnet mask information. Since VLSM allows you to assign different subnet masks in you network, therefore you can use VLSM with routing protocols such as RIPv2, EIGRP, and OSPF.

For better understanding of how FLSM and VLSM work, consider the following network:


Consider that you are working as the network administrator of this company having 3 offices located at remote locations and all the offices are inter-connected via WAN links.

  • Head office has 28 computers
  • Branch office-1 has 5 computers
  • Branch office-2 has 12 computers
  • Each WAN link need only 2 IP addresses.
Default Subnet-Mask Approach

Without using the concept of Subnetting, every remote network should be assigned a different subnet address and a default subnet mask of C class i.e By looking into the following table, you can see that how much addresses would be wasted by this approach.

Office Subnet Mask No. of Hosts Wasted IPs
Head Office 28 224
Branch Office-1 5 247
Branch Office-2 12 240

Aside to this, each WAN segment requires only 2 IP addresses for point to pint link but choosing this approach will waste other 250 addresses on each segment.

FLSM Approach

By using this approach, We need to use subnet mask of in order to accommodate maximum number of hosts (i.e. 28) for our network segment. This subnet mask gives us 30 usable addresses. Look at the table below to compare the wastage of IP address space.

Office Subnet Mask No. of Hosts Wasted IPs
Head Office 28 2
Branch Office-1 5 25
Branch Office-2 12 18

You can see that by using FLSM approach, we can save pretty much IP addresses as compared to default subnet mask approach.

VLSM Approach

Choosing VLSM approach will give you freedom not to keep same subnet mask which was You can use subnet mask which can provide you enough hosts per subnet without wasting large number of addresses. Look at the below table and compare the wasted address space by using this approach.

Office Subnet Mask No. of usable hosts/subnet No. of Hosts actually needed Wasted IPs
Head Office 30 28 2
Branch Office-1 6 5 1
Branch Office-2 14 12 2
Each WAN Link 2 2 0

By choosing VLSM approach, you are saving a big IP address space since VLSM allows you to choose different subnet mask for different network segments. The only downside of this approach is the limitation of capacity for future growth. Therefore, VLSM design requires a lot more planning and experience of company’s future-growth before implementing in real world networks.


Microsoft Certified | Cisco Certified