Variable length subnet mask (VLSM) is a method that allows network administrators to divide an IP address space into the subnet of different sizes, unlike simple same-size Subnetting. Variable Length Subnet Mask (VLSM) means subnetting a subnet. To simplify further, VLSM is the breaking down of IP addresses space into multiple level subnet and allocating it according to the person need on a network.
As illustrated in Figure 1, 2 and 3 the traditional subnetting creates subnets of equal size. Each subnet in a traditional plan uses the same subnet mask. But Variable Length Subnet Masking allows a network space to divide the network into different sizes. With VLSM, the subnet mask will vary on how many bits have borrowed for a particular subnet.
The difference between VLSM and FLSM is that subnetting is not a single practice. With VLSM, the network is initially subnetted; and then the subnets are subnet again and again to create subnets of various sizes.
In the process of using VLSM, always start by satisfying the host requirements of the largest subnet and continue subnetting until the host requirements of the smallest subnet have fulfilled.
Fixed length Subnet Mask (FLSM)
FLSM is a Traditional Subnetting method which causes wastes of IP Addresses. Using this method, the same number of addresses has allocated for each sub-network. If all the sub-network have the same requirements for hosts. These fixed size address blocks would be efficient. But, usually, that is not the case.
The topology shown in Figure 1 above requires 5 subnets, one for the four LANs, and one for WAN connection between routers. Using traditional subnetting with the address of 188.8.131.52/23, 1 bit can be borrowed from the third octet and 2 bits can be borrowed from the last octet of the host portion to meet the subnet need of 5 subnets. As shown in Figure 2, borrowing 3 bits creates 8 subnets and leaves 6 host bits with 62 usable hosts per subnet. This plan creates the desired subnets and meets the host necessity of the largest LAN.
Though this traditional subnetting meets the requirements of the largest LAN and divides the address space into enough number of subnets, So it results in the major waste of unused addresses.
For example, only two addresses have required for WAN subnet, But each subnet has 62 usable addresses, there are 60 unused addresses available in this subnets. This also limits the growth of the network by reducing the total number of subnets available. This incompetent use of addresses is the feature of traditional subnetting. Traditional subnetting scheme to this scenario is not professional and also a full of waste. To avoid a waste of IP address subnetting a subnet, or using Variable Length Subnet Mask (VLSM), was design. Figure 3 Show the pie chart for the above table of fixed length subnet masking.
The Chart in Figure 3 illustrates the traditional subnetting which divided the address space into equal sub-networks.
Go back to the example in Figure 1 and Figure 2 the network 184.108.40.206/23 was subnetted into eight subnets of equal size. Five subnets were allocating and three subnets were spare for future expansion. Four subnets were used for the LANs and one subnet for the WAN connections between the two routers. The wasted address space was in the all subnet but especially in the subnet used for the WAN connections; where only two addresses used out of sixty-two; one for each router interface. To avoid this waste, the network administrator uses VLSM to create smaller subnets according to hosts need. To create smaller subnets according to host need, the subnets will be subnetting again and again. In this example, the last subnet, 220.127.116.11, will be further subnets according to the host requirements of LAN-4 and for the WAN segment between both routers.
Remember, when the amount host addresses needed is known, the formula 2h-2 (where h equals the number of host bits remaining) can be used. The LAN-4 required 20 hosts and for 20 hosts 5 bits required in the host portion.
So, the subnetted IP address 18.104.22.168/26 has 6 host bits, 1-bit borrowing will leave 5 bits in the host portion, as shown in Figure 4. The subnetting at this point is exactly the same as those used for traditional subnetting. The bit is borrowed, and the resulting subnet ranges are determined. With borrowing 1-bit form 22.214.171.124/26 resulting two subnets 126.96.36.199/27 and 188.8.131.52/27.
The subnet 184.108.40.206/27 is assigning to LAN4. Now we required a subnet for the WAN segment between both routers. The WAN segment required two IP address. If we apply the formula of host 22-2=2, So we required 2 bits in the host portion; as shown in Figure 5 the subnet 220.127.116.11 has subnetted according to the requirement of the WAN segment.
The subnet 18.104.22.168 subnetted into 8 more subnets each consisting of 2 usable host address; the first subset of these are assigned to the WAN segment. This subnetting scheme reduces the number of addresses per subnet to a size for the WANs. Subnetting subnet 7 for LAN-4 and WANs. Subnetting with VLSM allows subnets 3, 4, 5, 6 to available for future networks as well as 7 additional subnets available for WANs segments. The chart in Figure 6 illustrates the subnetting with VLSM.