The Wayback Machine - https://web.archive.org/web/20240717025359/https://www.geeksforgeeks.org/classless-inter-domain-routing-cidr/
Open In App

Classless Inter Domain Routing (CIDR)

Last Updated : 07 Nov, 2023
Improve
Suggest changes
Post a comment
Like Article
Like
Save
Share
Report

Classless Inter-Domain Routing (CIDR) is a method of IP address allocation and IP routing that allows for more efficient use of IP addresses. CIDR is based on the idea that IP addresses can be allocated and routed based on their network prefix rather than their class, which was the traditional way of IP address allocation.

CIDR addresses are represented using a slash notation, which specifies the number of bits in the network prefix. For example, an IP address of 192.168.1.0 with a prefix length of 24 would be represented as 192.168.1.0/24. This notation indicates that the first 24 bits of the IP address are the network prefix and the remaining 8 bits are the host identifier.

Several Advantages of the Traditional Class-Based Addressing System of CIDR

  • Efficient use of IP addresses: CIDR allows for more efficient use of IP addresses by allowing the allocation of IP addresses based on their network prefix rather than their class.
  • Flexibility: CIDR allows for more flexible IP address allocation, as it allows for the allocation of arbitrary-sized blocks of IP addresses.
    Better routing: CIDR allows for better routing of IP traffic, as it allows routers to aggregate IP addresses based on their network prefix, reducing the size of routing tables.
  • Reduced administrative overhead: CIDR reduces administrative overhead by allowing for the allocation and routing of IP addresses in a more efficient and flexible way.
  • In summary, CIDR is a method of IP address allocation and routing that allows for more efficient use of IP addresses and better routing of IP traffic. It has several advantages over the traditional class-based addressing system, including greater flexibility, better routing, and reduced administrative overhead.

As with any technology or system, there are advantages and disadvantages of using CIDR:

Advantages of CIDR

  • Efficient use of IP addresses: CIDR allows for more efficient use of IP addresses, which is important as the pool of available IPv4 addresses continues to shrink.
  • Flexibility: CIDR allows for more flexible allocation of IP addresses, which can be important for organizations with complex network requirements.
  • Better routing: CIDR allows for more efficient routing of IP traffic, which can lead to better network performance. Reduced administrative overhead: CIDR reduces administrative overhead by allowing for easier management of IP addresses and routing.

Disadvantages of CIDR

  • Complexity: CIDR can be more complex to implement and manage than traditional class-based addressing, which can require additional training and expertise.
  • Compatibility issues: Some older network devices may not be compatible with CIDR, which can make it difficult to transition to a CIDR-based network.
  • Security concerns: CIDR can make it more difficult to implement security measures such as firewall rules and access control lists, which can increase security risks.
  • Overall, CIDR is a useful and efficient method of IP address allocation and routing, but it may not be suitable for all organizations or networks. It is important to weigh the advantages and disadvantages of CIDR and consider the specific needs and requirements of your network before implementing CIDR.

As we have already learned about Classful Addressing, so in this article, we are going to learn about Classless Inter-Domain Routing. which is also known as Classless addressing. In Classful addressing the no of Hosts within a network always remains the same depending upon the class of the Network.

Class A network contains 224(IP addresses) or 224 - 2 Hosts,
Class B network contains 216(IP addresses) or 216 - 2 Hosts,
Class C network contains 28(IP addresses) or 28 - 2 Hosts

Now, let’s suppose an Organization requires 214 hosts, then it must have to purchase a Class B network. In this case, 49150 Hosts will be wasted. This is the major drawback of Classful Addressing. In order to reduce the wastage of IP addresses a new concept of Classless Inter-Domain Routing is introduced. Nowadays IANA is using this technique to provide IP addresses. Whenever any user asks for IP addresses, IANA is going to assign that many IP addresses to the User. 32 Bit Address 

Representation: It is as also a 32-bit address, which includes a special number that represents the number of bits that are present in the Block Id.

 a . b . c . d / n 

Where n is the number of bits that are present in Block Id / Network Id.

Example:

20.10.50.100/20 

Rules for forming CIDR Blocks:

All IP addresses must be contiguous.

Block size must be the power of 2 (2n). If the size of the block is the power of 2, then it will be easy to divide the Network. Finding out the Block Id is very easy if the block size is of the power of 2.

Example: If the Block size is 25 then, Host Id will contain 5 bits and Network will contain 32 – 5 = 27 bits. 
CIDR Block

First IP address of the Block must be evenly divisible by the size of the block. in simple words, the least significant part should always start with zeroes in Host Id. Since all the least significant bits of Host Id is zero, then we can use it as Block Id part.

Example: Check whether 100.1.2.32 to 100.1.2.47 is a valid IP address block or not?

  • All the IP addresses are contiguous.
  • Total number of IP addresses in the Block = 16 = 24.
  • 1st IP address: 100.1.2.00100000 Since, Host Id will contains last 4 bits and all the least significant 4 bits are zero. Hence, first IP address is evenly divisible by the size of the block.

All three rules are followed by this Block. Hence, it is a valid IP address block.

FAQs On Classless Inter Domain Routing (CIDR)

Q.1: What is CIDR (Classless Inter-Domain Routing)?

Answer:

CIDR, or Classless Inter-Domain Routing, is a networking technique introduced to overcome the limitations of the traditional IP addressing system, which was based on classes. CIDR allows more flexible allocation of IP addresses by eliminating the strict class-based divisions.

Q.2: What problem does CIDR solve?

Answer:

CIDR solves the problem of IP address exhaustion and inefficient address allocation. With the growth of the internet, the original IP address classes (Class A, B, and C) led to wastage of IP addresses due to their fixed size. CIDR enables the allocation of variable-sized blocks of IP addresses, improving address space utilization.

Q.3: How does CIDR differ from traditional IP addressing?

Answer:

Traditional IP addressing used classes with fixed address ranges (e.g., Class A: 1.0.0.0 to 126.0.0.0). CIDR uses a format that combines an IP address and a prefix length to denote the network and subnet portion (e.g., 192.168.1.0/24).



Previous Article
Next Article

Similar Reads

Difference between Classful Routing and Classless Routing
Classful Routing: Classful Routing does not import subnet mask. And in this also subnet mask is provided after the route update. In classful routing, subnet mask is same throughout, does not vary for all devices, we can see it in the given picture. In classful routing, VLSM (Variable Length Subnet Mask) is not supported and also CIDR (Classless Int
2 min read
Inter VLAN Routing by Layer 3 Switch
Prerequisite - Access and trunk ports Normally, Routers are used to divide the broadcast domain and switches (at layer 2) Operate in a single broadcast domain but Switches can also divide the broadcast domain by using the concept of VLAN (Virtual LAN). VLAN is the logical grouping of devices in the same or different broadcast domains. By default, a
5 min read
CIDR Full Form
CIDR stands for Classless Inter-Domain Routing. It is an IP address assigning method that improves the efficiency of address distribution. It is also known as supernetting that replaces the older system based on classes A, B, and C networks. By using a single CIDR IP address many unique IP addresses can be designated. CIDR IP address is the same as
2 min read
Difference between Distance vector routing and Link State routing
Prerequisite – Classification of Routing Algorithms Distance Vector Routing - It is a dynamic routing algorithm in which each router computes a distance between itself and each possible destination i.e. its immediate neighbors.The router shares its knowledge about the whole network to its neighbors and accordingly updates the table based on its nei
2 min read
What is Routing Loop and How to Avoid Routing Loop?
Routing is a procedure that helps the packet choose an optimal path to reach its destination as soon as possible. For example, a device can be a router, which is used to handle traffic within networks. Optimal network routing methods help maintain your network operating efficiently at help in some ways i.e. faster data access and preventing overloa
3 min read
Unicast Routing - Link State Routing
Prerequisite: Distance Vector Routing, Dijkstra algorithm Unicast means the transmission from a single sender to a single receiver. It is a point-to-point communication between the sender and receiver. There are various unicast protocols such as TCP, HTTP, etc. TCP is the most commonly used unicast protocol. It is a connection-oriented protocol tha
6 min read
Collision Domain and Broadcast Domain in Computer Network
Prerequisite - Network Devices, Transmission Modes The most common network devices used are routers and switches. But we still hear people talking about hubs, repeaters, and bridges. Do you ever wonder why these former devices are preferred over the latter ones? One reason could be: 'because they are more efficient and powerful'. But what actually
5 min read
IPv4 Classless Subnet equation
Prerequisite - Classless Addressing, Supernetting Problem - How to calculate Network Address, Broadcast Address, First and Last IP address of a given IP Address in the CIDR(Classless Inter-Domain Routing) Notation. There is a simple equation to calculate the above mentioned Addresses which is used and tested with Class C Networks. Firstly, remember
2 min read
Classful Vs Classless Addressing
Classful Addressing: Introduced in 1981, with classful routing, IP v4 addresses were divided into 5 classes(A to E). Classes A-C: unicast addresses Class D: multicast addresses Class E: reserved for future use Class A : In a class A address, the first bit of the first octet is always '0'. Thus, class A addresses range from 0.0.0.0 to 127.255.255.25
5 min read
Classless Addressing in IP Addressing
The Network address identifies a network on the internet. Using this, we can find a range of addresses in the network and total possible number of hosts in the network. Mask is a 32-bit binary number that gives the network address in the address block when AND operation is bitwise applied on the mask and any IP address of the block. The default mas
7 min read
Article Tags :
three90RightbarBannerImg