What is CIDR and Why Classful Addressing Failed
Classless Inter-Domain Routing (CIDR) was introduced in 1993 by the Internet Engineering Task Force (IETF) to replace the original Classful Network Architecture (Class A, Class B, and Class C).
Under the legacy classful system:
- Class A (/8) gave an organisation 16.7 million IP addresses.
- Class B (/16) assigned 65,536 IP addresses.
- Class C (/24) assigned 256 IP addresses.
This coarse allocation resulted in massive IPv4 address exhaustion. CIDR solved this by allowing subnets to be partitioned at any arbitrary bit boundary from /0 to /32.
---
Anatomy of an IPv4 Address
An IPv4 address consists of 32 bits, divided into 4 octets (8 bits per octet) separated by dots:
192.168.1.1 = 11000000 . 10101000 . 00000001 . 00000001
The CIDR suffix (e.g. /24) specifies how many leading bits represent the Network ID, leaving the remaining bits for Host IDs.
---
CIDR Subnet Reference Table
---
Step-by-Step Subnet Calculation Example
Let's calculate the subnet details for 10.0.4.0/22:
- Calculate Host Bits: 32 - 22 = 10 host bits
- Calculate Total IPs: 2^10 = 1,024 IP addresses
- Calculate Usable Hosts: 1,024 - 2 = 1,022 usable hosts
- Subnet Mask: 255.255.252.0 (11111111.11111111.11111100.00000000)
- First Usable IP: 10.0.4.1
- Last Usable IP: 10.0.7.254
- Broadcast Address: 10.0.7.255
Pro Tip for Cloud Architecture: AWS reserves the first 4 IP addresses and the last 1 IP address in every subnet (e.g., in a /24 subnet, only 251 IPs are available for your EC2 instances).
---
Calculate Subnets Instantly with Yurlie
Calculate IP ranges, broadcast addresses, wildcard masks, and binary layouts in real-time with our free CIDR Subnet Calculator.
Try Yurlie Online Developer Tools
Run CIDR calculations, JSON formatting, Base64 encoding, and UUID generation instantly in your browser.