Classless Inter-Domain Routing (CIDR) notation is a method for specifying IP addresses and their associated network masks. It simplifies the address format by using a suffix (e.g., /24) to indicate how many bits are used for the network portion of the address, with the remaining bits reserved for host addresses.
Below is a table summarizing CIDR prefixes, potential hosts, netmasks, and the number of subnets.
| CIDR Prefix | Potential Hosts | Netmask | Number of Subnets |
|---|---|---|---|
| /31 | 2 | 255.255.255.254 | 128 |
| /30 | 4 | 255.255.255.252 | 64 |
| /29 | 8 | 255.255.255.248 | 32 |
| /28 | 16 | 255.255.255.240 | 16 |
| /27 | 32 | 255.255.255.224 | 8 |
| /26 | 64 | 255.255.255.192 | 4 |
| /25 | 128 | 255.255.255.128 | 2 |
| /24 | 256 | 255.255.255.0 | 1 |
| /23 | 512 | 255.255.254.0 | 128 |
| /22 | 1,024 | 255.255.252.0 | 64 |
| /21 | 2,048 | 255.255.248.0 | 32 |
| /20 | 4,096 | 255.255.240.0 | 16 |
| /19 | 8,192 | 255.255.224.0 | 8 |
| /18 | 16,384 | 255.255.192.0 | 4 |
| /17 | 32,768 | 255.255.128.0 | 2 |
| /16 | 65,536 | 255.255.0.0 | 1 |
| /15 | 131,072 | 255.254.0.0 | 128 |
| /14 | 262,144 | 255.252.0.0 | 64 |
| /13 | 524,288 | 255.248.0.0 | 32 |
| /12 | 1,048,576 | 255.240.0.0 | 16 |
| /11 | 2,097,152 | 255.224.0.0 | 8 |
| /10 | 4,194,304 | 255.192.0.0 | 4 |
| /9 | 8,388,608 | 255.128.0.0 | 2 |
| /8 | 16,777,216 | 255.0.0.0 | 1 |
| /7 | 33,554,432 | 254.0.0.0 | 128 |
| /6 | 67,108,864 | 252.0.0.0 | 64 |
| /5 | 134,217,728 | 248.0.0.0 | 32 |
| /4 | 268,435,456 | 240.0.0.0 | 16 |
| /3 | 536,870,912 | 224.0.0.0 | 8 |
| /2 | 1,073,741,824 | 192.0.0.0 | 4 |
| /1 | 2,147,483,648 | 128.0.0.0 | 2 |
| /0 | 4,294,967,296 | 0.0.0.0 | 1 |
Key Concepts
- CIDR Notation: The
/suffix in CIDR notation (e.g.,/24) indicates the number of bits used for the network portion of the address. The remaining bits are used for host addresses. - Netmask: The netmask is a 32-bit number that masks an IP address, dividing it into the network and host portions.
- Potential Hosts: Represents the total number of IP addresses available within the subnet, including the network and broadcast addresses.
- Number of Subnets: Represents the possible number of subnets when the corresponding prefix is applied to a larger network.
Example
- 192.168.1.12/24: The
/24indicates a 24-bit network mask (255.255.255.0), meaning the first 24 bits are used for the network address, leaving the remaining 8 bits for host addresses. Therefore,192.168.1.12is part of the192.168.1.0/24network.
This cheat sheet provides a quick reference to understanding CIDR notation, helping you determine the size of a subnet and the potential number of hosts it can support.
