Case 1
- CIDR prefix length (/n)
- 24
254
Open with these valuesChange any value to update the result.
254hosts
Usable hosts: 254 hostsFor ordinary subnets, subtract the network and broadcast addresses: a /24 has 2⁸ − 2 = 254 usable hosts. On an RFC 3021 point-to-point link, a /31 has 2 usable endpoints; a /32 is one host address.
| CIDR prefix length (/n) | Usable hosts |
|---|---|
| 16 | 65,534 |
| 18 | 16,382 |
| 20 | 4,094 |
| 22 | 1,022 |
| 24Your value | 254 |
| 26 | 62 |
| 28 | 14 |
| 30 | 2 |
| 32 | 1 |
254
Open with these values65,534
Open with these values2
Open with these valuesordinary subnet: 2^(32 − prefix) − 2; /31: 2; /32: 1
An IPv4 address is 32 bits long, and the prefix says how many bits name the network. The remaining 32 minus prefix bits identify addresses in the block. In an ordinary subnet, the all-zero host pattern names the network and the all-one pattern is broadcast, so two addresses are reserved.
A /24 leaves 8 host bits: 2⁸ = 256 addresses and 254 usable hosts. A /25 has 126, a /16 has 65,534 and a /0 has 4,294,967,294. The two smallest blocks are exceptions.
RFC 3021 makes both addresses of a /31 usable endpoints on a point-to-point link. A /32 denotes one host address. The result is a count, not an address range: it does not say where the block starts or how to divide a larger allocation.
The first address in an ordinary subnet names the network itself, and the last one is the broadcast address that reaches every host at once. Neither can be assigned there, which is where the minus two in 2^n − 2 comes from.
A /31 uses both addresses as endpoints on an RFC 3021 point-to-point link, so it returns 2. A /32 is a single-address host route and returns 1. The ordinary minus-two rule does not apply to either case.
A /25 holds 126 usable hosts, a /24 holds 254 and a /16 holds 65,534. Each bit taken from the prefix is a bit added to the host part.
MisconceptionA /24 has 256 usable hosts.
CorrectionIt has 256 addresses but only 254 usable ones, because the network and broadcast address are reserved.
MisconceptionA bigger prefix number means a bigger subnet.
CorrectionThe prefix counts the leading bits that identify the network, so a larger prefix leaves fewer host bits. A /25 is half the size of a /24.
MisconceptionA /30 is useless because it only has 4 addresses.
CorrectionTwo of those four are usable, which is exactly what a point-to-point link between two routers needs.
| Prefix | What it usually is | Usable hosts |
|---|---|---|
| 0 | the whole IPv4 space | 4294967294 |
| 8 | a former class A block | 16777214 |
| 16 | a former class B block | 65534 |
| 24 | a typical office or home LAN | 254 |
| 25 | half a LAN | 126 |
| 30 | a point-to-point link | 2 |
| 31 | point-to-point under RFC 3021 | 2 |
| 32 | a single host route | 1 |
For ordinary subnets, raise two to the host-bit count and subtract two: 2^(32 − prefix) − 2. A /24 has 254 usable hosts. A /31 point-to-point link has 2 usable endpoints, and a /32 host route has 1 address.
Two addresses in every ordinary subnet are reserved: the network address, the first one, which names the subnet itself, and the broadcast address, the last one, which reaches all hosts at once. Neither can be given to a device, so a /24 with 256 addresses has only 254 usable ones.
254. A /24 has 8 host bits, so 2⁸ = 256 addresses, minus the network and broadcast address. A /16 holds 65,534, a /25 holds 126 and a /30 holds just 2 — each smaller prefix roughly doubles the count.
Under RFC 3021, a /31 uses both addresses as point-to-point endpoints, so this calculator returns 2. A /32 is a host route containing one address, so it returns 1. Neither uses the ordinary minus-two rule.
It is the /n written after an IP address, as in 192.168.1.0/24, and it counts the leading bits that identify the network. The remaining 32 − n bits number the individual hosts. A larger prefix means fewer host bits and fewer usable addresses.
Diese Seite gibt es auch auf Deutsch.
Zu Deutsch wechseln