Calculation notebook · case study

Worked Example: IPv4 /30, /31 and /32 Address Counts

This illustrative example uses documentation addresses and standard IPv4 range arithmetic. It does not configure a network or claim that every address in a range is assignable in every environment.

Inspect a traditional /30 block

For 192.0.2.8/30, 32 − 30 = 2 host bits give four addresses: .8 through .11. Under the traditional broadcast-subnet convention, .8 is the network label, .11 the broadcast address and .9–.10 the two host addresses.

Use the point-to-point /31 convention

For 192.0.2.8/31, one remaining bit gives .8 and .9. RFC 3021 permits both addresses on a point-to-point link rather than reserving a network/broadcast pair. Applying the traditional minus-two rule would produce zero and miss the special convention.

Read a /32 as one address

Prefix /32 fixes every bit, so the address range contains one address. It may be used as a host route, depending on context. It is not a conventional broadcast subnet with a network and broadcast endpoint.

Read a /32 as one address
PrefixTotal addressesConvention-sensitive interpretation
/3042 traditional hosts
/3122 endpoints on an RFC 3021 point-to-point link
/321One address/host route

Normalize an address to its block

Entering 192.0.2.10/30 clears the two host bits to find network 192.0.2.8. A host address and its containing network have different roles. Keep the original address in an audit note rather than replacing it with the normalized network and forgetting which endpoint was examined.

Confirm how the result will be used

Broadcast semantics, routing and reservation rules belong to the actual network design. IPv6 has no IPv4-style broadcast endpoint, so it must not inherit this subtraction rule. Raw block size is a mathematical property; operational usability is a convention with explicit scope.

A second documentation block with three host bits

Consider the illustrative input 203.0.113.14/29. These are documentation addresses, not a discovered or contacted network. Three host bits remain, so the raw block contains 2³ = 8 addresses. Clearing those bits produces network 203.0.113.8 and last address 203.0.113.15. The dotted IPv4 mask is 255.255.255.248. Under the ordinary broadcast-subnet convention, six host addresses run from .9 through .14; .8 and .15 have the network and broadcast roles.

The final octet of the supplied address, fourteen, is binary 00001110. A /29 retains its upper five bits and clears the lower three. Masking with 11111000 gives 00001000, decimal eight. Setting the three host bits gives 00001111, decimal fifteen. This manual bit check explains the normalized endpoints without treating the supplied host address as a block boundary.

A third illustrative input, 198.51.100.63/27, has five host bits and thirty-two addresses. The containing block starts at .32 and ends at .63. Its mask ends in 224, and the traditional host range is .33 through .62. The entered .63 is the last address of this block, so it has the broadcast role under that convention rather than an ordinary host role. Raw inclusion in a range is not sufficient to determine an address's operational assignment.

Independent IPv4 range checks using documentation addresses
InputNetwork / lastRaw countTraditional host count
203.0.113.14/29203.0.113.8 / .1586
198.51.100.63/27198.51.100.32 / .633230

Test /31 and /32 with a non-boundary address

Enter 192.0.2.11/31 rather than the aligned .8 used in the baseline. With one host bit, the containing block is .10 through .11. Both addresses can serve as endpoints under RFC 3021's point-to-point convention. The tool reports two usable addresses for this special case rather than subtracting two. The odd-numbered input does not create an odd-aligned pair; masking still determines the block boundary.

At 192.0.2.11/32, no host bits remain. Both the normalized network and the last address equal the supplied .11, and the raw count is one. The calculator also reports one usable address under its single-address convention. This is not a conventional multi-access broadcast subnet with two reserved endpoints. Depending on network context, the notation may describe a host route or one explicitly identified address.

The usable-host result is a stated convention, not a test of device support. RFC 3021 applies to point-to-point links, and other network designs may impose different requirements. A mathematical count says nothing about interface configuration, reachability, address conflicts or administrative reservations. Confirm those constraints separately when turning a range calculation into a real design. This article performs no probes and changes no network settings.

Small-prefix normalization and scoped usability
InputNormalized rangeCountInterpretation
192.0.2.11/30.8 through .114 raw / 2 traditional hostsEntered address is traditional broadcast
192.0.2.11/31.10 through .112 raw / 2 point-to-point endpointsRFC 3021 convention
192.0.2.11/32.11 only1 raw / 1 single addressNo network/broadcast pair to subtract

Reconcile adjacent blocks without transferring IPv4 rules to IPv6

Four adjacent /30 blocks at 192.0.2.32, .36, .40 and .44 cover the aligned /28 range .32 through .47. Each /30 has four raw addresses, so the raw counts add to sixteen. Under the traditional convention each small block provides two hosts, for eight host positions across the four separately broadcast subnets. A single /28 would conventionally offer fourteen host positions. The raw union is identical, but changing subnet boundaries changes the number and roles of reserved endpoints.

This distinction prevents an allocation ledger from adding usable counts as though they were independent of the segmentation. Preserve the prefix of every block, check that ranges do not overlap, and distinguish a union of addresses from a proposed subnet consolidation. Consolidation is an operational design change; this arithmetic does not perform it or establish that a routing policy permits it.

IPv6 uses a 128-bit address space. An illustrative 2001:db8::5/126 normalizes to 2001:db8::4 through 2001:db8::7, containing four mathematical addresses. IPv6 has no IPv4-style broadcast endpoint, so the article does not label its first and last addresses as a network/broadcast pair and subtract two. IPv6 assignment and reserved-role considerations should be reviewed under their own specifications, not inferred from the IPv4 host-count column.

For a reproducible check, save the entered address, address family, prefix, normalized first and last addresses, raw count and the convention attached to any usability claim. The calculator validates literal addresses rather than resolving names. Documentation ranges keep the examples illustrative, while the cited addressing specifications support their conventions. Neither the examples nor a correct range calculation certify that a real deployment is configured, reachable or free of conflicts.

Questions and checks

Why does a /31 show two addresses?

One host bit gives two values; RFC 3021 supports both on point-to-point links.

Does /32 contain zero hosts after subtracting two?

No. The traditional broadcast-subnet subtraction is inappropriate; it is a single-address range.

Can I apply the same rules to IPv6?

No. IPv6 has different addressing semantics, including no IPv4-style broadcast address.

Sources and scope

The examples are illustrative calculations, not records of individual users. Check the policy or measurements that apply to your situation.

Try the calculations