VLSM stands for Variable Length Subnet Mask where the subnet design uses more than one mask in the same network which means more than one mask is used for different subnets of a single class A, B, C or a network. It is used to increase the usability of subnets as they can be of variable size. It is also defined as the process of subnetting of a subnet.
Procedure of implementing VLSM –
In VLSM, subnets use block size based on requirement so subnetting is required multiple times. Suppose there is an administrator that has four departments to manage. These are sales and purchase department with 120 computers, development department with 50 computers, accounts department with 26 computers and management department with 5 computers.
If the administrator has IP 192.168.1.0/24, department wise IPs can be allocated by following these steps:
- For each segment select the block size that is greater than or equal to the actual requirement which is the sum of host addresses, broadcast addresses and network addresses. Make a list of subnets possible:
table – possible subnets list
- Arrange all the segments in descending order based on the block size that is from highest to lowest requirement.
Sales and Purchase: 120 Development: 50 Accounts: 26 Management: 5
- The highest IP available has to be allocated to highest requirement so the sales and purchase department gets 192.168.1.0/25 which has 126 valid addresses that can easily be available for 120 hosts. The subnet mask used is 126.96.36.199
- The next segment requires an IP to handle 50 hosts. The IP subnet with network number 192.168.1.128/26 is the next highest which can be assigned to 62 hosts thus fulfilling the requirement of development department. The subnet mask used is 255.255.255.192
- Similarly the next IP subnet 192.168.1.192/27 can fulfill the requirements of accounts department as it has 30 valid hosts IP which can be assigned to 26 computers.The mask used is 255.255.255.224
- The last segment requires 5 valid hosts IP which can be fulfilled by the subnet 192.168.1.224/29 which has the mask as 255.255.255.248 is chosen as per the requirement. The IP with the mask 255.255.255.240 could be chosen but it has 14 valid hosts IPs and the requirement is less in comparison so the one that is comparable with the requirement is chosen . Thus there is less IP wastage in VLSM as compared to FLSM.
Advantages of VLSM over FLSM –
- In Fixed length subnet mask subnetting (FLSM), all subnets are of equal size and have equal number of hosts but in VLSM the size is variable and it can have variable number of hosts thus making the IP addressing more efficient by allowing a routed system of different mask length to suit requirements.
- In FLSM there is a wastage of IP addresses but in VLSM there is a minimum wastage of IP addresses.
- FLSM is preferred for private IP addresses while for public IP addresses VLSM is the best option.
- Finding Network ID of a Subnet (using Subnet Mask)
- C Program to find IP Address, Subnet Mask & Default Gateway
- IPv4 Classless Subnet equation
- How to get a variable name as a string in PHP?
- PHP | Check if a variable is a function
- 5 variable K-Map in Digital Logic
- How to declare a global variable in PHP?
- Variable Entrant Map (VEM) in Digital Logic
- Lock Variable Synchronization Mechanism
- How to get the value of System Property and Environment Variable in Java?
- Variable (or dynamic) Partitioning in Operating System
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : Rekiko