VLSM
VLSM
Subnet
Dividing a network into two or more networks is called subnetting.
When we perform Subnetting, all subnets have the same number of hosts, this is
known as FLSM ( Fixed length subnet mask). In FLSM all subnets use same subnet
mask, this lead to inefficiencies.
VLSM(Variable Length Subnet Mask) is a process of dividing an IP network into the
subnets of different sizes without wasting IP addresses.
In real life scenario, some subnets may require large number of host addresses while
other may require only few addresses as in the above example.
Therefore we are using VLSM for the solution.
VLSM Subnetting
Step 1 :- Oder all segments according the hosts requirement (Largest to smallest).
Subne Segment Hosts
t
1 Development 74
2 Production 52
3 Administrative 28
4 Wan link 1 2
5 Wan link 2 2
6 Wan link 3 2
Step 3 :- Assign subnet mask to the largest segment. As you can see in above table, subnet 1
fulfill our largest segment requirement. Assign it to our segment.
Subnet mask 255.255.255.128(as leftmost 25 bits are 1)
128 64 32 16 8 4 2 1
1 0 0 0 0 0 0 0
Segment Development
Requirement 74
CIDR /25
Network ID 192.168.1.0
Broadcast ID 192.168.1.127
Step 4 :- Do subnetting for second largest segment from next available subnet. Next segment
requires 52 host addresses. Subnetting of /25 has given us two subnets with 126 hosts in each,
from that we have assigned first subnet to development segment. Second segment is
available, we would do subnetting of this.
Production department needs 52 host addresses.
We can use 64(26) addresses.
Total bits 32 - bits used for production department 6= /26
Number of subnets = 256/64=4 subnets.
/26 provide us 4 subnets with 62 hosts in each subnet.
128 64 32 16 8 4 2 1
1 1 0 0 0 0 0 0
Subnet mask
255.255.255.(128+64)
255.255.255.192
We cannot use subnet 1 and subnet 2 ( address from 0 to 127 ) as they are already assigned to
development department. We can assign subnet 3 to our production department.
Segment Production
Requirement 52
CIDR /26
Network ID 192.168.1.128
Broadcast ID 192.168.1.191
Step 5 :- Our next segment requires 28 hosts. From above subnetting we have subnet 3 and
subnet 4 available. Do subnetting for the requirement of 28 hosts.
Admin department needs 28 host addresses.
We can use 32(25) addresses.
Total bits 32 - bits used for Admin department 5= /27
Number of subnets = 256/32=8 subnets.
192.168.1.0/27
Subnets 1 to 6 [ address from 0 to 191] are already occupied by previous segments. We can
assign subnet 7 to this segment.
128 64 32 16 8 4 2 1
1 1 1 0 0 0 0 0
Subnet mask
255.255.255.(128+64+32)
255.255.255.224
Segment Administrative
Requirement 28
CIDR /27
Network ID 192.168.1.192
Broadcast ID 192.168.1.223
Step 6 :- Our last three segments require 2 hosts per subnet. Do subnetting for these.
WAN links needs 2 host addresses.
We can use 4(22) addresses.[2 host addresses +1 broadcast IP + 1 network IP)
Total bits 32 - bits used for wan links 2= /30
Number of subnets = 256/4=64 subnets.
192.168.1.0/30
Valid subnets are:-
0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,1
16,120,124,128,132,136,140,144,148,152,156,160,164,168,172,176,180,184,188,192,196,20
0,204,208,212,216,220,224,228,232,236,240,244,248,252,256
From these subnets, subnet 1 to subnet 56 ( Address from 0 - 220) are already assigned to
previous segments. We can use 224,228, and 232 for wan links.
128 64 32 16 8 4 2 1
1 1 1 1 1 1 0 0
Subnet mask
255.255.255.(128+64+32+16+8+4)
255.255.255.252
Subnet Subnet 57 Subnet 58 Subnet 59
Wan Link 1
Requirement 2
CIDR /30
Network ID 192.168.1.224
Broadcast ID 192.168.1.227
Wan Link 2
CIDR /30
Network ID 192.168.1.228
Broadcast ID 192.168.1.231
Wan link 3
Requirement 2
CIDR /30
Network ID 192.168.1.232
Broadcast ID 192.168.1.235
We have assigned IP addresses to all segments, still we have 20 addresses available. This is
the magic of VLSM.
Design Topology
1. Click on the PC
2. Select Desktop and go to IP Configuration
3. Set IP address, subnet mask and gate way for the particular host.
Same procedure is followed for all the PCs.
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.128
Router(config-if)#no shutdown
Router(config-if)#exit
Equivalent Commands
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#router rip
Router(config-router)#network 192.168.1.0
Same procedure is followed for all the Routers.
Equivalent Commands
Router>enable
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#ip route 192.168.1.128 255.255.255.192 192.168.1.225