ShareYourGroupShareYourGroupSubnet and Ports

What is CIDR notation? Prefix lengths explained

CIDR is the slash notation you see everywhere: 192.168.1.0/24. The number after the slash is how many bits are fixed.

Meaning

CIDR stands for Classless Inter-Domain Routing. RFC 4632 describes it as the system of address assignment and aggregation that replaced the old class A, B and C structure. Instead of three fixed network sizes, a network can have any prefix length from 0 to 32, which is written after a slash. 192.168.1.0/24 means: the first 24 bits identify the network and the last 8 bits are free for hosts.

Why it was introduced

The class system gave out blocks that were too big or too small: a class C had 256 addresses, which is too few for many organisations, and a class B had 65,536, which is too many for most. The result was wasted addresses and huge routing tables. CIDR allows sizes in between and lets a router describe many neighbouring networks with one entry (aggregation). That is why the same notation is used by routers, firewalls, cloud providers and allow lists.

Reading it

WrittenNetwork bitsFree bitsAddresses
10.0.0.0/882416,777,216
172.16.0.0/1212201,048,576
192.168.1.0/24248256
203.0.113.64/2626664
8.8.8.8/323201

The number of addresses is always 2 raised to the number of free bits. A bigger prefix number means a smaller block.

Aggregation (supernetting)

Two neighbouring blocks of the same size, aligned properly, can be combined into one block with a prefix one bit shorter. 192.168.0.0/24 and 192.168.1.0/24 together make 192.168.0.0/23. Routers use this to keep their tables small. The range to CIDR tool shows how an arbitrary range is expressed as the minimum number of aligned blocks.

Alignment rule

A block must start at an address that is a multiple of its size. 192.168.1.0/23 is not valid as a block, because 192.168.1.0 is not on a 512-address boundary (the block that contains it is 192.168.0.0/23).

IPv6 uses the same idea

IPv6 prefixes are written the same way (2001:db8::/32) with lengths from 0 to 128.

Common mistakes

  1. Reading /24 as "24 hosts".
  2. Writing a block with host bits set (192.168.1.77/24); the correct network is 192.168.1.0/24.
  3. Assuming a /23 can start anywhere.
Is CIDR the same as a subnet mask?

It is the same information in a shorter form: /24 equals 255.255.255.0.

Are classes still used?

Not for real networks. They survive in textbooks and in some old documents.

Sources

  • RFC 4632, Classless Inter-domain Routing (CIDR): The Internet Address Assignment and Aggregation Plan (read 14 November 2026)

This is an independent guide. It is not connected with IANA, the IETF or any network equipment maker. Address and port data come from the IANA registries as fetched on 14 November 2026; RFC texts were read from rfc-editor.org. Check the originals for anything you rely on.