IP Address Classes
The classful system carved the 32-bit IPv4 space into five blocks based on leading bits. Classes A through C carry traffic. Class D is multicast. Class E is reserved.
Modern routing uses CIDR rather than classes, but the boundaries still define where reserved ranges live and how addresses are parsed by humans. Knowing them is the difference between recognizing 10.0.0.1 as private and treating it as a routable host.
| Class | Start | End | Leading Bits |
|---|---|---|---|
| A | 0.0.0.0 | 127.255.255.255 | 0xxxxxxx |
| B | 128.0.0.0 | 191.255.255.255 | 10xxxxxx |
| C | 192.0.0.0 | 223.255.255.255 | 110xxxxx |
| D | 224.0.0.0 | 239.255.255.255 | 1110xxxx |
| E | 240.0.0.0 | 255.255.255.255 | 1111xxxx |
Reserved Private Ranges
Some address blocks never leave the local network. RFC 1918 carves out three private ranges for internal use, and additional blocks handle loopback and auto-configuration.
| Designation | Range | Purpose |
|---|---|---|
| Class A | 10.0.0.0 to 10.255.255.255 | Large internal networks (RFC 1918) |
| Class B | 172.16.0.0 to 172.31.255.255 | Medium internal networks (RFC 1918) |
| Class C | 192.168.0.0 to 192.168.255.255 | Home and small office (RFC 1918) |
| Localhost | 127.0.0.0 to 127.255.255.255 | Loopback to this machine |
| Zeroconf | 169.254.0.0 to 169.254.255.255 | APIPA and Bonjour auto-config |
Terminology
Two terms come up constantly when reading or writing IPv4 access policies. They are easy to confuse, so anchor them now.
Wildcard Mask
Indicates which parts of an IP address are available for examination. Used heavily in ACLs and OSPF. The wildcard mask is the bitwise inverse of a subnet mask.
CIDR
Classless Inter-Domain Routing. Replaces legacy classful addressing with bit-level granularity. Notation is expressed as /XX where XX is the number of network bits, like 192.168.1.0/24.
Binary to Decimal
Every dotted decimal address is four 8-bit binary numbers wearing a friendlier disguise. The example walks through 172.16.254.1.
Decimal to Binary: Mask Values
A subnet mask only takes nine possible values in any one octet. Memorize these and the binary math becomes pattern recognition.
| Subnet | Binary | Wildcard | Binary |
|---|---|---|---|
| 255 | 1111 1111 | 0 | 0000 0000 |
| 254 | 1111 1110 | 1 | 0000 0001 |
| 252 | 1111 1100 | 3 | 0000 0011 |
| 248 | 1111 1000 | 7 | 0000 0111 |
| 240 | 1111 0000 | 15 | 0000 1111 |
| 224 | 1110 0000 | 31 | 0001 1111 |
| 192 | 1100 0000 | 63 | 0011 1111 |
| 128 | 1000 0000 | 127 | 0111 1111 |
| 0 | 0000 0000 | 255 | 1111 1111 |