1.5 IPv4 Addressing and Subnetting

Key Takeaways

  • An IPv4 address is 32 bits divided into a network portion and host portion by the subnet mask.
  • CIDR notation /24 means 24 network bits and 8 host bits (256 addresses, 254 usable).
  • The formula for usable hosts per subnet is 2^h - 2 (subtract network and broadcast addresses).
  • Private IP ranges: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 (RFC 1918).
  • VLSM (Variable Length Subnet Masking) allows different subnet sizes within the same network.
Last updated: March 2026

IPv4 Addressing and Subnetting

Subnetting is arguably the most important skill for the CCNA exam. It appears in questions across every domain. Master subnetting and you'll have a significant advantage.

IPv4 Address Structure

An IPv4 address is a 32-bit number, typically written in dotted decimal notation as four octets separated by dots (e.g., 192.168.1.100).

192.168.1.100 in binary:
11000000.10101000.00000001.01100100

Each octet is 8 bits, with values from 0 to 255.

Subnet Masks and CIDR Notation

A subnet mask identifies which portion of an IP address is the network part and which is the host part:

  • Network bits = 1s in the subnet mask (identify the network)
  • Host bits = 0s in the subnet mask (identify the individual host)
Subnet MaskCIDRNetwork BitsHost BitsUsable Hosts
255.0.0.0/882416,777,214
255.255.0.0/16161665,534
255.255.255.0/24248254
255.255.255.128/25257126
255.255.255.192/2626662
255.255.255.224/2727530
255.255.255.240/2828414
255.255.255.248/292936
255.255.255.252/303022
255.255.255.254/313112 (point-to-point)
255.255.255.255/323201 (host route)

Key Subnetting Formulas

FormulaPurpose
2^nNumber of subnets (n = borrowed bits)
2^h - 2Usable hosts per subnet (h = host bits)
256 - subnet mask valueBlock size (magic number)

Subnetting Step-by-Step Example

Problem: Given the network 192.168.10.0/26, find the subnet details.

Step 1: Determine the mask /26 = 255.255.255.192

Step 2: Calculate block size 256 - 192 = 64 (each subnet contains 64 addresses)

Step 3: Calculate usable hosts Host bits = 32 - 26 = 6 Usable hosts = 2^6 - 2 = 62

Step 4: List the subnets

SubnetNetwork AddressFirst UsableLast UsableBroadcast
1192.168.10.0192.168.10.1192.168.10.62192.168.10.63
2192.168.10.64192.168.10.65192.168.10.126192.168.10.127
3192.168.10.128192.168.10.129192.168.10.190192.168.10.191
4192.168.10.192192.168.10.193192.168.10.254192.168.10.255

Key observations:

  • The network address is always the first address in each block (all host bits = 0)
  • The broadcast address is always the last address in each block (all host bits = 1)
  • Usable addresses are everything in between

Private IPv4 Address Ranges (RFC 1918)

These addresses are not routable on the public internet:

RangeCIDRClassNumber of Addresses
10.0.0.0 - 10.255.255.25510.0.0.0/8Class A16,777,216
172.16.0.0 - 172.31.255.255172.16.0.0/12Class B1,048,576
192.168.0.0 - 192.168.255.255192.168.0.0/16Class C65,536

Private addresses are used inside organizations and translated to public addresses using NAT (Network Address Translation) to access the internet.

Other Special IPv4 Addresses

Address/RangePurpose
127.0.0.0/8Loopback (127.0.0.1 is localhost)
169.254.0.0/16APIPA (Automatic Private IP Addressing)
0.0.0.0Default route / unspecified address
255.255.255.255Limited broadcast
224.0.0.0 - 239.255.255.255Multicast (Class D)

On the Exam: If a host has a 169.254.x.x address, it means the DHCP process failed and the host assigned itself an APIPA address. This is a common troubleshooting scenario.

VLSM (Variable Length Subnet Masking)

VLSM allows you to use different subnet mask lengths within the same classful network. This is essential for efficient IP address allocation.

Example: You have 10.0.0.0/24 and need to allocate subnets for:

  • LAN A: 100 hosts → needs /25 (126 usable hosts)
  • LAN B: 50 hosts → needs /26 (62 usable hosts)
  • LAN C: 25 hosts → needs /27 (30 usable hosts)
  • WAN Link: 2 hosts → needs /30 (2 usable hosts)

VLSM allocation (start with the largest subnet):

  1. LAN A: 10.0.0.0/25 (10.0.0.1 - 10.0.0.126)
  2. LAN B: 10.0.0.128/26 (10.0.0.129 - 10.0.0.190)
  3. LAN C: 10.0.0.192/27 (10.0.0.193 - 10.0.0.222)
  4. WAN Link: 10.0.0.224/30 (10.0.0.225 - 10.0.0.226)

On the Exam: VLSM questions often present a network and ask you to efficiently allocate subnets. Always start with the largest subnet first, then work your way down to the smallest. This prevents address overlap.

Powers of 2 Reference Table

Memorize this table—it's the foundation of fast subnetting:

PowerValueHost BitsUsable HostsCIDR (from /24)
2^1212 (P2P)/31
2^2422/30
2^3836/29
2^416414/28
2^532530/27
2^664662/26
2^71287126/25
2^82568254/24
Test Your Knowledge

How many usable host addresses are available in a /27 subnet?

A
B
C
D
Test Your Knowledge

A host has the IP address 172.20.5.100/22. What is the network address?

A
B
C
D
Test Your Knowledge

Which of the following is a private IPv4 address range defined by RFC 1918?

A
B
C
D