opyebCidrPlan

VLSM: splitting a range by real host requirements

Splitting · 6 min read

In one line: Why equal-size FLSM wastes space, and how VLSM places the largest requirement first, aligns every block and reports the leftover space.

Departments rarely need the same number of hosts, so cutting a range into equal subnets wastes addresses. VLSM (Variable Length Subnet Masking) gives each subnet its own prefix length. There is one rule that makes it work: place the largest host requirement first.

Where FLSM wastes space

Split 192.0.2.0/24 into four equal /26 blocks and each holds 62 hosts. If the requirements are 100, 50, 25 and 2, the first block cannot hold 100, while the 2-host link still gets 62 addresses.

The VLSM procedure

  1. Sort the requirements from largest to smallest: 100, 50, 25, 2.
  2. Add the two reserved addresses of each new subnet: 102, 52, 27, 4.
  3. Pick the smallest power of two that fits and its prefix: 128→/25, 64→/26, 32→/27, 4→/30.
  4. Place them from the start of the parent, each at an address that is a multiple of its own size.
NeedAddressesSubnetRangeUsable
100102192.0.2.0/25.0 – .127126
5052192.0.2.128/26.128 – .19162
2527192.0.2.192/27.192 – .22330
24192.0.2.224/30.224 – .2272

The remaining space is .228 – .255. Written back as CIDR it becomes 192.0.2.228/30, 192.0.2.232/29 and 192.0.2.240/28. CidrPlan computes that leftover automatically.

Why alignment matters

A CIDR block must start at a multiple of its size: a /27 starts at a multiple of 32, a /26 at a multiple of 64. Placing large blocks first keeps every later block naturally aligned. Put a small block first and the gap behind it may be too small for the next large block.

largest first:  /25 (.0)     /26 (.128)     /27 (.192)   /30 (.224)  → left .228-.255
smallest first: /30 (.0)  /27 (.32)  ... then no aligned /26 left

FLSM or VLSM?

FLSM is easier to operate when the requirements are similar and the count is small. VLSM saves addresses when requirements vary widely, at the cost of documentation: every prefix now has a reason. Keep a table of which subnet came from which requirement — the CSV and Markdown export is there for that.

Everything is calculated in your browser. The ranges you type are not stored on a server.

Back to the CIDR calculator

Frequently asked questions

Which prefix does a two-host point-to-point link need?

A /30 holds 4 addresses, 2 usable. On a true point-to-point link a /31 (RFC 3021) gives both addresses to hosts.

Is a /25 enough for 100 hosts?

Yes. A /25 holds 128 addresses with 126 usable, so 100 fits. A /26 with 62 usable does not.

Why does the leftover space appear as several blocks?

A leftover range has to be expressed as aligned CIDR blocks. One contiguous range can need a /30, a /29 and a /28 depending on where it starts.

Sources

Read next