What Is IP Subnetting?
IP subnetting is the practice of dividing a network into smaller sub-networks (subnets). Each subnet has a defined range of IP addresses, a network address, and a broadcast address. Subnetting improves network performance by reducing broadcast domains and enhances security by isolating network segments.
A subnet mask determines which portion of an IP address identifies the network and which portion identifies the host. The CIDR (Classless Inter-Domain Routing) notation uses a prefix length (e.g., /24) to indicate how many bits are used for the network portion.
Subnet Calculation
Common Subnet Masks
| CIDR | Subnet Mask | Usable Hosts | Total Addresses |
|---|---|---|---|
| /8 | 255.0.0.0 | 16,777,214 | 16,777,216 |
| /16 | 255.255.0.0 | 65,534 | 65,536 |
| /24 | 255.255.255.0 | 254 | 256 |
| /25 | 255.255.255.128 | 126 | 128 |
| /26 | 255.255.255.192 | 62 | 64 |
| /27 | 255.255.255.224 | 30 | 32 |
| /28 | 255.255.255.240 | 14 | 16 |
| /30 | 255.255.255.252 | 2 | 4 |
Frequently Asked Questions
What is the difference between network and broadcast address?
The network address is the first address in a subnet and identifies the network itself (e.g., 192.168.1.0/24). The broadcast address is the last address and is used to send data to all hosts in the subnet (e.g., 192.168.1.255). Neither can be assigned to a host device.
Why subtract 2 for usable hosts?
The total addresses in a subnet is 2^(32-CIDR). Two addresses are reserved: the network address (first) and the broadcast address (last). So usable host addresses = total - 2. Exception: /31 subnets (point-to-point links) use both addresses per RFC 3021.
What are private IP ranges?
Private IP ranges reserved by RFC 1918 are: 10.0.0.0/8 (Class A), 172.16.0.0/12 (Class B), and 192.168.0.0/16 (Class C). These addresses are not routable on the public internet and are used for internal networks behind NAT.