CIDR Notation and Subnetting Explained Simply

CIDR notation looks cryptic at first, but it is just a compact way of saying how many addresses a block of IP addresses contains.

The number after the slash counts network bits

In an address like 192.168.1.0/24, the "/24" means the first 24 bits of the 32-bit IPv4 address identify the network, leaving the remaining 8 bits to identify individual devices (hosts) within that network.

Fewer network bits means a bigger block

Each host bit doubles the number of possible addresses, so a /24 (8 host bits) contains 2^8 = 256 addresses, a /16 (16 host bits) contains 2^16 = 65,536 addresses, and a /8 (24 host bits) contains over 16.7 million addresses.

Two addresses in every block are reserved

The very first address in a block identifies the network itself, and the very last address is reserved as the broadcast address for that network, so a /24's 256 total addresses works out to 254 addresses actually usable by devices.

CIDR notation and a subnet mask describe the same thing

A /24 is equivalent to a subnet mask of 255.255.255.0. CIDR notation is just a shorter way of writing the same network-size information that a dotted-decimal subnet mask expresses.

Subnetting splits a network into smaller pieces

Dividing a larger address block into smaller subnets (for example, splitting a /24 into several /26 blocks) lets an organization separate traffic between departments, buildings, or purposes, and generally keep broadcast traffic more contained.

CIDR replaced the old class A/B/C system

IPv4 addressing originally used fixed classes (Class A, B, and C) that only allowed a few rigid network sizes, which wasted large numbers of addresses for organizations that needed something in between. CIDR, introduced in the 1990s, replaced that rigid system with arbitrary-length prefixes, allowing address blocks to be sized much more precisely to actual need.

Smaller prefix number, larger network

It can feel backwards at first, but the relationship is inverse: a smaller number after the slash (like /8) means fewer bits are used for the network, leaving more bits for hosts, so it describes a much larger address block than a bigger number like /28.

Frequently Asked Questions

Does a /24 network really only give 254 usable addresses out of 256?

Yes, in standard IPv4 subnetting. The first address in the block is reserved to identify the network itself and the last is reserved as the broadcast address, so exactly two of the 256 total addresses are not assignable to individual devices.

Is a smaller subnet always better for security?

Smaller subnets can limit the reach of certain kinds of network traffic and make segmentation easier, but subnet size alone is not a security control β€” firewalls, access controls, and monitoring do the actual protective work, with subnetting mainly helping with organization and traffic containment.