# CIDR Notation

Key: `technology.internet.cidr`

Classless Inter-Domain Routing notation combining an IPv4 address with a prefix length (e.g., 192.168.1.0/24). Used in network configuration, firewall rules, and IP access control.

Page: <https://meridian.online/docs/projects/finetype/types/technology/internet/cidr>

Samples: `192.168.1.0/24`, `10.0.0.0/8`, `172.16.0.0/12`, `0.0.0.0/0`

## Background

### Origin

Before CIDR, IPv4 network numbers were assigned in three fixed classes, A, B and C.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) In November, 1991, the IETF created the ROAD (Routing and Addressing) group to examine concerns over the long-term scaling of the Class A/B/C system.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) The ROAD group identified exhaustion of the Class B address space, the growth of routing tables and the eventual exhaustion of the 32-bit IPv4 address space as the three major problems.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) RFC 4632 says Class C, with a maximum of 254 host addresses, was too small, while Class B, with up to 65534 host addresses, was too large for most organisations.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt)

RFC 4632, published in August 2006 as Best Current Practice 122, obsoletes RFC 1519.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) RFC 4632 was written by V. Fuller and T. Li.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) RFC 4632 notes that CIDR was intended as a short-term response lasting approximately three to five years, and that it has far outlasted its anticipated lifespan.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt)

In CIDR notation, a prefix is written as a 4-octet quantity like an IPv4 address, followed by a slash, followed by a decimal value between 0 and 32 giving the number of significant bits.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) RFC 4632 gives the legacy Class B network 172.16.0.0, with an implied mask of 255.255.0.0, as the prefix 172.16.0.0/16.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) RFC 4632's table of prefix sizes runs from /32, a single-address host route, to 0.0.0.0/0, the default route covering 4294967296 addresses.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) RFC 4632 describes a /24 as the size of a legacy Class C network, a /16 as a legacy Class B and a /8 as a legacy Class A.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) CIDR notation is also used for IPv6 addresses, where the prefix length can run from 0 to 128.[[2]](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing)

### Use

RFC 4632 shows router filter rules rewritten from bare network numbers such as accept 10.0.0.0 to prefixes such as accept 10.0.0.0/8.[[1]](https://www.rfc-editor.org/rfc/rfc4632.txt) AWS publishes its public IPv4 address ranges in a JSON file whose ip\_prefix values are in CIDR notation.[[3]](https://docs.aws.amazon.com/vpc/latest/userguide/aws-ip-syntax.html) Seeing 10.0.0.0/8, 172.16.0.0/12 or 192.168.x.x prefixes in a column is a strong hint that it describes internal networks rather than the public internet. (Meridian's view)

PostgreSQL's cidr type rejects a value with bits set to the right of the netmask, such as 192.168.0.1/24, which its inet type accepts.[[4]](https://www.postgresql.org/docs/current/datatype-net-types.html) Python's ipaddress module raises ValueError for a network with host bits set unless strict is False, in which case the host bits are masked out.[[5]](https://docs.python.org/3/library/ipaddress.html) Python's ipaddress module accepts 192.168.1.0/24, 192.168.1.0/255.255.255.0 and 192.168.1.0/0.0.0.255 as equivalent IPv4 network specifications.[[5]](https://docs.python.org/3/library/ipaddress.html) Treat a CIDR block as a range rather than a string: two different strings can describe overlapping blocks, so membership and overlap tests belong in an address-aware library or database type. (Meridian's view)

### Where you'll meet it

AWS's ip-ranges.json file lists its IPv4 ranges as ip\_prefix values such as 3.5.140.0/22.[[6]](https://ip-ranges.amazonaws.com/ip-ranges.json) Cloudflare's IP Ranges page, which Cloudflare calls the definitive source of its current IP ranges, lists its IPv4 ranges in the form 103.21.244.0/22.[[7]](https://www.cloudflare.com/ips/)

## Sources

1. [Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan](https://www.rfc-editor.org/rfc/rfc4632.txt) — standard
2. [Classless Inter-Domain Routing](https://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing) — secondary source
3. [Syntax for AWS IP address range JSON](https://docs.aws.amazon.com/vpc/latest/userguide/aws-ip-syntax.html) — organisation
4. [8.9. Network Address Types](https://www.postgresql.org/docs/current/datatype-net-types.html) — documentation
5. [ipaddress — IPv4/IPv6 manipulation library](https://docs.python.org/3/library/ipaddress.html) — documentation
6. [ip-ranges.json](https://ip-ranges.amazonaws.com/ip-ranges.json) — dataset
7. [IP Ranges \| Cloudflare](https://www.cloudflare.com/ips/) — organisation
