Network Engineers around the world will tell you that subnetting is a bear; however, if given the right instruction, it can be very swift and straightforward. Hence, WasabiRoll thought that nothing speaks better than a step by step tutorial - first with a simple two node network, then a complex example with nine subnets requiring the 3rd Octet. Anyways, enough of that, please enjoy the narrative as we walk you through the basics of simple and complex subnetting, fully illustrated with detailed step by step instructions. Share and Enjoy...
History of VLSM
Classless Inter-Domain Routing (CIDR) is a method for allocating IP addresses and IP routing. The Internet Engineering Task Force introduced CIDR in 1993 to replace the previous addressing architecture of classful network design in the Internet. This was a method that allowed subnetting the given address to support subdivisions of networks within the allotment of addresses, usually in equal parts.
Classless Inter-Domain Routing is based on variable-length subnet masking (VLSM), which allows a network to be divided into variously sized subnets, providing the opportunity to size a network more appropriately for local needs. In short, choosing the subnet mask that best fits the required subnets and hosts, a mix and match, if you will...
What is VLSM ?
- Subnetting of a subnet.
- The more realistic way of Subnetting.
- To make the most efficient use of all the bits of a network.
- Prevent network and host from waste.
Steps of VLSM:
- Find the largest segment which need largest number of hosts address.
- Do Subnetting to fulfill the requirement of largest segment.
- Assign the appropriate subnet mask for the largest segment.
- For second largest segments, take one of these newly created subnets and use different subnet mask for this one.
- It will cover from the large number host first.
- Repeat this process until the last network.
Given 172.16.128.0/24
With the following subnet, we are given and IP address of 172.16.128.0/24; however, we need at total of three subnets. The first is in between the two routers representing the serial connections. The second is Headquarters requiring 75 hosts, and finally, the Branch which 50 hosts are required.
If you are familiar with standard subnetting, you will see
that using the conventional table:
NNNNNNNN.NNNNNNN.NNNNNNNN.nnnnnnnn
/25 is 10000000 has 2^N subnets; and 2^n hosts; 2 segments
& 128 hosts
/26 is 11000000 has 2^N
subnets; and 2^n hosts; 4 segments & 64 hosts
/27 is 11100000 has 2^N
subnets; and 2^n hosts; 8 segments & 32 hosts
/28 is 11110000 has 2^N subnets; and 2^n
hosts; 16 segments & 16 hosts
We have been
given the IP address 172.16.128.0/24 and we need to break that into at least
three subnets. A /25 from the table above just to gives us 128 hosts: however,
only 2 subnets. In addition, if I break that into four subnets, /26, that is
going to give the 4; however, with only 64 host each and that is not enough for
the HQ which needs at least 75.
So, what is to be done? This is where Variable Length Subnet Masking, VLSM comes into play.
Step 1
Well to start off, we place our address in the table and
start by subnetting by /25, for at least I know that will cover the 75 hosts we
need, for it has 128 hosts.
So, if that is the case, we know the network segment goes
from
172.16.128.0 to 172.16.128.128 because /25 is the subnet
mask that borrows 1 bit from the host side…
11111111.11111111.11111111.10000000
has 2^(number of zeros) hosts = 2^7 = 128 hosts. 128 also
happens to define the number of addresses per segment, so our table now looks
like:
To recap
we know that the /25 borrows 1 bit leaving 7 zeros; hence,
the number of hosts is calculated with 2^(number of zeros) which is 128 – so I
know my next network number is 128.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.128.128 – 1 which is 172.16.128.127
- We know the 1st host available is the network number + 1 (172.16.128.0 + 1), 172.16.128.1 and the last is the broadcast number - 1 (127 – 1), 172.16.128.126
- Finally, we also know the subnet will be the network number with the suffix 172.16.128.0 /25
Step 2
Ok, since we are playing by VLSM rules…
For the next line, my requirements change and even though I have a remaining subnet of 128 addresses because that’s what /25 give you. I am not going to use that – I am going to subnet it further with the new criteria of the next line which is 50 hosts.
So,
with the new criteria of 50 hosts, I need a subnet mask that gives me at least
50 hosts, or in other words…
2number of zeros = 50+ hosts
So, we look at our binary table, focusing only on the top half of the 4th Octet, we see that:
26 zeros = 64 hosts should do the trick
So,
we know that if you have only 6 zeros then the other remaining are ones “1”,
which are borrowed, i.e.., 2 ones like so:
11111111.11111111.11111111.11000000
which is /24 + 2 =/26 (26 “1”s in the subnet
mask)
Yes, yes, we could have
just looked it up in the table…
NNNNNNNN.NNNNNNN.NNNNNNNN.nnnnnnnn
/25 is
10000000 has 2^N subnets; and 2^n hosts;
2 segments & 128 hosts
/26 is 11000000 has 2^N
subnets; and 2^n hosts; 4 segments & 64 hosts
/27 is 11100000 has 2^N subnets;
and 2^n hosts; 8 segments & 32 hosts
/28 is 11110000 has 2^N subnets; and 2^n
hosts; 16 segments & 16 hosts
Stop being a wuss, because unless you memorize this table you are up the creek without a paddle… Besides what if your problem exceeds your table – then what. Hmmmmmmmm?
Just remember… The 3 golden rules in Subnetting…
- Only
interesting Octet in the subnet mask counts, i.e., the # that is not 255 or 0 .
- 2Number of 1s = Number of subnets; and 2number of zeros = Number of hosts.
- Binary math: just
remember to start at 20 = 1 then double it as you move left
indefinitely:
“Tables, tables? We don’t need no Stinking tables!”
To recap
we know that the /26 borrows 2 bits leaving 6 zeros; hence, the number of hosts is calculated
with 2(number of zeros) which is 64 – so I know my next network number is 128 + 64 = 192.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.128.192 – 1 which is 172.16.128.191
- We know the 1st host available is the network number + 1 (128 + 1), 172.16.128.129 and the last is the broadcast number - 1 (191 – 1), 172.16.128.190
- Finally, we also know the subnet will be the network number with the suffix 172.16.128.128 /26
Step 3
For
the next line, my requirements change and even though I have a remaining 3
subnets of 64 addresses because that’s what /26 give you. I am not going to use
that – I am going to subnet it further with the new criteria of the next line
which is 2 hosts.
So,
with the new criteria of 2 hosts, I need a subnet mask that gives me at least 2
hosts, or in other words…
2number of zeros = 2+ hosts
So,
we look at our binary table, focusing only on the top half of the 4th Octet, we
see that:
22 zeros = 4 hosts should do the trick (remember I need two extra because # of hosts
-2 (for Network & broadcast)
So,
we know that if you have only 2 zeros then the other remaining are ones “1”,
which are borrowed, i.e.., 2 ones like so:
11111111.11111111.11111111.11111100
which is /24 + 6 =/30 (30 “1”s in the subnet mask)
To recap
we know that the /30 borrows 6 bits leaving 2 zeros; hence, the number of hosts is calculated
with 2(number of zeros) which is 4 – so I know my next network number is 192 + 4 = 196.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 72.16.128.196 – 1 which is 172.16.128.195
- We know the 1st host available is the network number + 1 (192 +1), 172.16.128.193 and the last is the broadcast number - 1 (195 – 1), 172.16.128.194
- Finally, we also know the subnet will be the network number with the suffix 172.16.128.192 /30

Now at this point the curious mind might say – what about the rest of the addresses. Well we know the field of addresses goes to 172.16.128.256, so we can see the available hosts by continuing the calculation.
Example II Complex
What if We Need to Use the Third Octet?
From a Cisco Net Academy Introduction to Networks – this is a Lab…
From
their lab instructions: We have been given a network address 172.16.128.0/17
Step 1
By
examining the diagram, we need at least 6 subnets from the various Gigabit
connections and an additional 3 from the connections between the routers, a
total of 9 subnets. We cannot divide
this evenly, so VLSM is a must…
So, given the address 172.16.128.0/17, we know that the subnet mask is:
When in doubt binary it out… /17 says 17 1’s, so…
The subnet mask is: 11111111.11111111.10000000.0000000 ; 255.255.128.0
And I know that on the third octet its only number
turned on is 128, highest bit in the octet is 128 = (27)
From
that we begin to build our table by placing in the required host and initial
network number
Since our first host requirement is 16000, we can see
that at the 3rd Octet two borrowed bits…
11111111.11111111.11000000.00000000;
Hence, the
subnet mask is 255.255.192.0
Fits in nicely.
This makes the /18 (the total number of 1’s) the subnet mask of choice
for the 16000, for it affords 16,284 hosts (see binary table above). Now the
key here is to remember that we are dealing only with the interesting Octet, which
is 255.255.192.0. Which is the 3rd Octet. Hence, the number of hosts are 2number
of zeros which is 2^6 = 64; Thus, the next network address is 172.16.128.0 + 64 in
the 3rd Octet is 172.16.192.0.
To recap
We know that the /18 borrows 2 bits leaving 6 zeros in the 3rd Octet; hence, the
number of hosts is calculated with 2(number of zeros) which is 64 – so I know my next network number is
(in the 3rd Octet) 128 + 64 = 192.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.192.0 – 1 which is 172.16.191.255
- The 1st host available is the network number + 1 (172.16.128.0 + 1), 172.16.128.1
- The last host available is the broadcast number - 1 (172.16.191.255 – 1), 172.16.191.254
- Finally, we know the subnet will be the network number with the suffix 172.16.128.0 /18
Step 2
Knowing that the next number requires 8000, we look at the numbers on the 3rd Octet and note that the 3rd bit from the left has 8192, so the subnet mask would be /16 + 3 = /19 which corresponds the subnet increment of 32. Hence, the next network number is 172.16.192.0 +32 = 172.16.224.0
To recap
We know that the /19 borrows 3 bits leaving 5 zeros in the 3rd Octet; hence, the
number of hosts is calculated with 2(number of zeros) which is 32 – so I know my next network number is
(in the 3rd Octet) 192 + 32 = 224.
From that...
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.224.0 – 1 which is 172.16.223.255
- The 1st host available is the network number + 1 (172.16.192.0 + 1), 172.16.192.1
- The last host available is the broadcast number - 1The broadcast number - 1 (172.16.223.255 – 1), 172.16.223.254
- Finally, we know the subnet will be the network number with the suffix 172.16.192.0 /19

Step 3
Knowing that the next number requires 4000, we look at the numbers on the 3rd Octet and note that the 4th bit from the left has 4096, so the subnet mask would be /16 + 4 = /20 which corresponds the subnet increment of 16. Hence, the next network number is 172.16.224.0 +16 = 172.16.240.0
To recap
We know that the /20 borrows 4 bits leaving 4 zeros in the 3rd Octet; hence, the
number of hosts is calculated with 2(number of zeros) which is 16 – so I know my next network number is
(in the 3rd Octet) 224 + 16 = 240.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.240.0 – 1 which is 172.16.239.255
- The 1st host available is the network number + 1 (172.16.224.0 + 1), 172.16.224.1
- The last host available is the broadcast number - 1 (172.16.239.255 -1),172.16.239.254
- Finally, we know the subnet will be the network number with the suffix 172.16.224.0 /20
Step 4
Knowing that the next number requires 2000, we look at
the numbers on the 3rd Octet and note that the 5th bit
from the left has 2048, so the subnet mask would be /16 + 5 = /21 which
corresponds the subnet increment of 8.
Hence, the next network number is 172.16.240.0 +16 = 172.16.248.0
To recap
We know that the /21 borrows 5 bits leaving 3 zeros in the 3rd Octet; hence, the
number of hosts is calculated with 2(number of zeros) which is 8 – so I know my next network number is (in
the 3rd Octet) 240 + 8 = 248.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.248.0 – 1 which is 172.16.247.255
- The 1st host available is the network number + 1 (172.16.240.0 + 1), 172.16.240.1
- The last available is the broadcast number - 1 (172.16.247.255 - 1 ), 172.16.247.254
- Finally, we know the subnet will be 172.16.240.0 /21
Step 5
Knowing that the next number requires 1000, we look at the numbers on the 3rd Octet and note that the 6th bit from the left has 1024, so the subnet mask would be /16 + 6 = /22 which corresponds the subnet increment of 4. Hence, the next network number is 172.16.248.0 +4 = 172.16.252.0
To recap
We know that the /22 borrows 6 bits leaving 2 zeros in the 3rd Octet; hence, the
number of hosts is calculated with 2(number of zeros) which is 4 – so I know my next network number is (in
the 3rd Octet) 248 + 2 = 252.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.252.0 – 1 which is 172.16.251.255
- The 1st host available is the network number + 1 (172.16.248.0 + 1), 172.16.248.1
- The last available is the broadcast number - 1 (172.16.251.255 - 1 ), 172.16.251.254
- Finally, we know the subnet will be 172.16.248.0 /22
Step 6
Knowing that the next number requires 500, we look at the numbers on the 3rd Octet and note that the 7th bit from the left has 512, so the subnet mask would be /16 + 7 = /23 which corresponds the subnet increment of 2. Hence, the next network number is 172.16.252.0 +2 = 172.16.254.0.
To recap
We know that the /23 borrows 7 bits leaving 1 zeros in the 3rd Octet; hence, the
number of hosts is calculated with 2(number of zeros) which is 2 – so I know my next network number is (in
the 3rd Octet) 252 + 2 = 254.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.254.0 – 1 which is 172.16.253.255
- The 1st host available is the network number + 1 (172.16.252.0 + 1), 172.16.252.1
- The last available is the broadcast number - 1 (172.16.253.255 - 1 ), 172.16.253.254
- Finally, we know the subnet will be 172.16.252.0 /23
Step 7
Knowing that the next number requires ONLY 2, we look at the numbers on the 4th Octet (Reason – the 3rd octet handles 256 and above, where 2 falls in the 4th octet) and note that the 6th bit from the left has 4, so the subnet mask would be /24 + 6 = /30 which corresponds the subnet increment of 4. Hence, the next network number is 172.16.254.0 + 4 = 172.16.254.4.
To recap
We know that the /30 borrows 6 bits leaving 2 zeros in the 4th Octet; hence, the number of hosts
is calculated with 2(number of zeros) which is 4 – so I know my next network number is (in the 4th
Octet) 0 + 4 = 4
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.254.4 – 1 which is 172.16.254.3
- The 1st host available is the network number + 1 (172.16.254.0 + 1), 172.16.254.1
- The last available is the broadcast number - 1 (172.16.254.3 - 1 ), 172.16.254.2
- Finally, we know the subnet will be 172.16.254.0 /30

Step 8 Rinse and Repeat
For the remaining subnets we just repeat the last calculation incrementing by 4.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.254.8 – 1 which is 172.16.254.7
- The 1st host available is the network number + 1 (172.16.254.4 + 1), 172.16.254.5
- The last available is the broadcast number - 1 (172.16.254.7 - 1 ), 172.16.254.6
- Finally, we know the subnet will be 172.16.254.4 /30
For the remaining subnets we just repeat the last calculation incrementing by 4.
From that…
- We immediately know that my broadcast address for the first line is just one less the next network number, i.e., 172.16.254.12 – 1 which is 172.16.254.11
- The 1st host available is the network number + 1 (172.16.254.8 + 1), 172.16.254.9
- The last available is the broadcast number - 1 (172.16.254.11 - 1 ), 172.16.254.10
- Finally, we know the subnet will be 172.16.254.8 /30
Conclusion
Hopefully, this brief tour of VLSM has at the very least shed some light on what can be a formidable obstacle in certifying for a Network Exam, for with today's advances in Subnetting techniques may soon make this as simple as apple pie, but until then, Wasabi Roll will be standing vigilante! Share and Enjoy...
- https://www.certificationkits.com/cisco-certification/cisco-ccna-640-802-exam-certification-guide/cisco-ccna-vlsm-and-summarization-part-i/
- https://networking.fandom.com/wiki/VLSM


































No comments:
Post a Comment
Thanks for your input, your ideas, critiques, suggestions are always welcome...
- Wasabi Roll Staff