What is CIDR?
Also known as: Classless Inter-Domain Routing
CIDR (Classless Inter-Domain Routing) is a method for allocating IP addresses and routing packets using variable-length subnet masks (e.g., /24) instead of fixed classful boundaries.
CIDR, or Classless Inter-Domain Routing, is a standard introduced in 1993 (RFC 1518 and RFC 1519) to replace the older classful IP addressing system. Instead of forcing addresses into rigid Class A, B, or C blocks, CIDR allows network prefixes of any length, denoted by a slash followed by the number of network bits (e.g., 192.168.0.0/24). This enables more granular allocation, reducing wasted addresses that the classful system could not avoid.
CIDR works by combining the IP address with a subnet mask that determines which bits belong to the network prefix and which to the host identifier. Routers use the longest prefix match algorithm to forward packets: when multiple routing table entries match a destination, the most specific (longest) prefix wins. This mechanism supports route aggregation (supernetting), where a single routing entry can represent many contiguous smaller networks. For example, eight contiguous /24 networks can be advertised as one /21 block, shrinking routing table size.
In the wider stack, CIDR is a fundamental building block of IPv4 and the basis for IPv6 addressing (which uses the same prefix notation). It is used by ISPs to allocate customer blocks, by cloud providers to define VPC subnets, and by firewall rules to match source or destination ranges. Nearly every modern routing protocol (e.g., BGP, OSPF, IS-IS) relies on CIDR to exchange prefix information and enable scalable inter-domain routing.
Key facts
- Defined in RFC 1518 and RFC 1519 in 1993, replacing classful addressing.
- Uses variable-length subnet masking (VLSM) notation like /24, /28, or /64.
- Routers employ longest prefix match to select the most specific route.
- Supports route aggregation (supernetting) to reduce global routing table size.
- Adopted by both IPv4 and IPv6 addressing schemes.
How it works in practice
Related terms
References
More in Networking & Routing
Anycast
Anycast is a network addressing and routing method where a single IP address is assigned to multiple servers, and routers send traffic to the nearest server based on routing protocol metrics.
AS Path
A BGP path attribute that lists the sequence of autonomous system numbers a route has passed through, used for loop detection and path selection.
ASN
A globally unique 16 or 32 bit number assigned to an autonomous system for use in BGP routing between organizations on the Internet.
Autonomous System
An Autonomous System (AS) is a group of IP networks under a single administrative routing policy, identified by a unique ASN (Autonomous System Number) for exterior gateway routing.
BGP
BGP (Border Gateway Protocol) is the path vector routing protocol that networks use to exchange reachability information between autonomous systems on the public internet.
Hop
A hop is one passage of a packet through a router or other layer-3 forwarding device as it travels from source to destination across an internetwork.
IPv4
IPv4 is the core Internet Protocol using 32-bit addresses, providing roughly 4.3 billion unique identifiers for network interfaces on the global internet.
IPv6
IPv6 is the most recent version of the Internet Protocol, using 128-bit addresses to provide an effectively unlimited number of unique identifiers for networked devices.
Latency
Latency (or round-trip time, RTT) is the time required for a packet to travel from a source to a destination and back, measured in milliseconds, and is a critical metric in network performance.
Looking Glass
A looking glass is a public web-based tool that provides read-only access to a network's BGP routing table, ping, and traceroute diagnostics from that network's perspective.