Skip to main content
⚡ OpenDevDocs
Networking
networkingnetworkingCore ConceptIntermediate

CIDR Notation & IP Block Fundamentals

Master Classless Inter-Domain Routing (CIDR), prefix lengths (/24, /16, /8), subnet masks, and address range calculations.

Verified: 2026-09-30
Platforms:
webnodelinux
#networking#cidr#subnetting#ip#devops

What is CIDR?

CIDR (Classless Inter-Domain Routing) is the standard method used to allocate IP address blocks and route network traffic efficiently. It replaces the obsolete legacy "Class A/B/C" system.

CIDR notation appends a slash / followed by a number (prefix length) to an IP address, indicating how many bits represent the Network Prefix:

$$\text{192.168.1.0/24}$$


How Prefix Lengths Work (IPv4)

An IPv4 address has 32 bits total. A /24 prefix means:

  • First 24 bits: Network identifier (fixed for all devices in this subnet).
  • Remaining 8 bits ($32 - 24$): Host identifier (unique for each device).

Number of total IP addresses in a CIDR block: $$\text{Total IPs} = 2^{(32 - \text{prefix})}$$


CIDR Prefix Reference Table

CIDR NotationSubnet MaskTotal AddressesUsable HostsTypical Cloud / LAN Usage
/32255.255.255.25511Single specific host/machine IP
/30255.255.255.25242Point-to-point router links
/28255.255.255.2401614Small microservice subnets
/24255.255.255.0256254Standard office LAN / Web subnet
/20255.255.240.04,0964,094Standard Cloud VPC Subnet
/16255.255.0.065,53665,534Standard Cloud VPC (e.g. AWS 10.0.0.0/16)
/8255.0.0.016,777,21616,777,214Massive enterprise network
/00.0.0.04,294,967,296All0.0.0.0/0 represents the entire Internet

Reserved Addresses in Every Subnet

In standard networking, 2 addresses are automatically reserved in every subnet:

  1. Network Address (First IP): e.g. 192.168.1.0
  2. Broadcast Address (Last IP): e.g. 192.168.1.255

[!NOTE] In Cloud VPCs (like AWS), 5 IP addresses are reserved per subnet (Network, VPC Router, DNS server, Future reserve, Broadcast).

On this page