concept Networks
CIDR and subnet masks
CIDR combines an IP address and prefix length, such as `192.0.2.0/24`, to describe a range of IP addresses by their leading bits.
What it means
CIDR notation combines an IP address and a prefix length. The prefix specifies how many leading bits identify the address block, which determines its network boundary and size. It does not assign every address to your host, nor does every block lose exactly two usable addresses. CIDR routing Point-to-point /31
Try it
Simulation — compute an IPv4 prefix. Start with 192.0.2.130/26 and compare 192.0.2.191: the block runs from 192.0.2.128 through .191 and contains 64 total addresses. Change the comparison address to .192, then test /31, /32 and /0 to see why a blanket “subtract two hosts” rule fails. Invalid octets, fractional prefixes and /33 are rejected. Reset clears inputs and comparison state.
IPv4 CIDR and subnet boundary
Compute a documentation address block and test whether a second address belongs to it.
192.0.2.191 is inside this prefix. Network and last address are bounds; usable-host rules depend on context.
| Observation | Model value |
|---|---|
| Network | 192.0.2.128 |
| Mask | 255.255.255.192 |
| Last address | 192.0.2.191 |
| Total | 64 |
| Comparison address | 192.0.2.191 |
| Membership | Inside |
Local, bounded educational fixture. No DNS, mail, certificate, network, socket or external request is performed.
About this model
Contiguous IPv4 masks and prefix-length membership only. /31 point-to-point and /32 host routes do not follow a blanket subtract-two rule. Size is total address count, not a promise of routable or usable hosts.
See the article’s protocol sources and model limits. The scene does not alter a real system.
How the mechanism works
IPv4 addresses comprise 32 bits. A /26 prefix mask has 26 leading one bits and six zero bits: 255.255.255.192. Applying bitwise AND between an address and that mask yields the network address; OR with the inverse mask gives the last address. The block size is 2^(32-prefix) with exact integer arithmetic, so /0 contains 4,294,967,296 address values without enumerating them.
A conventional multi-access IPv4 subnet often reserves all-zero and all-one host portions for network/broadcast roles, but this is not a universal rule. RFC 3021 permits /31 point-to-point link addressing using the two values; /32 names one exact address. IPv6 also uses prefix lengths, but this widget deliberately stays with the IPv4 arithmetic and documentation address blocks rather than pretending the same host-usage conventions apply unchanged to IPv6.
Find the /26 boundary without guessing hosts
Take 192.0.2.130/26. Six host bits mean 64 total address values, and the mask is 255.255.255.192. The prefix begins at 192.0.2.128 and ends at 192.0.2.191; 192.0.2.192 is outside it.
Do not automatically subtract two to determine usable devices. A /31 on an appropriate point-to-point IPv4 link can use both addresses, while /32 designates one address. A /0 denotes all IPv4 addresses mathematically, but that fact does not grant ownership or a route. Enter canonical dotted-decimal octets without leading zeros: 192.000.002.130 is ambiguous across parsers and is rejected here.
Neighboring networks and overlapping allocations
The IPv4 blocks 192.0.2.128/26 and 192.0.2.192/26 are adjacent: the first ends at .191 and the second begins at .192, so their address ranges do not overlap. By contrast, 192.0.2.160/27 spans .160 through .191 and sits inside 192.0.2.128/26; treating it as an independent nonoverlapping allocation would be a mistake.
The prefix bits establish this relationship mathematically. They do not grant address ownership, configure an interface or install a router policy. Before an authorized change, compare the proposed range with existing route and allocation tables, including more-specific prefixes. This IPv4 calculator is a local block-membership model, not a live route scanner. CIDR addressing
In practice
Before creating a route or allocation, validate address family, prefix range, intended network boundary and overlapping blocks with existing assignments. Check the router/platform’s actual policy and required broadcast/point-to-point conventions. Do not treat a calculated “host count” as approval to allocate the entire block or publish a production route.
Limits and common mistakes
The model accepts canonical dotted-decimal IPv4 octets (no ambiguous leading zeros) and integer prefixes only; it does not parse arbitrary dotted mask syntax, enumerate large ranges, allocate actual IP resources or test routes. Membership answers are mathematical, not evidence that a connection can be established.
Key takeaways
Compute the block from prefix bits, then apply the actual interface and routing rules. Network size, address usability and administrative ownership are three different questions.
Frequently asked questions
Editorial questions, answered from the sources listed for this article.
Are there always two unusable IPv4 addresses in each subnet?
No. The familiar network/broadcast convention is context-specific; /31 point-to-point links and /32 host prefixes have different usage rules.
Does a /0 prefix mean my host owns the entire IPv4 address space?
No. A /0 prefix mathematically matches every IPv4 address, but ownership, routing and authorization are independent of the bitmask calculation.
Does /26 mean 26 addresses?
No. In IPv4 it means 26 network bits, leaving six variable bits and 64 addresses in the block.
Does /32 represent an IPv4 subnet with two reserved addresses?
No. It identifies a single IPv4 address and is used differently from ordinary multiaddress LAN allocations.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan
IPv4 CIDR addressing and prefix aggregation. Prefix addressing/aggregation; avoid enumerating hugeblocks.
Checked .
- Using 31-Bit Prefixes on IPv4 Point-to-Point Links
31-bit prefix operation on IPv4 point-to-point links. /31 exception to conventional subnet network/broadcast host subtraction.
Checked .
- IP Version6 Addressing Architecture
IPv6 addressing architecture and address types (§2). Address representation and addressing architecture; verify applicableupdates.
Checked .