VLSM Step by Step: Planning Subnets Without Wasting Addresses
5 min read
Fixed-length subnetting gives every subnet the same size — which means the subnet sized for your biggest department wastes most of its addresses in the smallest one. VLSM (Variable Length Subnet Masking) fixes that by letting each subnet be sized to its actual need. It is the standard way real networks are addressed, and it is a favourite exam topic because it tests whether you can plan rather than just calculate.
In simple words
You have one long ribbon and need pieces for gifts of different sizes. Cutting equal pieces wastes ribbon on the small gifts. VLSM is cutting each piece to the exact size the gift needs — big piece for the big gift, small piece for the small one — starting with the biggest so it always fits.
The problem VLSM solves
Imagine you need subnets for 100, 50, 25 and 10 hosts, plus two point-to-point WAN links. With fixed /25 subnets (the smallest that fits 100 hosts), you would carve six /25 blocks: 6 × 128 = 768 addresses for about 170 devices. Over half the space is wasted. VLSM sizes each subnet individually, packing them into far less space.
The golden rule: biggest first
Always allocate the largest requirement first, then work down. This is the step people get wrong most often — allocating small subnets first fragments the space and can leave the big subnet with nowhere to fit.
Worked example: 192.168.1.0/24
Requirements: 100 hosts, 50 hosts, 25 hosts, 10 hosts, and two WAN links needing 2 addresses each.
1. 100 hosts → /25. Needs 7 host bits (2^7 = 128, 126 usable). Take the first block: 192.168.1.0/25 — addresses .0–.127, usable .1–.126.
2. 50 hosts → /26. Needs 6 host bits (2^6 = 64, 62 usable). Next free block: 192.168.1.128/26 — addresses .128–.191, usable .129–.190.
3. 25 hosts → /27. Needs 5 host bits (2^5 = 32, 30 usable). Next free block: 192.168.1.192/27 — addresses .192–.223, usable .193–.222.
4. 10 hosts → /28. Needs 4 host bits (2^4 = 16, 14 usable). Next free block: 192.168.1.224/28 — addresses .224–.239, usable .225–.238.
5. Two WAN links → two /30s. Each needs 2 host bits (2^2 = 4, 2 usable). Next free blocks: 192.168.1.240/30 (.240–.243) and 192.168.1.244/30 (.244–.247).
Everything fits in .0–.247, leaving .248–.255 spare for growth. Total space used: 248 addresses, versus 768 with fixed /25s. The same method works at any scale — including summarising the results into a single advertised prefix afterwards.
An empty bar: 192.168.1.0/24 — 256 addresses.
- An empty bar: 192.168.1.0/24 — 256 addresses.
- Biggest first: 100 hosts — /25 (.0).
- Next: 50 hosts — /26 (.128).
- Next: 25 hosts — /27 (.192).
- Next: 10 hosts — /28 (.224).
- Router links: WAN — /30 (.240) and WAN — /30 (.244).
- Spare .248–.255 — room to grow.
Designing for summarisation
A good VLSM plan does more than fit — it stays summarisable. Notice that our example's subnets (.0/25, .128/26, .192/27, .224/28, .240/30, .244/30) are contiguous and were allocated in order, so the entire site still summarises cleanly to 192.168.1.0/24. If you had scattered the subnets — taking .0/25 here and .128/26 from a different corner — no single summary would cover them without gaps. In OSPF, the ABR can then advertise one area range instead of six prefixes; in BGP, one aggregate instead of six announcements. The discipline is simple: allocate contiguously from one end of the block, keep the free space in one piece at the other end, and your addressing plan and your routing advertisements stay in agreement.
The binary check: why boundaries matter
Boundary alignment feels arbitrary until you see it in binary. Take the /27 for 25 hosts placed at 192.168.1.192: the last octet 192 is 11000000 — the first three bits are the borrowed network bits (110 = the third /27 block of the /24), and the remaining five zeros are the host part. If you instead tried to start that /27 at .160 (10100000), the borrowed bits would read 101 — a different block — and the range .160–.191 would collide with whatever the .128/26 already claimed (.128–.191). The rule "start on a multiple of the block size" is just the decimal expression of keeping the borrowed bits clean. When a VLSM plan misbehaves, convert the disputed boundary to binary: the overlapping bits will be staring at you.
Checking your plan
Three checks catch nearly every VLSM error:
- No overlaps — each new block must start exactly where the previous one ended.
- Boundary alignment — each block must start on a multiple of its own size (a
/26must start at a multiple of 64 in the octet, a/27at a multiple of 32, and so on). - Room for growth — real plans leave the largest gaps at the end, not scattered through the middle.
Second worked example: planning for growth
Base 192.168.10.0/24. Requirements: 60, 28 and 12 hosts, plus two WAN links — but this time, deliberately leave room to grow:
- 60 hosts →
/26:192.168.10.0/26(usable.1–.62) - 28 hosts →
/27:192.168.10.64/27(usable.65–.94) - 12 hosts →
/28:192.168.10.96/28(usable.97–.110) - 2 WAN links →
/30:192.168.10.112/30and192.168.10.116/30
Everything fits in .0–.119, leaving .120–.255 — 136 addresses, more than half the block — untouched for future subnets. Compare with packing the requirements tightly against the end: identical today, but the first new request would force a renumber. Experienced planners also round up one prefix size on the largest subnets (a 60-host need in a /25 rather than a /26) so the departments most likely to grow have headroom where they need it, while small subnets stay tight.
At a glance: why, where, when, how
- Why: fixed-size subnets waste addresses; VLSM sizes each subnet to its real need.
- Where: branch offices, campuses, and any site where departments have very different sizes.
- When: when one address block must serve a mix of big and small networks (the normal case).
- How: list the needs, sort biggest first, and allocate each the smallest prefix that fits, as the worked example in this article shows.
Advantages and disadvantages
Advantages
- Far less waste: the article's example fits in 248 addresses what fixed subnetting needed 768 for.
- Room to grow: free space stays in one piece at the end, ready for the next subnet.
- Cleaner routing: a well-planned VLSM block still summarises into one advertised prefix.
Disadvantages
- Needs planning and discipline — one wrong allocation can fragment the free space.
- Harder to read at a glance than uniform subnets; documentation matters.
- A subnet sized exactly for today has no headroom when that team grows.
Real-life example
A small company moves into one office: 100 staff computers, a 25-person call centre, 10 printers and cameras, and two router links. With VLSM, one /24 block covers all of it with space left over. With equal-sized subnets, they would have run out of block and had to request (and document) a second one.
FAQ
Is VLSM the same as CIDR?
No. CIDR is the notation (/26) that made variable-length masks possible; VLSM is the practice of using different mask lengths for different subnets within one network.
Why does order matter?
Because a small block allocated early can sit exactly where a later large block needs to begin. Largest-first keeps the free space in one clean piece for as long as possible.
Do routers care about VLSM?
Only classless routing protocols (RIP-2, EIGRP, OSPF, BGP, IS-IS) support it, because they advertise the mask with the route. Classful protocols like RIP-1 cannot — one more reason they are obsolete.
Related: VLSM Planner