HomeGuides › VLSM

How to plan subnets with VLSM

Variable Length Subnet Masking means sizing each subnet to its own requirement instead of splitting a network into equal pieces.

Carving a /22 into four equal /24s is simple and usually wasteful. One segment holds 500 machines and does not fit; another holds a two-address router link and wastes 252. VLSM sizes each subnet separately.

Step-by-step

  1. Enter the parent network you have been given.
  2. List each segment with how many hosts it must hold.
  3. Choose a growth allowance — see below.
  4. Read the plan, and export it as CSV or JSON.

Allocate largest first

This is the rule that makes VLSM work by hand and it is what the tool does. Sort the requirements from largest to smallest and place them in that order.

Going smallest-first leaves fragments scattered through the space that are individually too small for the large segments still waiting, and the plan fails even though the total space was sufficient. Largest-first packs the space contiguously.

Choosing each prefix

A segment needing n hosts gets the smallest prefix where 2host bits − 2 ≥ n. For 100 hosts that is a /25, which holds 126 usable. For 500 it is a /23, holding 510.

Two exceptions, both worth knowing: two hosts gets a /31 under RFC 3021, and one host gets a /32.

Growth, applied honestly

A 20% allowance on 100 hosts sizes for 120, which still fits a /25. The same allowance on 110 sizes for 132 and forces a /24 — double the space. That jump is exactly the decision worth making deliberately now rather than discovering when the subnet fills.

Growth is not applied to a two-address point-to-point link, because a point-to-point link has two ends for its entire life. Inflating it to a /29 would be arithmetic applied without thought.

Leave space between allocations if you expect to add segments. A plan that packs a parent to 100% is efficient and impossible to extend without renumbering, which is a far more expensive problem than a slightly larger allocation would have been.

Frequently asked questions

Why allocate the largest subnet first?

Because it packs the address space contiguously. Smallest-first scatters fragments that are individually too small for the large segments still waiting, and the plan fails even when there was enough total space.

What happens if a segment does not fit?

It is listed separately with the reason and the rest of the plan still allocates. It is never silently dropped or given a smaller subnet than it needs.

Should I use a /30 or a /31 for a router link?

A /31 if your equipment supports it, which most modern equipment does. It uses two addresses instead of four for the same two-ended link.

Is my addressing plan uploaded?

No. The allocation runs in your browser and the CSV and JSON exports are generated there too.

Open the VLSM designer →