AdvikPrep
Interactive Subnet Learning

Master CIDR & IPv4 Subnetting

Understand Classless Inter-Domain Routing without boring formulas. Play through progressive levels, test host capacities, and calculate subnet ranges in real time.

CIDR Labs

Interactive Subnet Learning

Score
0 XP
Streak
0x

CIDR Cheat Sheet & Core Concepts

Essential rules for cloud engineers, network architects, and exam candidates.

The 2^(32 - Prefix) Formula

Every IPv4 address consists of 32 bits. The CIDR prefix length (e.g., /24) denotes how many network bits are locked. The remaining bits determine total host count.

Total IPs = 2^(32 - Prefix)
Standard vs AWS Reserved IPs

Standard networks reserve 2 IP addresses (Network Address and Broadcast Address). AWS VPCs reserve 5 IP addresses per subnet (Network, VPC Router, DNS, Future Use, and Broadcast).

AWS Usable = Total IPs - 5

The table uses 10.0.0.0 as the example network for every prefix, so the broadcast address is calculated for that specific block. The IPv4 multicast range is 224.0.0.0/4; multicast is a separate address range, not a special address repeated inside every subnet. None of the example 10.0.0.0/p blocks are multicast.

IPv4 CIDR subnet sizes, address counts, broadcast addresses, multicast range, and AWS-reserved addresses using 10.0.0.0 as the example network.
CIDR PrefixSubnet MaskTotal IPsUsable Hosts (Standard)Broadcast IP (10.0.0.0/p)IPv4 Multicast RangeAWS Reserved IPs (first 4 + last)
/32255.255.255.2551110.0.0.0224.0.0.0/4Not an AWS VPC subnet size
/31255.255.255.2542210.0.0.1224.0.0.0/4Not an AWS VPC subnet size
/30255.255.255.2524210.0.0.3224.0.0.0/4Not an AWS VPC subnet size
/29255.255.255.2488610.0.0.7224.0.0.0/4Not an AWS VPC subnet size
/28255.255.255.240161410.0.0.15224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.0.15
/27255.255.255.224323010.0.0.31224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.0.31
/26255.255.255.192646210.0.0.63224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.0.63
/25255.255.255.12812812610.0.0.127224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.0.127
/24255.255.255.025625410.0.0.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.0.255
/23255.255.254.051251010.0.1.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.1.255
/22255.255.252.01,0241,02210.0.3.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.3.255
/21255.255.248.02,0482,04610.0.7.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.7.255
/20255.255.240.04,0964,09410.0.15.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.15.255
/19255.255.224.08,1928,19010.0.31.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.31.255
/18255.255.192.016,38416,38210.0.63.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.63.255
/17255.255.128.032,76832,76610.0.127.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.127.255
/16255.255.0.065,53665,53410.0.255.255224.0.0.0/4Network: 10.0.0.0Router: 10.0.0.1DNS: 10.0.0.2Future: 10.0.0.3Broadcast: 10.0.255.255
/15255.254.0.0131,072131,07010.1.255.255224.0.0.0/4Not an AWS VPC subnet size
/14255.252.0.0262,144262,14210.3.255.255224.0.0.0/4Not an AWS VPC subnet size
/13255.248.0.0524,288524,28610.7.255.255224.0.0.0/4Not an AWS VPC subnet size
/12255.240.0.01,048,5761,048,57410.15.255.255224.0.0.0/4Not an AWS VPC subnet size
/11255.224.0.02,097,1522,097,15010.31.255.255224.0.0.0/4Not an AWS VPC subnet size
/10255.192.0.04,194,3044,194,30210.63.255.255224.0.0.0/4Not an AWS VPC subnet size
/9255.128.0.08,388,6088,388,60610.127.255.255224.0.0.0/4Not an AWS VPC subnet size
/8255.0.0.016,777,21616,777,21410.255.255.255224.0.0.0/4Not an AWS VPC subnet size

How to calculate a subnet

An IPv4 address has 32 bits. In /p, the prefix length p is the number of network bits; the remaining 32 - p bits identify addresses within the block. Therefore, Total IPs = 2^(32 - p). The subnet mask is made from p leading 1 bits followed by zero bits. The network address is the first address in the aligned block, and the broadcast address is the last.

Usable hosts and special prefixes

For most traditional IPv4 subnets, usable hosts = total addresses minus two (the network and broadcast addresses). A /31 is a point-to-point link and can use both addresses under RFC 3021, while a /32 identifies one host address. Real broadcast addresses depend on the subnet’s network address; the table uses the aligned 10.0.0.0/p examples to make them concrete.

AWS VPC reservations and multicast

AWS IPv4 VPC subnets support prefixes from /16 to /28. AWS reserves the first four addresses and the final address in each subnet: network, VPC router, DNS, future use, and broadcast, respectively. For example, in 10.0.0.0/28, 10.0.0.0 is the network address, 10.0.0.1 the router, 10.0.0.2 DNS, 10.0.0.3 future use, and 10.0.0.15 the last (broadcast) address. That leaves Total IPs - 5 addresses available; the rows outside /16–/28are included for general subnetting reference and are not valid AWS subnet sizes. IPv4 multicast uses 224.0.0.0 through239.255.255.255 (224.0.0.0/4). It is a group-address range, not a per-subnet reserved IP, and is distinct from subnet-directed broadcast.

To apply this in a network design, choose a prefix that gives each subnet enough addresses for its devices and growth, then calculate the aligned network and last address from the actual base IP. Keep the network and broadcast addresses out of ordinary host assignments; for AWS, also keep all five AWS-reserved addresses out of your usable capacity estimate. Use the calculator above to try prefixes and compare standard and AWS host counts before allocating address space.