How VLSM allocation works
Variable Length Subnet Masking lets each segment get a prefix sized to its own host count instead of forcing one mask across the whole network. The algorithm used here is the one taught in CCNA and used in real address plans:
- For every requirement, find the smallest block where 2h − 2 ≥ hosts. That gives the prefix /(32 − h).
- Sort the requirements from largest to smallest block.
- Allocate each block at the next address that is a multiple of its size, so every subnet is aligned on its natural boundary.
Allocating largest first is what prevents fragmentation: a big block placed after small ones would have to skip forward to its next boundary, wasting the gap.
Worked example: 192.168.10.0/24
Requirements: Sales 100 hosts, IT 50, HR 20 and a WAN link with 2.
| Segment | Need | Subnet | Usable | Range |
|---|---|---|---|---|
| Sales | 100 | 192.168.10.0/25 | 126 | .1 – .126 |
| IT | 50 | 192.168.10.128/26 | 62 | .129 – .190 |
| HR | 20 | 192.168.10.192/27 | 30 | .193 – .222 |
| WAN | 2 | 192.168.10.224/30 | 2 | .225 – .226 |
Total allocated: 128 + 64 + 32 + 4 = 228 of 256 addresses (89.1%). The next free address is 192.168.10.228, and the remaining 28 addresses split naturally into 192.168.10.228/30, 192.168.10.232/29 and 192.168.10.240/28.
Input format
One requirement per line, name followed by the host count: Voice 180, MGMT: 14 or just 60. Commas and semicolons also work as separators. The parent network accepts any prefix, from a /16 campus block down to a /26.
Design advice
- Plan for growth before you plan for efficiency. If Sales has 100 users today, a /25 with 126 hosts gives only 26% headroom. In private space, a /24 per user VLAN is usually the better operational choice.
- Point-to-point links: the tool sizes a 2-host link as /30. On modern platforms use /31 (RFC 3021) and save half of that space; carve a dedicated /24 just for transit links.
- Keep a summarizable plan. If every site gets a contiguous block (for example a /20 per branch), each site advertises a single route and your routing tables stay small.
- Reserve, don't squeeze. Leave the unallocated tail of the parent block contiguous; it is far easier to grow into a free /27 than into scattered /30s.
If a requirement does not fit, it is marked in the table and the status turns red. Use a shorter parent prefix or reduce the largest request.