Data Source & Methodology
AuthoritativeDataSource: Internet Engineering Task Force (IETF) RFCs —
RFC 4632 (CIDR),
RFC 791 (IPv4),
RFC 950 (Subnetting),
RFC 3021 (/31).
All calculations implement these specifications.
Tutti i calcoli si basano rigorosamente sulle formule e sui dati forniti da questa fonte.
The Formula Explained
Let \( p \) be the prefix length (0–32). Then:
\[ \text{Total addresses} = 2^{32-p} \]
\[ \text{Usable hosts} = \begin{cases} 2^{32-p} - 2, & \text{if } p \le 30 \\ 2, & \text{if } p = 31 \text{ (RFC 3021 point-to-point)} \\ 1, & \text{if } p = 32 \end{cases} \]
\[ \text{Wildcard mask} = \neg \text{Subnet mask} \quad\ \ \ \ \text{Network} = \text{IP} \ \&\ \text{Mask} \quad\ \ \ \ \text{Broadcast} = \text{Network} \ |\ \neg \text{Mask} \]
Glossary of Variables
- IPv4 address: host address in dotted-decimal form.
- CIDR prefix: number of leading 1 bits in the mask (e.g., /24).
- Subnet mask: 32-bit mask that selects the network portion.
- Wildcard mask: bitwise NOT of the subnet mask; useful for ACLs.
- Network address: IP AND mask; identifies the subnet.
- Broadcast address: last address in the subnet (all host bits 1), except /31 and /32 special cases.
- Usable hosts: total assignable host addresses in the subnet.
How It Works: A Step-by-Step Example
Case: 192.168.10.42/24
- Mask from /24: 255.255.255.0 (24 leading 1s).
- Network: 192.168.10.0 = 192.168.10.42 AND 255.255.255.0.
- Broadcast: 192.168.10.255 = network OR wildcard (0.0.0.255).
- Total: \(2^{8}=256\) addresses; Usable: \(256-2=254\).
- Hosts: 192.168.10.1 through 192.168.10.254.
FAQ
Why does /31 show 2 usable addresses?
Per RFC 3021, /31 networks are for point-to-point links and don’t reserve network/broadcast, making both addresses usable.
What about /32?
/32 identifies a single host address; there’s 1 total address and no range to assign beyond the host itself.
Why is my custom mask considered invalid?
Masks must be contiguous (all 1s followed by all 0s). Non-contiguous masks like 255.255.0.255 are not valid per CIDR.
Does this handle private vs public ranges?
Yes, but it does not validate routability. It calculates pure subnet math regardless of private/public classification.
How many subnets can I split into?
Each time you increase the prefix by 1 (e.g., /24 → /25), you double the subnets. The preview caps display to 64 rows for performance.
Why might first/last host be “—” for /31 or /32?
For /31, both addresses are usable; some contexts don’t label first/last. For /32, there’s no host range beyond the single address.
Strumento sviluppato da Ugo Candido. Contenuti verificati da CalcDomain Editorial Board.
Ultima revisione per l'accuratezza in data