What is CIDR?
CIDR is a classless way of addressing IP that writes the mask as a prefix length (e.g. /24). We cover notation, aggregation and classless routing.
Last updated:
CIDR (Classless Inter-Domain Routing) is a classless way of allocating IP addresses and writing networks in which the boundary between the network and host portions is set by a prefix length written after a slash, for example 192.0.2.0/24. The number after the slash states how many leading bits of the address are shared by the whole network. CIDR is described in RFC 4632. It replaced the rigid split into class A, B and C, so addresses can be allocated in blocks of any size and routes can be aggregated. That in turn slows the growth of the global routing table.
CIDR notation and prefix length
CIDR notation combines a network address with a prefix length, the number of bits in the network mask. A /24 prefix equals the mask 255.255.255.0 and covers 256 addresses (254 usable for hosts), a /25 is half that block, and a /23 is two adjacent /24s. Each bit added to the prefix halves the size of the network. The principle is the same in IPv6, though prefixes are longer and you typically work with /32, /48 or /64 blocks.
- /24 = 256 addresses (254 hosts), mask 255.255.255.0.
- /25 = 128 addresses, /26 = 64 addresses, /27 = 32 addresses.
- /30 = 4 addresses (2 usable), typical for point-to-point links.
- /32 is a single IPv4 address, often used for loopbacks.
- In IPv6 the standard end network is a /64, and a typical customer assignment is a /48.
Aggregation and supernetting
CIDR lets you combine adjacent prefixes into one shorter prefix, a technique called supernetting. Four contiguous /24 networks that fit within a common block can be announced as a single /22 prefix, and eight /24s as a /21. Instead of many entries, the router then advertises one aggregated route. The global BGP table therefore grows more slowly, and operators limit the number of prefixes the rest of the internet has to carry. Aggregation only works when the blocks are contiguous and aligned to the supernet boundary.
Classless routing in practice
Classless routing means every entry in the routing table carries both an address and a prefix length, and the router selects the route with the longest matching prefix (longest prefix match). A more specific /25 will always win over a less specific /24 covering the same range. This rule governs BGP behaviour on the internet. Operators can break larger blocks into smaller ones to steer inbound traffic, but registries and transit networks usually filter prefixes longer than /24 for IPv4 and /48 for IPv6 to protect the table from excessive fragmentation.
CIDR and AS202520 SkyPass
Knowing CIDR helps when you configure BGP sessions, prefix filters and route objects in the IRR. AS202520 SkyPass accepts IPv4 and IPv6 prefix announcements from customers over BGP as part of IP transit and access to the Polish internet exchanges (THINX, TPIX, WRIX, 1-IX). We handle correct aggregation, ROA validation through RPKI and consistent filtering, so your prefixes are announced cleanly and predictably into the Polish and European internet.
Frequently asked questions
What does the number after the slash, such as /24, mean?
It is the prefix length, the number of leading address bits that belong to the network portion. /24 means 24 network bits and 8 host bits, that is 256 addresses (254 usable).
How does CIDR differ from the old address classes?
Class A, B and C had fixed boundaries (8, 16 or 24 bits). CIDR lets you set the boundary on any bit, so blocks can match real needs and routes can be aggregated.
What is supernetting?
It is combining several adjacent, aligned prefixes into one shorter prefix. For example, four contiguous /24s can be announced as a single /22, which reduces the number of entries in the routing table.
Why do operators filter prefixes longer than /24?
To protect the global BGP table from excessive fragmentation. Prefixes longer than /24 for IPv4 and /48 for IPv6 are usually rejected by transit networks and internet exchanges.
