fbpx

As a network engineer, administrator, or Site Reliability Engineer (SRE) you probably have run across CIDR notation for defining IPv4 address spaces for both networks and subnets. CIDR notation is used a lot in the IT infrastructure configuration world. The following is a description of what CIDR notation is, in case you’re not that familiar, as well as a helpful CIDR range calculator and reference table. I hope these resources prove useful for you when defining CIDR ranges for your networks and subnets.

What is Classless Inter-Domain Routing?

Classless Inter-Domain Routing, often abbreviated as CIDR, is a method used in IP (Internet Protocol) addressing and routing to efficiently allocate and manage IP addresses. It replaced the older class-based addressing system (Class A, Class B, and Class C) and provides a more flexible way to allocate and subnet IP addresses.

CIDR allows for a more precise allocation of IP addresses by using a prefix length notation. In this notation, an IP address is followed by a forward slash (“/”) and a number, which represents the number of bits in the network portion of the address. For example, in the CIDR notation “192.168.1.0/24,” the “/24” indicates that the first 24 bits of the IP address are the network portion, and the remaining 8 bits are used for host addresses.

Key points about CIDR:

  1. Subnetting: CIDR allows network administrators to create subnets of varying sizes, depending on their specific needs. This flexibility is crucial for optimizing IP address allocation and routing within a network.
  2. Efficient IP address allocation: With CIDR, organizations can allocate IP addresses more efficiently, reducing IP address wastage. This is particularly important as IPv4 addresses have become increasingly scarce.
  3. Routing: CIDR simplifies routing by aggregating IP address blocks into larger blocks, reducing the size of routing tables and making internet routing more efficient.
  4. Variable-length prefixes: CIDR allows for variable-length prefixes, meaning that IP address blocks don’t have to conform to strict class boundaries. This results in more efficient utilization of the IP address space.
  5. CIDR notation: CIDR notation is used to represent IP address blocks with prefix lengths, making it easier to understand and manage IP address assignments and routing configurations.

CIDR has played a crucial role in extending the life of IPv4, which was initially designed with a limited number of addresses. It has also been incorporated into IPv6, the next-generation Internet Protocol, to provide similar flexibility in addressing and routing within IPv6 networks.

What is CIDR IPv4 Address Range Notation?

CIDR stands for “Classless Inter-Domain Routing”, and is the method used for assigning IP addresses and routing Internet traffic. IPv4 CIDR notation, specifically, is a way of representing a range of IP addresses in a concise and standardized format. CIDR notation is commonly used by network engineers, administrators, and Site Reliability Engineers (SRE) to manage IP addresses and create subnets.

CIDR notation is a flexible and efficient allocation of IP addresses by allowing the use of variable-length subnet masks. The network portion and the host portion of an IP address are not fixed, but can be specified by a number known as the CIDR prefix.

The CIDR prefix is written as a slash followed by a number between 0 (zero) and 32. The number represents the number of network bits in the subnet mask, and is used to determine the range of IP addresses that belong to the network. For example, the CIDR prefix of /24 indicates that the first 24 bits of the IP address represent the network address, while the remaining 8 bits represents the host address.

To calculate the CIDR prefix for a given IP address range, you need to count the number of leading 1 bits in the binary representation of the subnet mask. For example, the subnet mask of 255.255.255.0 (in dotted decimal notation) has 24 leading 1 bits, so its CIDR prefix is /24.

If this sounds a little difficult for you to calculate, then the following calculator and reference table for IPv4 CIDR notations should prove useful.

Calculate Start/End IPv4 Addresses for CIDR Range

When calculating the CIDR range of IPv4 IP addresses, it can be difficult to figure out the full range of IP Addresses that are included within the CIDR range. At least if you aren’t familiar with the binary math needed to calculate it. For this reason, I’ve included the following calculator that allows you to enter the CIDR range, click “Calculate”, then it will display the Starting IP Address and Ending IP Address of the CIDR range entered.




IPv4 Address CIDR Range Reference Table

Some times it can be difficult to remember how many IP addresses are in each of the CIDR ranges that can be defined. These range from a /0 with the entire IPv4 address space, down to a /32 that only includes a single IP address in the range.

The following table lists out all the CIDR ranges with the number of IPv4 address within that range:

CIDR RangeAddress MaskIP Address Count
/00.0.0.04,294,967,296
(entire IPv4 address space)
/1128.0.0.02,147,483,648
/2192.0.0.01,073,741,824
/3224.0.0.0536,870,912
/4240.0.0.0268,435,456
/5248.0.0.0134,217,728
/6252.0.0.067,108,864
/7254.0.0.033,554,432
/8255.0.0.016,777,216
/9255.128.0.08,388,608
/10255.192.0.04,194,304
/11255.224.0.02,097,152
/12255.240.0.01,048,576
/13255.248.0.0524,288
/14255.252.0.0262,144
/15255.254.0.0131,072
/16255.255.0.065,536
/17255.255.128.032,768
/18255.255.192.016,384
/19255.255.224.08,192
/20255.255.240.04,096
/21255.255.248.02,048
/22255.255.252.01,024
/23255.255.254.0512
/24255.255.255.0256
/25255.255.255.128128
/26255.255.255.19264
/27255.255.255.22432
/28255.255.255.24016
/29255.255.255.2488
/30255.255.255.2524
/31255.255.255.2542
/32255.255.255.2551

Note: The IP address count column shows the total number of IP addresses within each CIDR range, including the network address and broadcast address.

Microsoft MVP

Chris Pietschmann is a Microsoft MVP, HashiCorp Ambassador, and Microsoft Certified Trainer (MCT) with 20+ years of experience designing and building Cloud & Enterprise systems. He has worked with companies of all sizes from startups to large enterprises. He has a passion for technology and sharing what he learns with others to help enable them to learn faster and be more productive.
HashiCorp Ambassador Microsoft Certified Trainer (MCT) Microsoft Certified: Azure Solutions Architect

Discover more from Build5Nines

Subscribe now to keep reading and get access to the full archive.

Continue reading