- Classless Inter-Domain Routing (CIDR) is defined as a method to combine numerous IP address ranges into one route or network, also known as supernetting.
- CIDR reduces routing table size and makes more IP addresses available within enterprise networks.
- This article covers the meaning, working, advantages, and disadvantages of CIDR.
Table of Contents
Classless Inter-Domain Routing (CIDR) is a method used to combine numerous IP address ranges into one route or network. Also known as supernetting, it can reduce routing table size and make more IP addresses available within enterprise networks.
Every server, endpoint, and other machine that can connect to the internet has an IP address. This unique number can be used to track the device across the internet. Devices also use IP addresses to locate and communicate with each other.
CIDR is used by enterprises to allocate IP addresses efficiently and flexibly within their networks. Simply put, CIDR is a method used for IP address allocation to enhance the efficiency of data routing on the internet.
Before we dive deeper into how CIDR works, we should understand IP address formats. An IP address has two parts:
- Network address, which is a series of numbers that defines the unique identifier of the network.
- Host address, which is a series of numerical digits that defines the identifier for the host or individual device within the network.
Before the turn of the millennium, IP address allocation would take place using the classful addressing system. The total length of the address was predefined, as was the number of bits allocated to the host and network segments.
What are classful addresses?
An IPv4 address is composed of 32 bits. Each string of numbers separated by the â€˜full stop’ lies between 0 and 255 in numerical form and consists of 8 bits. Under the classful address system, enterprises had the option to purchase from among three classes of IPv4 addresses.
- Class A addresses with 8 network prefix bits (think 188.8.131.52 with 44 as the network address and 0.0.1 as the host address).
- Class B addresses with 16 network prefix bits (think 184.108.40.206 with 128.16 as the network address and 0.2 as the host address).
- Class C addresses with 24 network prefix bits (think 192.168.1.100 with 192.168.1 as the network address and 100 as the host address).
What are classless addresses?
Classless addresses, also known as CIDR, leverage variable length subnet masking (VLSM) to modify the ratio of network and host address bits in internet protocol addresses. Think of a subnet mask as an address that segregates an IP address into network bits (to identify the network) and host bits (to identify the host device operating on that network).
A VLSM sequence enables network admins to convert an IP address space into subnets of differing sizes. Each subnet can feature a flexible host count and a specific number of IP addresses. A CIDR IP address adds a suffix value that states the number of network address prefix bits to a normal IP address. For instance, 192.0.2.0/24 is an IPv4 CIDR address in which 192.0.2 (the first 24 bits) is the network address.
Limitations of classful addressing
Classful IP addressing has two key limitations that CIDR addresses. Before CIDR, these classful address limitations gave rise to inefficiencies.
- Low flexibility in IP addressing
The classful addressing system allowed for each class to support a specific number of devices:
- Class A addresses were capable of supporting 16,777,214 hosts.
- Class B addresses could support 65,534 hosts.
- Class C addresses supported 254 hosts.
This arrangement showed inefficiencies during the allocation of IP addresses and gave rise to the wastage of IP address space. For instance, an enterprise with 275 online devices could not opt for Class C IP addressing since this class only allowed up to 254 devices. Therefore, the enterprise would have had to opt for Class B IP addressing with 65,534 unique host addresses. However, with only 275 devices being connected, 65,259 IP address spaces would have been left unused.
2. Constraints in network design
Classful IP addresses also limited the ability of the user to combine networks as needed. For instance, the IP addresses 192.168.1.0 and 192.168.0.0 belong to different class C networks within the classful architecture. However, since the class C subnet mask was fixed as 255.255.255.0, a network administrator could not combine both networks.
Working of CIDR
CIDR enables network routers to direct data packets to destination devices based on the specified subnet. Rather than the IP address being categorized based on classes, the network and host addresses are retrieved by the routers as directed by the CIDR suffix.
To learn how CIDR works, let’s understand more about CIDR blocks and CIDR notation.
- CIDR blocks
CIDR blocks are collections of IP addresses sharing a single network prefix and the same number of bits. A large block would feature a small suffix and more IP addresses.
The Internet Assigned Numbers Authority (IANA) allocates large CIDR blocks to regional internet registries (RIR). The next step is the RIR allocating smaller blocks to local internet registries (LIR), after which the LIR allocates them for enterprise use. Private users can submit applications for CIDR blocks to their internet service providers (ISPs).
CIDR represents IP addresses in binary. CIDR blocks are a core component of CIDR as they enable address groups to be put together and addressed as a single entity for routing functions. These blocks feature a sequence of bits shared by several IP addresses, known as the prefix. The network portion of the IP addresses is determined by the prefix.
For IPv4, CIDR block identification uses a syntax similar to IPv4 addresses. This syntax includes a dotted-decimal address, such as 192.168.0.0. The address is then followed by a slash and a number between 0 and 32 (e.g., /26). The number added after the slash specifies the prefix length, indicating the number of shared bits in the binary representation of the IP addresses.
CIDR blocks can represent a range of IP addresses. For example, a block with a 20-bit prefix is represented by a /20 CIDR block, and the exact addresses within that block may be different. The address segment in the CIDR notation can be skipped when focusing on network size.
Let’s say a specific IP address is contained within a certain CIDR block. If the initial bits of the address are the same as the CIDR prefix, this address is said to match the CIDR prefix. The number of matching bits determines network size. While shorter CIDR prefixes are a match for more addresses, fewer addresses match longer prefixes.
CIDR blocks are also used for Internet Protocol Version 6 (IPv6) addresses, which feature a greater number of bits. However, the semantics and syntax for IPv6 CIDR blocks are the same as in IPv4. For IPv6, the prefix length can range between 0 and 128, indicating the number of shared bits in the address.
Certain CIDR prefixes have particular uses. For instance, point-to-point links between routers for security and policy applications use /127 prefixes. Subnets generally have a fixed 64-bit host identifier on broadcast MAC layer networks.
CIDR blocks play a fundamental role in IP addressing and routing. They enable efficient management and grouping of IP addresses, simplifying the handling of routing decisions by routers.
CIDR block assignment
CIDR block assignment involves numerous steps, and several organizations work together to allocate IP addresses efficiently.
Here’s how the CIDR block assignment takes place:
Internet Assigned Numbers Authority (IANA)
IANA is responsible for allocating large, short-prefix CIDR blocks to regional internet registries. The largest block that IANA can allocate is /8, which contains over 16 million addresses.
2. Regional internet registries (RIR)
RIRs such as the European RIPE NCC or North American ARIN receive CIDR blocks from IANA. Specific RIRs are responsible for particular geographies and manage IP address allocation within their regions. RIRs further divide the large CIDR blocks that IANA allocates to them and assign smaller subnets to local internet registries.
3. Local internet registries (LIR)
RIRs allocate subnets to LIRs, which then distribute IP addresses to end-use networks in their respective local areas. Subnet size is decided based on projected short-term network needs.
4. ISPs and end-use networks
Networks served by a single internet service provider generally benefit from obtaining IP address space directly from their respective ISP. However, if a network is served by multiple ISPs, it can request allocation of provider-independent address space directly from their respective RIR.
CIDR blocks in IPv4
Network administrators use CIDR for the efficient allocation and management of IP addresses. With CIDR, it is easy to ensure that IP addresses are used effectively while supporting network and broadcast addresses within each subnet.
This is how CIDR works in IPv4.
CIDR uses subnets to represent IP address groupings. All bits in the host identifier are â€˜zeros’ in the first subnet address. This is reserved to refer to the network itself. The last address contains â€˜ones’ for all the bits in the host identifier. This serves as a broadcast address for the network. Therefore, individual hosts cannot access these two addresses in each subnet, decreasing the number of usable addresses.
For instance, in a /24 subnet with 24 bits being used for the network portion, the network itself is represented by the first address (which ends in .0), and the broadcast address is the last address (which ends in .255). Except for these two addresses, all addresses are available for hosts.
To increase the efficiency of address space usage, CIDR supports smaller subnets such as /31 and /32. However, these subnets would generally not provide usable host addresses due to the reserved network and broadcast addresses.
RFC 3021 specifies an exception that enables using/31 subnets for point-to-point links (for instance, linking two routers). In these subnets, only two addresses are available, one for each end of the link.
In subnets larger than /31 or /32, the available host addresses are further reduced by two, with the largest address reserved as the broadcast address and the smallest address used to identify the network. Note that /32 addresses, which represent a single-host network, need explicit routing rules for access as it is impossible to provide a gateway in such a small network.
CIDR blocks in IPv6
By leveraging CIDR in IPv6, network administrators can increase the efficiency of managing and allocating IP addresses. This can help ensure that the large address space that IPv6 features is used effectively while the different needs of varying network links are accommodated.
This is how CIDR works in IPv6.
IPv6 features a 128-bit unique identifier that enables it to support 1,028 times more IP addresses than IPv4. An IPv6 address contains 8 sets of hexadecimal values demarcated by colons. This enables a much larger set of unique addresses.
Like in IPv4, IPv6 uses CIDR to aggregate addresses with prefixes having varying lengths. For instance, in the IPv6 CIDR address 2001:0db8:/32, the network address is represented by the first 32 bits (2001:db8).
CIDR in IPv6 allows for global route summarization, ensuring sufficient address pools and efficient routing. In IPv6 networks, the standard subnet size is generally a /64 block. This subnet size is important for stateless address autoconfiguration, which enables devices to configure their own IPv6 addresses without human intervention.
Initially, users would follow the recommended practice of allocating a /48 address block for every end site. With time, however, more flexible allocation recommendations started to be followed, and smaller allocations, such as a /56 block for home networks, came into practice.
Represented by the subnet mask, the subnet size determines the division between the interface identifier and the network identifier prefix. By selecting a smaller prefix size, users can decrease the number of covered networks while providing more addresses inside each network.
2. CIDR notation
A CIDR notation makes IP address representation simple and enhances the efficiency with which network administrators can organize and allocate IP addresses. The CIDR notation represents an IP address along with a suffix indicating network identifier bits in a particular format. For instance, 192.168.1.0 using a 22-bit network identifier can be expressed as 192.168.1.0/22.
Simply put, CIDR notation allows users to understand IP addresses and network masks more easily. Created by Phil Karn in the 1980s, the format used for CIDR notation consists of the IP address, a â€˜forward slash’ character, and a number representing the count of consecutive â€˜1-bits’ in the network mask (also known as the network prefix). The IP address in CIDR notation follows the standards for either IPv4 or IPv6, while the number after the slash signifies the number of bits used to identify the network.
A CIDR notation can signify a specific address on a device or even the starting address of an entire network. For instance, an IP address 10.0.0.1 with a network prefix of 8 bits is represented by 10.0.0.1/8, while 10.0.0.0/8 can be used to indicate the beginning address for the whole network. A CIDR notation without an IP address can be used to signify a generic IPv4 network; for instance, a network with a 24-bit prefix and 8-bit host numbers can be signified using â€˜/24′.
Here are a few examples that will help you understand CIDR notation better:
- The 1024 IPv4 addresses from 198.51.100.0 to 220.127.116.11 are represented by the IPv4 block 198.51.100.0/22.
- The block of IPv6 addresses from 2001:db8:0:0:0:0:0:0 to 2001:db8:0:ffff:ffff:ffff:ffff:ffff is represented by IPv6 block 2001:db8::/48.
- The IPv6 loopback address is represented by ::1/128. Here, the prefix length (number of bits in the address) is 128.
After CIDR’s introduction, CIDR notation gained popularity for IPv4. Network administrators found it easier to understand and compute the network prefix using a single number, such as 18.104.22.168/22, than the older dotted-decimal subnet mask format.
The formula 2^(address length â€“ prefix length) can be used to compute the number of addresses in a network or subnet. For instance, an IPv4 prefix length of /29 would have 2^(32-29) = 2^3 = 8 addresses within the subnet.
CIDR offers several benefits and some drawbacks, which are listed below.
CIDR Benefits and Drawbacks
Benefits of CIDR
With CIDR, enterprises enjoy greater flexibility in assigning IP addresses and routing data between devices.
- Decreased IP address space wastage
CIDR provides users flexibility while determining the network assignment and host identifier on an IP address. CIDR can be used to provision the needed number of IP addresses for a specific network and thus decrease wastage. Apart from this, CIDR minimizes routing table entries and streamlines data packet routing.
2. Swift data transmission
CIDR enables routers to classify IP addresses into several subnets efficiently. Enterprises can also swiftly create and group numerous subnets together. As such, data can be transmitted to its destination address without deviating from unnecessary paths.
3. VPC creation
A virtual private cloud (VPC) is a digital space with controlled access hosted within a cloud environment. VPCs enable enterprises to provision workloads within secure, isolated environments. In the case of VPCs, CIDR IP addresses are used during the transfer of data packets among connected devices.
4. Flexible supernet deployment
A supernet is a collection of subnets that share similarities in network prefixes. CIDR allows for the flexible creation of supernets, which is not possible through conventional masking architecture. For instance, an enterprise could combine IP addresses into a single network block through a notation such as:
A subnet mask of 255.255.254.0 is applied to the IP address through this notation. Thus, the first 23 bits are returned as the network address. The router would require only a single routing table entry for data packet management between devices on the subnets.
Drawbacks of CIDR
While CIDR brings numerous advantages to IP address management, it is not without its limitations and potential challenges.
Implementing and managing CIDR is generally more complex than traditional class-based addressing. Often, it requires additional training and experience among network administrators.
Certain older network devices are incompatible with CIDR. In larger networks, this could translate to difficulties and additional costs when transitioning to a CIDR-powered network.
Without the right expertise, CIDR might increase the difficulty of implementing security measures such as access control lists and firewall rules. This has the potential to increase cybersecurity risks at the enterprise level.
CIDR is a method of IP address allocation that comes with several benefits over classful addressing. For instance, by allocating IP addresses based on user requirements, CIDR minimizes the wastage of address space and enhances efficient utilization.
CIDR uses blocks of continuous IP addresses, represented in CIDR notation with a prefix appended to the IP address. This prefix indicates the number of network bits. Additionally, CIDR supports Variable-Length Subnet Masking (VLSM), thus supporting more precise network prefix specifications.
CIDR grants users flexibility by offering support for prefixes of any length. This also makes it a powerful addressing method. Besides, CIDR notation decreases the size of routing tables, making IP address space management more effective.
However, CIDR has some disadvantages. This means that while CIDR is a useful and efficient IP address allocation and routing method, it may not be suitable for all kinds of networks. Network administrators need to consider the pros and cons of CIDR and compute the specific requirements of their networks before choosing to implement it.
Did this article help you understand more about Classless Inter-Domain Routing (CIDR)? Share your thoughts on FacebookOpens a new window , TwitterOpens a new window , or LinkedInOpens a new window ! We’d love to hear from you.
Image Source: Shutterstock
MORE ON NETWORKING
- What Is Remote Desktop Protocol (RDP)? Meaning, Working, Benefits, and Challenges
- What Is User Datagram Protocol (UDP)? Definition, Working, Applications, and Best Practices for 2022
- What Is SD-WAN (Software-Defined WAN)? Definition, Solutions, and Benefits
- What Is MPLS (Multi-Protocol Label Switching)? Definition, Working, and Architecture
- What is DHCP (Dynamic Host Configuration Protocol)? Meaning, Working, and Features