Guide

What Is a CIDR Block? IPv4/IPv6 CIDR Subnetting Explained Simply

Understand CIDR blocks, subnet masks, and slash notation (/24, /16, /8). Includes a complete IPv4 CIDR cheat sheet table and practical networking examples.

When inspecting IP lookup results, configuring cloud firewalls in AWS or GCP, or designing home router subnets, you will constantly encounter notations like 192.168.1.0/24 or 10.0.0.0/16.

This format is called CIDR (Classless Inter-Domain Routing). CIDR is the universal foundation of modern Internet routing, address allocation, and subnetting.

Understanding CIDR notation and subnet math allows you to accurately interpret IP lookup data, configure network security rules, and prevent IP address exhaustion.


⚡ What Is a CIDR Block? (The Fast Summary)

Before CIDR was introduced by the Internet Engineering Task Force (IETF) in 1993, the Internet relied on rigid Classful Networking (Class A, Class B, and Class C):

  • Class A networks allocated an enormous 16.7 million IP addresses to single organizations.
  • Class B networks allocated 65,536 addresses.
  • Class C networks allocated only 256 addresses.

This rigid system led to massive waste. Organizations that needed 1,000 addresses were forced to take a Class B block (wasting over 64,000 addresses).

CIDR solved this problem by introducing flexible, variable-length prefix notation:

$$\text{Base IP Address} / \text{Prefix Length (n)}$$

  • The IP Address portion (e.g., 192.168.1.0): Represents the starting network boundary.
  • The Prefix Length /n (e.g., /24): Indicates how many leading binary bits are locked for the network identifier.
  • The Core Rule: The smaller the slash number, the larger the block of IP addresses.

📊 Complete IPv4 CIDR Reference Cheat Sheet

Every IPv4 address contains exactly 32 binary bits. The formula to calculate total IP addresses in an IPv4 /n CIDR block is:

$$\text{Total Addresses} = 2^{(32 - n)}$$

For local networks, usable host addresses equals $\text{Total Addresses} - 2$ (subtracting 1 Network Address and 1 Broadcast Address).

CIDR Prefix Subnet Mask Total IP Addresses Usable Host IPs Common Use Case
/32 255.255.255.255 1 1 (Single Host) Point-to-point firewall rule, VPN client endpoint
/30 255.255.255.252 4 2 Direct router-to-router point-to-point links
/29 255.255.255.248 8 6 Small business with static public IPs for servers
/28 255.255.255.240 16 14 Small office department / micro-service cluster
/27 255.255.255.224 32 30 Database subnet or isolated testing environment
/26 255.255.255.192 64 62 Medium branch office segment
/25 255.255.255.128 128 126 Large internal department or staging network
/24 255.255.255.0 256 254 Standard home Wi-Fi LAN / typical office network
/23 255.255.254.0 512 510 Dual /24 contiguous blocks aggregated
/22 255.255.252.0 1,024 1,022 Corporate office building / regional hotel network
/20 255.255.240.0 4,096 4,094 Data center server cluster / mid-sized ISP pool
/16 255.255.0.0 65,536 65,534 Cloud Virtual Private Cloud (AWS VPC, GCP, Azure)
/12 255.240.0.0 1,048,576 1,048,574 Regional telecom carrier distribution pool
/8 255.0.0.0 16,777,216 16,777,214 Major national ISP, cloud giant, or government block

Step-by-Step: How to Calculate Any CIDR Range

Let us calculate the network properties of 198.51.100.128/26:

  1. Find Host Bits:
    $32 - 26 = 6\text{ host bits}$.
  2. Calculate Total Address Count:
    $2^6 = 64\text{ total addresses}$.
  3. Calculate Usable Host Count:
    $64 - 2 = 62\text{ usable devices}$.
  4. Determine the Network Boundaries:
    • Network Identifier (First Address): 198.51.100.128
    • First Assignable Host: 198.51.100.129
    • Last Assignable Host: 198.51.100.190
    • Broadcast Address (Last Address): 198.51.100.191
    • Subnet Mask: 255.255.255.192

Why CIDR Is Essential for IP Lookups, Geolocation, & Security

1. How Regional Internet Registries (RIRs) Allocate Space

Global IP addresses are managed by the Internet Assigned Numbers Authority (IANA) and delegated to five Regional Internet Registries:

  • ARIN (North America)
  • RIPE NCC (Europe, Middle East, Central Asia)
  • APNIC (Asia-Pacific)
  • LACNIC (Latin America & Caribbean)
  • AFRINIC (Africa)

These registries never allocate single /32 IP addresses. They allocate large CIDR blocks (such as /12 or /16 blocks) to Internet Service Providers (ISPs) and Autonomous Systems (ASNs).

When you look up an IP on ip-address.site, the database retrieves routing metadata, ISP name, and ASN belonging to the overarching CIDR block.

2. Explaining Geolocation Fluctuations

If your ISP assigns you dynamic addresses within a /19 block (containing 8,192 addresses), those addresses may be routed across an entire metropolitan area.

This is why an IP lookup might report your location as a neighboring town or central district—the registry coordinates reflect the central routing exchange of that CIDR block, not your physical router location.

3. Route Summarization (Supernetting)

Without CIDR, core Internet routers would have to store hundreds of millions of individual routing table entries.

Through route summarization (supernetting), an ISP can advertise a single /16 route to global BGP tables instead of advertising 256 individual /24 networks. This keeps global Internet routing fast, stable, and memory-efficient.

4. Cloud VPC and Security Architecture (AWS / Azure / GCP)

When designing a cloud infrastructure:

  • The entire cloud network (VPC) is typically defined as 10.0.0.0/16 (65,536 addresses).
  • Public subnets for load balancers and web servers are assigned 10.0.1.0/24.
  • Private subnets for databases and internal microservices are isolated on 10.0.2.0/24.
  • Firewall security groups allowlist traffic using CIDR notation (e.g., allow office access from 203.0.113.0/28).

IPv4 vs IPv6 CIDR Differences

IPv6 uses 128-bit addresses written in hexadecimal, completely eliminating the address scarcity of IPv4:

  • /128: Represents a single IPv6 device (equivalent to an IPv4 /32).
  • /64: The universal standard subnet size for a single local network. A single /64 contains $18,446,744,073,709,551,616$ addresses ($18.4\text{ quintillion}$).
  • /56: The typical prefix assigned by residential ISPs to home broadband customers, allowing the home router to create up to 256 separate /64 subnets (e.g., main LAN, guest Wi-Fi, IoT network).
  • /48: The standard enterprise allocation provided to companies, data centers, and universities, containing 65,536 individual /64 networks.

Common Subnetting Mistakes to Avoid

  1. Confusing Network Address with Host IP: You cannot assign the very first address in an IPv4 subnet (the network ID) or the very last address (the broadcast ID) to an individual computer or server.
  2. Subnet Overlap in VPN / Routing: When establishing site-to-site VPN tunnels, connecting two networks that both use 192.168.1.0/24 creates an IP collision. Always ensure remote offices and cloud VPCs use non-overlapping CIDR blocks (e.g., 10.10.0.0/16 vs 10.20.0.0/16).
  3. Assuming a CIDR Block Represents a Single User: A /24 or /20 block contains hundreds or thousands of independent users. Blocking an entire CIDR block because of one abusive user can unintentionally block thousands of legitimate visitors.

Read This Next

FAQ

What is a CIDR block in simple terms?

A CIDR block is a standard way to represent a range of contiguous IP addresses using a slash notation (e.g., 192.168.1.0/24). The number after the slash indicates how many network bits are locked, defining the size of the IP pool.

How does CIDR work in IPv4 networks?

An IPv4 address has 32 bits. In CIDR notation like /24, the first 24 bits represent the network, leaving 8 bits (32 - 24) for host devices. 2^8 equals 256 total IP addresses (254 usable for devices, with 1 network and 1 broadcast address).

What is the difference between /24, /16, and /8 CIDR blocks?

A /24 block contains 256 addresses (typical small business or home subnet). A /16 block contains 65,536 addresses (medium-to-large organization or university). A /8 block contains 16,777,216 addresses (massive ISP, carrier, or cloud provider allocation).

Why does an IP lookup tool display CIDR notation?

IP lookup tools show CIDR ranges because Internet registries (ARIN, RIPE, APNIC) allocate IP space in blocks rather than individual addresses. Geolocation, ISP attribution, and routing policies are assigned to the entire CIDR block.

Can CIDR explain why my IP location changes within the same city or region?

Yes. ISPs manage large CIDR blocks across broad metropolitan areas. Your device may be dynamically assigned different IP addresses within that same carrier block, resulting in minor geolocation shifts.