Understanding IP Subnets
Subnetting divides a large network into smaller, manageable sub-networks. Each subnet has its own range of IP addresses, defined by the subnet mask (or CIDR prefix length).
Key Concepts
- Network Address: First address in the subnet — identifies the network itself
- Broadcast Address: Last address — sends data to all hosts on the subnet
- Usable Hosts: Total addresses minus 2 (network and broadcast). A /24 = 256 - 2 = 254 hosts
- Wildcard Mask: Inverse of subnet mask — used in ACLs and OSPF. For 255.255.255.0, wildcard is 0.0.0.255
IPv4 Subnet Reference Table
| Prefix | Network Mask | Usable Hosts |
|---|---|---|
| Classless | ||
| /1 | 128.0.0.0 | 2,147,483,646 |
| /2 | 192.0.0.0 | 1,073,741,822 |
| /3 | 224.0.0.0 | 536,870,910 |
| /4 | 240.0.0.0 | 268,435,454 |
| /5 | 248.0.0.0 | 134,217,726 |
| /6 | 252.0.0.0 | 67,108,862 |
| /7 | 254.0.0.0 | 33,554,430 |
| Class A | ||
| /8 | 255.0.0.0 | 16,777,214 |
| /9 | 255.128.0.0 | 8,388,606 |
| /10 | 255.192.0.0 | 4,194,302 |
| /11 | 255.224.0.0 | 2,097,150 |
| /12 | 255.240.0.0 | 1,048,574 |
| /13 | 255.248.0.0 | 524,286 |
| /14 | 255.252.0.0 | 262,142 |
| /15 | 255.254.0.0 | 131,070 |
| Class B | ||
| /16 | 255.255.0.0 | 65,534 |
| /17 | 255.255.128.0 | 32,766 |
| /18 | 255.255.192.0 | 16,382 |
| /19 | 255.255.224.0 | 8,190 |
| /20 | 255.255.240.0 | 4,094 |
| /21 | 255.255.248.0 | 2,046 |
| /22 | 255.255.252.0 | 1,022 |
| /23 | 255.255.254.0 | 510 |
| Class C | ||
| /24 | 255.255.255.0 | 254 |
| /25 | 255.255.255.128 | 126 |
| /26 | 255.255.255.192 | 62 |
| /27 | 255.255.255.224 | 30 |
| /28 | 255.255.255.240 | 14 |
| /29 | 255.255.255.248 | 6 |
| /30 | 255.255.255.252 | 2 |
| /31 | 255.255.255.254 | 0 |
| /32 | 255.255.255.255 | 0 |
Private IP Address Ranges
| Class | Range | CIDR | Addresses |
|---|---|---|---|
| A | 10.0.0.0 — 10.255.255.255 | 10.0.0.0/8 | 16,777,216 |
| B | 172.16.0.0 — 172.31.255.255 | 172.16.0.0/12 | 1,048,576 |
| C | 192.168.0.0 — 192.168.255.255 | 192.168.0.0/16 | 65,536 |
IPv6 Addressing
IPv6 uses 128-bit addresses written as eight groups of four hexadecimal digits separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). Leading zeros in each group can be omitted, and consecutive groups of all zeros can be replaced with "::".
Common IPv6 Prefix Lengths
- /32: Minimum allocation to an ISP from a Regional Internet Registry
- /48: Typical allocation to a single site or customer
- /56: Smaller site allocation — gaining popularity for residential customers
- /64: Standard subnet size — required for SLAAC (Stateless Address Autoconfiguration)
- /128: Single host address (loopback, point-to-point)