Understanding Variable Length Subnet Masks (VLSM)

We have a limited number of private IPv4 addresses that can be used in every organization. The Internet Assigned Numbers Authority (IANA) has assigned several addresses ranges to be used by private networks, which are Class A, Class B, and Class C. As the Internet and most of the organizations are aggressively growing, we need a way to eliminate wasting IPv4 address. One of the ways we can maximize the use of private IPv4 addresses in the organization is subnetting.

Subnetting is a way of dividing a network into one or more networks in the most efficient way. 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 need to use Variable Length Subnet Masking (VLSM).

 

How to Implement Variable Length Subnet Mask (VLSM)?

We will use the below network topology diagram as we go through the steps of implementing the Variable Length Subnet Mask (VLSM). In this example, we will subnet on HQ LAN.

VLSM

 

1. Identify the host required for each LAN network.

HQ LAN – 50 hosts

BRANCH 1 LAN– 30 hosts

BRANCH 2 LAN– 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 required is 106 hosts.

 

2. Determine the class of IP subnet. To determine the class of IP subnet that we need to use based on the required number of hosts, we will use the formula:

 Total number of hosts required (usable IP address) = 2H  - 2

 

Where H is the host bit which is 6. Here, we will not use the network address and the broadcast address as we only need the usable IP address for the hosts.

Class A has 16,777,216, class B has 65,536, and class C has 256 IP addresses. As per our sample topology, we need only 106 hosts, and then we will use Class C.

 

3. Identify how many bits are there in the host requirement of every LAN. In our example, HQ LAN has 50 hosts, and then the host bit is 6 bits.

 

4. Get the new subnet mask. In our sample network, the new subnet mask for HQ LAN is /26, and the long format is 255.255.255.192

 New Subnet Mask = 32 – number of host bits

 

5. Get the increment. In HQ LAN, we have 64 increments.

 Increment = 255 – 192 (the last octet of the subnet mask)

 

6. Compute for the ranges of host IP addresses. By using the increment, which is 64, the HQ LAN range is from 192.168.10.0 to 192.168.10.63. Please note that the network address of the subnets (range) is 192.168.10.0 and the broadcast address is 192.168.10.63. The usable IP address of the range is from 192.168.10.1 to 192.168.10.62

 

Now, we are done with subnetting the HQ LAN. To 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. Get the range of IP addresses of the most-required IP subnet which is “BRANCH 1 LAN”. Follow the “BRANCH 1 LAN” IP range after the IP range of “HQ LAN”. Then follow it by the second most-required IP subnet, which is “BRANCH 2 LAN”, until all the subnets required for all the LAN and WAN on the network are assigned.

 

Below are the host bits, subnet mask, increment, and IP ranges on 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

IP range – 192.168.10.0 to 192.168.10.63

 

BRANCH 1 LAN:

Number of Hosts – 30

Host Bits – 5 bits

Subnet Mask – /27 or 255.255.255.224

Increment – 32

IP range – 192.168.10.64 to 192.168.10.95

 

BRANCH 2 LAN:

Number of Hosts – 20

Host Bits – 5 bits

Subnet Mask – /27 or 255.255.255.224

Increment – 32

IP range – 192.168.10.96 to 192.168.10.127

 

WAN 1:

Number of Hosts – 2

Host Bits – 2 bits

Subnet Mask – /30 or 255.255.255.252

Increment – 4

IP range – 192.168.10.128 to 192.168.10.131

 

WAN 2:

Number of Hosts – 2

Host Bits – 2 bits

Subnet Mask – /30 or 255.255.255.252

Increment – 4

IP range – 192.168.10.132 to 192.168.10.135

 

WAN 3:

Number of Hosts – 2

Host Bits – 2 bits

Subnet Mask – /30 or 255.255.255.252

Increment – 4

IP range – 192.168.10.136 to 192.168.10.139

 

You can follow the steps we did on HQ LAN subnetting and use a different number of hosts for the remaining LAN and WAN networks.

 

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: