Classless Inter-Domain Routing

This is an old revision of this page, as edited by Stevertigo (talk | contribs) at 20:27, 27 July 2004. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Classless Inter-Domain Routing (CIDR), introduced in 1993, was a refinement to the way traffic was routed between IP networks. It allowed increased flexibility when dividing ranges of IP Addresses into separate networks, and thus promoted more efficient use of increasingly scarce IP addresses. CIDR is defined in RFC 1519.


IP addresses in Internet Profile version 4 are 32 bits long and are separated into two parts: the network address (which identifies a whole network or subnet), and the host address (which identifies a particular machine's connection or interface to that network). A subnet mask is a bitmask which shows where the network address ends and the host address begins.

Historically, the IP address space was divided into three main 'classes of network', where each class had a fixed network size. Classes A, B and C had 8, 16, and 24 bit network address fields respectively. The class, and hence the length of the subnet mask and the number of hosts on the network, could always be determined from the most significant three bits of the IP address. Without any other way of specifying the length of a subnet mask, routing protocols necessarily used the class of the IP address specified in route advertisements to determine the size of the routing prefixes to be set up in the routing tables.


CIDR uses variable length subnet masks (VLSM) to allocate IP addresses to subnets according to individual need rather than some general network-wide rule. Thus the network/host division can occur at any bit boundary in the address. Because the normal class distinctions are ignored, the new system was called classless routing. This led to the original system being called, by back-formation, classful routing.


The standard notation for a CIDR address range begins with the network address (padded on the right with the appropriate number of zero-valued bits - up to 4 octets for IPv4, and up to 8 16-bit hexadecimal fields for IPv6). This is followed by a "/" character and a prefix length, in bits, defining the size of the network in question (the prefix is actually the length of the subnet mask).

For example (a more complete IPv4 subnetting reference table is available):

  • 192.168.0.0 /24 represents the 256 IPv4 addresses 192.168.0.0 through 192.168.0.255 inclusive, with 192.168.0.255 being the broadcast address for the network.
  • 192.168.0.0 /22 represents the 1024 IPv4 addresses 192.168.0.0 through 192.168.3.255 inclusive, with 192.168.3.255 being the broadcast address for the network.
  • 2002:C0A8::/48 represents the IPv6 addresses 2002:C0A8:0:0:0:0:0:0 through 2002:C0A8:0:FFFF:FFFF:FFFF:FFFF:FFFF, inclusive.

For IPv4, an alternative representation uses the network address followed by the network's subnet mask, written in dotted decimal form:

  • 192.168.0.0 /24 could be written 192.168.0.0 255.255.255.0
  • 192.168.0.0 /22 could be written 192.168.0.0 255.255.252.0


Another benefit of CIDR is the possibility of routing prefix aggregation. For example, sixteen contiguous /24 networks could now be aggregated together, and advertised to the outside world as a single /20 route (if the first 20 bits of their network addresses match). Two contiguous /20s could then be aggregated to a /19, and so forth. This allowed a significant reduction in the number of routes that had to be advertised over the Internet, preventing 'routing table explosion' from overwhelming routers and stopping the Internet from expanding further.

Nowadays most ISPs on the public Internet will not route anything smaller than a /19 prefix, effectively preventing small networks from obtaining full public Internet routing without going through a routing aggregator such as an ISP.

CIDR/VLSM network addresses are used throughout the public Internet, although they are also used elsewhere, particularly in large private networks. An average desktop LAN user generally does not see them in practice, as their LAN network is usually numbered using special private RFC 1918 addresses.


  • RFC 1518 - An Architecture for IP Address Allocation with CIDR
  • RFC 1519 - Classless Inter-Domain Routing (CIDR): an Address Assignment and Aggregation Strategy
  • BGP & Advanced Routing Resources