๐Ÿ“ Blog

CIDR Notation and Subnetting: A Complete Guide for Network Engineers

January 2025  ยท  6 min read
โ† Back to Blog

CIDR (Classless Inter-Domain Routing) notation is the standard way to express IP address ranges and subnet configurations. Whether you are provisioning cloud infrastructure on AWS or GCP, configuring firewall rules, designing VPC layouts, or troubleshooting network issues, understanding CIDR and subnetting is an essential skill for developers and network engineers alike.

What Is CIDR Notation?

CIDR notation combines an IP address with a prefix length, separated by a slash:

192.168.1.0/24

The number after the slash โ€” the prefix length โ€” indicates how many bits of the 32-bit IPv4 address are used to identify the network. The remaining bits identify individual hosts within that network.

For 192.168.1.0/24: the first 24 bits (192.168.1) identify the network, and the last 8 bits (the final octet) identify up to 254 usable hosts.

IPv4 Subnet Fundamentals

The Subnet Mask

The subnet mask is the traditional way to express the same information as a prefix length. A /24 prefix equals a subnet mask of 255.255.255.0 โ€” 24 consecutive binary ones followed by 8 zeros:

/24 = 11111111.11111111.11111111.00000000 = 255.255.255.0
/16 = 11111111.11111111.00000000.00000000 = 255.255.0.0
/8  = 11111111.00000000.00000000.00000000 = 255.0.0.0

Network, Broadcast, and Host Addresses

For any subnet, three special addresses are defined:

Usable hosts = 2(32 โˆ’ prefix) โˆ’ 2 (subtract 2 for network and broadcast).

Common Subnet Sizes and Their Uses

Private IP Address Ranges (RFC 1918)

These ranges are reserved for private networks and are not routable on the public internet:

Subnetting โ€” Dividing a Network

Subnetting divides a larger network into smaller, more manageable subnets by extending the prefix length. Each additional bit borrowed doubles the number of subnets and halves the number of hosts per subnet.

Example: Split 10.0.0.0/24 into four equal /26 subnets:

10.0.0.0/26   โ†’ hosts 10.0.0.1   โ€“ 10.0.0.62   (62 usable)
10.0.0.64/26  โ†’ hosts 10.0.0.65  โ€“ 10.0.0.126  (62 usable)
10.0.0.128/26 โ†’ hosts 10.0.0.129 โ€“ 10.0.0.190  (62 usable)
10.0.0.192/26 โ†’ hosts 10.0.0.193 โ€“ 10.0.0.254  (62 usable)

Borrowing 2 bits from the host portion: 22 = 4 subnets, each with 26 โˆ’ 2 = 62 usable hosts.

Cloud Infrastructure Subnetting

When designing AWS VPCs, GCP VPCs, or Azure VNets, subnetting decisions have long-term consequences. Best practices:

IPv6 Subnetting

IPv6 addresses are 128 bits long, written as eight groups of four hex digits: 2001:db8:abcd:0012::1/64. The prefix length works identically to IPv4.

A /64 IPv6 subnet contains 264 host addresses โ€” roughly 18.4 quintillion. The standard practice is to always assign /64 subnets to individual network segments, since SLAAC (Stateless Address Autoconfiguration) requires a /64.

IPv6 Address Types

Calculate Subnets Instantly

The IPv4 and IPv6 Subnet Calculator on DataConvertProTools gives you complete subnet information instantly โ€” network address, broadcast address, first and last host, subnet mask, wildcard mask, binary representation, and a subnetting chart showing how the network can be divided. Enter any IP/CIDR notation and get results in under a second, entirely in your browser.

Calculate any subnet instantly: DataConvertProTools IPv4 & IPv6 Subnet Calculator โ€” full results including binary view, host ranges, and subnetting table. Free, private, no signup required.