What is CIDR

What is CIDER

CIDR stands for “Classless Inter-Domain Routing” and is also called cider.

Classless addressing is  the process of freely assigning IP addresses without class boundaries . CIDR is a mechanism that enables routing in a classless addressing environment.

 Originally, IP addresses were classified into Class A, Class B, and Class C, and were operated in an address system in which the network address part and the host address part were separated in 8-bit units.

In this method, the subnet mask is determined from the beginning.

“255.0.0.0” for class A
“255.255.0.0” for class B “255.255.255.0”
for class C

This is called classful addressing .

With this addressing method, the size of each network is determined as follows.

Class A: 16,777,214 (2 24 -2)
Class B: 65,534 (2 16 -2)
Class C: 254 (2 8 -2)

 Especially in class A and class B, the size is large and there are cases where it is too large for the network to be applied. Also, even though it is small, there are cases where even Class C is too large. Especially noticeable on WAN links. A WAN link with a point-to-point connection uses only two IP addresses.

 This is where a mechanism called a subnet mask comes into play. This makes it possible to operate a single network by dividing it into smaller parts. With this mechanism, it is possible to reduce the number of IP addresses that are wasted.

 There are cases where it is too big, and there are cases where it is too small. For example, Class C allows only 254 IP addresses per network.

 It cannot be used in networks with more than 254 hosts. Therefore, we would like to use a class B address, but IP addresses are in short supply and it is difficult to obtain a class B IP address.

 So look at the diagram below. As shown in the figure below, class C addresses can have 510 host addresses (2 9 -2) if the network address is changed from 24 bits to 23 bits .

Also, as shown in the figure below, if the network address is changed from 24bit to 22bit, it will increase to 1,022 (2 10 -2).

 In this way, by eliminating class boundaries and freely allocating addresses, it is possible to allocate addresses that match the size of the network.

 This addressing method is called classless addressing, and CIDR is the concept that enables routing in this classless allocated network.

Problems with classful routing

Here, I will explain the problems of classful routing.

◆ Waste of IP address

Classful routing can only route correctly with classful addresses.

 Therefore, each network can only be assigned a classful address with the network address part and the host address part separated in 8-bit units.

 This means that you allocate addresses that are not the correct size for the network to which they apply. For example, suppose you assign a Class C IP address to your WAN link as shown in the diagram below.

 Class C has 254 addresses available. You’re wasting 252 IP addresses by using only 2 IP addresses on the WAN link.

 In situations like this where only classful addresses are routable, a significant amount of IP addresses is wasted.

◆Routing table size problem

 In large networks, routers have to learn a huge number of networks. Therefore, the number of entries in the routing table becomes enormous. It is said that there are hundreds of thousands of networks on the Internet.

 As the size of the routing table increases, the CPU and memory of the router will be burdened and the overhead will increase. Searching through this huge number of entries for each received packet would be a very heavy task.

 Classful routing has limitations. By consolidating multiple networks into one, it is necessary to reduce the routing table size and reduce the burden on CPU and memory. This is called route aggregation.

CIDR enables routing in this route aggregation environment.

◆Classful routing problem

Depending on your network layout, especially if you have discontinuous subnets in place, they may not route correctly.

 In a classful environment, routing has many restrictions. You’ll run into problems with class boundaries. For example, route information for a network different from the sending interface will be sent updates to neighboring routers as classful network addresses.

 Typical classful routing protocols include RIPv1 and IGRP. Here, we will explain assuming that RIP is used as the routing protocol.

●Router_A notifies “172.16.0.0” to Router_B.
●Router_C notifies “172.16.0.0” to Router_B.

 In the figure above, for Router_B, “172.16.1.0/24” and “172.16.2.0/24” have the same distance, so the cost is the same. As a result, the routing table on Router_B will have a “172.16.0.0/16” route to the right and a “172.16.0.0/16” route to the left.

 For RIP, load balancing occurs when there are multiple equal-cost paths. In other words, at this point, it means that routing cannot be done correctly.

Thus, classful routing has its limits.

 By eliminating class boundaries called CIDR, you can now understand how important it is to be able to allocate IP addresses freely and to enable routing in a classless addressing environment.