## What is CIDR notation

I mentioned this several times in my articles and included a link to wikipedia’s definition of CIDR notation. However only now I saw how complex the wiki’s definition is. From the other hand, I guess any formal definition of the subject would be complex and hard to understand. So I took the liberty to describe what CIDR notation is in two words.

First of all, in two words CIDR notation is a way to describe computer networks, or sub-networks to be more precise. I suppose you are familiar with terms sub-network and netmask. As you know, Internet is a network of sub-networks. Netmask is a way to describe your sub-network. I.e. one uses netmask to describe range of IP addresses that are part of the network. If you do logical AND between IP address and the netmask and you end up with a so called base network address. Base network address is the same for all subnet participants.

Although netmask allows you to declare subnets where for instance 192.168.0.100 and 193.168.23.129 are in the same subnet, the common practice is significantly different. Instead of tinkering higher bits of the netmask, people usually change lower bits of the netmask, one by one. As a result, most of the time we can identify a subnet by simply counting number of most significant ones in the netmask. I.e. netmask 255.255.255.0 contains 24 ones, out of 32.

You may count least significant zeros in the netmask. In that case you’ll have to subtract the result from 32.

To write subnet specification in CIDR notation, just write subnet base address followed by / and number of ones in the netmask. For instance, 192.168.0.0 netmask 255.255.255.0 in CIDR will look like this: 192.168.0.0/24. And if the netmask is 255.255.0.0, we will write 192.168.0.0/16. Finally, a more complex example, if netmask is 255.255.252.0, we will write 192.168.0.0/22.

Did you know that you can receive periodical updates with the latest articles that I write right into your email box? Alternatively, you subscribe to the RSS feed!

Want to know how? Check out
Subscribe page

1. squiffy says:

Thanks you. Your explanation of how CIDR subnets are expressed clicked with me. This is the 500th page I’ve read and i finally get it. Sometimes just takes a different way of describing it …

2. @squiffy
Happy to serve you Finally, I can rest assured someone found this article useful Please visit my web-site again!

3. David says:

Dude thanks! I’m cramming for my MS 70-291 exam (windows 2003) and this is the best explanation of cidr notation! Thanks!

4. @David
Good luck with the exam
Thanks for a warm comment and please visit again

5. dave says:

Thanks for the explanation on CIDR. Now if only you could show how to do it. For example, given an ip address how to I find the subnet mask, network address, hosts and increments of the subnets.

Or, If I have the netork address, how do I break up the network into subnets.

I’ve been working on this (CLASSLESS subnetting) now for many, many hours, going over many, many web pages, and still cannot figure it out. My mental acuity is being seriously questioned.

Regardless of what I would like and what you can afford to do in terms of time, I thank you for the CIDR explanation.

Cheers,

dave

6. Steve says:

Ahhhhhhhhhhh! I seeeeeeeee! Good man – many thanks for explaining CIDR so clearly. I had no idea what the other pages I read were on about, but now it seems perfectly simple

7. @Steve
My pleasure. Please visit again