NewAI Content Creation is now live in Early Access
Turning Point Academyby Training Center
Skip to content
0%
IP Networks: Addressing and SubnettingLesson 4 of 8
Video lesson

Subnetting with CIDR - Part 1: The Mechanics

BeginnerVideo lesson
21 min videoBeginner
Downloads & resources
Download this lesson's materials, ready to use.

Subnetting with CIDR — Part 1: The Mechanics

Example prompt

Where you are: Module 4, lesson 4 of 8 — the lesson this module has been training you for. You need the binary landmarks from lesson 1 (the nine left-filled octets), the mask-as-filter model and /n notation from lesson 2, and nothing else. Everything here is arithmetic you can do on paper, and by the end you will be doing it fast. A companion video and a graded worksheet close the lesson; Part 2 (next lesson) turns today's mechanics into design practice.

What you'll learn

  • Convert fluently between /n prefixes and dotted subnet masks
  • Split any network into subnets by borrowing host bits — and predict how many subnets and hosts each borrow buys
  • Compute the five landmarks of any subnet: network ID, first host, last host, broadcast address, next network
  • Answer the seven questions every subnetting problem reduces to
  • Solve real address-dissection problems with the block-size method, without a calculator

This lesson builds on the subnetting sections of Chapter 6 of Dr. Tahseen Al-Doori's Network Essentials. The book teaches this arithmetic through the classful lens of its era; per the history you learned two lessons ago, this course runs the same machinery natively in CIDR — every technique below works at any prefix length, no classes required.

Why cut a network into pieces

Suppose your organization holds the block 172.16.0.0/16 — sixty-five thousand addresses. Nothing forces you to divide it; you could run one giant network. Three reasons say don't.

Broadcasts scale badly. A network is a broadcast domain: every broadcast frame interrupts every host on it. You watched this yourself in the last lab — your machine received ARP requests meant for others, because broadcasts go to everyone. On a network of twenty devices that chatter is nothing; on a network of ten thousand, it is a permanent background roar, and every device wastes capacity processing questions that were never for it.

One network means no interior walls. Devices on the same network talk directly, with no router between them — which also means no natural place to put security boundaries. Splitting accounting from the guest Wi-Fi at the network level is only possible if they are separate networks.

Organizations have structure; addressing should match it. Separate networks per floor, per department, per branch make faults easier to locate, plans easier to read, and growth easier to manage.

The solution is subnetting: dividing one address block into multiple smaller networks, called subnets. A classic analogy from Dr. Al-Doori's course: a whole pie is one object; cut it into slices and it becomes servable portions — nothing added, nothing thrown away, the same pie in usable pieces. Subnetting cuts an address block the same way: every address in the parent block ends up in exactly one slice.

Borrowing bits: the one trade subnetting makes

Recall the anatomy of an address under CIDR: the prefix length says how many leading bits are network; the rest are host bits. Subnetting is a single move performed on that boundary: take some host bits and reassign them to the network side — the traditional phrase is borrowing bits. Extending the prefix from /24 to /26 borrows two host bits; those two bits now distinguish subnets from each other.

The arithmetic of the trade is pure powers of two:

  • Borrow b bits → the parent block divides into 2^b subnets. (Two borrowed bits → four subnets; three → eight.)
  • Each subnet keeps h host bits → it spans 2^h addresses.
  • Of those, 2^h − 2 are usable for devices, because every subnet reserves its two extreme addresses:
    • the network ID — host bits all 0 — the subnet's name, used in plans and routing tables, never assigned to a device;
    • the broadcast address — host bits all 1 — the everyone-here destination, never assigned to a device.

Each borrowed bit therefore doubles the subnets and halves the size of each — the pie cut into ever-thinner slices. And notice what the reserved pair implies: subnetting has a cost. A /24 offers 254 usable addresses; the same /24 cut into four /26s offers 4 × 62 = 248, because every new slice spends two addresses on its own bookkeeping. You trade a little capacity for a lot of structure.

Prefix↔mask fluency is assumed from here, so pin the table — it is the lesson-1 value row wearing its /n names:

PrefixMask (last interesting octet)Block sizeAddressesUsable hosts
/24255.255.255.0256 (whole octet)256254
/25255.255.255.128128128126
/26255.255.255.192646462
/27255.255.255.224323230
/28255.255.255.240161614
/29255.255.255.248886
/30255.255.255.252442
/16255.255.0.0256 in the third octet65,53665,534
/20255.255.240.016 in the third octet4,0964,094

("Block size" is about to become your favorite column.)

The seven questions

Every subnetting problem you will ever face — exam, interview, or a live network at 2 a.m. — reduces to some of the same seven questions about an address and prefix:

  1. What is the network ID (which subnet does this address belong to)?
  2. What is the broadcast address of that subnet?
  3. What is the first usable host address?
  4. What is the last usable host address?
  5. What is the next network (where does the following subnet begin)?
  6. How many addresses — total and usable — does the subnet hold?
  7. What is the mask ↔ prefix conversion in play?

Answer all seven and the subnet holds no further secrets. The method below produces all of them in seconds.

The block-size method

You could answer the seven questions by writing addresses out in binary and filtering, as in lesson 2 — it always works, and you should do it a few times to see why the shortcut is true. The professional shortcut is the block-size method:

  1. Find the interesting octet — the one where the mask is neither 255 nor 0 (where the prefix boundary falls).
  2. Compute the block size: 256 minus the mask's value in that octet. (Mask 192 → block 64; mask 240 → block 16.) The block size is how wide each subnet is, counted in that octet — because the borrowed bits step through the octet in exactly those strides.
  3. List the multiples of the block size from 0 upward: they are the subnets' starting points in the interesting octet.
  4. Place your address: its subnet starts at the largest multiple that does not exceed the address's value in the interesting octet.
  5. Read off the answers: the next multiple starts the next network; the broadcast is one address below the next network; first and last usable hosts sit just inside the network ID and broadcast. When the interesting octet is not the last one, octets to its right fill with 0 for the network ID and 255 for the broadcast.

That is the whole method. Three worked examples make it concrete — one easy, one crossing into the third octet, one small and sharp.

Worked example 1 — four slices of a /24

The office network 192.168.10.0/24 is subnetted with /26. Where does the host 192.168.10.137 live? Answer all seven questions.

Borrowed bits: 26 − 24 = 2, so 2² = 4 subnets. Host bits: 32 − 26 = 6, so 2⁶ = 64 addresses each, 62 usable (question 6). Mask: /26 = 255.255.255.192 (question 7). Interesting octet: the fourth. Block size: 256 − 192 = 64.

Multiples of 64: 0, 64, 128, 192 — the four subnets begin at 192.168.10.0, .64, .128, .192. Place 137: the largest multiple not exceeding 137 is 128.

  1. Network ID: 192.168.10.128
  2. Broadcast: next network starts at .192, so one below: 192.168.10.191
  3. First host: 192.168.10.129
  4. Last host: 192.168.10.190
  5. Next network: 192.168.10.192

Sanity-check the shape: 64 addresses from .128 through .191; strip the two reserved ends and 62 remain, .129 through .190. Host .137 sits comfortably inside. Total time with practice: under thirty seconds.

Worked example 2 — the boundary in the third octet

Your company subnets 172.16.0.0/16 into /20 blocks. A server is at 172.16.42.7/20. The seven questions again.

Borrowed: 20 − 16 = 4 → 2⁴ = 16 subnets. Host bits: 32 − 20 = 12 → 4,096 addresses, 4,094 usable. Mask: /20 = 255.255.240.0 — and here is the twist: the interesting octet is the third. Block size: 256 − 240 = 16, counted in the third octet.

Multiples of 16: 0, 16, 32, 48, 64… Place the address's third octet, 42: largest multiple not exceeding it is 32.

  1. Network ID: third octet 32, fourth octet fills with 0 → 172.16.32.0
  2. Next network: 172.16.48.0 (question 5, taken early because broadcast hangs off it)
  3. Broadcast: one address below the next network → 172.16.47.255 — note the fourth octet fills with 255
  4. First host: 172.16.32.1
  5. Last host: 172.16.47.254

Read the span aloud: this subnet owns sixteen consecutive third-octet values, 32 through 47, each carrying a full octet of fourth-octet values — 16 × 256 = 4,096 addresses. Addresses like 172.16.40.200 and 172.16.47.3 are all the same subnet; 172.16.48.1 is the next one over. Decimal instinct fails here — 172.16.42.x and 172.16.47.x don't look like neighbors — but the block arithmetic is the truth.

Worked example 3 — thin slices for small jobs

A lab cuts 10.20.30.0/24 into /29s for benches of six devices. Which subnet holds 10.20.30.100, and does a seventh device fit?

Borrowed: 29 − 24 = 5 → 32 subnets. Host bits: 3 → 8 addresses, 6 usable — the answer to the second question is already no: a /29 seats exactly six devices, a seventh needs a bigger slice. Mask: 255.255.255.248; block size 256 − 248 = 8.

Multiples of 8 around 100: 96, 104. Largest not exceeding 100 → 96.

  1. Network ID: 10.20.30.96
  2. Broadcast: 10.20.30.103
  3. First host: 10.20.30.97
  4. Last host: 10.20.30.102
  5. Next network: 10.20.30.104

Three examples, one method: interesting octet, block size, multiples, place, read. That is the complete mechanical core of subnetting. What remains — choosing prefix lengths from requirements, laying out whole addressing plans, checking for overlaps — is design, and it is exactly what Part 2 trains next lesson.

From the textbook to 2026

The arithmetic on this page is the book's own subnetting machinery — borrowing bits, counting combinations, sizing networks — with one framing change: Chapter 6 starts each problem from a class's default mask and subnets downward from there, because that matched the certification curricula of its day. Since CIDR (1993), no class defaults exist: you subnet from whatever prefix you actually hold, whether that is a /16, a /21 or a /26 from your cloud provider, and the method never asks what the first octet is. Nothing else needed modernizing — powers of two have not changed, and this is precisely the kind of stable core that makes the book worth keeping as a backbone. One important qualification, because the "minus two" rule is not universal. It applies to ordinary broadcast subnets — the LANs this course designs — where the all-zeros host pattern names the network and the all-ones pattern is the broadcast. Two cases fall outside it:

  • /31 point-to-point links (RFC 3021). A link joining exactly two routers has nobody to broadcast to: "everyone else on this link" is the other end. So the standard drops the reservation and both addresses are usable — 2 addresses, 2 hosts, zero waste. The older /30 (4 addresses, 2 usable) does the same job while spending half the block, and remains extremely common in deployed networks and study material.
  • /32 is a single address — a host route, not a multi-host subnet at all. You will meet it on loopback interfaces and in routing tables.

So: on a normal LAN, subtract two. On a two-router link, /31 is the efficient modern choice and /30 the traditional one. On a /32, there is nothing to subtract.

Watch: What is Subnetting? — Subnetting Mastery, Part 1 of 7

Why this video earns its place. Subnetting Mastery from the channel Practical Networking is probably the most-recommended subnetting series in networking study communities — the "it finally clicked" recommendation passed between students, and a staple of CCNA preparation. Part 1 is its opening lecture: what subnetting is, why it exists, and — most valuably for you — a framing of every subnetting problem as solving for seven attributes: Network ID, Broadcast IP, First Host IP, Last Host IP, Next Network, Number of IP Addresses, and the CIDR/mask conversion. If that list sounds familiar, it should: they are this lesson's seven questions, and hearing a second teacher build the same frame from scratch is exactly the reinforcement that makes a skill stick.

As you watch, notice:

  • How the video motivates cutting networks into pieces — compare it with the three reasons (broadcasts, boundaries, structure) this lesson gave.
  • The seven attributes as he introduces them, and how each maps onto a landmark you already computed in the worked examples — network ID and broadcast as the reserved bookends, first/last host just inside them.
  • "Next network" doing real work in his framing — the same role it played in our block-size method, where the broadcast is found by stepping back one from the next network.
  • The promise of a "cheat sheet" solving method for the later parts of the series — the technique it builds answers the same seven questions our block-size method already answers; treat it as a second route up the same mountain.

Guidance before you press play. Part 1 is deliberately conceptual — it frames the problem and defines the attributes, and leaves the solving technique to Parts 2 through 7. That is why this lesson taught you the complete mechanics first: watch Part 1 as a second pass over today's concepts, not as the source of the skill. If the series' style suits you, continuing into Parts 2–7 — paired with the channel's free drill site, SubnetIPv4.com — is an excellent optional deep-dive and among the best subnetting practice available; our own Part 2 lesson continues from here regardless, so nothing depends on it. Note also the series is IPv4-only, as is all subnetting arithmetic in this module; IPv6's very different addressing story arrives at the end of the module. The video reinforces visually what you just learned — the lesson is complete without it.

Worksheet: Subnetting Exercises — Set A

Instructions. Twelve graded items in three sets, mirroring how the skill is actually used: conversions, dissections, decisions. Work every item on paper with the block-size method (or binary, where you want to see the gears) before checking the answers. No calculator — fluency is the point.

Set A — conversions and counts.

  1. Write /27 as a dotted mask.
  2. Write 255.255.252.0 as a prefix.
  3. A /24 is subnetted into /28s. How many subnets, and how many usable hosts in each?
  4. How many usable host addresses does a /26 hold?

Set B — dissect the address. For each, give network ID, first host, last host, broadcast, and next network.

  1. 192.168.50.77/26
  2. 10.10.10.130/25
  3. 172.31.77.200/20
  4. 192.168.2.9/30
  5. For the subnet 10.44.32.0/19 — just the next network.

Set C — decide and design.

  1. Hosts 192.168.1.60/26 and 192.168.1.70/26 — same subnet, or is a router needed between them?
  2. You must divide 192.168.8.0/24 into at least six subnets. What prefix do you use, how many usable hosts does each subnet hold, and what are the first two subnets' network IDs?
  3. A subnet beginning at 10.5.5.0 must hold 100 hosts. What is the smallest sufficient subnet (longest prefix), and what is its broadcast address?

Deliverable. Twelve worked answers with the block size shown for every Set B and Set C item.

Self-check (answers).

  1. /27 → three borrowed bits past /24 → 255.255.255.224.
  2. 252 = 11111100 (six 1s) → 8+8+6 = /22.
  3. /24→/28 borrows 4 bits → 16 subnets, each 2⁴ = 16 addresses → 14 usable.
  4. /26 → 6 host bits → 64 − 2 = 62.
  5. Block 64; multiples 0, 64, 128… 77 → 64. Network 192.168.50.64 · first .65 · last .126 · broadcast .127 · next 192.168.50.128.
  6. Block 128; 130 → 128. Network 10.10.10.128 · first .129 · last .254 · broadcast .255 · next network 10.10.11.0 (the parent /24's end — the step carries into the third octet).
  7. /20 → interesting octet is the third; block 16; 77 → 64. Network 172.31.64.0 · first 172.31.64.1 · last 172.31.79.254 · broadcast 172.31.79.255 · next 172.31.80.0.
  8. Block 4; 9 → 8. Network 192.168.2.8 · hosts .9 and .10 (a /30's entire usable range) · broadcast .11 · next .12.
  9. /19 → block 32 in the third octet → next network 10.44.64.0.
  10. Block 64: 60 lives in the 0-subnet (192.168.1.0, hosts up to .62); 70 lives in 192.168.1.64. Different subnets — router required, even on the same switch.
  11. Six subnets need 2^b ≥ 6 → b = 3 → /27, eight subnets of 30 usable hosts; first two: 192.168.8.0/27 and 192.168.8.32/27. (If the requirement had been "six subnets of 40 hosts," a /27 fails — sizing from both directions is Part 2's opening topic.)
  12. 100 hosts need 2^h − 2 ≥ 100 → h = 7 (126 usable) → /25: network 10.5.5.0/25, broadcast 10.5.5.127.

Grading. Eleven or twelve correct: mechanics mastered — proceed. Eight to ten: solid; redo the missed items in binary to find the slipped gear. Below eight: no shame — this is a rhythm skill; drill Download: Subnetting Workbook A (thirty further graded exercises with full worked solutions) before Part 2, where design problems assume these mechanics are automatic.

Check yourself

  1. A host is configured 192.168.4.33/27 with default gateway 192.168.4.62. Is the gateway usable — and why can this host not reach a printer at 192.168.4.65 without routing?
  2. Two PCs on the same switch: 10.1.1.10/24 and 10.1.2.10/24. The owner insists "they're both 10-dot, they should see each other." Explain the fault in subnet terms and offer two distinct fixes.
  3. A DHCP scope must serve 70 laptops inside one /26. Will it? If not, what is the smallest subnet that will?
  4. Two routers connect over a dedicated point-to-point link. Which prefix from this lesson's table serves the link with the least waste, and how many addresses does it leave unused?
  5. A junior admin assigns a server the address 172.31.79.255/20. It never receives a single packet addressed to it — explain using worksheet item 7.
  6. Planning meeting claim: "If we split 172.16.0.0/16 into /24s, we get about a hundred subnets." Correct the number, and give the usable hosts per subnet.

Answers

  1. Block 32: host 33 lives in subnet 192.168.4.32/27, usable hosts .33 through .62 — the gateway at .62 is the last usable host, perfectly valid. The printer at .65 sits in the next subnet (192.168.4.64/27, of which .65 is the first host) — a different network, so only a router can carry traffic between them.
  2. Under /24, network IDs are 10.1.1.0 and 10.1.2.0 — different subnets, so direct delivery is impossible regardless of the shared switch; the shared first octet means nothing under CIDR. Fixes: re-address one PC into the other's subnet (design intent: one network), or put a router/gateway between the two subnets (design intent: two networks). A third, design-level fix — widening the mask so both fall in one subnet — belongs to Part 2's planning discussion and must be applied to every host on the network, not one.
  3. No — a /26 offers 62 usable addresses, and 70 exceed it. The smallest sufficient subnet is a /25 (126 usable).
  4. /31 — 2 addresses, both usable, nothing wasted. This is the modern answer, and it is a real standard: RFC 3021 defines /31 for point-to-point links, where the network-and-broadcast reservation is dropped because a link with exactly two ends never needs a broadcast — "everyone else" is simply the other router. The traditional answer is /30: 4 addresses, of which 2 are usable and 2 are spent on the network ID and broadcast — still perfectly valid, still extremely common in deployed networks and in exam material, but it wastes half the block. Know both: /30 is what you will find, /31 is what wastes least.
  5. Worksheet 7 showed 172.31.79.255/20 is the broadcast address of subnet 172.31.64.0/20 — host bits all 1s, reserved, never assignable. The "server" was configured with the one address in its subnet that means everyone, so nothing unicast will ever be addressed to it.
  6. /16 → /24 borrows 8 bits → 2⁸ = 256 subnets (not "about a hundred"), each with 254 usable hosts.

Key terms

  • Subnetting — dividing one address block into multiple smaller networks by extending the prefix.
  • Subnet — one of the resulting networks; a slice of the parent block.
  • Borrowing bits — reassigning host bits to the network side; each borrowed bit doubles the subnets and halves their size.
  • Network ID — host bits all 0; the subnet's name, never assigned to a device.
  • Broadcast address — host bits all 1; the subnet's everyone-destination, never assigned to a device.
  • Usable hosts — 2^h − 2: the subnet's addresses minus the two reserved bookends.
  • Next network — the address where the following subnet begins; the broadcast is always one below it.
  • Interesting octet — the octet where the prefix boundary falls (mask neither 255 nor 0); the octet the block-size method works in.
  • Block size — 256 minus the mask's interesting-octet value; the width of each subnet counted in that octet.
  • The seven questions — network ID, broadcast, first host, last host, next network, address count, mask↔prefix — the complete checklist of any subnetting problem.

Summary

  • Networks are subnetted for three reasons: broadcast domains that scale, security and organizational boundaries, and address plans that mirror structure — the pie cut into servable slices.
  • Subnetting is one move: borrow host bits into the prefix. 2^b subnets, 2^h addresses each, 2^h − 2 usable — every slice spends two addresses on its network ID and broadcast.
  • Every problem reduces to seven questions, and the block-size method answers them: find the interesting octet, block = 256 − mask value, count multiples, place the address, read off the landmarks (broadcast = next network − 1).
  • When the boundary falls in the third octet, right-hand octets fill with 0 (network ID) and 255 (broadcast) — worked example 2 is the template.
  • The mechanics are CIDR-native: start from whatever prefix you hold; classes play no part (the book's classful starting points are history, per lesson 2).
  • The Practical Networking series frames subnetting as seven attributes — the same seven questions — and with SubnetIPv4.com makes excellent optional drilling beyond this lesson's worksheet and workbook.
  • Mechanics are necessary but not sufficient: choosing prefixes from requirements and building whole plans is design — next lesson's subject.

Next lesson

You can dissect any subnet a plan hands you. Next lesson reverses the direction: the requirements come first — "four departments, this many hosts each, room to grow" — and you design the plan, sizing and laying out subnets that don't collide. That design skill feeds directly into the course capstone.

Sources and further study

  • Al-Doori, T., Network Essentials, Chapter 6 — the subnetting machinery this lesson modernizes into native CIDR.
  • RFC 4632, "Classless Inter-Domain Routing (CIDR)" — https://www.rfc-editor.org/rfc/rfc4632 — the standard (BCP 122) behind prefix-based addressing.
  • RFC 1918, "Address Allocation for Private Internets" — https://www.rfc-editor.org/info/rfc1918/ — the private blocks used in this lesson's examples.
  • Practical Networking, "Subnetting Mastery" series page — https://www.practicalnetworking.net/stand-alone/subnetting-mastery/ — the full seven-part series accompanying this lesson's video.
  • SubnetIPv4 — https://subnetipv4.com/ — the series' free companion drill generator; unlimited practice problems with instant checking.
  • Download: Subnetting Workbook A (thirty graded exercises with worked solutions — the bridge between this lesson's worksheet and Part 2's design problems).