Variable Length Subnet Mask (VLSM)
Variable Length Subnet Mask (VLSM)
(VLSM)
Topic Outline
• Understand the concept of VLSM
• Calculate VLSM in a given scenario
Subnetting without VLSM
• Using traditional subnetting, the same number of
addresses is allocated for each subnet.
• Inefficient used of IP address. Why ?
Subnet /
Network 1
Subnet /
Network 2
Subnet /
Network 3
Subnet /
Network 4
Subnet /
Network 5
Subnet /
Network 6
Subnet /
Network 7
192.168.20.0/24
Solution :
• Number of subnet needed = 7
• Using formula, determine the number of bits to be borrowed to create 7
subnet.
2^n = 7
n = 3; meaning 3 bits from host portion will be borrowed / joint network
portion.
Subnet Subnet / Network 1st Usable IP Address Last Usable IP Address Broadcast Address
/Network Address
Number
Subnet /
192.168.20.0 192.168.20.1 192.168.20.30 192.168.20.31
Building A Network 1
Subnet / 192.168.20.32 192.168.20.33 192.168.20.62 192.168.20.63
Building B Network 2
Building C
Subnet /
Network 3
192.168.20.64 192.168.20.65 192.168.20.94 192.168.20.95
G0/0 G0/1
Network #1 Network #2
Number of IP needed = 6 Number of IP needed = 2
a. start calculation with highest number of IP address / host needed.
Network 1 > Network 2
Network #1
2nd IP
1st Usable IP = 192.168.10.1
3rd IP
1st IP
2nd Usable IP = 192.168.10.2
3rd Usable IP = 192.168.10.3
4th IP
4th Usable IP = 192.168.10.4
5th IP 6th IP 5th Usable IP = 192.168.10.5
6th Usable IP = 192.168.10.6
2
22
2
Network #2
a. Use formula Use formula 2^n – 2 = number of host needed
2^n – 2 = 2
n = 2 ; means allocate 2 bits for host portion.
b. Custom subnet mask =111111111.11111111.11111111.11111100
2^2 = 4
=255.255.255.252
c. Range for subnet = 2^2 =4
d. Continue from previous addressing table
Network Custom Subnet Prefix Network 1st Last Usable IP Broadcast
Mask address usable IP
Network 255.255.255.248 / 29 192.168.10.0 192.168.10.1 192.168.10.6 192.168.10.7
#1
8
Network 255.255.255.252 /30 192.168.10.8 192.168.10.9 192.168.10.10 192.168.10.11
#2 4
192.168.10.12
1st IP
2nd IP
Se0/0
Se0/1
R1 R2
Subnet /
Network 1
Subnet /
Network 2
Subnet /
Network 3
Subnet /
Network 4
Subnet /
Network 5
Subnet /
Network 6
Subnet /
Network 7
Step : Begin your calculation with the highest number of host required
LAN 3
• Use formula 2^n – 2 = number of host needed
2^n - 2 = 250
n = 8 , meaning 8 bits for host portion. Balance 24 bits are for network portion.
custom subnet mask = 11111111.11111111.11111111.00000000 = /24
= 255.255.255.0
LAN 1 175.30.5.128
LAN 2
R1 to R2
LAN 4
• Use formula 2^n – 2 = number of host needed
2^n – 2 = 100
n = 7 , meaning 7 bits for host portion. Balance 25 bits are for network portion.
custom subnet mask = 11111111.11111111.11111111.10000000 = /25
= 255.255.255.224
Subnet Custom Subnet Mask Prefix Subnet / Network 1st Usable IP Last Usable IP Broadcast Address
/Network Address Address Address
Number
Subnet Custom Subnet Mask Prefix Subnet / Network 1st Usable IP Last Usable IP Broadcast Address
/Network Address Address Address
Number
R1 to R2 175.30.5.208
R1 to R2
• Use formula 2^n – 2 = number of host needed
2^n – 2 = 2
n = 2 , meaning 2 bits for host portion. Balance 30 bits are for network portion.
custom subnet mask = 11111111.11111111.11111111.11111100 = /30
= 255.255.255.252
Subnet Custom Subnet Mask Prefix Subnet / Network 1st Usable IP Last Usable IP Broadcast Address
/Network Address Address Address
Number
175.30.5.212
10.10.96.0/21
Subnet Subnet / Custom Subnet Prefix 1st Usable IP Last Usable IP Broadcast
/Network Network Mask Address Address Address
Number Address
192.168.6.0/23
Subnet Subnet / Custom Subnet Prefix 1st Usable IP Last Usable IP Broadcast
/Network Network Mask Address Address Address
Number Address