CIDR and CIDR Calculation

cidr calculation cidr value and cidr notation

In this CIDR Calculation lesson, we willm focus on Classless Inter-Domain Routing (CIDR) and we will learn the details of this ip address allocation method. We will learn what is CIDR, CIDR notation, how to calculate CIDR value and more. This lesson is very important for IPv4 Addressing and IP Subnetting. You can check the related lessons with this lesson. You can also check CIDR values on Subnetting Cheat Sheet.

 


What is CIDR?

CIDR (Classless Inter-Domain Routing) is a method of ip address allocation that is developed for efficient ip address usage. With CIDR, you can allocate and route ip addresses independent from the traditional ip address classless.

As you know, there are ip address classes in classful ip addressing. These are Class A, Class B and Class C. By using CIDR, you can bypass these classes and with the help of CIDR notation, you can use any network prefix with any ip address.

 

So, what is CIDR notation and CIDR value? Let’s also learn the details of these terms.

 


CIDR Notation and CIDR Value

Classless Inter-Domain Routing (CIDR) has a format. This format is called CIDR notation. What is this CIDR notation? CIDR notation basically combines an ip address and a subnet mask value as the number of ones with “/ (slash)” sign. Let’s give and example for CIDR notation to understand this format better.

 

192.168.0.1/24

 

Here, the first part is ip address (192.168.0.1) and the second part is the number of 1s in the subnet mask (24). A “/ (slash)” is used between these two values. Maybe, this is one of the most used notations in network world.

 

CIDR value or in other words Prefix Length is the number of 1s in the subnet mask. Here, 24 is the CIDR value and it means that, the first 24 bits are 1s and the remaining 8 bits are 0s. In other words, the first 24 bits represent network bits and the remaining 8 bits represent host bits.  So, with this CIDR value, there are 256 possible ip addresses and 254 usable host addresses.

cidr calculation cidr value and cidr notation

As a summary, with CIDR notation, we learn how an IP address range is divided. It is the combination of ip address, “/ (slash)” and the number of 1s in the subnet mask (CIDR value). With CIDR Value, we define how many bits are the network bits in the ip address. It is the value after “/ (slash)”.

CIDR Notation: IP Address / CIDR Value

 


CIDR Calculation

We have learned what is Classless Inter-Domain Routing (CIDR), its notation and CIDR value. It is time to learn CIDR calculation. How can we calculate CIDR value?

 

Some of the CIDR value and available addresses for these values:

  • /8: 16,777,216 addresses (Class A)
  • /16: 65,536 addresses (Class B)
  • /24: 256 addresses (Class C)
  • /30: 4 addresses (used for point-to-point links)

 

You can also find a detailed one below. For more detail, you can visit Subnetting Cheat Sheet page.

 

CIDR SUBNET MASK ADDRESSES WILDCARD
/32 255.255.255.255 1 0.0.0.0
/31 255.255.255.254 2 0.0.0.1
/30 255.255.255.252 4 0.0.0.3
/29 255.255.255.248 8 0.0.0.7
/28 255.255.255.240 16 0.0.0.15
/27 255.255.255.224 32 0.0.0.31
/26 255.255.255.192 64 0.0.0.63
/25 255.255.255.128 128 0.0.0.127
/24  255.255.255.0 256 0.0.0.255
/23 255.255.254.0 512 0.0.1.255
/22 255.255.252.0 1024 0.0.3.255
/21 255.255.248.0 2048 0.0.7.255
/20 255.255.240.0 4096 0.0.15.255
/19 255.255.224.0 8192 0.0.31.255
/18 255.255.192.0 16384 0.0.63.255
/17 255.255.128.0 32768 0.0.127.255
/16 255.255.0.0 65536 0.0.255.255
/15 255.254.0.0 131072 0.1.255.255
/14 255.252.0.0 262144 0.3.255.255
/13 255.248.0.0 524288 0.7.255.255
/12 255.240.0.0 1048576 0.15.255.255
/11 255.224.0.0 2097152 0.31.255.255
/10 255.192.0.0 4194304 0.63.255.255
/9 255.128.0.0 8388608 0.127.255.255
/8 255.0.0.0 16777216 0.255.255.255
/7 254.0.0.0 33554432 1.255.255.255
/6 252.0.0.0 67108864 3.255.255.255
/5 248.0.0.0 134217728 7.255.255.255
/4 240.0.0.0 268435456 15.255.255.255
/3 224.0.0.0 536870912 31.255.255.255
/2 192.0.0.0 1073741824 63.255.255.255
/1 128.0.0.0 2147483648 127.255.255.255
/0 0.0.0.0 4294967296 255.255.255.255

 

To calculate CIDR value or prefix length, firstly we should write our subnet mask in binary format. After that, we will count the number of 1s in this binary number. The number of 1s will give us CIDR value (prefix length). Let’s give an example to learn this CIDR calculation better.

 


CIDR Calculation Example 1

For example, our ip address is 10.1.1.1 and our subnet mask is 255.255.255.240. Let’s calculate the CIDR value and CIDR notation of them.

 

Firstly, we will write the given subnet mask in binary format. 255 is all 1s, so we will write 11111111 instead of 255. And 240 is 11110000. We will write this binary number to the latest octet.

 

11111111.11111111.11111111.11110000

 

Then, let’s count the number of 1s in this binary subnet mask. There are 28 1s and 4 0s. So, this means that, first 28 bits are network bits. The latest 4 bits are host bits. So, our CIDR value is 28.

 

After that, we will combine ip address and CIDR value together to find our CIDR notation. We will use “/ (slash)” between these two values. Our CIDR notation will be:

 

10.1.1.1/28

cidr notation example, cidr valur example


CIDR Calculation Example 2

Let’s do another calculation example for Classless Inter-Domain Routing. This time, our ip address is 172.16.100.1 and our subnet mask is 255.255.248.0.

 

Again, firstly, we will write the subnet mask in binary format. Frist two octets are 255 and this means that they are full 1s. The third octet is 248 and the binary form of this number is 11111000. I am calculation this by trying to reach 248 from the beginning of the octet.

 

When I write 1 to the first bit in the octet, it means 128. When I write 1 to the second bit, the value of it 64. Totally we have 192 with these two values. So, we need more 1s. When I write 1 to the third bit, the value of it will be 32. When I write 1 to the next bit, the value of it is 16. And lastly, when I write one to the fifth bit, the value of it is 8.

 

128 + 64 + 32 + 16 + 8 = 248

 

So, the binary of the third octet will be 11111000. The last octet is full of 0s.

 

11111111.11111111.11111000.00000

cidr notation example, cidr valur example

Now, let’s count the number of 1s in this binary number. It is 21. So, our CIDR value is 21.

 

Laslty, let’s combine the given ip address and the calculated CIDR value with “/ (slash)” and find CIDR notation.

 

172.16.100.1/21

 


DOWNLOAD SUBNETTING CHEAT SHEET


Frequently Asked Questions about CIDR

What is CIDR stands for?

CIDR stands for Classless Inter-Domain Routing. A method used for an efficient ip address allocation and routing.

 


What is CIDR Notation?

CIDR notation is the combination of ip address and the CIDR value. (Example: 192.168.1.0/24)

 


What is CIDR Value?

CIDR value is the number of 1s in the subnet mask. It is showed after “/”. (Example: 24)

 


How to calculate CIDR value?

To calculate CIDR value, we should write the given subnet mask in binary format firstly. Then, we count the number of 1s in this binary number. The number that we have found is CIDR value.

 


How to calculate CIDR notation?

When we write the given subnet mask in binary format and find CIDR value with the number of 1s in the subnet mask, we combine given ip address and the calculated CIDR value with “/ (slash)” to find CIDR notation. (CIDR Notation: IP Address / CIDR Value)

 


Test Yourself With Subnetting Quizes and CCNA Quizes!


 

Lesson tags: subnetting, subnet mask, ip address, ip addressing
Back to: CCNA 200-301 v1.1 > IPv4 Addressing

Leave a Reply

Your email address will not be published. Required fields are marked *

CCNA 200-301 v1.1

Collapse
Expand
Latest Blog Posts