CIDR Notation Explained

Complete guide to CIDR notation - what it is, why it replaced IP classes, and how to read network prefixes.

What is CIDR?

CIDR (Classless Inter-Domain Routing) is a method for describing IP networks using a slash followed by a number. The number after the slash tells you how many bits are used for the network portion of the address. For example, in 192.168.1.0/24, the "/24" means the first 24 bits identify the network, and the remaining 8 bits identify individual hosts within that network.

Quick Example
In 192.168.1.0/24, the network is 192.168.1.0 and there are 254 usable host addresses (192.168.1.1 through 192.168.1.254).

Why CIDR Replaced IP Classes

The old class system (Class A, B, C) was too rigid and wasteful. It only allowed networks of fixed sizes: - Class A: 16 million addresses (way too big for most needs) - Class B: 65,536 addresses (often too big) - Class C: 256 addresses (often too small) CIDR lets you create networks of any size by choosing exactly how many network bits you need.

How to Read CIDR Notation

The number after the slash is the "prefix length" - it counts the network bits from left to right: - /8 = 8 network bits (24 host bits) - /16 = 16 network bits (16 host bits) - /24 = 24 network bits (8 host bits) - /30 = 30 network bits (2 host bits)

Common Examples

Network Examples
192.168.0.0/24 254 hosts
Home network - 254 usable addresses
10.0.0.0/8 16,777,214 hosts
Large private network - 16 million addresses
172.16.0.0/12 1,048,574 hosts
Medium private network - 1 million addresses
2001:db8::/32 2^96 addresses
IPv6 network - massive address space

Prefix Length Reference Table

PrefixSubnet MaskUsable HostsTypical Use
/8255.0.0.016,777,214ISP allocation
/16255.255.0.065,534Large enterprise
/20255.255.240.04,094Medium business
/24255.255.255.0254Small office/home
/25255.255.255.128126Small subnet
/26255.255.255.19262Point-to-point
/30255.255.255.2522Router links
/32255.255.255.2551Single host

Key Points to Remember

  • Smaller prefix numbers = bigger networks (more hosts)
  • Larger prefix numbers = smaller networks (fewer hosts)
  • /24 is the most common size for small networks
  • IPv6 commonly uses /64 for end-user networks
  • CIDR allows efficient use of IP address space
Remember
The first and last addresses in any network are reserved (network address and broadcast address), so the usable host count is always 2 less than the total addresses.