Variable Length Subnet Mask (VLSM) Subnetting: By: Fritzie S. Estrada
Variable Length Subnet Mask (VLSM) Subnetting: By: Fritzie S. Estrada
Variable Length Subnet Mask (VLSM) Subnetting: By: Fritzie S. Estrada
SUBNET MASK
(VLSM) SUBNETTING
By: Fritzie S. Estrada
◦Variable Length Subnet Masking (VLSM) is a
technique that allows network administrators to
divide an IP address space into subnets of
different sizes, unlike simple same-size Subnetting.
◦ VLSM in a way, means subnetting a subnet. To
simplify further, VLSM is the breaking down of IP
addresses into subnets (multiple levels) and
allocating it according to the individual need on
a network. It can also be called a classless IP
addressing.
IMPLEMENTING VLSM
◦Subnetting lets you efficiently allocate addresses by
taking one large broadcast domain and breaking it up
into smaller, more manageable broadcast domains.
◦VLSMs let you more efficiently allocate IP addresses by
adding multiple layers of the addressing hierarchy.
◦Variable Length Subnet Masks (VLSM) allows you to
use different masks for each subnet, thereby using
address space efficiently.
Differences between FLSM Subnetting and
VLSM Subnetting
FLSM (Fixed Length Subnet Masks) Subnetting VLSM (Variable Length Subnet Masks)
Subnetting
All subnets have equal number of hosts. Subnets have variable number of hosts.
All subnets use same subnet mask. Subnets use different subnet masks.
It supports both classfull and classless routing It supports only classless routing protocols.
protocols.
◦ Which Subnetting should be used depends on the
objectives and type of addresses used in network. FLSM
provides easier Subnetting at the cost of IP addresses
while VLSM best utilizes IP addresses at the cost of
simplicity. For private IP addresses, FLSM is the best
choice. For public IP addresses, VLSM is the best option.
◦ The biggest advantage of VLSM Subnetting is that,
instead of forcing us to use a fixed size for all segments, it
allows us to choose the individual size for each segment.
This flexibility reduces the IP wastage. We can choose the
size of subnet which closely matches with our
requirement.
CIDR Subnet mask Network Host bits Networks Block Size Valid Hosts
bits or Total
CLASS A
Hosts
/8 255.0.0.0 0 24 1 16777216 16777214
/9 255.128.0.0 1 23 2 8388608 8388606
SUBNETTING
/10 255.192.0.0 2 22 4 4194304 4194302
/11 255.224.0.0 3 21 8 2097152 2097150
/12 255.240.0.0 4 20 16 1048576 1048574
CHART /13
/14
/15
255.248.0.0
255.252.0.0
255.254.0.0
5
6
7
19
18
17
32
64
128
524288
262144
131072
524286
262142
131070
/16 255.255.0.0 8 16 256 65536 65534
/17 255.255.128.0 9 15 512 32768 32766
CLASS B
Hosts
/16 255.255.0.0 0 16 1 65536 65534
/17 255.255.128.0 1 15 2 32768 32766
/26 255.255.255.192 2 6 4 64 62
/27 255.255.255.224 3 5 8 32 30
/28 255.255.255.240 4 4 16 16 14
/29 255.255.255.248 5 3 32 8 6
/30 255.255.255.252 6 2 64 4 2
VLSM Example
◦Given the same network and requirements as
in Sample Exercise 2 (last meeting’s Powerpoint
Presentation) develop a subnetting scheme with
the use of VLSM, given:
◦netA: must support 14 hosts
◦netB: must support 28 hosts
◦netC: must support 2 hosts
◦netD: must support 7 hosts
◦netE: must support 28 hosts
Determine what mask allows the required number of hosts.
◦ netA: requires a /28 (255.255.255.240) mask to support 14
hosts
◦ netB: requires a /27 (255.255.255.224) mask to support 28
hosts
◦ netC: requires a /30 (255.255.255.252) mask to support 2
hosts
◦ netD*: requires a /28 (255.255.255.240) mask to support 7
hosts
◦ netE: requires a /27 (255.255.255.224) mask to support 28
hosts
The easiest way to assign the subnets is to assign the
largest first. For example, you can assign in this manner:
◦netB: 204.15.5.0/27 host address range 1 to 30
◦netE: 204.15.5.32/27 host address range 33 to 62
◦netA: 204.15.5.64/28 host address range 65 to 78
◦netD: 204.15.5.80/28 host address range 81 to 94
◦netC: 204.15.5.96/30 host address range 97 to 98
This can be graphically represented in the figure in the
next slide.
The figure below illustrates how using VLSM helped
save more than half of the address space.
VLSM Example 1 (Class A Network)
VLSM Example 2 (Class B Network)
VLSM Example 3 (Class C Network)
Solution for VLSM Example 3:
Based on hosts’ requirement, arrange all segments in
descending order and select appropriate block size for each
segment. No. Segment Host Nearest Valid hosts
requireme block size in block
nt
1 LAN Segment1 29 32 30 (32 -2)
2 LAN Segment 2 21 32 30 (32 -2)
3 LAN Segment 3 12 16 14 (16-2)
4 LAN Segment 4 8 16 14 (16-2)
5 WAN Link 1 2 4 2 (4-2)
6 WAN Link 2 2 4 2 (4-2)
7 WAN Link 3 2 4 2 (4-2)
8 WAN Link 4 2 4 2 (4-2)
◦While selecting the nearest block size, compare the
host requirement with valid host instead of the
block size itself. For example, LAN segment 4 needs
8 hosts, but we can’t use the block size 8 for it. As
block size 8 offers only 6 valid hosts (8 -2) while we
need 8 valid hosts for this segment. For this
segment, we have to use the block size which
provides 8 or more valid hosts such as block size 16.
Same way for WAN links which need 2 hosts, we
have to use the block size 4.
◦ Once segments are arranged based on hosts’ requirement and host
requirements are converted in nearest block size, use following steps.
◦ Do Subnetting for the largest segment. From subnetted subnets, assign
first subnet to it.
◦ If next segment has similar block size, assign next subnet to it.
◦ Repeat this process till the requirements are same.
◦ If next segment requires different block size, do Subnetting again for
the block size of that segment and pick the subnet which comes after
the occupied subnets. Occupied subnets are the subnets which
provide the IP addresses which are already used.
◦ Just like above step, if next segment requires similar block size, use next
subnet for it otherwise do Subnetting again.
◦ Repeat same steps till the last segment of the network.
◦ The first largest segment (LAN Segment1) requires the block size 32. For 32
block size, we use the Subnetting of /27.
◦ In class C, Subnetting of /27 provides us 8 networks (subnets) of block size 32.
◦ 0-31, 32-63, 64-95, 96-127, 128-159, 160-191, 192-223, 224-255
◦ Let’s use the first subnet 0-31 for it.
◦ Since second segment (LAN Segment2) also has the similar requirement, use
the second subnet 32-63 for it.
◦ Third segment (LAN Segment3) requires the block size 16 which is different
from the second segment, so instead of using the subnet which provides
block size 32, we will do the Subnetting again and use the subnet which
provides block size 16.
◦ In class C, Subnetting of /28 provides 16 networks of block size 16.
◦ 0-15, 16-31, 32-47, 48-63, 64-79, 80-95, 96-111, 112-127, 128-143, 144-159, 160-
175, 176-191, 192-207, 208-223, 224-239, 240-255
◦ If we exclude the occupied subnets, we will get the available
subnets for this segment and next segments.
◦ The subnets which provide the addresses which are already
assigned are known as occupied subnets. In this Subnetting the
occupied subnets are 0-15, 16-31, 32-47 and 48-63. These
subnets provide the addresses (0 to 63) which are already
assigned in previous segments.
◦ Let’s use the first available subnet 64-79 from this Subnetting for
the third segment (LAN Segment3).
◦ Forth segment (LAN Segment4) also has the similar requirement.
Let’s assign next available subnet 80-95 to it.
◦ Next segments are WAN links. WAN links require only 2
addresses. For 2 valid addresses we need the block size of 4.
◦ In class C, Subnetting of /30 provides us 64 networks of block
size 4.
◦ 0-3, 4-7, 8-11, 12-15, 16-19, 20-23, 24-27, 28-31, 32-35, 36-39, 40-
43, 44-47, 48-51, 52-55, 56-59, 60-63, 64-67, 68-71, 72-75, 76-79,
80-83, 84-87, 88-91, 92-95, 96-99, 100-103, 104-107, 108-111, 112-
115, 116-119, 120-123, 124-127, 128-131, 132-135, 136-139, 140-
143, 144-147, 148-151, 152-155, 156-159, 160-163, 164-167, 168-
171, 172-175, 176-179, 180-183, 184-187, 188-191, 192-195, 196-
199, 200-203, 204-207, 208-211, 212-215, 216-219, 220-223, 224-
227, 228-231, 232-235, 236-239, 240-243, 244-247, 248-251, 252-
255
◦ Exclude the occupied subnets and use first four available
subnets 96-99, 100-103, 104-107 and 108-111 for WAN links.
Segment CIDR Subnet Mask Network Broad cast Valid host
Address Address addresses
LAN Segment1 /27 255.255.255.224 192.168.1.0 192.168.1.31 192.168.1.1 to
192.168.1.30
LAN Segment 2 /27 255.255.255.224 192.168.1.32 192.168.1.63 192.168.1.33 to
192.168.1.62