What to practice
- Calculate Network ID, Directed Broadcast, First/Last Usable Host IP, dotted-decimal mask, and usable host capacity for any IPv4 CIDR prefix.
- Design non-overlapping VLSM addressing plans by allocating subnets from largest host requirement to smallest.
- Distinguish public IPv4 space from RFC 1918 private blocks, 127.0.0.1 loopback, and 169.254.x.x APIPA addresses.
Limited preview notice: AP Networking is not yet open to all schools. College Board lists 2026-27 as its third and final pilot year, with a multiple-choice pilot exam in May 2027 for pilot schools, availability for all schools in 2027-28, and the AP Networking Exam in May 2028. This free preview teaches networking foundations. It is not a complete course, it is not for sale, and College Board does not endorse it.
Framework
Host Bits: h = 32 - Prefix Length (p) | Total IPv4 Addresses per Block = 2^h | Usable Host IPv4 Addresses = 2^h - 2 (subtracting Network ID [all host bits 0] and Directed Broadcast [all host bits 1]) | Fourth-Octet Block Size (for /24 to /30) = 2^(32 - p) | RFC 1918 Private Ranges: 10.0.0.0/8, 172.16.0.0/12 (172.16.0.0-172.31.255.255), 192.168.0.0/16
In this chapter, Layer 3 IPv4 logical addressing structures networks into routable hierarchies. A 32-bit IPv4 address paired with a CIDR prefix /p allocates p bits to the Network Prefix and h = 32 - p bits to the Host ID. Every subnet block has a block size of 2^h total addresses: the very first address (all host bits = 0) is the reserved Network ID, the very last address (all host bits = 1) is the reserved Directed Broadcast Address, and the remaining 2^h - 2 addresses in between are Usable Host IPs. Variable Length Subnet Masking (VLSM) prevents IP exhaustion by sizing each subnet to its actual host count, allocating largest subnets first (e.g., /25 = 126 hosts, /26 = 62 hosts, /27 = 30 hosts, /28 = 14 hosts, /29 = 6 hosts, and /30 = 2 hosts for point-to-point router links). Internally, enterprises use non-routable RFC 1918 private blocks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), while 127.0.0.0/8 is local loopback and 169.254.0.0/16 (APIPA) indicates failed DHCP allocation.
Worked CIDR/VLSM Subnet Boundaries, Usable Host Range & Point-to-Point Sizing Audit
A network engineer assigns the IPv4 host address 192.168.10.145/26 to a department server. Determine the dotted-decimal subnet mask, number of host bits h, block size, Network ID, Directed Broadcast address, First and Last Usable Host IPs, and total usable host capacity. Also state the optimal CIDR prefix for a 2-router point-to-point WAN serial link.
Step 1 (Host Bits & Block Size): For /26, host bits h = 32 - 26 = 6 bits. Block size = 2^6 = 64 addresses per subnet, and Usable Hosts = 64 - 2 = 62 hosts. Dotted-decimal mask = 255.255.255.192 (256 - 64 = 192).
Step 2 (Find Subnet Multiples of 64): Fourth-octet multiples of 64 are 0, 64, 128, 192. Because 145 lies between 128 and 191, the Network ID is 192.168.10.128/26.
Step 3 (Compute Broadcast & Usable Range): The next subnet starts at .192, so the Directed Broadcast is 192.168.10.191, the First Usable Host is 192.168.10.129, and the Last Usable Host is 192.168.10.190.
Step 4 (Point-to-Point Link Sizing): A 2-router link requires 2 usable IPs, so h = 2 (2^2 - 2 = 2 usable hosts), corresponding to a /30 prefix (255.255.255.252).
For any prefix /p between /24 and /30, the fourth-octet block size is 2^(32 - p) and the subnet mask's last octet equals 256 - 2^(32 - p).
Practice procedure
Compute h = 32 - p first, evaluate 2^h for block size, subtract 2 for usable hosts, and find the largest multiple of 2^h that is <= the given host octet.
Common mistakes
Forgetting to subtract 2 reserved addresses (Network ID and Broadcast) and stating that a /26 subnet supports 64 usable hosts instead of 62.
Assigning a subnet's Network ID (e.g., .128 on a /26) or Directed Broadcast address (.191 on a /26) to a host interface or router default gateway.
Key terms
Term: Classless Inter-Domain Routing (CIDR)
Definition: Prefix-based IP addressing notation (/p) allowing variable network prefix lengths independent of legacy A/B/C classes.
Term: Variable Length Subnet Masking (VLSM)
Definition: Dividing an IP block into subnets of different prefix lengths matched to each segment's host count.
Term: APIPA (169.254.0.0/16)
Definition: Automatic Private IP Addressing self-assigned by a DHCP client when no DHCP server responds with a lease.
Term: RFC 1918 Private Addresses
Definition: Internal IPv4 blocks (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16) that are not routed on the public Internet without NAT.