Internet and most of the network infrastructures uses IP Protocol. IP protocol uses IP addresses in order to connect different hosts and networks over globe. Classless Inter Domain Routing or CIDR is hierarchical IP addressing scheme used to set IP addresses to the hosts and network. Here we will learn how to calculate IP address, Network Address, Broadcast Address, Network Mask and provide these as cheat sheet.
IP address, Network Address, Broadcast Address, Network Mask Calculation
We will calculate given network parameters in this part we can use following cheat sheet. In this example we will use 192.168.1.0
as network address. We need 10 IP address for our host. If we look to the table we see that Potential host numbers a 2 and its multiply. So we will use 16 host line which have /28
network mask or 255.255.255.240
. So the network information will be like below.
Network Address: 192.168.1.0 Host IP Range: 192.168.1.1 - 192.168.1.10 Actual Useable Host IP Count: 14 Broadcast Address: 192.168.1.15
CIDR Cheat Sheet
Here is some explanation
Prefix
is bit count for network addressAmount Of a Class C
is how many C class network can be created in this networkPotential Hosts
is the count of IP numbersActual Hosts
is the count of usable IP numbers because 1 IP is used for network address and 1 IP is used for broadcast purposes.Netmask
is decimal presentation of the prefix with IP format.
Prefix | Amount Of a Class C | Potential Hosts | Actual Hosts | Netmask | # of subnets |
/31 | 1/128 | 2 | 0 | 255.255.255.254 | 128 |
/30 | 1/64 | 4 | 2 | 255.255.255.252 | 64 |
/29 | 1/32 | 8 | 6 | 255.255.255.248 | 32 |
/28 | 1/16 | 16 | 14 | 255.255.255.240 | 16 |
/27 | 1/8 | 32 | 30 | 255.255.255.224 | 8 |
/26 | 1/4 | 64 | 62 | 255.255.255.192 | 4 |
/25 | 1/2 | 128 | 126 | 255.255.255.128 | 2 |
/24 | 1 | 256 | 254 | 255.255.255.0 | 1 |
/23 | 2 | 512 | 510 | 255.255.254.0 | 128 |
/22 | 4 | 1,024 | 1,022 | 255.255.252.0 | 64 |
/21 | 8 | 2,048 | 2,046 | 255.255.248.0 | 32 |
/20 | 16 | 4,096 | 4,094 | 255.255.240.0 | 16 |
/19 | 32 | 8,192 | 8,190 | 255.255.224.0 | 8 |
/18 | 64 | 16,384 | 16,382 | 255.255.192.0 | 4 |
/17 | 128 | 32,768 | 32,766 | 255.255.128.0 | 2 |
/16 | 256 = 1 class B net | 65,536 | 65,534 | 255.255.0.0 | 1 |
/15 | 512 = 2 B nets | 131,072 | 131,070 | 255.254.0.0 | 128 |
/14 | 1,024 = 4 B nets | 262,144 | 262,142 | 255.252.0.0 | 64 |
/13 | 2,048 = 8 B nets | 524,288 | 524,286 | 255.248.0.0 | 32 |
/12 | 4,096 = 16 B nets | 1,048,576 | 1,048,574 | 255.240.0.0 | 16 |
/11 | 8,192 = 32 B nets | 2,097,152 | 2,097,150 | 255.224.0.0 | 8 |
/10 | 16,384 = 64 B nets | 4,194,304 | 4,194,302 | 255.192.0.0 | 4 |
/9 | 32,768 = 128 B nets | 8,388,608 | 8,388,606 | 255.128.0.0 | 2 |
/8 | 65,536 = 256 B nets = 1 A net | 16,777,216 | 16,777,214 | 255.0.0.0 | 1 |
/7 | 131,072 = 2 A nets | 33,554,432 | 33,554,430 | 254.0.0.0 | 128 |
/6 | 262,144 = 4 A nets | 67,108,864 | 67,108,862 | 252.0.0.0 | 64 |
/5 | 524,888 = 8 A nets | 134,217,728 | 134,217,726 | 248.0.0.0 | 32 |
/4 | 1,048,576 = 16 A nets | 268,435,456 | 268,435,454 | 240.0.0.0 | 16 |
/3 | 2,097,152 = 32 A nets | 536,870,912 | 536,870,910 | 224.0.0.0 | 8 |
/2 | 4,194,304 = 64 A nets | 1,073,741,824 | 1,073,741,822 | 192.0.0.0 | 4 |
/1 | 8,388,608 = 128 A nets | 2,147,483,648 | 2,147,483,646 | 128.0.0.0 | 2 |
/0 | 16,777,216 = 256 A nets | 4,294,967,296 | 4,294,967,294 | 0.0.0.0 | 1 |
Another CIDR Cheat Sheet
CIDR Total number Network Description: Notation: of addresses: Mask: -------------------------------------------------------------- /0 4,294,967,296 0.0.0.0 Every Address /1 2,147,483,648 128.0.0.0 128 /8 nets /2 1,073,741,824 192.0.0.0 64 /8 nets /3 536,870,912 224.0.0.0 32 /8 nets /4 268,435,456 240.0.0.0 16 /8 nets /5 134,217,728 248.0.0.0 8 /8 nets /6 67,108,864 252.0.0.0 4 /8 nets /7 33,554,432 254.0.0.0 2 /8 nets /8 16,777,214 255.0.0.0 1 /8 net (Class A) -------------------------------------------------------------- /9 8,388,608 255.128.0.0 128 /16 nets /10 4,194,304 255.192.0.0 64 /16 nets /11 2,097,152 255.224.0.0 32 /16 nets /12 1,048,576 255.240.0.0 16 /16 nets /13 524,288 255.248.0.0 8 /16 nets /14 262,144 255.252.0.0 4 /16 nets /15 131.072 255.254.0.0 2 /16 nets /16 65,536 255.255.0.0 1 /16 (Class B) -------------------------------------------------------------- /17 32,768 255.255.128.0 128 /24 nets /19 16,384 255.255.192.0 64 /24 nets /19 8,192 255.255.224.0 32 /24 nets /20 4,096 255.255.240.0 16 /24 nets /21 2,048 255.255.248.0 8 /24 nets /22 1,024 255.255.252.0 4 /24 nets /23 512 255.255.254.0 2 /24 nets /24 256 255.255.255.0 1 /24 (Class C) -------------------------------------------------------------- /25 128 255.255.255.128 Half of a /24 /26 64 255.255.255.192 Fourth of a /24 /27 32 255.255.255.224 Eighth of a /24 /28 16 255.255.255.240 1/16th of a /24 /29 8 255.255.255.248 5 Usable addresses /30 4 255.255.255.252 1 Usable address /31 2 255.255.255.254 Unusable /32 1 255.255.255.255 Single host -------------------------------------------------------------- Reserved Space: 0.0.0.0/8 127.0.0.0/8 192.0.2.0/24 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 169.254.0.0/16