CIDR Cheatsheet: An Introduction to Classless Inter-Domain Routing

CIDR Cheatsheet

0 Comment

6 mins Read

CIDR Cheatsheet

Any device that is connected to the Internet needs an IP address. Similar to how a house address differentiates your house from the other houses on the street, an IP address is a unique address that differentiates your device from other devices connected to your network. 

That said, IPv4, which is the current version of IP address that’s used by most of the world, is running out of unique IP addresses. One of the ways of combatting this issue was the implementation of CIDR or Classless Inter-Domain Routing. 

However, to efficiently manage a network, network administrators need a reference to see the number of hosts, subnet mask, and range of IP addresses available for a given CIDR block. 

That’s why, in this article, I’ll include a CIDR cheatsheet and answer the question, “What does CIDR mean?”, the ins and outs of IPv4 CIDR and IPv6 CIDR, and what a CIDR notation range is. 

What Does CIDR Mean?

CIDR, or Classless Inter-Domain Routing, is an IP address allocation system developed in 1993 that addresses the previous system’s inefficiencies. Before implementing CIDR, the Internet relied on a class-based system of IP allocation. 

Basically, there were three classes of IP addresses that differed based on the number of available IP addresses available for that network. The class blocks were as follows:

  • Class A: Used for very large organizations and networks with a maximum of over 16 million IP addresses per network.
  • Class B: Used for medium-sized networks with up to 65,534 available unique IP addresses.
  • Class C: Used for small networks with only 254 unique IP addresses.

While this system worked for the time, it was hugely inefficient since the difference between the number of IP addresses available for each network was too high. This led to many instances where, for example, an organization or network that needed 300 IP addresses couldn’t use a Class C block since it only had 254 unique IP addresses, forcing the IP registry to allocate a Class B block.

This meant that an organization that only required 300 IP addresses was allocated 65,534 IP addresses. As I mentioned earlier, this worked for the time since the number of unique IPv4 addresses available (around 4.3 billion) far outnumbered the number of IP addresses that were going to be used. For example, in 1993, the entire population was only around 5.6 billion people, with only 15 million people connected to the Internet.

However, as the years passed and more and more users started to connect to the Internet, IPv4 addresses started to run out, leading to the development of CIDR. CIDR completely removed the rigid structure of classes and introduced Variable-Length Subnet Masking or VLSM.

This system allowed network administrators to allocate however many IP addresses they required rather than a choice of 254, over 65,000, or over 16 million. But how does CIDR work? How does IPv4 CIDR differ from IPv6 CIDR? And how can you use a CIDR cheatsheet to configure your network easily?

CIDR Notation Range 

CIDR Notation helps network administrators understand how many devices can connect to a network and how the IP addresses are organized. But before we decrypt a CIDR notation let’s talk about what each number in an IP address means.

In IPv4, the address contains 32 bits. This means 32 variables can be 0 and 1, which leads to 2^32 (around 4.3 billion) unique IP addresses. So, let’s say a CIDR notation range for IPv4 CIDR is as follows: 192.168.1.0/24.

The /24 at the end of that address means that there are 24 bits reserved for the network, with the remaining 8 bits used for hosts. Those first 24 bits represent your network, with the remaining 8 bits being variables that can be used for your devices. This translates into 2^8 addresses or 256 total IP addresses. Of those 256, two addresses are reserved for network and broadcast, leaving 254 usable IP addresses for devices to connect to this network. 

In other words, the first 2^24 bits represent the country, state, city, and street portion of your home address. The rest of the eight bits are like the house numbers for individual homes on that street.

The CIDR notation range for IPv4 can range from /0 to /32, with /0 CIDR typically used for firewalls and internet gateways and /32 for specifying a single IP address and VPN configurations. Everything between those two numbers can be used for various purposes and networks, from small-case uses like home networks to large-scale uses like enterprises and large organizations.

You can check out the CIDR cheatsheet at the end of this article for a detailed look at the exact number of available host and network IPs in any given IPv4 CIDR.

In IPv6, the address contains 128 bits, meaning there are 2^128 or 340 undecillion (34 with 37 zeros behind it). Despite the ridiculously large number of available IP addresses, CIDR is still used for efficient IP allocation. 

An example of a CIDR notation range for IPv6 CIDR is as follows: 2001:db8::/64

Similar to IPv4 CIDR, the /64 means that the first 64 bits are used for the network. In this network, the rest of the 64 bits are for host addresses. This means that 2^64 or around 18 quintillion (18 with 18 zeros behind it) unique IP addresses are available for hosts (devices). 

Unlike IPv4, IPv6 uses multicast rather than broadcast, so rather than the two that would be unavailable for device use in IPv4, in IPv6, only one is used for non-host use, which is the network address.

You can check out the CIDR cheatsheet at the end of this article for a detailed look at the exact number of available host and network IPs in any given IPv6 CIDR.

IPv6 is the future of the Internet, and if you want to stay ahead of the curve, Cloudzy offers the best, most affordable IPv6 VPS deal available. With our IPv6 VPS, you also get a /64 subnet for free; that means an IP address pool of 18,446,744,073,709,551,616 IPv6 addresses that are uniquely yours! 

If you’re worried about compatibility, you can add IPv4 to make your IPv6 VPS dual-stacked for only a dollar a month. You can check out Cloudzy’s IPv6 VPS rates here!

Subnetting In CIDR 

One of the key benefits of IPv4 CIDR and IPv6 CIDR is the ability to subnet and break down CIDR blocks. This allows network administrators to isolate and manage different segments of a CIDR block. 

To allocate more or fewer bits for network and host portions of the address, you simply have to adjust the prefix length. Here is an example of subnetting an IPv4 CIDR:

The address 192.168.1.0/24 can be divided into two smaller subnets: 

  • 192.168.1.0/25: A subnet with 128 IP addresses.
  • 192.168.1.128/25: A second subnet with 128 addresses.

With this setup, you can split a 256-address network into two 128-address networks, enhancing security, network performance, and management. This is done so that sensitive systems, such as the financial department, can be placed on a separate subnet, restricting access to only authorized employees or devices. 

By isolating traffic this way, performance improves by reducing congestion, as data flows more efficiently within each subnet without unnecessary interactions. Additionally, subnetting simplifies network management by allowing independent troubleshooting and maintenance in each subnet without disrupting the entire network.

Subnetting IPv6 CIDR is especially important as there are a large number of available IP addresses in typical /64-CIDR setups. Let’s say you have a typical /64 IPv6 network such as 2001:db8:abcd:1000::/64; if we borrow, for instance, 4 bits from the network portion, we can divide our network into 16 subnets, which leads to the following changes:

  • Original subnet: 2001:db8:abcd:1000::/64
  • New subnet: /68
  • Number of subnets: 2^(bits borrowed from network)= 2^4=16 subnets
  • First subnet: 2001:db8:abcd:1000:0000::/68
  • Second subnet: 2001:db8:abcd:1000:1000::/68
  • Third subnet: 2001:db8:abcd:1000:2000::/68
  • … up to 2001:db8:abcd:1000:f000::/68
  • 2001:db8:abcd:1000: The first 64 bits define the global routing prefix.
  • 0000 – f000: The next 4 bits are used for subnetting.
  • Host Portion: The remaining 60 bits are used for host addresses. (The remaining “::” which shows three 16-bit blocks)

Each /68 subnet has 2^60 = 1.15 quintillion possible host addresses. 

If you’re still unsure about how you want to split up your network, I’ve provided a CIDR subnetting cheat sheet at the end of this article post.

CIDR Cheatsheet

Calculating the number of available IP addresses in a given IPv4 CIDR and IPv6 CIDR can be quite tricky and tasking if done manually and without a CIDR cheatsheet, especially with IPv6, as there are billions, quintillions, and even more IP addresses. 

If you’re interested in how a CIDR notation range is calculated, here is the following for CIDR notation for IPv4 CIDR and CIDR IPv6:

For IPv4:

  • Number of addresses= 2^(32-prefix length)
  • For example, a /24 CIDR block has: 2^(32-24)= 2^8= 256 IP addresses

For IPv6:

  • Number of addresses= 2^(128-prefix length)
  • For example, a /64 CIDR block has: 2^(128-64)= 2^64= around 18 quintillion (18 with 18 zeros behind it) IP addresses

As you can see, the numbers can get quite ridiculous without a CIDR cheatsheet, so to avoid the hassle of calculating, HERE’s a complete CIDR cheatsheet that not only covers CIDR but everything you need to know about IPv4, IPv6, and subnetting.

Final Thoughts

Without CIDR, we would’ve run out of IPv4 addresses decades ago and faced many IP allocation issues with IPv6 today, as well. Hopefully, our CIDR cheat sheet can help you fully configure your network without a hitch!

FAQs

What does CIDR mean?

CIDR, or Classless Inter-Domain Routing, is an IP address allocation system developed in 1993 that addresses the previous system’s inefficiencies. CIDR completely removed the rigid structure of classes and introduced variable-length subnet masking or VLSM. This system allowed network administrators to allocate however many IP addresses they required rather than a choice of 254, over 65,000, or over 16 million.

What is a CIDR notation range?

CIDR notation is used to represent IP addresses and their associated network prefixes. It looks something like this: 192.168.1.0/24. The IP address (192.168.1.0) is followed by a slash (“/”) and a number (24), which shows how many bits of the IP address are reserved for the network prefix. The remainder of the bits are used to identify individual devices (hosts) on the network.

Is there a CIDR cheat sheet for CIDR?

Yes! Calculating the number of IP addresses available for IPv4 CIDR and especially for IPv6 CIDR is a hassle and a half; that’s why I’ve compiled a complete CIDR cheat sheet that covers everything from CIDR and subnetting to IPv4 and IPv6 commands here.

Your friendly neighborhood writer guiding you through the sea of tech and cloud.

Comments

Leave a Comment

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


Latest Posts