How to Remember Subnetting: The Block-Size Method
DEV Community

How to Remember Subnetting: The Block-Size Method

This article was first published on the SecLern blog.

The fastest way to remember subnetting is the block-size method. Subtract the mask value in the first octet that is not 255 from 256, and you have the block size. Count blocks upward from 0, and the block that holds your address starts at the network address.

Memorize one ladder, 128, 192, 224, 240, 248, 252, 254, 255, and you can rebuild every mask, prefix and host count from memory. Everything else is just the edges of that block.

TL;DR

  • Block size = 256 minus the mask value in the first octet that is not 255; count blocks upward from 0.
  • Memorize one ladder: 128, 192, 224, 240, 248, 252, 254, 255. It maps to /25 through /32.
  • 192.168.10.147/27 is in 192.168.10.128/27: broadcast 192.168.10.159, usable 192.168.10.129 to 192.168.10.158, 30 hosts.
  • Usable hosts = 2^(32 - prefix) - 2; a /27 has a block size of 32 but only 30 usable hosts.
  • Drill five minutes on days 1, 3, 7, 14 and 30; check with a calculator only after you commit to an answer.

What is the fastest way to remember subnetting?

The fastest way to remember subnetting is the block-size method: block size = 256 minus the mask value in the first octet that is not 255 (the interesting octet). You memorize one artifact and derive the rest.

The ladder 128, 192, 224, 240, 248, 252, 254, 255 gives you every subnet mask; 256 minus the mask gives the block size; the block size gives the network, broadcast and usable range.

CompTIA's N10-009 exam objectives put IPv4 addressing inside Networking Concepts (23%), while Network Troubleshooting is the largest domain at 24%. Cisco's CCNA 200-301 exam topics give IP Connectivity the largest share at 25%, and the exam runs 120 minutes.

The CompTIA Network+ exam page lists a maximum of 90 questions in 90 minutes, passing at 720 on a 100-900 scale.

The worked example below is 192.168.10.147/27. Blocks start at 0 and step by the block size, never at 1.

Why does subnetting feel impossible to remember?

Subnetting feels impossible to remember when you try to memorize answers, dozens of subnet tables, instead of one method that produces them. You memorize output, not a process. A 64-row table is 64 separate things to recall under pressure; one method is one thing.

Three skills get tangled. Mask-to-prefix conversion, block size and usable host count are separate skills. Learn each alone, then combine them.

Calculator-first practice trains recognition. If the answer appears before your brain works, you are learning to read, not to subnet.

There is no spaced retrieval. Subnetting is a procedure, and procedures fade unless you retrieve them cold, at intervals. The same rule makes port numbers stick.

What should you memorize first? The 8-row subnetting table

Memorize the eight-value ladder 128, 192, 224, 240, 248, 252, 254, 255. It maps to /25 through /32, and every subnetting chart you have seen is built from it.

CIDR Dotted mask Mask value in interesting octet Block size Total addresses Usable hosts /24 255.255.255.0 0 256 256 254 /25 255.255.255.128 128 128 128 126 /26 255.255.255.192 192 64 64 62 /27 255.255.255.224 224 32 32 30 /28 255.255.255.240 240 16 16 14 /29 255.255.255.248 248 8 8 6 /30 255.255.255.252 252 4 4 2

The interesting octet is the first octet that is not 255; for /24 that is the fourth, with mask value 0. Only that octet needs arithmetic. In 255.255.255.224, the first three octets are 255, so 224 is the only value you use. A /20 uses the third octet.

Two exceptions: RFC 3021 allows /31 on point-to-point links, where both addresses are usable; /32 is a single host route. Do not apply 2^h - 2 to either. Confirm current exam fees and passing scores on the vendor's official page.

How do you use the block-size method step by step?

Use five steps: find the interesting octet, subtract its mask value from 256, count blocks from 0, find the block that contains your address, then read the edges.

Find the interesting octet. A /27 stops in the fourth octet; a /20 stops in the third. Everything left is 255; everything right is 0.

Subtract from 256. /27 means 224 in that octet, so 256 - 224 = 32. Block size: 32.

Count blocks from 0. 0, 32, 64, 96, 128, 160, 192, 224.

Pick the block holding your address. Compare only the interesting octet. For 147, that block is 128 to 159.

Read the edges. Network = block start. Broadcast = next block start - 1. Usable = network + 1 to broadcast - 1. Hosts = 2^(32 - prefix) - 2.

Worked example: what subnet is 192.168.10.147/27 in? 192.168.10.147/27 sits in the subnet 192.168.10.128/27. Its usable range is 192.168.10.129 to 192.168.10.158, its broadcast is 192.168.10.159, and it has 30 usable hosts.

Out loud: /27 stops in the fourth octet, so the mask value is 224. 256 - 224 = 32, so the block size is 32. Blocks: 0, 32, 64, 96, 128, 160, 192, 224. 147 falls between 128 and 159, so the block starts at 128. The next block starts at 160, so broadcast is 159, usable is 129 to 158, and 32 - 2 = 30 hosts.

The 192.168.x.x range is one of the private ranges reserved by RFC 1918.

Second rep, different octet: 172.16.90.10/20. The prefix stops in the third octet, so the mask there is 240 and the block size is 16. Blocks are 0, 16, 32, 48, 64, 80, 96. 90 falls between 80 and 95, so the network is 172.16.80.0, broadcast is 172.16.95.255, usable is 172.16.80.1 to 172.16.95.254, and 12 host bits give 4,094 hosts. The fourth octet never entered the arithmetic.

Sanity check: in the interesting octet, the network value is a multiple of the block size, so the network ends even and the broadcast ends odd. Break that pattern and you slipped a block.

How do you remember subnet masks and prefix numbers?

Build the mask ladder by halving: 128, then add 64 for 192, add 32 for 224, add 16 for 240, add 8 for 248, add 4 for 252, add 2 for 254, add 1 for 255. Each step adds half of what is left. Once you see the halving, the ladder becomes one pattern, not eight facts.

The prefix is the count of 1 bits. 255.255.255.0 is /24, so the ladder runs /25 to /32: 128 is /25, 192 is /26, 224 is /27, 240 is /28, 248 is /29, 252 is /30, 254 is /31, 255 is /32.

One subtraction reads backwards. 256 - 224 = 32 gives the block size; 224's ladder position gives the prefix.

Anchor borrowed bits. 192 borrows 2 bits past /24, 224 borrows 3, 240 borrows 4, 248 borrows 5.

Write the ladder from memory daily for a week. Sixty seconds, no reference. Hesitate at 240 and that is tomorrow's drill.

How do you remember how many hosts a subnet has?

Usable hosts = 2^(32 - prefix) - 2. RFC 791 defines an IPv4 address as 32 bits, so host bits are whatever the prefix leaves. RFC 950 reserves the all-zeros host field as the network address and the all-ones field as broadcast; neither can be assigned to a host, which is the -2.

Memorize the anchors: /24 = 254, /25 = 126, /26 = 62, /27 = 30, /28 = 14, /29 = 6, /30 = 2. Each step roughly halves the usable count, so a number outside that /24 to /30 sequence means you mis-stepped.

The classic trap: a /27 has a block size of 32 and 30 usable hosts. Block size and host count are different numbers.

The exception to the -2 rule is a /31 on a point-to-point link, where both addresses are usable.

Which subnetting mistakes should you stop making?

The most common subnetting mistake is confusing block size with usable hosts: a /27 has 32 addresses and 30 usable hosts.

Counting the network or broadcast address as usable. Both are reserved, so every host count ends in -2.

Starting the block list at 1. Blocks start at 0 and step by the block size. Start at 1 and every subnet after shifts.

Doing the arithmetic in the wrong octet. /12, /20 and /26 use different octets. Only the interesting octet gets the 256 - mask treatment.

Reading 255.255.255.192 as /25. It is /26. Count bits back through the ladder, not by how small the number looks.

Subnetting addresses that are not ordinary subnets. IANA's special-purpose registry lists 127.0.0.0/8 as loopback and 169.254.0.0/16 as link-local.

How do you make it stick? A 5-minute daily routine

Drill five minutes on days 1, 3, 7, 14 and 30, and retrieve cold: write an answer before you check anything.

Minute 1: write the ladder. 128 to 255, then the /24 to /30 host anchors.

Minutes 2 to 4: three random cards. Pick any address and prefix, then say the network, broadcast and usable range in under 60 seconds each. Mix the octets.

Minute 5: check, then log. Confirm with the free subnet calculator only after you have written an answer down. Every miss becomes tomorrow's first card.

Use the arithmetic in a config task. Assign the mask to an interface in a hands-on lab. Exams ask you to configure, not just calculate.

Professor Messer's free Network+ videos and Practical Networking's Subnetting Mastery series are solid free walkthroughs. SubnettingPractice.com gives random problems, Anki handles spacing, and Boson ExSim-Max sells timed practice exams.

Subnetting memory checklist

This checklist tells you whether the method is automatic: you can do all seven without a chart, a calculator or a long pause.

  • I can write 128 to 255 from memory in under 60 seconds.
  • I can turn 255.255.255.224 into /27, and back, without a table.
  • I can state the block size for any /24 to /30 in one subtraction.
  • I can give the network, broadcast and usable range for a random IP and prefix in under 60 seconds.
  • I can explain why a /27 has 30 usable hosts, not 32.
  • I can do it when the interesting octet is the third, not the fourth.
  • I only open a calculator after I have committed to an answer.

Any no is tomorrow's five minutes. Once the method is automatic, move to the 7-day subnetting drill plan.

Our perspective

SecLern's labs put the arithmetic to work: you configure addresses and masks in a simulated Windows, Linux or Cisco desktop instead of only solving on paper.

My honest take is that the calculator is the least important tool on the site. Use it to check an answer you have already committed to, never to produce one, because every rep the calculator does for you is a rep your brain does not get. Checking by hand is slower for the first two weeks; after that it is faster than typing the question into anything.

If you only do one thing, write the ladder from memory every morning until it is boring.

Practice SecLern's CompTIA Network+ (N10-009) study page and Cisco CCNA 200-301 study page cover the exam objectives, and the practice questions explain every answer, right and wrong. The free tier gives you the first module of each path, 30 questions a day, 3 labs and PBQs, and unlimited flashcards, with no card needed. Pro is $15 a month or $99 a year with a 7-day trial and includes every lab, PBQ and full timed simulation. Exam Sprint is $29 once for 90 days if your test date is already booked.

FAQ

Is subnetting on the CCNA exam? Yes. Cisco's CCNA 200-301 exam topics give IP Connectivity 25% of the exam, its largest domain, and Network Fundamentals another 20%, so subnetting questions can appear in both. The exam runs 120 minutes. Check Cisco's page for the current blueprint version before you book a date.

Do you get a subnet cheat sheet or calculator on exam day? Do not plan on a subnet cheat sheet or a subnet calculator. CompTIA and Cisco do not supply a subnet chart, and personal devices are not allowed in the testing room. Practice writing the ladder by hand on whatever scratch materials your test provider allows. Confirm the current rules with your test provider when you book.

How long does it take to learn subnetting? It depends on your starting point. If you already know binary and CIDR, you can learn the ladder and block-size method in a few short sessions; reaching exam-speed recall takes regular spaced practice over several weeks. The key variable is cold retrieval, not total study hours. Use a short daily drill and a week-long plan to structure it.

What is the easiest way to learn subnetting for beginners? Learn one ladder, one method and one worked example before touching a question bank. Write 128 to 255 from memory, do 192.168.10.147/27 by hand three times, then drill random prefixes. Beginners get stuck because they open dozens of practice questions before doing five slow, correct repetitions of the same procedure.

Do I have to memorize every subnet mask? No. You need the eight ladder values in the first non-255 octet, plus the knowledge that /24 is 255.255.255.0. The other octets are always 255 to the left of that octet and 0 to the right, so the full mask table is derived, not memorized.

Is it bad to use a subnet calculator while studying? It is bad as a first step and fine as a last one. If the calculator produces the answer, you practiced typing. If it checks an answer you already wrote down, it catches errors and builds confidence. The rule is commit in pen, then verify.

Sources

CompTIA Network+ (Plus) Certification CompTIA Exam Objectives (Network+ N10-009) Cisco CCNA Exam Topics RFC 791: Internet Protocol RFC 950: Internet Standard Subnetting Procedure RFC 1918: Address Allocation for Private Internets RFC 3021: Using 31-Bit Prefixes on IPv4 Point-to-Point Links IANA IPv4 Special-Purpose Address Registry Read the original, kept up to date, on SecLern.

This article was first published on the SecLern blog.

The fastest way to remember subnetting is the block-size method. Subtract the mask value in the first octet that is not 255 from 256, and you have the block size. Count blocks upward from 0, and the block that holds your address starts at the network address.

Memorize one ladder, 128, 192, 224, 240, 248, 252, 254, 255, and you can rebuild every mask, prefix and host count from memory. Everything else is just the edges of that block.

TL;DR

  • Block size = 256 minus the mask value in the first octet that is not 255; count blocks upward from 0.
  • Memorize one ladder: 128, 192, 224, 240, 248, 252, 254, 255. It maps to /25 through /32.
  • 192.168.10.147/27 is in 192.168.10.128/27: broadcast 192.168.10.159, usable 192.168.10.129 to 192.168.10.158, 30 hosts.
  • Usable hosts =
Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.