What is Classless Inter-Domain Routing (CIDR)

The IETF introduced RFC 1517 in 1993, introducing classless inter-domain routing (CIDR). The CIDR replaced the old classful network assignments. The classful address has now become obsolete due to the CIDR scheme.

The CIDR network address is determined by the subnet mask instead of the value of the address’s first octet. The network and host portions of the IP address are also determined by the subnet mask, which is called the network prefix. The network prefix is also known as prefix lengths such as /16, /17, /25, and /30.

The ISPs are no longer bound only to the 8/16 or /24 subnet mask. They can now assign IP addresses more efficiently using any prefix length. Now, the ISPs can assign IP address blocks according to the customers’ requirements, from a few hosts to hundreds or thousands of hosts. The CIDR also reduces routing table size and manages the IPv4 address space more efficiently using Route summarization and supernetting.

Route Summarization and Supernetting

Route summarizations, also known as prefix aggregation, combine multiple routes into a single route to reduce the size of routing tables. For example, one summary static route can change several specific static route statements.

The figure below illustrates the route summarization. Router1 has 5 different routes. Each network has a different IP address network. All networks can be summarized into a single network to Router0.

CIDR

The 172.16.0.0/21 summarized or aggregated route includes all the networks belonging to Router2, Router3, Router4, and Router5. To summarize this type of route, suppernetting is required. A supernet summarizes multiple network addresses with a smaller mask than the classful mask.

Supernetting is required when the route summarization mask is less than the default traditional classful mask. The supernet is always a route summary, but a route summary is not always a supernet. The procedure to determine a summary route is the following:

  • Convert all network addresses into binary format.
  • Count the number of far-left matching bits to identify the summarised route’s prefix length or subnet mask.
  • Copy the matching bits and add zero to the remaining places to determine the summarized network address.

This address and subnet mask can now be used as a summary route for all the networks. We can configure Summary routes for both static routes and classless routing protocols. The figure below illustrates the summary routing procedure:

Static Routing CIDR Example

The smaller routing tables make the routing table lookup process easy, fast, and efficient because there are fewer routes to search. So, if we use a single static route instead of multiple static routes, the size of the routing table is reduced.

A single static route can efficiently represent dozens, hundreds, or even thousands of routes. It is possible to configure a summary static route using CIDR.

In the Figure below, Router0 has been configured to reach the identified networks in the topology. Though acceptable, configuring a summary static route would be more efficient.

Figure 2 shows route aggregation using CIDR summarization. The four static route entries were reduced to 172.16.0.0/21 entries. The example below removes the six static route entries and replaces them with a static route summary.

Classless Routing Protocol Example

In the classful routing protocols, the receiving router automatically applies the default subnet mask to the network address in the routing table. If the topology in the figure contained a classful routing protocol, then Router0 would only install 172.16.0.0/16 in the routing table.

Variable Length Subnet Mask(VLSM) and supernet routes needed classless routing protocols such as RIPv2, OSPF and EIGRP. Classless routing protocols advertise network addresses with their associated subnet masks. When a supernet route is in a routing table, such as a static route, a classful routing protocol does not include that route in its updates.