BuildTheNet

Opening your workspace

Your learning content and tools are loading.

Learning paths › CCNA › 1. Network Fundamentals

Finding Subnets Fast

Written reference: Master lightning-fast mental math for finding the network ID, broadcast address, and valid host range for any IP address in under 30 seconds.

About 11 minutes

Why it matters

On the exam and at the CLI you rarely have time for long binary arithmetic. A quick method gives you the network, broadcast and host range in seconds.

The Fast 4-Step Subnetting Method

Step 1: Identify the 'Interesting Octet' — the octet where the subnet mask is neither 255 nor 0.

Step 2: Calculate the Block Size (Magic Number) = 256 minus the mask value in that interesting octet.

Step 3: Count by multiples of the Block Size (0, block, 2*block...) until you find the multiple closest to, but less than or equal to, your IP.

Step 4: That multiple is your Network Address! The next multiple minus 1 is your Broadcast Address.

The 4-Step Speed Method Walkthrough

Problem: Find the Network ID, Broadcast, and Usable Range for 172.20.155.84/22.

Step 1: Convert /22 to Dotted Decimal Mask: • /16 = 255.255.0.0 • /22 = 6 bits in octet 3 (11111100 = 252) • Mask = 255.255.252.0 • Interesting Octet = Octet 3 (value is 252).

Step 2: Find Block Size: • 256 - 252 = 4.

Step 3: Multiples of 4 around 155: • 155 / 4 = 38 remainder 3 -> 38 * 4 = 152. • Subnet multiples in octet 3: ... 148, 152, 156, 160 ... • 155 falls between 152 and 156.

Step 4: Construct the Subnet: • Network Address: 172.20.152.0 • Next Subnet: 172.20.156.0 • Broadcast Address: 172.20.155.255 (one before 156.0) • First Usable Host: 172.20.152.1 • Last Usable Host: 172.20.155.254

Another Example: /28 in Octet 4

Problem: Find the Subnet for 192.168.10.147/28.

• Mask: 255.255.255.240 (/28 = 4 bits = 240) • Interesting Octet: Octet 4 • Block Size: 256 - 240 = 16 • Multiples of 16 near 147: 16 * 9 = 144, 16 * 10 = 160 • Network Address: 192.168.10.144 • Broadcast Address: 192.168.10.159 • Usable Range: 192.168.10.145 to 192.168.10.158

The words you need

Interesting Octet — The specific octet in an IP address where the subnet mask changes from 1s to 0s (where the mask value is between 128 and 254).

Subnet Multiples — The progression of valid network IDs calculated by repeatedly adding the block size (e.g. 0, 32, 64, 96, 128...).

Why the magic number works

Every subnet mask divides the address into a network part and a host part, and the "interesting octet" is the one where that line falls. In that octet the mask has some leading 1s followed by 0s, and the value 256 minus the mask octet is the block size: the distance from one subnet to the next. For a /26 the mask octet is 192, so the block size is 64 and subnets start at 0, 64, 128 and 192. Every octet to the left of the interesting one is copied straight into the network address; every octet to the right is all zeros in the network address and all ones in the broadcast address.

The exam never asks you to convert to binary if you do not want to. It asks five repeating questions: what is the network address, the broadcast address, the first and last usable host, how many hosts, and are these two hosts in the same subnet. The block-size method answers all five in a few seconds once the mask is a habit.

Worked example reasoned from the numbers

Take host 172.16.45.200 with mask /20. A /20 is 255.255.240.0, so the interesting octet is the third and the block size is 256 - 240 = 16. Third-octet subnets start at 0, 16, 32, 48 and so on. 45 sits between 32 and 48, so the network address is 172.16.32.0 and the next subnet is 172.16.48.0. The broadcast address is one less than the next network: 172.16.47.255. Usable hosts run from 172.16.32.1 to 172.16.47.254. Host bits are 32 - 20 = 12, so the host count is 2^12 - 2 = 4094.

Second case, in the last octet: 10.1.1.77/27. The mask octet is 224, so the block is 32 and the subnets are .0, .32, .64, .96. 77 lands in the .64 block, giving network 10.1.1.64, broadcast 10.1.1.95, usable .65 to .94 and 2^5 - 2 = 30 hosts. Always finish by sanity-checking: the given host must fall between the first and last usable address.

How it is tested and where people slip

Typical stems: "Which address is a valid host on the subnet of 192.168.5.130/26?", "What is the broadcast address?", or "Which two hosts are in the same subnet?". Distractors are almost always the network address, the broadcast address, or an address from the neighbouring block. Rule of thumb: if the host octet equals a multiple of the block size it is a network address (unusable), and if it is one below a multiple it is a broadcast address (unusable).

Common mistakes: using the mask value instead of 256 minus the mask value; forgetting that when the interesting octet is not the last, the broadcast address ends in 255 for every octet to its right; and subtracting 2 from the block size to count hosts when the interesting octet is not the last (the host count comes from the host bits, not from the block size). Point-to-point links are a special case: a /30 gives two usable hosts, and a /31 (RFC 3021) is accepted on point-to-point links where both addresses are used. For VLSM design, allocate the largest subnet first so the blocks stay aligned.

Check: broadcast address

Host 192.168.5.130/26. What is the broadcast address of its subnet?

Takeaways

Next: VLSM Subnetting

More free lessons in 1. Network Fundamentals