Skip to tool
ecech.
🌐 Network & IP

VLSM Works If You Allocate Largest First, and Fails If You Do Not

A subnet must start on a multiple of its own size, so a large block placed after small ones can be blocked by a boundary while addresses remain.

Addresses used

Still free

Wasted

allocated but not needed

Efficiency

Allocation

The block, filled

Advertisement

How the calculation works

Same four subnets, two allocation orders largest first /25 /26 /27 free everything fits, 28 addresses left over smallest first /25 cannot start here a /25 must begin at .0 or .128, and both are taken or blocked

How to Use This Tool

Enter a block and the subnets you need. They are allocated largest first, which is what makes VLSM work, and the table shows exactly where each one lands.

The alignment rule

A subnet has to start on a multiple of its own size. A /25 holds 128 addresses and can only begin at .0 or .128. A /26 holds 64 and can begin at .0, .64, .128 or .192.

That constraint is why order matters. Place a small subnet at the start of a block and it may occupy the only boundary a larger subnet could have used. There is then plenty of free space and nowhere legal to put the large block — the failure is alignment, not capacity, which is why it confuses people the first time they meet it.

Allocating largest first avoids the problem entirely, because a large block placed at a valid boundary leaves valid boundaries for everything smaller. It is a one-line rule with a real proof behind it.

Why every subnet loses two addresses

The first address in a subnet is the network address and the last is the broadcast address, so a /24 gives 254 usable hosts rather than 256. That is why the planner asks how many hosts you need and then finds a prefix with room for them plus two.

A link between two routers therefore needs a /30 — four addresses, two usable — even though only two hosts exist. Unless you enable the /31 option: RFC 3021 allows a two-address subnet with no network or broadcast on point-to-point links, saving two addresses per link. Across a large network that adds up, and most modern routers support it.

Waste is unavoidable and worth seeing need 100 hosts a /26 holds 62 — not enough so you get a /25 126 usable, 26 wasted Subnet sizes are powers of two, so anything not a power of two rounds up. Asking for 100 when you need 90 costs nothing; asking for 130 costs a whole tier.
Check the waste column before adding headroom — a few extra hosts can double the block.

How much headroom to add

Because sizes are powers of two, a small increase in requirement sometimes costs nothing and sometimes doubles the allocation. Going from 60 hosts to 62 stays in a /26; going from 62 to 63 needs a /25 and doubles the block.

So look at the waste column before padding your numbers. If you are already near the bottom of a tier, extra headroom is free. If you are near the top, it is expensive, and it is worth asking whether the requirement is real.

Practical notes

  • Leave room at the end. Allocating a block exactly to capacity means the next requirement needs renumbering. Reserving a quarter is cheap insurance in private address space, where addresses cost nothing.
  • Group by function, not by size. Adjacent subnets that belong to the same purpose can be summarised into one route later; scattered ones cannot.
  • Document as you go. The table here is exportable, and a subnet plan nobody wrote down is rediscovered by whoever breaks it.
Advertisement

Frequently Asked Questions

What is VLSM?
Variable length subnet masking: carving one block into subnets of different sizes rather than dividing it evenly. It exists because a router link needs two addresses and an office floor needs two hundred, and giving both the same size wastes most of the block.
Why must I allocate the largest subnet first?
Because a subnet has to begin on a multiple of its own size. Placing a small subnet early can occupy the only boundary a large one could have used, leaving free addresses that no large block can legally start at. Largest first always leaves valid boundaries for everything smaller.
Why does a /24 have 254 usable hosts instead of 256?
The first address identifies the network and the last is the broadcast address, so neither can be assigned to a machine. That is why a planner asks for host count and then finds a prefix with room for that plus two.
Why does a two-host link need a /30?
Because after losing the network and broadcast addresses, a /30's four addresses leave exactly two usable. RFC 3021 allows a /31 on point-to-point links with both addresses usable, saving two per link, and most modern routers support it — the option is available above.
How much headroom should I leave in a subnet?
Look at the waste column first. Sizes are powers of two, so going from 60 hosts to 62 costs nothing while going from 62 to 63 doubles the block. Near the bottom of a tier headroom is free; near the top it is expensive.
What happens if my subnets do not fit?
The planner says which one failed and why. It is usually capacity, but it can be alignment — there are enough addresses free and no valid boundary for a block that size. That distinction is the thing VLSM planning exists to manage.

Related tools in Network & IP

Browse all Network & IP tools
The desk where ecech. tools get written: a laptop, a notebook of to-dos and a whiteboard listing the tools on the site.

Made by one person

ecech. is not a content farm. Every tool here is written and checked by hand, one at a time, by someone who wanted the tool to exist and could not find a version that showed its working.

No accounts and no sign-in, and nothing you type reaches a server — every calculation on this page runs inside your browser. The ads are served by Google and do set their own cookies, which is set out in full on the privacy page. More about the site.