Week 7 · Lesson 3

Finding the Subnet & Range

You are given an IP address and a prefix and asked: which subnet is this, and what is its full range? There are two routes to the answer — the binary AND that always works, and the block (magic number) shortcut that is fast enough for the exam. Learn both; trust the shortcut.

CCNA 200-301 Domain 1.7 IPv4 Addressing Verified 2026-10-11
Part 1

What the question gives you

A typical question reads: “Host 192.168.1.211/27 — what is the network address, the first usable, the last usable and the broadcast?” You are given an ordinary host address sitting somewhere inside a subnet, and you must work out where that subnet starts and ends.

The prefix fixes two things up front:

That octet — the one where the mask is neither 0 nor 255 — is called the magic octet. For any /25–/30 inside a classful /24 the magic octet is the fourth one. For /17–/23 it is the third (Lesson 5 covers that). Pinpointing the magic octet first is the whole secret.

Magic octet & block increment · pick a prefix
Subnet boundaries in the magic octet

Part 2

Method A — the binary AND

The subnet address is, by definition, the address ANDed bit-for-bit with the mask. Where the mask has a 1, the address bit is kept; where the mask has a 0, the bit becomes 0. This method always works and never relies on recognising a pattern.

Worked with 192.168.1.211/27. The first three octets (mask 255 = all 1s) pass through unchanged. Only the fourth octet needs work:

Mask last octet  /27  ->  224  =  11100000
Address .211                  =  11010011
                                    --------
AND (bit-by-bit)              =  11000000  =  192

Network address = 192.168.1.192

Read the columns: 1·1=1, 1·1=1, 0·0=0, 1·0=0, 0·0=0, 0·0=0, 1·0=0, 1·0=0 → 11000000, which is 128 + 64 = 192. The host bits (the last five) have been forced to 0; the network bits (first three) survived.

Definition — subnet address by AND. Subnet address = IP address AND subnet mask. The result always has all host bits set to 0, which is exactly the definition of a network address.
Binary AND · type an address, pick a prefix

      

Part 3

Method B — the block (magic-number) shortcut

The AND method is correct but slow under exam pressure. The block method gets the same answer in one subtraction.

Definition — block increment. In the magic octet, block increment = 256 − (mask value in that octet). The subnet boundaries are the multiples of that increment.

For a /27 the mask value is 224, so the increment is 256 − 224 = 32. The subnet boundaries are the multiples of 32: 0, 32, 64, 96, 128, 160, 192, 224. The address 211 falls between 192 and 224, so the network address is 192 in the last octet — 192.168.1.192, matching the AND method. The next boundary up (224) minus one gives the broadcast: 192.168.1.223.

Calculation trick. You do not need to write out every multiple. Divide the host octet by the increment and round down to the nearest multiple. For 211 ÷ 32 ≈ 6.6 → 6 × 32 = 192. For 130 ÷ 64 ≈ 2.03 → 2 × 64 = 128. This mental division is the fastest reliable path on the clock.

PrefixMask octetPower of 2Block increment (256 − mask)
/2512827128
/261922664
/272242532
/282402416
/29248238
/30252224
Subnet and range calculator · type an address, pick a prefix

Part 4

From network to full range

Once you have the network address in the magic octet, the rest is pure arithmetic:

  1. Broadcast = network + increment − 1. All host bits become 1, so it is one less than the next subnet boundary.
  2. First usable = network + 1.
  3. Last usable = broadcast − 1.

Always verify with the count rule from Lesson 2: the number of addresses between first usable and last usable inclusive must equal 2h − 2. If it does not, one of your four numbers is wrong.

Exam tip. A subtle trap: in a /29 the host address .199 is exactly the broadcast address of its subnet, so it is not a valid host address. The exam loves asking “is this a valid host?” or “can this address be assigned?”. After finding the network, always compare the given address against the range boundary.
Part 5

Four worked examples & drills

Each example is fully worked and then checked with the count rule.

Example 1 — 192.168.1.211/27
  Mask .224, magic octet = 4th, increment = 256 − 224 = 32
  Multiples of 32: 0,32,64,96,128,160,192,224
  211 lies between 192 and 224  ->  network octet = 192
  Network     192.168.1.192
  Broadcast   192.168.1.223     (192 + 32 − 1)
  First       192.168.1.193
  Last        192.168.1.222
  Check: 222 − 193 + 1 = 30 = 2^5 − 2   OK

Example 2 — 10.10.10.130/26
  Mask .192, magic octet = 4th, increment = 256 − 192 = 64
  Multiples of 64: 0,64,128,192
  130 lies between 128 and 192  ->  network octet = 128
  Network     10.10.10.128
  Broadcast   10.10.10.191      (128 + 64 − 1)
  First       10.10.10.129
  Last        10.10.10.190
  Check: 190 − 129 + 1 = 62 = 2^6 − 2   OK

Example 3 — 172.16.5.87/28
  Mask .240, magic octet = 4th, increment = 256 − 240 = 16
  Multiples of 16: 0,16,32,48,64,80,96,...
  87 lies between 80 and 96  ->  network octet = 80
  Network     172.16.5.80
  Broadcast   172.16.5.95       (80 + 16 − 1)
  First       172.16.5.81
  Last        172.16.5.94
  Check: 94 − 81 + 1 = 14 = 2^4 − 2   OK

Example 4 — 192.168.100.199/29
  Mask .248, magic octet = 4th, increment = 256 − 248 = 8
  Multiples of 8: 0,8,16,...,192,200
  199 lies between 192 and 200  ->  network octet = 192
  Network     192.168.100.192
  Broadcast   192.168.100.199   (192 + 8 − 1)
  First       192.168.100.193
  Last        192.168.100.198
  Check: 198 − 193 + 1 = 6 = 2^3 − 2   OK
Drills · select a row to see the reasoning
Host / prefixIncrementNetworkBroadcastUsable range
192.168.5.100/2664192.168.5.64192.168.5.127.65–.126 (62)
172.16.20.33/2732172.16.20.32172.16.20.63.33–.62 (30)
10.20.30.68/281610.20.30.6410.20.30.79.65–.78 (14)
192.168.9.170/298192.168.9.168192.168.9.175.169–.174 (6)

Part 6

Key terms & sources

Magic octet

The octet where the mask is neither 0 nor 255 — where the subnet boundary falls.

Block increment

256 − mask value in the magic octet; the spacing between subnet boundaries.

Binary AND

Bit-by-bit multiplication of address and mask that yields the network address.

Network address

IP AND mask; all host bits 0.

Broadcast address

Network + increment − 1; all host bits 1.

Usable range

First usable to last usable; its length must equal 2h − 2.

  1. Fuller, V. & Li, T. RFC 4632: Classless Inter-Domain Routing (CIDR) (2006) (prefix/block semantics). rfc-editor.org/rfc/rfc4632.
  2. Pummill, R. & Manning, B. RFC 1878: Variable Length Subnet Table For IPv4 (1995). rfc-editor.org/rfc/rfc1878.
  3. Cisco. CCNA (200-301) Exam Topics, IPv4 Addressing and Subnetting. cisco.com.
Part 7 · Your turn

Review

Check what you have learned with these review questions.

Review · 6 questions

Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.