What Is VLSM in Networking?
This page mentions older exam versions. See the Current Exam Context and Legacy Exam Context sections below for the updated mapping.
On This Page
Quick Definition
VLSM is a way to divide a network into smaller pieces called subnets, but each piece can be a different size. Instead of making every subnet the same size, you give each one exactly the number of IP addresses it needs. This avoids wasting IP addresses and makes the network more efficient.
Commonly Confused With
CIDR (Classless Inter-Domain Routing) is a broader concept that includes VLSM as a key component. CIDR is a method for allocating IP addresses and routing IP packets, using any prefix length. VLSM is specifically the technique of using different prefix lengths within a single network. CIDR is about routing efficiency and address summarization; VLSM is about subnet design.
CIDR allows route summarization like 192.168.0.0/16, while VLSM allows subnets inside that block like 192.168.1.0/26 and 192.168.1.64/27.
Classful subnetting uses only the default subnet masks based on the class of the IP address (A, B, C). VLSM overrides this by allowing any prefix length, not just /8, /16, /24. In classful subnetting, all subnets from the same major network must have the same mask. VLSM breaks that rule.
A Class C network 192.168.5.0/24 subnetted with classful method would use only /24 subnets. With VLSM, you could use /26, /27, /28, /30 within the same 192.168.5.0/24 block.
Supernetting is the opposite of subnetting. It combines multiple smaller networks into one larger network to reduce routing table entries. VLSM breaks a network into smaller pieces. Supernetting combines them. They are used for different purposes: VLSM for internal design, supernetting for external routing summarization.
VLSM: 10.0.0.0/16 split into 10.0.1.0/24, 10.0.2.0/24, etc. Supernetting: combining 192.168.0.0/24, 192.168.1.0/24, 192.168.2.0/24 into 192.168.0.0/22.
Must Know for Exams
VLSM is a high-weight topic in the Cisco CCNA (200-301) exam, appearing under the 'Network Fundamentals' and 'IP Connectivity' sections. It also features prominently in CompTIA Network+ (N10-008) under 'Network Addressing' and 'Subnetting'. In these exams, you will be required to calculate subnet masks, network addresses, broadcast addresses, and usable host ranges for given host counts. You will also need to design a subnetting scheme that fits multiple size requirements into a single address block without overlap.
Question types vary. You may see multiple-choice questions asking for the correct subnet mask for a subnet needing X hosts. You may see fill-in-the-blank questions where you write the network address or the subnet mask in slash notation. You may see scenario-based questions where you are given an IP block and a list of departments with host counts, and you must determine the correct subnet assignments. Some questions may ask you to identify the broadcast address of a VLSM subnet or to find the last usable host address. There are also troubleshooting-style questions: given a routing table or IP configuration, determine if the subnet mask is correct or if there is an overlap.
In CCNA, VLSM is often combined with route summarization, where you need to calculate the summarization route for a set of VLSM subnets. For example, given subnets 192.168.1.0/26, 192.168.1.64/27, and 192.168.1.96/28, you must find the summary route (e.g., 192.168.1.0/25). This tests your ability to think in binary and aggregate subnets.
In the exam, time pressure is real. You must be able to do binary calculations quickly. Many candidates fail because they cannot compute VLSM subnets accurately under time constraints. Therefore, practicing VLSM problems is critical. Focus on identifying the block size from the subnet mask, counting bits, and remembering the formula 2^n - 2 for usable hosts. Learn to use the 'block size' shortcut: a /26 means block size 64, /27 means 32, /28 means 16, /29 means 8, /30 means 4. This will save you time.
Finally, remember that VLSM is not just about calculation, it is about design. You need to know how to start with the largest subnet and work down, and how to ensure subnets do not overlap. Exam questions may give you a set of subnets and ask if they are valid. If two subnets overlap, the answer is usually 'no'.
Simple Meaning
Imagine you are organizing a company picnic and you have a large rectangular tablecloth that represents your entire network of IP addresses. You need to divide the tablecloth into sections for different teams: the IT team needs space for 30 people, the HR team needs space for 10 people, and the sales team needs space for 5 people. If you cut every section the same size, you would waste a lot of tablecloth on small teams. With VLSM, you measure each section exactly to fit each team. So you cut a big piece for IT, a medium piece for HR, and a small piece for sales, all from the same tablecloth. In networking, VLSM works the same way. Instead of using one fixed subnet mask for all subnets, you apply different subnet masks to different subnets. This means you can create a subnet with 30 usable IP addresses, another with 10, and another with 5, all within the same larger network. The magic happens because subnet masks can be written in binary, and you can borrow different numbers of bits from the host portion for each subnet. This gives you flexibility to match the exact size of each subnet to the number of devices it needs to support, reducing wasted IP addresses especially in IPv4 where addresses are limited.
Think of a big apartment building. The building has 256 apartments total. The owner decides to give whole floors to different companies. Floor 1 needs 100 apartments, floor 2 needs 50, floor 3 needs 25. If every floor had exactly 100 apartments, floors 2 and 3 would have many empty apartments. VLSM lets the owner assign exactly 100, then exactly 50, then exactly 25, so no apartments are wasted. This is exactly what VLSM does for IP addresses.
VLSM is a key part of efficient network design. It requires careful planning because you have to decide which subnet sizes go where and how they fit into the larger address space. But the reward is that you can use your IP address block much more efficiently, which is why it is used in almost every modern enterprise network.
Full Technical Definition
VLSM stands for Variable Length Subnet Masking. It is a network design technique that allows the use of different subnet masks for different subnets within the same major network, thereby enabling the creation of subnets of varying sizes. In traditional classful IP addressing, every subnet would have the same subnet mask, defined by its class (A, B, or C). For example, a Class C network with the default mask 255.255.255.0 would create subnets of exactly 254 usable hosts each, regardless of need. This often led to significant IP address wastage. VLSM overcomes this by allowing the network administrator to apply a custom subnet mask to each subnet, borrowing more or fewer bits from the host portion as needed.
VLSM relies on the concept of subnetting a subnet. The process begins with a block of IP addresses, say 192.168.1.0/24. The administrator decides on a subnetting strategy, usually starting with the largest subnet requirement. For a subnet needing 60 hosts, a /26 mask (255.255.255.192) is used, providing 62 usable addresses (2^6 - 2 = 62). For a subnet needing 30 hosts, a /27 mask (255.255.255.224) provides 30 usable addresses (2^5 - 2 = 30). For a subnet needing 10 hosts, a /28 mask (255.255.255.240) provides 14 usable addresses. For a point-to-point link needing only 2 hosts, a /30 mask (255.255.255.252) provides 2 usable addresses. The key is that these subnets do not overlap. They are assigned sequentially from the original address block, each starting after the previous one ends.
In practice, VLSM requires a structured approach. The administrator first lists all network segments and their host requirements. Then the subnets are created in descending order of size, because larger subnets need larger address blocks and are harder to place later. The subnet mask determines the block size. For a /26, each subnet is 64 addresses; for /27, 32 addresses; for /28, 16 addresses; for /30, 4 addresses. The first and last addresses in each subnet are reserved for the network address and broadcast address respectively, so the usable hosts are the block size minus 2.
VLSM is fully supported by routing protocols that carry subnet mask information in their updates, such as OSPF, EIGRP, IS-IS, and BGP. These are called classless routing protocols. Older protocols like RIPv1 do not support VLSM because they assume classful addressing. Modern networks rely on classless inter-domain routing (CIDR) and VLSM to make efficient use of the IPv4 address space. VLSM is essential for private networks, hierarchical IP addressing, route summarization, and reducing routing table size.
From an exam perspective, understanding VLSM requires proficiency in binary math, calculating subnet masks, identifying the network address, broadcast address, and usable host range for any given subnet. It also requires the ability to design a subnetting scheme that fits multiple size requirements into a given address block without overlap. This is a core skill for network administrators and a frequent topic in certification exams.
Real-Life Example
Imagine you are moving into a new apartment and you have a bookshelf that is 100 centimetres wide. You need to organize your books into sections. You have three categories: large textbooks that need a 40 cm wide section, medium novels that need a 30 cm section, and small pocketbooks that need a 20 cm section. If you made every section exactly 40 cm wide, you would waste a lot of space on the medium and small sections. You could put the 40 cm section first, then the 30 cm section, then the 20 cm section. That way you use exactly 90 cm and have 10 cm left over for something else. This is exactly what VLSM does. The bookshelf is your IP address block. The sections are your subnets. Each subnet gets just enough space (IP addresses) for its needs.
But let's take it further. Suppose you also have a very thin section for a single bookmark that only needs 5 cm. With VLSM, you could even make a 5 cm section. In networking, you might have a point-to-point link that only needs two IP addresses. You would use a /30 subnet which gives exactly two usable addresses, wasting only two addresses (network and broadcast). This is far more efficient than using a full /24 subnet that would waste 252 addresses.
Now imagine you are a city planner dividing land into neighbourhoods. One neighbourhood needs 200 houses, another needs 50, and another needs 10. If you gave every neighbourhood a plot of land that fits 200 houses, the smaller neighbourhoods would have lots of empty lots. VLSM lets you give each neighbourhood exactly the right sized plot, saving land for other uses. In the real world, IP addresses are a scarce resource, and VLSM is the tool that makes sure we don't waste them.
Why This Term Matters
VLSM matters because it addresses a critical problem: IP address exhaustion. IPv4 has a limited number of addresses, and wasting them by using fixed-size subnets for all network segments is no longer acceptable. Enterprises, ISPs, and data centres all need to use their allocated IP address blocks as efficiently as possible. VLSM allows network engineers to design subnets that exactly match the number of hosts in each segment, reducing waste to a minimum.
VLSM enables hierarchical IP address design. By using different subnet masks, you can create a logical structure that mirrors your physical network. Your core switches can have a large subnet for servers, your access switches can have smaller subnets for departments, and point-to-point links can use tiny subnets. This hierarchical structure simplifies routing and allows route summarization, where multiple subnets are advertised as a single larger network. This reduces the size of routing tables and improves network performance.
VLSM is fundamental to modern routing protocols. Protocols like OSPF, EIGRP, and BGP are classless, meaning they include the subnet mask in routing updates. Understanding VLSM is necessary to configure and troubleshoot these protocols correctly. Without VLSM, you cannot implement proper route summarization or variable-length subnetting in a multi-site network.
Finally, VLSM is a core skill for network certification exams. It appears in the CCNA, CompTIA Network+, and many other exams as a key objective. Mastery of VLSM requires solid binary math skills and the ability to design subnetting schemes logically. For any IT professional working with IP networks, VLSM is not optional, it is a daily necessity.
How It Appears in Exam Questions
Exam questions about VLSM generally fall into four patterns: calculation, design, verification, and troubleshooting.
Calculation questions are the most common. They give you a network address and a host requirement and ask you to find the subnet mask, network address, broadcast address, or usable host range. For example: 'You have the network 192.168.10.0/24. You need a subnet that supports 25 hosts. What subnet mask would you use?' The answer is /27 (255.255.255.224) because it provides 30 usable hosts (2^5 - 2 = 30), which is the smallest size that fits 25. Another variation: 'Given the subnet 172.16.5.64/28, what is the broadcast address?' The block size for /28 is 16, so the next network is .80 (64+16), broadcast is .79. You should be comfortable with these binary-based calculations.
Design questions present a scenario with multiple subnet requirements. For example: 'You are given 10.10.0.0/19. You need three subnets: Subnet A: 400 hosts, Subnet B: 100 hosts, Subnet C: 25 hosts. Design the subnetting scheme using VLSM.' You would calculate: /22 for A (1022 usable hosts), /25 for B (126 usable hosts), /27 for C (30 usable hosts). Then assign them sequentially: A: 10.10.0.0/22, B: 10.10.4.0/25, C: 10.10.4.128/27. Ensure no overlap.
Verification questions ask you to check if a given subnetting scheme is valid. They might provide a table of subnets and you need to identify if any overlap or if the subnet mask is incorrect for the host count. For example: 'Subnet 1: 192.168.1.0/26, Subnet 2: 192.168.1.64/26. Are these valid?' The answer is no, because both have block size 64; Subnet 1 is 0-63, Subnet 2 is 64-127, and .64 is the network address of Subnet 2, so there is no overlap, wait, there is no overlap, but the question might be tricky. Actually, 192.168.1.64/26 starts at .64 and ends at .127, which is valid. But if the second subnet were .64/27, it would be inside the first. So care is needed.
Troubleshooting questions present a misconfigured device. For example: 'A router has an interface with IP 172.16.3.34/28, but cannot communicate with a host at 172.16.3.42. The network engineer suspects a subnet mask mismatch. What is the subnet mask on the other device?' This requires you to check if .34 and .42 are in the same subnet. For /28, block size 16, .34 is in the .32-.47 range, .42 is also in that range, so they should be in the same subnet. If there is a mismatch, likely the other device is using a different mask, say /29, which would put .34 in .32-.39 and .42 in .40-.47, causing the problem.
So, you need to be fast with binary, know your block sizes, and understand how to place subnets. Practice with many scenarios.
Practise VLSM Questions
Test your understanding with exam-style practice questions.
Example Scenario
A small company has been assigned the network 192.168.50.0/24. They have five departments with the following number of devices:
Engineering: 55 devices Marketing: 25 devices Sales: 12 devices HR: 6 devices IT Admin: 2 devices (point-to-point link)
The network administrator needs to create subnets using VLSM to avoid wasting IP addresses. Let's walk through the process.
First, identify the largest subnet requirement: Engineering needs 55 hosts. The smallest subnet that can support 55 hosts is /26, which provides 62 usable hosts (64 - 2 = 62). So Engineering gets 192.168.50.0/26. This covers addresses .0 to .63. The next subnet can start at .64.
Next, Marketing needs 25 hosts. The smallest subnet that supports 25 is /27, which provides 30 hosts (32 - 2 = 30). So Marketing gets 192.168.50.64/27. This covers .64 to .95. The next subnet starts at .96.
Sales needs 12 hosts. A /28 subnet provides 14 usable hosts (16 - 2 = 14). So Sales gets 192.168.50.96/28. This covers .96 to .111. Next subnet starts at .112.
HR needs 6 hosts. A /29 subnet provides 6 usable hosts (8 - 2 = 6). So HR gets 192.168.50.112/29. This covers .112 to .119. Next subnet starts at .120.
IT Admin needs only 2 devices (point-to-point link). A /30 subnet provides exactly 2 usable hosts (4 - 2 = 2). So IT Admin gets 192.168.50.120/30. This covers .120 to .123. The remaining addresses .124 to .255 are unused and can be reserved for future growth.
This VLSM scheme uses exactly 124 addresses, wasting only the unused portion beyond .124. Compared to using a fixed /24 network for each department, which would waste thousands of addresses, VLSM is extremely efficient. Each department gets exactly what it needs, and no addresses are wasted within the required boundaries. This is how a real network administrator would design subnets in practice.
Common Mistakes
Using the same subnet mask for all subnets regardless of host requirement.
This ignores the principle of VLSM, leading to wasted IP addresses. For example, using a /24 mask for a point-to-point link wastes 252 addresses.
Always calculate the exact number of hosts needed and choose the smallest subnet mask that can accommodate that number, plus 2 for network and broadcast.
Forgetting to reserve the network address and broadcast address when calculating usable hosts.
The formula is 2^n - 2, where n is the number of host bits. Forgetting the subtraction leads to overestimating the available IP addresses, which can cause address conflicts.
Always subtract 2 from the total number of addresses in the subnet (2^n) to get the usable host count. For example, /28 gives 16 addresses, minus 2 = 14 usable hosts.
Creating overlapping subnets by not correctly aligning the subnet boundaries.
If two subnets overlap, devices in different subnets may be unable to communicate correctly, and routing will be unpredictable. Overlap is a common exam trap.
When assigning subnets sequentially, ensure the next subnet starts exactly at the end of the previous subnet's broadcast address plus one. For example, if a /27 ends at .95, the next subnet must start at .96.
Confusing the slash notation with the decimal subnet mask.
For example, thinking /26 means 255.255.255.192, but incorrectly converting to decimal when adding or comparing. This leads to miscalculations.
Memorize the common slash notations and their corresponding masks. Use the block size method: /26 = 64, /27 = 32, /28 = 16, /29 = 8, /30 = 4. Practice converting between slash and decimal masks.
Starting the design with the smallest subnet first.
If you assign the small subnets first, you may break the contiguous address space and make it impossible to fit larger subnets later. The largest subnet needs the biggest continuous block.
Always sort the required subnets in descending order of host count. Assign subnets from largest to smallest to ensure the large subnets can be placed without fragmentation.
Exam Trap — Don't Get Fooled
{"trap":"Many exam questions present a scenario where you have a block of addresses and a list of required host counts, but one of the provided answer options is a subnet that is too small (e.g., using /30 for a subnet that needs 5 hosts).
Candidates often choose it because they misread the host requirement or forget the -2 rule.","why_learners_choose_it":"Learners may see a /30 subnet and think 'that's small, so it must be efficient', or they may simply miscalculate that /30 gives 4 addresses, and 4 is more than 5? Actually it's not, but they might think 4 is close enough.
Or they may forget that network and broadcast addresses are reserved, so /30 gives only 2 usable hosts, not 4.","how_to_avoid_it":"Always calculate usable hosts: usable = 2^(32 - prefix) - 2. For example, /30: 2^2 - 2 = 4 - 2 = 2.
If the requirement is 5 hosts, /30 is too small. The smallest valid subnet for 5 hosts is /29 (8 - 2 = 6). Do not rely on feeling; do the math every time."
Step-by-Step Breakdown
List all subnet requirements
Write down every network segment and the number of hosts it must support. Do not forget point-to-point links which need exactly 2 addresses (2 usable). Order them from largest to smallest host count.
Determine the subnet mask for each requirement
For each host count, find the smallest subnet mask that provides at least that many usable hosts. Use the formula 2^(32 - prefix) - 2 >= required hosts. Refer to the table: /30 = 2, /29 = 6, /28 = 14, /27 = 30, /26 = 62, /25 = 126, /24 = 254, etc.
Determine the block size for each mask
The block size is 2^(32 - prefix). For /26, block size = 64; /27 = 32; /28 = 16; /29 = 8; /30 = 4. This tells you the address range each subnet occupies. Subnets must start at multiples of the block size.
Assign subnets starting from the base network address
Start with the largest subnet. Its network address is the base address. Then the next subnet's network address is the previous subnet's broadcast address plus 1. Continue assigning in descending size order. Ensure each subnet starts at a multiple of its own block size.
Calculate the network and broadcast addresses for each subnet
For each subnet, the network address is the starting address. The broadcast address is the starting address plus block size minus 1. Usable IP addresses are everything between network and broadcast, excluding these two. Record these for verification.
Verify no overlaps and that all requirements are met
Double-check that no two subnets share any IP address. Also ensure the last subnet does not exceed the original address block size. If it does, the block is too small and you need a larger major network.
Practical Mini-Lesson
VLSM is one of the most practical skills for a network engineer. In a real enterprise, you will rarely have the luxury of using the same subnet mask for every VLAN or site. You will be given a finite block of IP addresses, maybe a /21 or /22, and you must fit many subnets of different sizes into it. For example, a company with a headquarters (300 hosts), three branch offices (50 hosts each), and a dozen point-to-point links between routers. Without VLSM, you would either waste addresses or run out of space. With VLSM, you give the head office a /23 (510 usable hosts), each branch a /26 (62 usable hosts), and each point-to-point link a /30 (2 usable hosts). This can all fit comfortably in a /21 block (2048 addresses).
In practice, VLSM requires you to think in binary. When you get a subnet mask like /28, you need to know immediately that the block size is 16 and that subnets start at multiples of 16 (0, 16, 32, 48, etc.). You also need to know how to convert between decimal and binary for tricky boundaries. For example, the subnet 172.31.64.0/21 is tricky because the block size is 2048 (2^11). The network address is 172.31.64.0, and the broadcast is 172.31.71.255. Understanding these boundaries is crucial for route summarization.
What can go wrong? The most common real-world problem is misconfiguration of subnet masks on routers or switches. If one device thinks a subnet is /26 and another thinks it's /27, devices that think they are on the same subnet may not be able to communicate. This leads to connectivity issues that are hard to troubleshoot. Also, if you forget to leave space for future growth, you may have to re-subnet the entire network later, which is disruptive.
From a professional standpoint, you should keep a subnetting reference chart and practice binary math until it is second nature. Many network engineers use the 'magic number' method: for a given mask, find the interesting octet. The magic number is 256 minus the mask value in that octet. For /26, the mask is 255.255.255.192, magic number is 256 - 192 = 64. Subnets are multiples of 64. This is a quick mental shortcut.
Finally, always document your VLSM scheme. In a large company, you may have hundreds of subnets. Document the network address, mask, broadcast, and purpose for each. This will save you hours of troubleshooting later.
Memory Tip
Remember 'LSLM', Largest Subnet, then Smaller, then Least, then Minimum. Always start with the largest requirement and work down.
Covered in These Exams
Current Exam Context
Current exam versions that test this topic — use these objectives when studying.
200-301Cisco CCNA →N10-009CompTIA Network+ →Legacy Exam Context
Older materials may mention these exam versions, but learners should use the current objectives for their target exam.
N10-008N10-009(current version)Related Glossary Terms
802.1Q is the networking standard that allows multiple virtual LANs (VLANs) to share a single physical network link by tagging Ethernet frames with VLAN identification information.
802.1X is a network access control standard that authenticates devices before they are allowed to connect to a wired or wireless network.
An A record is a type of DNS resource record that maps a domain name to an IPv4 address.
An AAAA record is a DNS record that maps a domain name to an IPv6 address, allowing devices to find each other over the internet using the newer IP addressing system.
AAA (Authentication, Authorization, and Accounting) is a security framework that controls who can access a network, what they are allowed to do, and tracks what they did.
Two-factor authentication (2FA) is a security method that requires two different types of proof before granting access to an account or system.
Frequently Asked Questions
What is VLSM in simple terms?
VLSM lets you create subnets of different sizes within one network, so you don't waste IP addresses. You give each subnet exactly the number of IP addresses it needs.
Why is VLSM important for the CCNA exam?
VLSM is a core objective in the CCNA. You will be tested on calculating subnet masks, network addresses, broadcast addresses, and designing efficient subnetting schemes.
What is the difference between VLSM and CIDR?
CIDR is a method for IP address allocation and routing that uses any prefix length. VLSM is specifically the technique of using different prefix lengths within a single network. CIDR includes VLSM.
How do I decide which subnet mask to use for a given number of hosts?
Find the smallest subnet mask where the formula 2^(32-prefix) - 2 is greater than or equal to your host requirement. Use a reference table for common masks: /30=2, /29=6, /28=14, /27=30, /26=62, /25=126, /24=254.
Can VLSM be used with IPv6?
Yes, but it is less critical because IPv6 has a huge address space. However, VLSM principles still apply, and IPv6 subnetting is also variable-length (often using /64 subnets for LANs and /126 for point-to-point).
What happens if two subnets overlap in a VLSM design?
Overlap causes routing problems and devices may not communicate properly. The network design is invalid. Always ensure subnets are contiguous and non-overlapping.
How can I practice VLSM?
Use subnetting calculators sparingly; do the binary math manually. Practice with different network blocks and create subnetting tables. Many online resources and practice exams provide VLSM exercises.
Summary
VLSM, or Variable Length Subnet Masking, is a fundamental technique for efficient IP address management in modern networks. It allows network engineers to create subnets of different sizes within the same major network, matching each subnet's size exactly to its host requirement. This avoids wasteful use of IPv4 addresses and enables hierarchical, scalable network designs. VLSM works by applying different subnet masks to different subnets, borrowing bits from the host portion as needed. The process requires careful planning: list all host requirements in descending order, choose the smallest appropriate mask for each, and assign subnets sequentially without overlap.
From an exam perspective, VLSM is a core skill for the Cisco CCNA, CompTIA Network+, and other IT certifications. Candidates must be able to calculate subnet masks, network addresses, broadcast addresses, and usable host ranges quickly and accurately. They must also be able to design a complete VLSM scheme given a block of addresses and multiple host requirements. Common exam traps include forgetting the -2 rule for usable hosts, creating overlapping subnets, and starting with the smallest subnet first.
In real-world practice, VLSM is used daily by network engineers and administrators. It is essential for efficient IP address allocation in enterprise networks, data centres, and service provider environments. Mastery of VLSM also supports route summarization and reduces routing table size. The key takeaway for learners is to practice binary math, memorize common subnet masks, and always design subnets from largest to smallest. With consistent practice, VLSM becomes second nature and is a significant confidence booster in exams.