$devtoolkit.sh/glossary/what-is-cidr

What is CIDR? — Classless Inter-Domain Routing Explained

Definition

CIDR (Classless Inter-Domain Routing) is a method for allocating and specifying IP addresses and their associated routing prefix. CIDR notation combines an IP address with a prefix length (a number from 0 to 32 for IPv4) separated by a slash, like 192.168.0.0/16. The prefix length specifies how many leading bits are the network portion. CIDR replaced the older classful system (Class A, B, C) in 1993 to allow more flexible and efficient use of IPv4 address space.

How It Works

In CIDR, the prefix length defines the subnet mask: /8 means 255.0.0.0, /16 means 255.255.0.0, /24 means 255.255.255.0. To find the network address, AND the IP with the subnet mask. The range of addresses in the block runs from the network address to the broadcast address (where all host bits are 1). For example, 10.0.0.0/8 includes all addresses from 10.0.0.0 to 10.255.255.255 — 16,777,216 total. Route aggregation (supernetting) uses CIDR to combine multiple smaller blocks into one larger advertisement, reducing the size of routing tables.

Common Use Cases

  • Defining IP address ranges for cloud VPCs (e.g., AWS VPC with 10.0.0.0/16)
  • Configuring firewall rules to allow or deny traffic from an IP range
  • Allocating IP address blocks to ISPs and organizations by regional registries
  • Aggregating routing advertisements to reduce BGP routing table size
  • Defining security group rules in cloud environments

Example

CIDR Block    | Addresses    | Usable Hosts
/8            | 16,777,216   | 16,777,214
/16           | 65,536       | 65,534
/24           | 256          | 254
/28           | 16           | 14
/32           | 1            | 1 (single host)

10.0.0.0/16: 10.0.0.0 – 10.0.255.255

Related Tools

FAQ

What is a /32 CIDR block?
A /32 block represents a single IP address — all 32 bits are fixed. It is used in firewall rules to allow or block exactly one host IP address. A /128 is the equivalent for IPv6.
What is the difference between CIDR and a subnet mask?
They express the same information in different formats. The CIDR prefix /24 is equivalent to the dotted-decimal subnet mask 255.255.255.0. CIDR is more concise and is the modern standard. Subnet masks in dotted notation are still used in legacy system interfaces.
What are the RFC 1918 private address ranges?
RFC 1918 defines three private (non-routable on the internet) IPv4 ranges: 10.0.0.0/8 (10.0.0.0–10.255.255.255), 172.16.0.0/12 (172.16.0.0–172.31.255.255), and 192.168.0.0/16 (192.168.0.0–192.168.255.255). These are used for internal networks and NAT.

Related Terms

/glossary/what-is-cidrv1.0.0