IP Addressing & CIDR

CIDR notation, subnetting, private RFC 1918 ranges, IPv6 basics, and calculating usable hosts per subnet.

Overview

Overview IP addressing and subnetting are foundational networking knowledge that every cloud engineer, SRE, and backend developer working with infrastructure must understand. Whether you are designing VPC address spaces, configuring Kubernetes pod CIDR ranges, debugging why two services cannot communicate, or understanding why a security group rule is not matching, IP addressing knowledge is directly applied.

An IP address is a 32-bit (IPv4) or 128-bit (IPv6) number that identifies a network interface. IPv4 addresses are written in dotted-decimal notation as four octets (e.g., 192.168.1.100). The address is divided into a network portion and a host portion, determined by the subnet mask.

CIDR (Classless Inter-Domain Routing, RFC 4632) replaced the rigid class-based addressing (Class A/B/C) with prefix notation. A CIDR block like 10.0.0.0/16 means the first 16 bits are the network prefix, leaving 16 bits for host addresses. This allows arbitrary prefix lengths, enabling efficient allocation of IP address space without wasting entire Class C blocks on networks with a handful of hosts.

RFC 1918 defines three private address ranges that are not routed on the public internet: 10.0.0.0/8 (16 million addresses), 172.16.0.0/12 (1 million addresses), and 192.168.0.0/16 (65,536 addresses). These ranges are used for private networks, VPCs, Kubernetes pod networks, and corporate LANs. They reach the internet via NAT (Network Address Translation).

IPv6 uses 128-bit addresses written as eight groups of four hex digits separated by colons (e.g., 2001:0db8:85a3:0000:0000:8a2e:0370:7334). Consecutive groups of zeros can be replaced with :: once per address. IPv6 has a vast address space (340 undecillion addresses), making NAT unnecessary — every device can have a globally unique address. IPv6 also introduces link-local addresses (fe80::/10) for communication within a network segment without configuration.

For cloud environments, VPC design decisions — CIDR block size, subnet allocation, reserved addresses, peering constraints — have long-term operational consequences that are expensive to change. Getting subnetting right the first time matters.

Key concepts

  • CIDR Notation
  • Subnet Mask
  • RFC 1918 Private Ranges
  • IPv6 Address Structure
  • AWS Reserved Addresses per Subnet
  • Supernetting and Route Summarization

Interview questions

  • How do you calculate the number of usable hosts in a /26 subnet, and what is its network and broadcast address if the base is 192.168.10.64?
  • How do you design a VPC address scheme for a multi-account AWS environment with dev, staging, and production?

Sign up free to read the full topic

More Networking topics

Start free on Cariara · Coding problems · System design studio