Classless interdomain routing

From Hill2dot0
(Redirected from CIDR)
Jump to: navigation, search

The IP address space is slowly but surely being depleted, with Class B addresses potentially in short supply. Using a Class C addresses for small networks (i.e., those with fewer than 254 hosts) is greatly relieving the strain on the IP address space, but is causing another problem. IP routing is based on tables that must be populated by the routing algorithms. However, every known IP address requires a routing table entry somewhere. Classless interdomain routing (CIDR), defined in RFC 1518 and RFC 1519, provides a way to limit the explosive growth in the size of routing tables within the Internet by building routing tables independent of the IP address class. The basic idea behind CIDR is to group blocks of addresses together so that a single routing table entry can point to several addresses. Suppose, for example, that a single organization is assigned eight Class C addresses. If we are clever in our allocation scheme, we will assign the eight addresses as a block so that all eight can be summarized in a single routing table entry, called route summarization. To provide for this summarization, CIDR requires that multiple IP addresses that are to be summarized share the same high-order bits in their address. In addition, routing tables and routing algorithms must be modified so that routing decisions can be based on a 32 bit address and a 32 bit mask. Finally, routing protocols must be extended to carry the 32 bit mask along with the 32 bit address. (OSPFv2 and Routing Information Protocol version 2]] (RIPv2) both have this capability.)

Consider the following example. RFC 1466 recommends that new Class C addresses for Europe be assigned in the range from to This represents some 130,000 possible Class C addresses, but all share the same value in the seven high-order bit positions. This means that all European addresses require but a single table entry ( and a 7 bit mask (

CIDR can work as described here because it follows the longest match rule, which states the best match is always the longest match—that is, the match with the highest number of 1 bits in the 32 bit mask. Continuing the example from above, let us suppose that one European network provider (whom we will call EurNet) is assigned a block of 16 Class C addresses in the range through EurNet, then, would have the routing table entry along with a 20 bit mask,, written as

Now, suppose a datagram needs to be routed to a host within the EurNet IP address space, such as This address would match the routing table entries for both the general European community and EurNet. However, EurNet’s mask is longer than the general Europe mask, so the datagram is routed to EurNet.

Classfull vs. Classless

Classfull vs. Classless

Traditional IP only allowed networks to be divided up according to predefined classes of addresses. All addresses were in one of the two formats below.

This is limiting for several reasons.

  • The number of different sized networks is limited to the predefined classes.
  • Subnetting, if used, only allows a single mask to be used within a subnet.
  • The all ones and all zeros networks (top and bottom subnets) could not be used because of ambiguity in some implementations.
  • Routing protocols assumed the class of the address in the absence of masks, resulting in routing “black holes.”

Classless Interdomain Routing (CIDR), described in RFC 1519 introduces classless addressing. Classless IP routing removes the notion of an address class and the terms Class A, Class B, and Class C address have become somewhat antiquated. The format for classless addresses is as follows.


Benefits of classless addressing include those below.

  • Dispenses with top and bottom subnets, freeing up those addresses for deployment.
  • Allows for supernetting which allows the combination of what were previously multiple blocks of Class C addresses into a single contiguous block of addresses.
  • Allows routing table entries to be summarized, thus reducing the size and lookup times of the routing tables.
  • Allows Variable Length Subnet Mask (VLSM).

Many implementations of IP are still classfull (e.g., for a Class C address, routers expect a mask equal to or longer than

Address Allocation Issues

The explosive growth the Internet has undergone in recent years has placed the Internet Assigned Numbers Authority (IANA) under increasing pressure to conserve the remaining addresses. In this case, however, conservation is mostly a matter of careful management of the address space.

The IANA’s directives for address conservation can be summed up by one rule: Justify what you say you need! RFC 2050 documents current IP allocation guidelines and reflects the practice of IP address registries with respect to address assignment. Examples abound. A few Class A blocks have been assigned to the top level registries for allocation in B or C sized blocks.

New assignments of Class B networks are currently available only to large providers or organizations that can prove a need for more than 32 subnets and more than 4096 hosts within a two year period.

ISPs and organizations that need fewer than 4096 hosts are assigned blocks of contiguous Class C networks, using classless interdomain routing (CIDR) notation and rules.

These same policies are being advanced on a smaller scale by the ISPs themselves with respect to their customers. For example, ISPs use CIDR and variable length subnet mask (VLSM) to optimize the use of host addresses whenever possible. They also endeavor to maintain “ownership” or control of their address blocks by using addresses contingent on the customer/provider contract. Keeping these blocks intact is one way in which Internet routing tables can stay as small as possible.

Also, facilities such as Network Address Translation (NAT) and the Dynamic Host Configuration Protocol (DHCP) provide tools that allow network administrators to more effectively manage the IP addresses assigned to them.


<mp3></mp3> | Classless Interdomain Routing