Understanding IP Subnetting
IP subnetting divides a network into smaller subnetworks. The CIDR prefix length defines how many bits are used for the network portion of the address, with the remaining bits used for host addresses.
Usable Hosts = 2^(32 - prefix) - 2
The two subtracted addresses are the network address (all host bits 0) and the broadcast address (all host bits 1). For /31 and /32 subnets, special rules apply per RFC 3021.