Subnetting Explained: CIDR, Subnet Masks, and Usable Hosts

NETOPS TOOLS · TECHNICAL GUIDE 03
Understand IPv4 addressing, one subnet at a time.

Learn how CIDR prefixes, subnet masks, network boundaries and usable host ranges work — with step-by-step examples you can apply to VLANs, site networks and cloud planning.

Subnetting is the process of dividing an IP address block into smaller, non-overlapping networks. It helps organize routing, segment VLANs, plan address capacity and make operational boundaries easier to manage. The calculations are predictable once you understand the prefix.

32 bits

An IPv4 address contains 32 binary digits.

/24

24 network bits, 8 remaining address bits.

254

Typically usable addresses in a conventional /24 subnet.

1. What do CIDR and subnet masks mean?

CIDR stands for Classless Inter-Domain Routing. The slash notation identifies how many of the 32 IPv4 bits are in the network prefix. For example, 192.168.10.0/26 has a 26-bit prefix and six remaining bits, giving 64 total addresses.

The dotted-decimal subnet mask represents the same prefix. A /26 mask is 255.255.255.192, while a /24 mask is 255.255.255.0. Modern routing uses explicit prefixes rather than assuming a default mask from an old address class.

Two essential formulas
Total IPv4 addresses = 2(32 − prefix)
Conventional usable hosts = total − 2

The second formula applies to a typical network-and-broadcast subnet with prefix lengths /1 through /30. Special /31 and /32 use cases are explained below; provider-specific reservations may further reduce assignable addresses.

2. Quick CIDR reference table

The table shows the mask, total number of IPv4 addresses and typical usable host addresses for familiar prefix lengths.

PrefixSubnet maskTotal addressesTypical usable
/23255.255.254.0512510
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242
/31255.255.255.25422 endpoints on supported point-to-point links
/32255.255.255.25511 individual address / host route

Scroll inside the table on narrow screens. /31 follows RFC 3021, and /32 is a single-address prefix rather than a conventional LAN subnet.

3. Worked example: 10.20.30.77/26

Suppose a device is assigned 10.20.30.77/26. What are its network address, broadcast address and host range?

  1. Find the subnet mask: /26 corresponds to 255.255.255.192.
  2. Find the address increment: In the last octet, 256 − 192 = 64. Boundaries occur at 0, 64, 128 and 192.
  3. Locate the device: The final octet 77 lies between 64 and 127, so the network begins at 10.20.30.64.
  4. Identify the conventional host range: The first address is the network identifier and the final address is broadcast. Hosts therefore run from .65 to .126.
Calculated /26 result
Network address10.20.30.64
Broadcast address10.20.30.127
First usable host10.20.30.65
Last usable host10.20.30.126
Subnet mask255.255.255.192
Usable host count62

4. Split one /24 into four /26 subnets

Consider an organization with 192.168.10.0/24. Borrowing two host bits changes the prefix to /26, yielding four equal subnets with 64 addresses each. Each conventional /26 accommodates up to 62 usable host addresses.

The complete /24 address space — no gaps and no overlaps
Every block contains 64 addresses. Boundaries increase by 64 in the final octet. Diagram is illustrative, not a routing configuration.
SubnetNetworkUsable host rangeBroadcast
1192.168.10.0/26192.168.10.1–62192.168.10.63
2192.168.10.64/26192.168.10.65–126192.168.10.127
3192.168.10.128/26192.168.10.129–190192.168.10.191
4192.168.10.192/26192.168.10.193–254192.168.10.255

In the usable-range column, the final octet is abbreviated only after the first full address; for instance, 192.168.10.1–62 means 192.168.10.1 through 192.168.10.62.

5. /30, /31 and /32: important differences

/30 — two conventional usable hosts

A 192.168.10.0/30 block has four addresses: .0 (network), .1 and .2 (hosts), and .3 (broadcast). It has traditionally been used for numbered point-to-point links.

/31 — two endpoints, when supported

Under RFC 3021, both addresses of a /31 are usable as endpoints on supported IPv4 point-to-point links. For example, 198.51.100.0/31 uses both 198.51.100.0 and 198.51.100.1 as endpoint addresses; there is no conventional directed broadcast address within that pair.

Do not generalize /31 to ordinary LAN segments. RFC 3021 addresses point-to-point behavior. Check device and routing-platform compatibility before deploying it.

/32 — one specific address

A /32 identifies a single IPv4 address, such as 203.0.113.25/32. It is common in host routes, access control entries and loopback-related routing. Treat it as one address, not a normal multi-host subnet with a network and broadcast pair.

The 198.51.100.0/24 and 203.0.113.0/24 ranges used here are documentation-only address blocks defined by RFC 5737.

6. Practical VLSM plan for an office

VLSM (Variable Length Subnet Masking) allows different-sized subnets within an available address block. Imagine these requirements inside 192.168.10.0/24: 100 employee devices, 50 guest devices, 20 IoT devices and 10 infrastructure addresses. Start with the largest requirement and allocate non-overlapping prefixes.

SegmentNeededAssigned subnetUsable hosts
Employee LAN100192.168.10.0/25126
Guest Wi-Fi50192.168.10.128/2662
IoT devices20192.168.10.192/2730
Infrastructure10192.168.10.224/2814
Unallocated reserve—192.168.10.240/2814 if assigned as a LAN
Address space allocated from largest to smallest
Bar lengths are proportional to the largest allocation (/25 = 128 addresses). The remaining /28 (16 addresses) is intentionally unallocated, giving room for a future small subnet.

VLSM improves allocation efficiency, but address planning must also account for future growth, default gateways, high-availability interfaces, platform reservations, and operational separation. Distinct IPv4 subnets do not, by themselves, enforce security: apply routing policy, firewalls or ACLs as needed.

7. Private IPv4 ranges and cloud subnet differences

RFC 1918 defines three private IPv4 blocks intended for internal networks:

Private rangeCIDR blockCommon context
10.0.0.0–10.255.255.25510.0.0.0/8Larger private addressing plans
172.16.0.0–172.31.255.255172.16.0.0/12Private enterprise and cloud networks
192.168.0.0–192.168.255.255192.168.0.0/16Home, branch and private LAN networks

Cloud planning caveat — AWS VPC: AWS reserves the first four and last one IPv4 address in every subnet. Therefore, a /26 still contains 64 addresses, but only 59 can be assigned to AWS resources. AWS also restricts IPv4 VPC subnet sizes to /28 through /16. These are AWS-specific operational rules, not changes to the CIDR formula.

For example, 10.0.0.64/26 in an AWS VPC has 64 total addresses; AWS reserves 10.0.0.64–67 and 10.0.0.127, leaving 10.0.0.68–126 for resource assignment. Always verify the provider’s current subnet restrictions and reservations rather than reusing the conventional total − 2 assumption.

8. Common subnetting mistakes to avoid

  • Confusing total and usable addresses: a conventional /26 has 64 total, but 62 typical host addresses.
  • Using an incorrect boundary: /26 networks advance in increments of 64 in the relevant octet.
  • Overlapping VLAN or VPC ranges: keep planned CIDR blocks disjoint within the same routing context.
  • Applying the /30 host formula to /31: RFC 3021 permits two point-to-point endpoints.
  • Assuming every cloud reserves two addresses: provider reservations can differ significantly.
  • Assuming subnet separation is a firewall: routing and security rules require their own configuration.

9. Frequently asked questions

How many usable hosts are in a /24?

A conventional IPv4 /24 contains 256 addresses and typically offers 254 usable host addresses: one address identifies the network, and one is the directed broadcast address.

Is a /26 larger or smaller than a /24?

A /26 is smaller. Increasing the prefix by two bits divides a /24 into four /26 blocks, each containing 64 total addresses.

Why does a /31 have two usable endpoints?

RFC 3021 defines special handling for IPv4 point-to-point links that support /31 numbering. Both addresses identify endpoints rather than reserving one network and one broadcast address as in a conventional LAN subnet.

What is the difference between CIDR and VLSM?

CIDR represents IP prefixes without classful address assumptions. VLSM is an address-planning technique that allocates multiple prefix sizes within an address space based on actual subnet requirements.

Can I use the full usable-host count in AWS?

No. AWS reserves five IPv4 addresses per subnet, so a /26 has 59 addresses assignable to resources instead of the conventional 62. Always consult your provider’s addressing rules.

Check your subnet calculations with NetOps Tools

Use the IPv4 Subnet Calculator to verify masks, network boundaries and host ranges. For authorized network diagnostics, the Nmap Command Generator helps assemble consistent scan commands.

10. Technical references

  1. RFC 4632 — Classless Inter-domain Routing (CIDR): prefix notation, aggregation and IPv4 block sizes.
  2. RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links: two usable /31 endpoints.
  3. RFC 1918 — Address Allocation for Private Internets: reserved private IPv4 address space.
  4. RFC 5737 — IPv4 Address Blocks Reserved for Documentation: example-only address ranges.
  5. AWS VPC — Subnet CIDR Blocks: supported subnet sizes and IPv4 address reservations.
NetOps Tools · Independent technical reference. Worked examples are educational; always validate the routing platform, cloud provider and operational requirements of your environment before deployment.

Leave a Comment

Your email address will not be published. Required fields are marked *