IPv4 Subnet Allocation Planner
Size and place IPv4 child subnets from host demand, with growth headroom and reservation rules that expose gaps, overflow and usable ranges.{{ summaryTitle }}
{{ summaryLine }}
{{ primaryCopyAnnouncement }}
Allocation preview unavailable.
| Measure | Value | Planning meaning | Copy |
|---|---|---|---|
| {{ row.label }} | {{ row.value }} | {{ row.detail }} |
The chart renderer is unavailable. The same values remain in the plan and ledger.
| Segment | Hosts | Headroom | CIDR | Usable range | Gateway | Spare | Gap | Note | Status | Copy |
|---|---|---|---|---|---|---|---|---|---|---|
| {{ row.segment }} | {{ count(row.hosts) }} | {{ count(row.reserve) }} | {{ row.cidr }} | {{ row.usable_range }} | {{ row.gateway }} | {{ count(row.spare) }} | {{ count(row.gap) }} | {{ row.note }} | {{ row.status }} |
{{ row.title }}
{{ row.finding }}
Next: {{ row.action }}
Address demand rarely arrives in powers of two. A segment may need 90 hosts plus growth, but an IPv4 child subnet can contain only 64, 128, 256, or another power-of-two number of addresses. Variable Length Subnet Masking (VLSM) rounds each demand to a fitting CIDR block and then places that block on a legal boundary inside the parent.
- Demand headroom
- Extra whole host slots added before prefix selection, useful for bounded growth rather than vague future capacity.
- Alignment gap
- Addresses skipped because the next chosen block must start on a multiple of its own size.
- Spare capacity
- Usable addresses left inside a fitted child after current demand and headroom are covered.
- Remaining tail
- The contiguous unallocated range after the last fitted child, excluding any internal gaps.
The usable capacity depends on reservation rules as well as prefix length. A conventional LAN through /30 loses the network and broadcast addresses. A /31 can use both addresses on a compatible point-to-point link. Some cloud environments reserve more addresses and impose their own minimum or maximum subnet sizes. Those policies can make a block that fits on paper unusable for the intended platform.
Allocation order changes the outcome. Largest-first placement often reduces gaps, while preserving a pasted order can support migration or documentation needs. Smallest-first can expose how badly later large blocks fragment the parent. No strategy is universally correct; the useful comparison is whether the chosen order fits, leaves deliberate headroom, and matches the operational rollout.
A subnet plan remains a proposal until it is checked against live IP address management, routes, DHCP ranges, provider restrictions, and existing allocations. Mathematical fit cannot detect an address already in use or a reserved range kept outside the input.
How to Use This Tool:
Describe the parent and demand first, then choose the reservation and ordering rules that match the target environment.
- Enter the Parent CIDR. Any host bits are normalized to the prefix boundary for calculation, but the entered value remains visible so you can spot a mistaken source.
- Paste one Demand segment per line as name, positive whole host count, and an optional note. Blank lines and lines beginning with # are ignored; invalid rows appear as parser notes.
- Choose the Allocation strategy, reservation model, and headroom percentage. Headroom from 0% through 90% is rounded up to whole host slots for each segment before sizing.
- Select a gateway convention and the longest allowed child prefix. Permit /31 only for compatible point-to-point links and /32 only for intentional host routes.
- Review Fit review and the exact Allocation ledger. Resolve Overflow rows and unintended gaps, then compare every proposed range with authoritative network records before provisioning.
Interpreting Results:
Fit count shows how many parsed demands received a child subnet. An Overflow row means no allowed prefix could supply the required usable hosts or the aligned block extended beyond the parent. Later rows are still evaluated, so a smaller demand may fit after a larger one overflows.
- Utilization is the sum of fitted child block sizes divided by the parent size. Internal gaps and the remaining tail are not counted as allocated.
- Spare is usable capacity left after requested hosts and rounded-up headroom. It is different from the gap before a subnet.
- The suggested gateway follows the selected convention. In cloud mode the reported router address is reserved, not part of the usable range.
- A zero-overflow result does not prove that ranges are unused, non-overlapping with external plans, routable, or accepted by a provider.
Technical Details:
The parent and every child are modeled as unsigned 32-bit ranges. Prefix length determines block size, and the entered parent address is masked to its network boundary. Each demand receives a reserve, a required usable-host count, a fitting prefix, an aligned start, and a final status.
Formula Core
A prefix p contains a power-of-two number of addresses. Percentage headroom is calculated per segment and rounded upward before prefix selection.
h is requested hosts, q is reserve percent, r is whole reserve hosts, and d is the usable capacity the child must meet.
Usable capacity is selected by the reservation profile. The longest allowed prefix whose capacity is at least d is chosen.
| Reservation rule | Usable capacity | Usable range |
|---|---|---|
| Standard or point-to-point profile, /0 to /30 | A(p) − 2 | Network + 1 through broadcast − 1 |
| Standard or point-to-point profile, /31 or /32 | A(p) | All addresses in the child |
| Cloud VPC profile | max(0, A(p) − min(5, A(p))) | Network + 4 through broadcast − 1 when more than five addresses exist |
The point-to-point profile does not by itself enable a /31. The Smallest child subnet setting controls whether /31 or /32 may be selected. Cloud mode applies a generic five-address reservation model, but it does not enforce a provider's allowed subnet-size range.
Rule Core
Demand rows are sorted by descending hosts, original order, or ascending hosts. Ties keep their pasted order. For each row, prefixes are tested from the longest allowed child back toward the parent until usable capacity is at least the required host count.
The chosen block is aligned on a global CIDR boundary:
The difference between start and cursor is the row's alignment gap. A row fits only when its broadcast address is inside the parent. A fitted row advances the cursor; an overflow row does not, which allows a later smaller row to be tested against the remaining space.
For a fitted child, spare hosts equal usable capacity − requested hosts − reserve hosts. Allocated addresses sum full block sizes, gap addresses sum skipped boundary space before fitted rows, and remaining addresses count the tail after the last fitted block. Utilization is allocated addresses ÷ parent addresses × 100 with full calculation precision.
Limitations and Accuracy Notes:
This is a generic planning model. It does not contact a provider, router, DHCP server, DNS system, or IP address manager, and it cannot discover overlap outside the entered parent and demand rows.
- Confirm provider-specific minimum and maximum prefix lengths, reserved addresses, and gateway behavior. The cloud model follows an AWS-style five-address reservation but does not enforce AWS's /28 to /16 IPv4 subnet-size rule.
- Confirm equipment and routing support before using /31, and use /32 only when a host route is intentional.
- Headroom is a percentage of each current demand, not a forecast model. Large or uneven growth may need explicit future subnets instead.
- Calculations run in the browser and are not sent to a planning service. Exported plans may still reveal private network structure.
Worked Examples:
Preserved order creates a gap
A 20-host segment followed by a 90-host segment inside 192.0.2.0/24, with no headroom and standard reservations, receives 192.0.2.0/27 and 192.0.2.128/25. The second block must align at .128, leaving a 96-address gap after the /27. Both rows fit, but no addresses remain after the last subnet.
Cloud reservation changes capacity
A 20-host application in 10.0.0.0/27 uses the whole /27 under the five-address cloud model. Of 32 total addresses, 27 are usable; the range is 10.0.0.4 through 10.0.0.30, and 10.0.0.1 is shown as the reserved router. The seven spare hosts are usable capacity beyond current demand, not additional unreserved addresses outside the subnet.
References:
- RFC 4632: Classless Inter-domain Routing (CIDR), RFC Editor, 2006.
- RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links, RFC Editor, 2000.
- Subnet CIDR Blocks, Amazon Web Services.