# How do I calculate an IPv4 subnet mask, broadcast address and usable host range?

Exam: HPE6-A86 — HPE Network Switching Associate Exam
Knowledge domain: Identify, describe, and apply foundational networking architectures and technologies.
Updated: 2026-11-25T03:39:59.854375+00:00
HTML: https://learningpathx.com/faq/HPE6-A86/hpe6-a86-calculate-ipv4-subnet-mask-and-host-range.html

## Also asked as

- How can I derive the network and usable addresses from an IPv4 CIDR prefix?
- How do I find the IPv4 subnet boundaries from a host address and prefix length?

Write the prefix length as that many leading binary ones in a 32-bit mask. A bitwise AND between the address and mask gives the network address. Set all host bits to one to get the broadcast address for an ordinary IPv4 subnet. Usable host values fall between those two boundaries.

For `192.0.2.77/26`, the 26 network bits leave six host bits. The mask is `255.255.255.192`, with `11000000` in the last octet. The block size in the last octet is `256 − 192 = 64`, so the blocks begin at `.0`, `.64`, `.128` and `.192`. Address `.77` lies in the block beginning at `.64`.

| Value | Result |
| --- | --- |
| Network | `192.0.2.64/26` |
| Broadcast | `192.0.2.127` |
| Usable host addresses | `192.0.2.65` through `192.0.2.126` |
| Usable host count | `2^6 − 2 = 62` |

Keep the ordinary host count rule scoped to conventional subnets such as this one. A `/31` point-to-point prefix and a `/32` host route have different purposes. Address eligibility also leaves assignment and uniqueness to check in the actual network.

## References

* [RFC 4632, CIDR address assignment and aggregation](https://www.rfc-editor.org/rfc/rfc4632.html)
* [RFC 1122, Requirements for Internet Hosts](https://www.rfc-editor.org/rfc/rfc1122.html)
* [RFC 3021, 31-bit prefixes on IPv4 point-to-point links](https://www.rfc-editor.org/rfc/rfc3021.html)

Source: [HPE6-A86: IPv4 Subnetting, ARP and the Next-Hop Decision](https://learningpathx.com/news/hpe6-a86-ipv4-subnetting-arp-and-the-next-hop-decision.html)
