IPv4 Subnetting · Network Address · Broadcast · Usable IP Range
CIDR (Classless Inter-Domain Routing) is a method for IP address allocation and routing. It's expressed as IP/prefix length, e.g. 192.168.1.0/24. The prefix length (0-32) indicates how many bits are used for the network portion, with remaining bits for host addresses. /24 means 24 network bits and 8 host bits.
Usable IPs = 2^(32 - prefix) - 2. We subtract 2 because the network address (first IP, e.g. 192.168.1.0) and broadcast address (last IP, e.g. 192.168.1.255) cannot be assigned to devices. A /24 network has 2^8 - 2 = 254 usable IP addresses.
Private IP addresses are used within local networks and cannot be routed on the public internet. IPv4 private ranges: 10.0.0.0/8 (~16.7M addresses), 172.16.0.0/12 (~1M addresses), 192.168.0.0/16 (~65K addresses). These can be reused across different LANs.
The CIDR prefix length is the number of consecutive 1s in the subnet mask. For example: /24 = 255.255.255.0 (24 ones + 8 zeros), /16 = 255.255.0.0, /8 = 255.0.0.0. Longer prefixes mean fewer host addresses available.