Introduction
A floor with 50 devices and a branch with 10 devices can share one allocation without receiving equal slices. Variable-length subnet masking assigns each LAN its own prefix length within a common parent.
Formula and calculation
block size = next power of 2 ≥ requested hosts + 2; prefix = 32 − log2(block size)The planner reserves a conventional IPv4 network and broadcast address and uses a minimum /30 LAN block. It sorts requests largest first, aligns each allocation, and rejects plans that exceed the parent.
- requested hosts · hosts
- endpoints requested for one LAN
- 2 · addresses
- network and broadcast addresses reserved by this tool's convention
Method and concepts
For each requested LAN, add the network and broadcast positions to the required interface count. Round that total up to a power of two and use a minimum block size of four. Allocate the largest block first. Smaller power-of-two blocks can then start on the boundaries left by larger ones.
- Enter the aligned parent network and the host requirements for the LANs. Include gateways, infrastructure interfaces and any planned growth in each requirement.
- Read the allocations in descending size. Check that each start is aligned for its prefix and every end lies inside the parent.
- Account for the full size of every assigned block when calculating remaining space. Unused positions inside an assigned LAN still belong to that LAN.
Subnetting and address planning diagram
- Parent · 192.0.2.0/25
- Office · .0/26
- Meeting rooms · .64/27
- Free block · .96/27
Worked examples
Divide 192.0.2.0/24 among three LANs
- For 50, 20 and 10 interfaces, the required totals including endpoints are 52, 22 and 12. Round these to 64, 32 and 16 addresses.
- Assign 192.0.2.0/26, 192.0.2.64/27 and 192.0.2.96/28. The blocks span .0–.63, .64–.95 and .96–.111.
- Subtract 64 + 32 + 16 from the parent size of 256. The remaining 144 addresses run from .112 to .255. That free interval contains several possible aligned blocks.
Subnetting and address planning: Fit two multiaccess LANs into a /25
- The office requires 48 interface addresses and the meeting rooms require 18. Including endpoints gives totals of 50 and 20. The next powers of two are 64 and 32.
- Assign 192.0.2.0/26 to the office. Its conventional host range is .1–.62. Assign 192.0.2.64/27 to the meeting rooms, with host range .65–.94.
- The second LAN ends at .95. The parent ends at .127, leaving .96–.127, exactly 192.0.2.96/27. The spare host positions inside the first two LANs remain with those allocations.
Reference table
| Required hosts | Allocated prefix | Available LAN host positions |
|---|---|---|
| 50 | 192.0.2.0/26 | 62 |
| 20 | 192.0.2.64/27 | 30 |
| 10 | 192.0.2.96/28 | 14 |
Reading the result
The plan uses conventional multiaccess LANs, with /30 as the smallest allocation. A /31 point-to-point design follows different endpoint rules. This planner partitions an available parent, so any earlier reservations must already be excluded from the planning space.
Common mistakes
- Checking only the sum of requested hosts. Each request must also pay for reserved endpoints and power-of-two rounding.
- Treating all free host positions inside existing LANs as one contiguous pool for a new subnet.
Frequently asked questions
Why does a 31-host LAN need a /26?
A /27 has 32 total positions and 30 conventional host positions. A /26 supplies 62 host positions, enough for the requested 31.
Can 60 and 4 requested hosts fit in a /26?
No. The first LAN needs the whole 64-address block and the second needs eight more addresses. Adding the host requests alone hides the overhead.
Why does requesting one extra interface sometimes double the allocation?
A conventional /27 has 30 host positions. Growing to 31 required interfaces crosses that threshold, so the smallest eligible power-of-two block is a /26.
How do I test the sheet for overlap?
Calculate each network's inclusive first and last addresses, sort by the first address, and verify that each following first address is greater than the previous last address.
How many IPv4 addresses are in a /27?
A /27 leaves five host bits, so the block contains 2^5 = 32 addresses. Usable host counts depend on subnet purpose and special cases such as point-to-point /31 links.
Why is a network address not always the first usable host?
In a conventional multi-access IPv4 subnet, the all-zero host portion names the network and the all-one host portion is the directed broadcast. Specialized prefixes can have different host-use rules.
Can two subnets overlap without a routing problem?
Overlapping prefixes can make route selection and address ownership ambiguous. A design should allocate non-overlapping blocks within the routing domain unless it explicitly handles overlap.
Should subnet size be rounded up or down to meet host demand?
Choose the smallest valid block that accommodates the required endpoints plus any addresses reserved by the network design. Leave room for documented growth when the plan requires it.
Why do conventional IPv4 subnets reserve two addresses?
For a typical subnet with at least two host bits, the all-zero host part identifies the subnet and the all-one host part is its directed broadcast. Point-to-point /31 links are a defined exception.
Can a /31 be used for a point-to-point IPv4 link?
Yes. RFC 3021 permits both addresses of a /31 to be used as endpoints on a point-to-point link, where a subnet and broadcast address are unnecessary.
What is the first step when splitting a parent network?
Choose child prefixes that fit the required host counts, then verify that each child starts on a valid boundary and remains entirely inside the parent allocation.
Why keep space for future growth in a subnet plan?
A plan with no room can force renumbering or fragmentation of later allocations. Documented headroom can make expansion easier, provided it does not create unnecessary waste or overlap.
How does VLSM differ from fixed-length subnetting?
Variable Length Subnet Masking assigns different prefix lengths to different subnets according to their needs. This can use address space more efficiently when host requirements vary.
Why must a subnet start on a block boundary?
A prefix fixes leading bits, so the network value must have all host bits set to zero. A misaligned address is normalized to the aligned network that contains it.
How many addresses does an IPv6 /64 contain?
It leaves 64 host bits, so the mathematical address count is 2^64. That count does not imply that a LAN should manually assign every address or that each value is used.
Should every IPv4 subnet subtract exactly two usable hosts?
That is the common rule for ordinary IPv4 multi-access subnets with enough host bits. Point-to-point /31 links and very small prefixes have special handling, so check the intended use.
What should be checked after a VLSM plan is calculated?
Verify every child prefix is aligned, contained in the parent, non-overlapping, large enough for its requirement, and consistent with the site policy and reserved addresses.
Further learning and references
- RFC 1878, Variable Length Subnet Table for IPv4
Reference source for the concepts and service described in this guide.
- RFC 4632 · Classless Inter-domain Routing
- RFC 3021 · IPv4 /31 on point-to-point links
- RFC 1878 · IPv4 variable-length subnet table

