Understanding Variable Length Subnet Masks (VLSM)

We have a limited number of private IPv4 addresses that can be used in every organization. As the Internet and most organizations are aggressively growing, we need a way to eliminate wasting IPv4 addresses. One of the ways that we can maximize the use of private IPv4 addresses in the organization is through subnetting.

The reason why we need subnetting is to efficiently distribute an IPv4 address with the least wastage and to create more networks with the smaller broadcast domains. To efficiently use subnetting, we can use Variable-Length Subnet Mask (VLSM).

With Variable-Length Subnet Mask (VLSM), we can allot the closest required number of IP addresses into a subnetwork in our LAN. We don’t need to use a /23 subnet mask in all of our subnets, for example.

 

Steps to Implement Variable-Length Subnet Mask (VLSM)

We will use the below network topology as we go through the steps of the Variable-Length Subnet Masking (VLSM).

vlsm

 

Step 1. Identify the host requirement. How many hosts or IP addresses are needed by the subnets in our LAN? We can arrange them from the highest host requirement to the lowest, as we will perform VLSM subnetting starting from the subnet with the highest host requirement. Don’t forget to include the point-to-point (WAN) links as well.

  • HQ LAN – 50 hosts
  • BRANCH 1 – 30 hosts
  • BRANCH 2 – 20 hosts
  • WAN 1 (HQ to BRANCH 1) – 2 hosts
  • WAN 2 (HQ to BRANCH 2) – 2 hosts
  • WAN 3 (BRANCH 1 to BRANCH 2) – 2 hosts

The total host requirement for our network is 106 hosts, and we will perform VLSM subnetting on the HQ LAN subnetwork first.

 

Step 2. Determine the class of IP subnet. We need to determine the class of IP subnet that we will use based on the required number of hosts.

Class A has 16,777,216, Class B has 65,536, and Class C has 256 IP addresses. As per our network requirement, we need only 106 hosts, therefore we will use a Class C IP address space. In our example, we will use 192.168.10.0. It could also be that the organization bought an IP address space from the IP address authorities.

 

Step 3. Identify the host bits for every subnet. In our network topology example, HQ LAN has 50 hosts requirement, therefore we would have 6 host bits.

2^6 host bits will give us 64 hosts, minus 2 for the network address and broadcast address, which is equal to 62 usable host addresses. It suffices our 50 hosts requirement for HQ LAN.

 

Step 4. Calculate the subnet mask. Identify the network bits and determine the subnet mask of the subnet. We can get the subnet mask by subtracting the host bits from 32 (the total IPv4 address bits). For HQ LAN, it’s 32 – 6 host bits, which is equal to a /26. The subnet mask for HQ LAN is /26 and its long format is 255.255.255.192

 

Step 5. Get the increment. To determine in which block of number should we go up, we can use the formula of 2^host bits. For HQ LAN, it is 2^6 host bits, which will give us an increment of 64.

 

Step 6. Determine the network address, broadcast address, and IP address range. Starting from the base IP address, we will go up or increment in the value computed in Step 5.

For our network, we have a base IP address of 192.168.10.0. For HQ LAN, we will increment in a block of 64 as calculated in Step 5. Moreover, since it is in the Class C IP address space, as identified in Step 2, we will increment in the 4th octet.

That will be:

192.168.10.0 + 64 (Current subnet)

192.168.10.64 (Base IP address for the next subnet)

We determined that the network address for HQ LAN subnet is 192.168.10.0. The broadcast address will be 1 less than the next IP subnet. That’s 192.168.10.64 – 1, which is 192.168.10.63.

Finally, to get the HQ LAN usable IP address range, it is the IP address range in between the network address and the broadcast address, 192.168.10.1 to 192.168.10.62.

 

Completing the Variable-Length Subnet Mask Subnetting Process

Now, we are done with subnetting the HQ LAN. To fully implement VLSM, we need to do subnetting as well on the remaining LAN and WAN networks, which are BRANCH 1 LAN, BRANCH 2 LAN, WAN 1, WAN 2, and WAN 3.

The next subnet to be subnetted in VLSM will be the BRANCH 1 LAN as it has the next highest number of hosts. We will start with 192.168.10.64 as our network address as it is where we ended with our first IP subnet, HQ LAN.

Follow the steps we did on HQ LAN to perform VLSM subnetting on the remaining LAN and WAN subnets in our network diagram.

Below are the host bits, subnet mask, increment, network address, broadcast address, and usable IP address ranges of each subnet of the network topology we used in our example:

 

HQ LAN:

Number of Hosts – 50

Host Bits – 6 bits

Subnet Mask – /26 or 255.255.255.192

Increment – 64

Network Address – 192.168.10.0

Broadcast Address – 192.168.10.63

Usable IP Addresses – 192.168.10.1 to 192.168.10.62

 

BRANCH 1 LAN:

Number of Hosts – 30

Host Bits – 5 bits

Subnet Mask – /27 or 255.255.255.224

Increment – 32

Network Address – 192.168.10.64

Broadcast Address – 192.168.10.95

Usable IP Addresses – 192.168.10.65 to 192.168.10.94

 

BRANCH 2 LAN:

Number of Hosts – 20

Host Bits – 5 bits

Subnet Mask – /27 or 255.255.255.224

Increment – 32

Network Address – 192.168.10.96

Broadcast Address – 192.168.10.127

Usable IP Addresses – 192.168.10.97 to 192.168.10.126

 

WAN 1:

Number of Hosts – 2

Host Bits – 2 bits

Subnet Mask – /30 or 255.255.255.252

Increment – 4

Network Address – 192.168.10.128

Broadcast Address – 192.168.10.131

Usable IP Addresses – 192.168.10.129 to 192.168.10.130

 

WAN 2:

Number of Hosts – 2

Host Bits – 2 bits

Subnet Mask – /30 or 255.255.255.252

Increment – 4

Network Address – 192.168.10.132

Broadcast Address – 192.168.10.135

Usable IP Addresses – 192.168.10.133 to 192.168.10.134

 

WAN 3:

Number of Hosts – 2

Host Bits – 2 bits

Subnet Mask – /30 or 255.255.255.252

Increment – 4

Network Address – 192.168.10.136

Broadcast Address – 192.168.10.139

Usable IP Addresses – 192.168.10.137 to 192.168.10.138


Download our Free CCNA Study Guide PDF for complete notes on all the CCNA 200-301 exam topics in one book.

We recommend the Cisco CCNA Gold Bootcamp as your main CCNA training course. It’s the highest rated Cisco course online with an average rating of 4.8 from over 30,000 public reviews and is the gold standard in CCNA training: