Class A: 8 network bits, 24 host bits (255.0.0.0)
Class B: 16 network bits, 16 host bits (255.255.0.0)
Class C: 24 network bits, 8 host bits (255.255.255.0)
Class D: Multicast (224.0.0.0–239.255.255.255)
Class E: Reserved (240.0.0.0–255.255.255.255)
CIDR removes classful restrictions by specifying the number of network bits. For example, 192.168.1.44/24 uses 24 bits for the network portion.
VLSM (Variable Length Subnet Masks) allows different subnet masks within the same classful network.
Example: 10.1.1.0/24 → 216 subnets, 28 − 2 = 254 hosts each.
“Magic number” = 256 − (value in the interesting octet of the subnet mask). Use this to find the subnet boundary.
Example: For 172.16.242.133/27, the interesting octet is 224, so magic number = 256 − 224 = 32.
| CIDR 1 | CIDR 2 | CIDR 3 | CIDR 4 | Subnet in Decimals | Networks | Addresses |
|---|---|---|---|---|---|---|
| /1 | /9 | /17 | /25 | 128 | 2 | 128 |
| /2 | /10 | /18 | /26 | 192 | 4 | 64 |
| /3 | /11 | /19 | /27 | 224 | 8 | 32 |
| /4 | /12 | /20 | /28 | 240 | 16 | 16 |
| /5 | /13 | /21 | /29 | 248 | 32 | 8 |
| /6 | /14 | /22 | /30 | 252 | 64 | 4 |
| /7 | /15 | /23 | /31 | 254 | 128 | 2 |
| /8 | /16 | /24 | /32 | 255 | 256 | 1 |
| Block Size | Ranges (Decimal) | |||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 128-address block | 0 | 128 | ||||||||||||||||||||||||||||||
| 64-address block | 0 | 64 | 128 | 192 | ||||||||||||||||||||||||||||
| 32-address block | 0 | 32 | 64 | 96 | 128 | 160 | 192 | 224 | ||||||||||||||||||||||||
| 16-address block | 0 | 16 | 32 | 48 | 64 | 80 | 96 | 112 | 128 | 144 | 160 | 176 | 192 | 208 | 224 | 240 | ||||||||||||||||
| 8-address block | 0 | 8 | 16 | 24 | 32 | 40 | 48 | 56 | 64 | 72 | 80 | 88 | 96 | 104 | 112 | 120 | 128 | 136 | 144 | 152 | 160 | 168 | 176 | 184 | 192 | 200 | 208 | 216 | 224 | 232 | 240 | 248 |
For IP: 165.245.12.88/24 with a subnet mask of 255.255.255.0
Network address: 165.245.12.0
Broadcast address: 165.245.12.255
Usable range: 165.245.12.1 to 165.245.12.254