Understanding network infrastructure · Part 1 · How does my PC get ready to communicate?
How do your IP address needs determine subnet size?
Turn address requirements into a prefix and block boundaries, then check overlap and summarization
Choosing an arbitrary prefix based only on the address count can leave too few addresses or waste a large range. The prefix length determines the address block size; its boundaries define the network address, broadcast address, and usable host range. We work through real address values, from a /26 calculation and VLSM layout to /31 and /32 uses and route summaries.
Count only today's needs, and your subnet can soon run out of addresses↑
Count only the endpoints you have now and the subnet may soon be too small. Include the gateway, network equipment, reserved addresses, and near-term expansion. Addresses excluded from the DHCP pool still occupy space in the same block.
For 50 endpoints, a /27 with 32 addresses is too small. A /26 has 64 addresses. On a conventional multi-access subnet, the network and broadcast addresses are excluded from the range assigned to hosts.
Address demand is greater than the number of endpoints powered on today. An office of 50 people may have personal endpoints, IP phones, printers, APs, a gateway, and replacement-device addresses in the same subnet. Allow for DHCP leases that are not reclaimed immediately and for future staffing growth. On the other hand, giving every department a /22 based on vague growth expectations needlessly enlarges the broadcast domain and the range of addresses to track.
In the design document, list current use, expected growth over 1–3 years, infrastructure and reserved addresses, the dynamic allocation range, and space held for expansion separately. Find the smallest address block that fits them all, then consider operating policy and failure scope. Saving addresses is not the only goal: leave room to grow without making one Layer 2 domain unnecessarily large.
A small address block that barely fits demand saves unused addresses but leaves little room to grow. Too large a block can expand broadcast and failure impact. Add growth capacity to the required count, then choose the block size with failure scope, security policy, and route summarization in mind.
Sources for this section IETF RFC 4632
When the prefix grows by one bit, how much smaller is the address block?↑
IPv4 has 32 bits, so a prefix of /p contains 2^(32-p) addresses. For /26, the host portion has 6 bits, giving 2^6 = 64 addresses.
| Prefix | Total addresses | Last-octet step |
|---|---|---|
| /24 | 256 | 256 |
| /25 | 128 | 128 |
| /26 | 64 | 64 |
| /27 | 32 | 32 |
| /28 | 16 | 16 |
Each extra prefix bit halves the address block. Split the 256 addresses of a /24 into two /25s and each has 128; split again into /26s and each has 64. This relationship lets you calculate neighboring prefix sizes without memorizing a table. A /23, for example, has 9 host bits and 2^9 = 512 addresses, with boundaries every 2 values of the third octet.
On a conventional broadcast LAN, subtract the network address and directed broadcast address from the total to get the host count. Standards-defined exceptions such as /31 point-to-point links mean that one formula cannot cover every link. To calculate DHCP availability for general dynamic allocation, start with the configured lease range and exclude addresses set aside for the gateway, static assignments, reservations, and other exclusions, counting overlapping exclusions only once. Record the prefix's total address count, capacity for general dynamic leases, and capacity reserved for specific clients separately.
Each extra prefix bit halves the block. After finding a prefix that meets your required count, check that the starting address is aligned to a multiple of that block size. Capacity alone does not make it a valid network boundary.
Sources for this section IETF RFC 4632
An IP address and prefix length identify the subnet boundaries↑
Within 192.0.2.0/24, /26 blocks start every 64 values in the last octet: 0, 64, 128, and 192.
192.0.2.64/26
Network 192.0.2.64
Host range 192.0.2.65 – 192.0.2.126
Broadcast 192.0.2.127
Next block 192.0.2.128/26
An address and prefix length together identify its block. For /26, whose boundary falls in the last octet, find the nearest boundary at or below that octet's value. With a larger address block such as /23, the boundary moves into an earlier octet, so calculate using all 32 bits.
For 192.0.2.173/26, /26 boundaries are 64 apart: 0, 64, 128, and 192. The nearest boundary at or below 173 is 128, the network address. Just before the next boundary, 192, is 191, the broadcast address. The host range is therefore 192.0.2.129 through 192.0.2.190. The same method locates the block containing any given address.
Looking only at the final number stops working when a block crosses an octet boundary. In 10.40.2.0/23, /23 groups the third octet in steps of 2 and covers 10.40.2.0 through 10.40.3.255. Even with a calculator, compare the network address, last address, and next block's start. These three values help expose an incorrect input prefix or an overlap.
Do not treat a given address as an arbitrary starting point for its range. Declaring 192.0.2.77/26 as a network does not align with the block boundary. Even if a device accepts and normalizes it, different notation in documentation, ACLs, and routes can make operators misread the range. Include the prefix and broadcast address alongside the start and end addresses in your checks.
Sources for this section IETF RFC 4632
What to look for in the diagram Apply bitwise AND to IP address 192.168.10.130 and the /26 subnet mask to derive network address 192.168.10.128 and address range 192.168.10.128–191. Compare the last octet of the address, mask, and result to identify the first two bits that belong to the network.
↔ Scroll horizontally to explore the diagram.
Different subnet sizes: why allocate the largest first?↑
VLSM uses different prefix lengths within one parent block. For departments of 100, 50, and 20 people, allocate the largest block, /25, first. Place the /26 and /27 blocks at the next appropriate boundaries.
Scattering small blocks across the available space first can leave no contiguous space for a larger block. Addresses may still be free, but fragmentation prevents you from allocating a contiguous prefix that can be summarized.
To fit 100, 50, and 20 devices into 10.50.0.0/24, first allocate 10.50.0.0/25 for 100 devices. Then place 10.50.0.128/26 for 50 and 10.50.0.192/27 for 20. This leaves 10.50.0.224/27 as a contiguous reserve. Placing a small /27 at an intermediate boundary first could have used up the aligned space needed for the /25.
Allocating the largest blocks first is only part of a good design. Where geographic, security zone, or route summary boundaries differ, fitting subnets into whatever space is free may work numerically but blur operational boundaries. A VLSM allocation table should record the purpose, VLAN, gateway, DHCP range, parent summary, and room for growth. The goal is not simply to minimize unused addresses, but to preserve contiguous space and clear ownership through future changes.
For example, if a site receives 10.20.0.0/22, allocate each floor's or function's subnets contiguously within it so upstream devices can summarize them as 10.20.0.0/22. Preserving ownership boundaries and route aggregation makes changes and fault isolation easier than packing today's allocations as tightly as possible. Check that the remaining space also aligns with the block sizes future expansion will require.
Sources for this section IETF RFC 4632
Where do two-address /31s and single-address /32s fit?↑
A /31 has only two addresses, but RFC 3021 allows both to be used on a point-to-point link, one for each end's interface. This rule does not apply unchanged to a conventional user broadcast LAN.
A /32 identifies exactly one host in a prefix. It is commonly used for loopback addresses, static host routes, and security policies. Do not infer from the prefix length alone that there are no usable hosts. Check the link type and intended use.
On a /31 point-to-point connection, each of the two addresses belongs to one end of the link; neither is reserved separately as a network or broadcast address. Verify that both devices support RFC 3021 and that the link really has only two endpoints. Older equipment or management tools may misinterpret /31, so test interoperability before deployment. Do not apply it merely to save addresses on a multi-host, broadcast-dependent Ethernet segment.
A /32 often describes not an address range but a single-host route. Advertising a router loopback as /32 lets an alternate path retain access to the same router ID and management address when one physical interface goes down, keeping the router reachable. A firewall may also use /32 to match one host, and a blackhole route may target it. Treating /31 and /32 as unusable because they lack enough host bits misses their purpose: standards define specific link and route uses for them.
A /32 identifies one address for a loopback, host route, policy object, or similar use. Even with an interface configured with /32, L2 connectivity alone does not guarantee IP communication with a neighbor. Reachability must also be designed—for example, through a peer route, an unnumbered arrangement, or separate neighbor handling. Verify support at both ends and check the actual FIB to confirm the intended behavior.
Sources for this section IETF RFC 3021
Correct arithmetic is not enough: check overlap and route summaries↑
Scenario: Allocate space within 10.40.0.0/22 for three VLANs serving 300, 120, and 50 people.
- Allowing for operational headroom, choose
/23,/25, and/26as the candidate sizes. - Allocate the largest block,
/23, first at10.40.0.0/23. - At the next boundary,
10.40.2.0, place the/25; at10.40.2.128, place the/26. - Record each network address, broadcast address, gateway, and DHCP range in IPAM.
- Verify that upstream devices can summarize the allocations as
10.40.0.0/22and that the range does not overlap another site's addresses.
After building the subnet table, checking for overlaps between its ranges is not enough. Verify that every child prefix fits within the intended parent summary and that a broader summary from another site does not cover it. For example, if a site advertises 10.40.0.0/22, decide where to discard traffic addressed to unused space within that range. Safe summarization requires both a sound address plan and matching reachability.
Before deployment, automatically check the gateway address, DHCP pool start and end, reservations, and broadcast address, then compare device configurations with IPAM. After deployment, verify that each VLAN's clients receive the correct mask and classify local and remote destinations as expected. Correct calculations alone are not enough: a different DHCP option or SVI prefix can send actual packets along a different path. That is why the final check must compare the design with data plane observations.
Summarization does more than shorten a list of routes. If a specific prefix disappears while its parent summary remains, traffic may enter a blackhole. Check the discard route and behavior under partial failures. Final validation should record address counts, boundary alignment, overlaps, room for growth, and route behavior during failures.
Sources for this section IETF RFC 4632 · IETF RFC 5737
Glossary↑
Sources and verification
- IETF RFC 4632 — CIDR address allocation and aggregation
- IETF RFC 3021 — using /31 on IPv4 point-to-point links
- IETF RFC 5737 — IPv4 address blocks for documentation
The table shows the total address count, not the usable host count, for each IPv4 subnet. Check the implementation and operating requirements for each platform's /31 and /32 support and address reservation policies.