18 March, 2023

What Is CIDR? The Concept and How CIDR Works

Quick summary: CIDR (Classless Inter-Domain Routing) is a classless inter-domain routing method introduced in 1993 to improve IP address allocation and slow the exhaustion of IPv4 resources. CIDR lets you combine several IP addresses into a single block, reducing the number of entries in routing tables. This makes network management more flexible and uses address space more efficiently than traditional classful addressing.

What is CIDR? CIDR (full name Classless Inter-Domain Routing) is a method introduced in 1993 to improve the allocation of an IP address and slow the exhaustion of IPv4 address resources. How do CIDR addresses work, and how is CIDR used in networks? Let's look at it in detail in the article below.

What is CIDR?

What is CIDR?

CIDR (Classless Inter-Domain Routing) is one of the methods that supports the allocation and routing of IP addresses. It was introduced in 1993 to overcome the limits of an IP address based on classes and to limit the exhaustion of IPv4 address resources.

Example: A business has 8 class C addresses: 200.100.48.0/24 – 200.100.55.0/24

  • Using a routing table, these take up 8 entries
  • Using CIDR, those 8 addresses can be represented by just 1 address: 200.100.48.0/21.

In a full IPv4 network design, the network prefix is one or more groups of 8 bits, which leads to class A, B and C address blocks. Classless inter-domain routing does not allocate address space to Internet service providers and end users on any address bit boundary.

In IPv6, however, the interface identifier has a fixed size of 64 bits by convention, and smaller subnets are never allocated to end users.

-> See more: Overview of the IPv4 and IPv6 protocols

Pros and cons of CIDR

Advantages

  • Saves IP addresses: CIDR lets you divide IP addresses more efficiently. Instead of the traditional network class system, CIDR lets you use exactly the number of IP addresses each subnet needs. This avoids wasting unused IP addresses and makes better use of IP addresses overall.
  • Flexible network management: CIDR lets you divide a network into CIDR blocks of different sizes. This makes network management more flexible and lets you allocate IP addresses precisely to specific subnets. CIDR also represents IP addresses in a simple, easy-to-use form, so network administrators can configure and maintain the network more easily.
  • Simpler routing tables: Classless Inter-Domain Routing significantly reduces the number of entries in a router's routing table. Instead of a separate route for every IP address, CIDR aggregates IP addresses into CIDR blocks, which lightens the load on the routing system and improves network performance.

Disadvantages of CIDR

  • Possible overlap: When a network is divided into CIDR blocks, the blocks can overlap. Overlapping blocks can cause IP address conflicts and make it hard to send and receive data for the overlapping addresses. Designing and managing a CIDR network takes care to avoid overlap.
  • Complex network design and configuration: Dividing and managing a CIDR network can be more complicated than the traditional classful system. Administrators need specific knowledge and skills to design, configure and maintain a CIDR network correctly and securely.
  • Greater dependence on the routing system: CIDR requires routing support in order to apply CIDR blocks during routing. In other words, a network that uses CIDR needs routers or routing devices that can handle CIDR.

Specific functions of CIDR

Now that you know what CIDR is, let's look at what CIDR does and how it is used. In detail:

  • CIDR provides a supernetting mechanism, which is useful for route aggregation. Supernetting shortens and combines routing information into a single entry, which reduces the size of the router's table and speeds up lookups.
  • CIDR can aggregate classful networks into a larger network. As a result, the number of entries in the routing table goes down while the number of hosts that can be allocated in the network goes up.
  • With CIDR, businesses no longer need to request addresses from a central authority. They request them from their ISP. CIDR then reviews and allocates ranges from the ISP's address block.

To understand how CIDR works, you also need to know about CIDR blocks and CIDR notation, covered next.

What is a CIDR block?

What are CIDR blocks?

CIDR blocks are groups of addresses that share the same prefix and contain the same number of bits. Several connected CIDR blocks can be combined into a larger system that shares a common network prefix, which is what supernetting is. The size of a CIDR block is determined by the length of its prefix:

  • A shorter prefix allows more addresses, so it produces a larger CIDR block.
  • A longer prefix allows fewer addresses and produces a smaller block.

The initial blocks are handled by the number-assignment authority Internet (IANA, the Internet Assigned Numbers Authority). IANA is responsible for distributing large blocks of IP addresses to the Regional Internet Registries (RIRs). These blocks serve large regions such as Africa, North America and Europe.

When an RIR receives a block, it creates smaller blocks to assign to Local Internet Registries (LIRs).

CIDR blocks can be split further until they reach the end user. The size of the block an end user gets depends largely on how many individual addresses they need.

Most end users are assigned blocks by their Internet service providers. Organizations that want an independent block, however, need to go through an ISP to get one from authorities such as an LIR or RIR.

-> See more: Overview of ICANN (Internet Corporation for Assigned Names and Numbers)

What is CIDR notation?

Some IP addresses are reserved for special purposes. For example, the Class B range 192.168.0.0 is fixed and cannot be changed, and it is used to identify private networks. Most home broadband routers assign these network addresses 192.168… to the devices in the home.

CIDR also does not allow a host identifier of all zeros, and it reserves the all-ones identifier to work as a broadcast address: data packets sent to this address are forwarded to every host on the network.

Originally, IP addresses were assigned in the main address classes A to C. Each class takes a different part of the 32-bit IP address to identify the gateway router for the packet: the first 8 bits for Class A, the first 16 for Class B and the first 24 for Class C. The bits not used for the network identifier are available to identify hosts on that network.

In a CIDR IPv4 address, the 32-bit address is split into four groups of 8 bits, each called an octet. The four groups look like this:

  • Binary form: 11000000.10101000.00000000.00000000.
  • Decimal form: 192.168.0.0.

CIDR notation is compact. It gives the network mask for an address by adding the number of network bits after a "/". For example: 192.168.129.23/17 gives you a 17-bit network mask. Internet users can refer to the whole network as A/17 to indicate its size without spelling out the actual network mask.

How does CIDR work?

How Classless Inter-Domain Routing works

CIDR is built on VLSM (Variable Length Subnet MaskSubnet Masking), a technique that lets engineers divide an IP address space into subnets of different sizes. It creates subnets with different numbers of hosts without wasting large numbers of addresses. It defines prefixes of arbitrary length, which makes it more efficient than the earlier system.

In addition,Classless Inter-Domain Routing can also aggregate several standard classful networks into one larger network. This reduces the number of entries in a router's routing table and increases the number of hosts allocated in the network without needing the network ID of a higher class.

A router using CIDR uses the destination address to route a packet toward the gateway destination (network node), and then resolves the address based on what it knows about the details of the supernetwork (supernet). If some routers know routes for different parts of the same supernet, it uses the longest matching network prefix.

Applying CIDR in Internet networks

CIDR has reduced the waste of IPv4 addresses without causing the number of routing table entries to explode. It allows a single routing table entry for a supernet to represent a set of networks, so only the router closest to the actual destination needs to know the detailed routes.

CIDR is now part of the routing system in the core of the Internet, and every ISP can use it. It is supported by the Border Gateway Protocol (BGP), as well as common protocols such as Exterior Gateway Protocol and Open Shortest Path First (OSPF).

CIDR is used when an organization or service provider manages addresses for a large number of hosts or networks. It should use supernetting together with Network Address Translation (NAT) to allocate address ranges in a way that makes traffic handling more efficient.

For example, you can use supernetting to split an internal network into subnets for administrative purposes, so that each department manages its own address space.

How CIDR is used in IPv6

Using CIDR in IPv6

Classless Inter-Domain Routing is used in IPv6 to manage address allocation and routing tables. In IPv6, CIDR works much as it does in IPv4, with a few small differences.

In IPv6, an IP address is a 128-bit address divided into 16-bit blocks called "hextets".

  • CIDR notation in IPv6 uses a slash (/) to give the prefix length of the IPv6 address: For example, if you have an IPv6 network with the address "2001:0DB8:ABCD:1234::/64", the first 64 bits of the address identify the network and the remaining 64 bits identify the devices in the network. With CIDR notation, you only need to specify the number of prefix bits to identify the network.
  • Splitting a network into subnets: If you want to split the network "2001:0DB8:ABCD:1234::/64" into 4 subnets by using the first 66 bits to identify the network, you can use the CIDR notation "2001:0DB8:ABCD:1234::/66" for each subnet.
  • CIDR notation can also identify subnets of a larger network: If you have a larger IPv6 network with the address "2001:0DB8:ABCD::/48" and want to split it into /64 subnets, you can use the CIDR notation "2001:0DB8:ABCD::/64" to identify each subnet.

In short, CIDR notation in IPv6 helps manage IP address allocation and subnetting by specifying the number of prefix bits of the IPv6 address.

Problems that can occur without CIDR

Problems that can occur without CIDR

Before CIDR, IP addresses were usually allocated by class. With this older method, IPv4 addresses were at risk of running out quickly. The routing system had three separate classes: A, B and C. Of these:

  • Class A: More than 16,000,000 host identifiers
  • Class B: About 65,535 host identifiers
  • Class C: About 254 host identifiers

When a business needs more than 254 hosts, it runs into problems. It no longer fits in Class C and falls into Class B instead, so the business has to use a Class B allocation even if it needs far fewer than 65,535 host identifiers.

So a business holding a Class B allocation has to accept wasting a large number of hosts, which significantly reduces the availability of IPv4.

Frequently asked questions

Can CIDR blocks overlap?

Yes. CIDR blocks can overlap when IP addresses are divided and used. When two or more CIDR blocks overlap, IP address conflicts can occur.

This can cause routing problems and make it hard to send and receive data for the overlapping addresses. So when you divide a network into CIDR blocks, make sure the blocks do not overlap.

How do you use IP addresses efficiently with CIDR?

To use IP addresses efficiently with CIDR, use smaller CIDR blocks and allocate only the number of IP addresses each subnet needs. This avoids wasting unused addresses and lets you divide them more flexibly among specific subnets.

Are CIDR and subnetting different?

CIDR and subnetting are related concepts in dividing IP addresses within a network. Classless Inter-Domain Routing is a method of dividing IP addresses without the old classful system, while subnetting is the process of dividing a large network into smaller subnets.

This article by Mona Media We hope this has given you a clearer picture of what CIDR is and how it works. CIDR is a method of allocating addresses and routing IP traffic. It was created to overcome the limits of class-based IP allocation and to slow the exhaustion of IPv4 address resources.

FAQ

What is CIDR notation and how do you read it?
CIDR notation is an IP address followed by a "/" and the number of bits in the network mask. For example, 192.168.129.23/17 means a 17-bit network mask. This notation lets you represent a range of IP addresses compactly instead of listing each address individually.
What is a CIDR block?
A CIDR block is a group of IP addresses that share the same network prefix. The shorter the prefix, the larger the block (more addresses); the longer the prefix, the smaller the block. Combining several CIDR blocks forms Supernetting, which shrinks routing tables.
About The MONA Group: Founded in 2016, with 60+ staff, MONA has delivered 14,000+ projects with an 85% client retention rate. MONA provides website design, full-scope SEO, custom software and AI automation solutions for businesses. Consultation hotline: 1900 636 648. Explore MONA AI Agent suite and MONA SEO services.
MONA has a podcast: listen instead of readingEpisodes on AI, automation & SEO for Vietnamese businesses
Nghe ngay
About the author

CEO & Founder · The MONA

Founder of The MONA, who built a services company of 60+ staff with 14,000+ projects delivered. Khánh Hùng shares how he thinks about building systems that run themselves, automating a business, and the real lessons from delivering projects at MONA.

Views 1,5K
Rate this article 4,6/5 · 9 ratings

Professional website
design services

Own a website with a beautiful, 100% exclusive design and a lifetime warranty, with the ability
to expand features flexibly as your business grows, starting today!

Contact Mona

    MONA có riêng một Người "Bạn Thân" cho bạn - Người Account sẽ đồng hành, hỗ trợ, hướng dẫn, đặt đồ ăn cho bạn mãi mãi, từ đây về sau!
    MONA will never sell your information or send you spam
    The MONA team advising on an online education management system
    Hỏi đáp giáo dục 4.0
    Tạo cuộc hẹn miễn phí với MONA để giải đáp và tư vấn mọi thắc mắc về giải pháp số hoá ngành giáo dục
    Thời lượng cuộc hẹn
    45 Phút
    Ngày và giờ
    Thứ 2, ngày 25 tháng 12, 2023
    [9:30 - 10:15]

      Chọn ngày và giờ
      Khung giờ
      Back
      Hãy cho MONA biết bạn là ai
      0:00