What Is CIDR? A Beginner’s Guide to IP Addressing and Subnetting

If you have worked with AWS, Kubernetes, or computer networking, you have probably encountered addresses such as 192.168.1.0/24.

But what does /24 mean, and why is it important?

This notation is called Classless Inter-Domain Routing (CIDR). It provides a flexible way to represent IP address ranges and is widely used in modern networking.

What Is CIDR?

CIDR is a method of allocating and describing IP address ranges using an IP address followed by a prefix length.

For example:

192.168.1.0/24

The /24 means that the first 24 bits identify the network portion of the IPv4 address. The remaining 8 bits identify individual addresses within that range.

IPv4 addresses contain 32 bits in total.

Understanding CIDR Prefixes

The CIDR prefix determines how many addresses belong to a network.

Here are some common IPv4 examples:

  • /16 provides 65,536 total addresses.
  • /24 provides 256 total addresses.
  • /25 provides 128 total addresses.
  • /26 provides 64 total addresses.
  • /30 provides 4 total addresses.

For traditional IPv4 subnets, some addresses are reserved for network and broadcast purposes. However, usable address counts can differ in special cases, including AWS VPC subnets.

What Is Subnetting?

Subnetting divides a larger IP address range into smaller networks. This helps organize devices, manage IP address allocation, and control network traffic.

For example, suppose you have the network 192.168.1.0/24. You can divide it into two /25 subnets:

  • 192.168.1.0/25
  • 192.168.1.128/25

Each subnet contains 128 total addresses. In a typical IPv4 subnet, 126 addresses are usable by hosts.

Subnetting is useful for separating application servers, databases, and other systems into different network segments.

Why Is CIDR Important in AWS?

Amazon Web Services uses CIDR blocks when you create a Virtual Private Cloud (VPC) and its subnets.

For example, you might create a VPC with the CIDR block 10.0.0.0/16, then allocate smaller ranges to different subnets.

A careful CIDR plan helps prevent overlapping IP ranges and makes it easier to expand your cloud infrastructure.

If you use Kubernetes, networking knowledge is also useful when working with pod networks, service networks, and connectivity between clusters.

How to Calculate a CIDR Range

You can calculate the total number of IPv4 addresses using this formula:

Total addresses = 2^(32 − prefix length)

For a /24 network:

2^(32 − 24) = 2^8 = 256 addresses.

For a /26 network:

2^(32 − 26) = 2^6 = 64 addresses.

You can perform these calculations manually or use an online CIDR calculator to find the network address, broadcast address, subnet mask, and address range.

Conclusion

CIDR is a fundamental networking concept for developers, system administrators, and cloud engineers. Understanding it helps you design networks, allocate IP addresses efficiently, and troubleshoot connectivity problems.

Start by learning common prefixes such as /24, /25, and /26, then practice dividing larger networks into smaller subnets.

With practice, CIDR calculations become easier—and the knowledge becomes especially valuable when managing cloud infrastructure.

Leave a Comment