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.
Table of Contents
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:
- 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.
- 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.
- Routing: CIDR simplifies routing by aggregating IP address blocks into larger blocks, reducing the size of routing tables and making internet routing more efficient.
- 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.
- 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
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 Range||Address Mask||IP Address Count|
(entire IPv4 address space)
Note: The IP address count column shows the total number of IP addresses within each CIDR range, including the network address and broadcast address.