IT TECHOLOGY

⌘K
  1. Home
  2. Docs
  3. IT TECHOLOGY
  4. NETWORKING
  5. DEFINITIONS

DEFINITIONS

Imagine you and your friends are planning to have a big party in your backyard. You need to make sure you have enough space for everyone to sit comfortably.

CIDR stands for Classless Inter-Domain Routing, and it’s like a way to divide up the available space in your backyard so you can plan for your party.

CIDR uses a series of numbers to represent an address range, just like how you might use numbers to represent the length and width of your backyard. For example, if you have a backyard that’s 50 feet wide and 100 feet long, you might say the address range is from 0 feet to 50 feet on the width, and from 0 feet to 100 feet on the length.

Similarly, in CIDR, we use a series of numbers to represent an address range. For example, an IP address range might be represented as 192.168.0.0/24. The number after the slash (/) tells us how many bits in the IP address are used to represent the network part of the address. In this example, the first 24 bits are used to represent the network, and the remaining 8 bits are used to represent individual hosts on the network.

Think of CIDR like a way to divide up your backyard into smaller sections, so you can plan for your party more effectively. By dividing up the address space into smaller ranges, CIDR allows us to more efficiently manage and allocate IP addresses in a network.

https://www.keycdn.com/support/what-is-cidr

CIDR, which stands for Classless Inter-Domain Routing, is an IP addressing scheme that improves the allocation of IP addresses. It replaces the old system based on classes A, B, and C. This scheme also helped greatly extend the life of IPv4 as well as slow the growth of routing tables.

In this article, we’ll explore how CIDR actually works, as well as provide examples to better demonstrate the concepts explained.

Problems with class-based IP addressing#

The old method of IP addressing came with inefficiencies that exhausted the availability of IPv4 addresses faster than it needed to. The classful routing system included classes A, B, and C:

  • Class A – Over 16 million host identifiers
  • Class B – 65,535 host identifiers
  • Class C – 254 host identifiers

The problem would commonly occur when an organization required more than 254 host machines and therefore would no longer fall into class C but rather class B. This means that the organization would use a class B license even though they had far less than 65,535 hosts. Therefore if an organization only required 2,500 hosts, they would be wasting about 63,000 hosts by holding a class B license which would greatly decrease the availability of IPv4 addresses unnecessarily.

How does CIDR work?#

CIDR is based on variable-length subnet masking (VLSM). This allows it to define prefixes of arbitrary lengths making it much more efficient than the old system. CIDR IP addresses are composed of two sets of numbers. The network address is written as a prefix, like you would see a normal IP address (e.g. 192.255.255.255). The second part is the suffix which indicates how many bits are in the entire address (e.g. /12). Putting it together, a CIDR IP address would look like the following:

192.255.255.255/12

The network prefix is also specified as part of the IP address. This varies depending upon the number of bits required. Therefore, taking the example above, we can say that the first 12 bits are the network part of the address while the last 20 bits are for host addresses.

Wikipedia’s IPv4 CIDR blocks table below provides a good overview of how varying address formats render a different number of addresses. Formats are also categorized by typical uses.

CIDR example#

We’ve already covered what a CIDR IP address looks like, now let’s go over a couple of examples that break down their formatting. The CIDR Calculation tool is great if you want to easily determine what IP range a particular CIDR address equates to. Simply enter the CIDR address into the tool and click Calculate. This will return information such as the first IP, last IP, number of hosts and more.

Similarly, you can also convert an IP range to a CIDR. For example, let’s say you wanted the CIDR notation for IP ranges between 192.0.0.0 and 192.0.0.255. You would simply plug these two numbers into the IP Range to CIDR tool and have it return the corresponding CIDR address.

CIDR LengthMask# of Networks#  of Hosts
/1128.0.0.0128 A2,147,483,392
/2192.0.0.064 A1,073,741,696
/3224.0.0.032 A536,870,848
/4240.0.0.016 A268,435,424
/5248.0.0.08 A134,217,712
/6252.0.0.04 A67,108,856
/7254.0.0.02 A33,554,428
/8255.0.0.01 A16,777,214
/9255.128.0.0128 B8,388,352
/10255.192.0.064 B4,194,176
/11255.224.0.032 B2,097,088
/12255.240.0.016 B1,048,544
/13255.248.0.08 B524,272
/14255.252.0.04 B262,136
/15255.254.0.02 B131,068
/16255.255.0.01 B65,024
/17255.255.128.0128 C32,512
/18255.255.192.064 C16,256
/19255.255.224.032 C8,128
/20255.255.240.016 C4,064
/21255.255.248.08 C2,032
/22255.255.252.04 C1,016
/23255.255.254.02 C508
/24255.255.255.01 C254
/25255.255.255.1282 subnets124
/26255.255.255.1924 subnets62
/27255.255.255.2248 subnets30
/28255.255.255.24016 subnets14
/29255.255.255.24832 subnets6
/30255.255.255.25264 subnets2
/31255.255.255.254nonenone
/32255.255.255.255none1

Summary#

CIDR is a great way to improve the efficiency of IP address distribution. It was vital with IPv4 as IP addresses were quickly being exhausted. IPv6 is now rolling out and although running out of IP address is now less of a problem, CIDR will continue to be used. Read our IPv6 tutorial guide to learn more about what differences exist in the newest version of the Internet Protocol.

Articles

How can we help?