MeridianMERIDIAN

CIDR Notation

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.

Worked samples

DuckDB 1.5.5 · finetype 0.6.64

ValueAs VARCHARnetworkprefix_length
192.168.1.0/24192.168.1.0/24192.168.1.024
10.0.0.0/810.0.0.0/810.0.0.08
172.16.0.0/12172.16.0.0/12172.16.0.012
0.0.0.0/00.0.0.0/00.0.0.00

Shape

Pattern
^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)/([0-9]|[12]\d|3[0-2])$
ValueLengthShape
192.168.1.0/2414matches
10.0.0.0/810matches
172.16.0.0/1213matches
0.0.0.0/09matches
192.168.1.0/24415rejected: one character extra

Background

Origin

Before CIDR, IPv4 network numbers were assigned in three fixed classes, A, B and C.[1] 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] 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] 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]

RFC 4632, published in August 2006 as Best Current Practice 122, obsoletes RFC 1519.[1] RFC 4632 was written by V. Fuller and T. Li.[1] 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]

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] 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] 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] 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] CIDR notation is also used for IPv6 addresses, where the prefix length can run from 0 to 128.[2]

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] AWS publishes its public IPv4 address ranges in a JSON file whose ip_prefix values are in CIDR notation.[3] 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] 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] 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] 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] 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]

Detection notes

IPv4 CIDR only. Prefix length 0-32. Distinguished from plain IPv4 by the /prefix suffix.

Use it

CLI · DuckDB
$ finetype infer -i "192.168.1.0/24" --mode column
→ technology.internet.cidr

SELECT ft_infer('192.168.1.0/24');
-- → 'technology.internet.cidr'
Cast expression
CAST({col} AS VARCHAR)

Schema

https://meridian.online/schemas/technology.internet.cidr · Frictionless type string

finetype taxonomy technology.internet.cidr -o json-schema

Aliases

cidr_blockip_range

Type Registry