IP Subnetting Explained With a Real /24 Example

How network address, broadcast address, and usable host count are calculated from an IP and CIDR prefix.

Subnetting is pure binary arithmetic wearing a dotted-decimal costume — once you see an IP address as 32 raw bits instead of four familiar numbers, every subnetting rule follows mechanically.

The setup: 192.168.1.10/24

The "/24" means the first 24 bits identify the network; the remaining 8 bits identify the host within that network. In binary, 192.168.1.10 is:

11000000.10101000.00000001.00001010

The /24 mask covers the first three octets entirely (24 bits = 3 × 8), leaving only the last octet (00001010, which is 10 in decimal) as the host portion.

Finding the network address

The network address zeroes out every host bit, keeping the network bits unchanged: 11000000.10101000.00000001.00000000 = 192.168.1.0. This is the "identity" of the subnet itself — never assigned to an individual device.

Finding the broadcast address

The broadcast address does the opposite — every host bit becomes 1: 11000000.10101000.00000001.11111111 = 192.168.1.255. This special address, when sent to, reaches every device on the subnet simultaneously.

Counting usable hosts

With 8 host bits, there are 2⁸ = 256 total possible addresses (0-255 in the last octet). Subtracting the 2 reserved addresses (network and broadcast) leaves 254 usable host addresses — everything from 192.168.1.1 through 192.168.1.254.

What changes with a different prefix length

Shrink the prefix to /26 (leaving only 6 host bits instead of 8): total addresses become 2⁶ = 64, usable hosts become 64−2 = 62. This is exactly how "subnetting" works in practice — carving a large network into smaller ones by extending the prefix length (borrowing more bits for the network portion), at the cost of fewer usable hosts per resulting subnet.

Why 2 addresses are always reserved, regardless of size

This isn't a network-size-specific quirk — every subnet, no matter how large or small, sacrifices exactly its lowest address (network) and highest address (broadcast) to serve those two special, non-host purposes. The only exception is /31 and /32 prefixes, which use special conventions (like point-to-point links) that don't follow the general rule.

Common mistakes to avoid

  • Forgetting that "total addresses" (2^host-bits) and "usable hosts" (total − 2) are different numbers, easy to conflate
  • Miscounting host bits — a /24 has 32−24 = 8 host bits, not 24
  • Assuming a subnet mask and a wildcard mask (used in Cisco ACLs) are the same thing — a wildcard mask is the bitwise inverse of a subnet mask

Work through your own subnet with the subnet calculator and IP to binary converter.