taap.digitalnetwork engineering toolkit

VLSM calculator

List each segment and the hosts it needs, one per line. The tool sorts by size, allocates aligned blocks from the parent network and reports what is left for growth.

vlsm

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:

  1. For every requirement, find the smallest block where 2h − 2 ≥ hosts. That gives the prefix /(32 − h).
  2. Sort the requirements from largest to smallest block.
  3. 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.

SegmentNeedSubnetUsableRange
Sales100192.168.10.0/25126.1 – .126
IT50192.168.10.128/2662.129 – .190
HR20192.168.10.192/2730.193 – .222
WAN2192.168.10.224/302.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.

Frequently asked questions

Why does the order of my list not matter?

The tool always sorts largest-first before allocating. That ordering guarantees aligned blocks with no gaps, which is the standard VLSM method.

Why did a 2-host link get a /30 instead of a /31?

The allocator uses the classic 2h − 2 rule, which gives /30. If your platforms support RFC 3021, manually replace those with /31s.

Can I plan VLSM inside a /16?

Yes. Enter something like 10.40.0.0/16 and list requirements with thousands of hosts; the same alignment rules apply at any size.

What does "does not fit" mean?

The remaining space in the parent block was smaller than the aligned block required. Increase the parent block or move that segment to another range.

Study and design tool. Validate any configuration in a lab and against vendor documentation before applying it in production.