IT131 · SUBNETTING · FIELD MANUAL

The Subnetting Field Manual

Everything you need to subnet by hand, from binary through VLSM and IPv6, in the order you should learn it. Each concept has worked examples, a calculator shows every step of its work, and the practice drills generate new problems for as long as you want to keep going.

Ties to Module 11 — IPv4 Addressing · Module 12 — IPv6 Addressing Builds on Module 5 — Number Systems Practice 8 drills, new problems every time

Start here

What subnetting is, and the order to learn it

Subnetting means splitting one block of IP addresses into smaller blocks, one per network segment. Each block needs a boundary that every router and host can calculate the same way.

Prefer a story?

The same material is also told as a six-episode workplace drama: The Zoning Office, an OSI Company spinoff. A rookie learns subnetting from a veteran Surveyor while fending off The Sprawl and The Overlap. Good for reading aloud, or for a first pass before the details below.

Why networks get subnetted

Two kinds of jobs, two tools

Almost every subnetting problem is one of two jobs. Before you start one, ask which job it is. Most wrong answers come from using the wrong tool.

Analysis

"Where does this address live?"

You're given an address and a mask, like 172.16.45.200/20. Find its network, broadcast, host range, and host count.

Tool: the block-size method (the ruler). The Method →

Design

"Cut this network up."

You're given a network and a requirement, like "192.168.10.0/24, 6 subnets." Choose the mask and list the subnets.

Tools: the 7 holy steps for equal-size subnets (Borrowing Bits →), then VLSM for different sizes (VLSM →).

The whole idea as a neighborhood

Keep this picture in your head for the whole guide. Every term on this page has a place in it.

Networking termIn the neighborhood
IP addressA full street address: Elm Street, house 77
Network portionThe street name. Everyone on the street shares it.
Host portionThe house number. Unique on that street.
Subnet mask / prefixThe rule for where the street name stops and the house number starts
Network addressThe street sign. It names the street, and nobody lives in it.
Broadcast addressThe street's loudspeaker. One announcement reaches every house.
Default gateway (router)The post office at the end of the street. Anything addressed to another street goes there.
SubnettingSplitting one long street into several shorter, separately named streets
Block sizeHow many house numbers each new street gets
VLSMGiving busy streets more house numbers and cul-de-sacs fewer, instead of making every street the same length

Where the picture breaks: real streets can have any number of houses. Subnets always come in powers of two (4, 8, 16, 32…), because they're carved out with bits.

Six questions nearly every subnetting problem asks

For an address and prefix such as 172.16.45.200/20, you should be able to write down all six:

#QuestionAnswer for 172.16.45.200/20
1What's the subnet mask?255.255.240.0
2What's the network (subnet) address?172.16.32.0
3What's the broadcast address?172.16.47.255
4What's the first usable host?172.16.32.1
5What's the last usable host?172.16.47.254
6How many usable hosts?4,094

The learning path

  1. Anatomy — network vs. host, masks, prefixes, ANDing, and the −2.
  2. Binary — the 8 place values, and converting both ways fast.
  3. The Method — analysis: the block-size (magic number) technique.
  4. Borrowing Bits — design: equal-size subnets and the 7 holy steps.
  5. VLSM — different subnet sizes for different needs, without overlaps.
  6. IPv6 — the 16-bit subnet ID; far easier than IPv4.
  7. Field Kit — cheat sheet, address ranges, calculator, eight drills, traps, flashcards, quiz, glossary.

Concepts

Anatomy of an IPv4 address

Every IPv4 address has two parts: a network portion, which is the same for every device on the subnet, and a host portion, which is unique to each device. The subnet mask marks where one part ends and the other begins.

▶ Story version: The Zoning Office, Episode 01: Street Names and House Numbers

The town picture

The network portion is the street name, and the host portion is the house number. The mask is the zoning line between them, and an address without a mask is a house number without a street.

ANDing works like a stencil: holes wherever the mask has a 1, so only the street name shows through. And every street has two addresses nobody lives in: the street sign (network address) and the street's loudspeaker (broadcast). That's the −2.

Mask and prefix length: two ways to write the same boundary

New to binary? Keep reading anyway The next few examples show addresses as 1s and 0s. You don't need to convert them yet. For now, just notice that a mask is a run of 1s followed by a run of 0s, and that the 1s mark the network part. The Binary section right after this one teaches the conversion, and these examples make more sense once you've done it.

The address 192.168.10.77/26 in binary, split at the prefix boundary:

Address  11000000.10101000.00001010.01001101   192.168.10.77
Mask /26 11111111.11111111.11111111.11000000   255.255.255.192
         └────────── 26 network bits ─────┘└6 host┘
network bitshost bits

ANDing: how a device finds its network address

A host or router gets the network address with a bitwise AND of the address and the mask. The rule: 1 AND 1 = 1, and anything else gives 0. Where the mask has a 1, the address bit passes through unchanged. Where the mask has a 0, the result is 0.

Address   11000000.10101000.00001010.01001101   192.168.10.77
Mask  AND 11111111.11111111.11111111.11000000   255.255.255.192
          ───────────────────────────────────
Network = 11000000.10101000.00001010.01000000   192.168.10.64
Where you've seen this before (Session 6) Before sending a packet, a host ANDs its own address with its mask and then ANDs the destination address with that same mask, its own. A host never knows the destination's mask. If the two results match, the destination is on the local network and the host ARPs for it directly. If they differ, the packet goes to the default gateway. Subnetting decides which of those two paths every packet takes.

Every subnet has three kinds of address

AddressHost bits are…Can a host use it?In 192.168.10.64/26
Network addressall 0sNo. It identifies the subnet itself (e.g., in routing tables).192.168.10.64
Host addressesanything in betweenYes. These are the usable addresses..65 – .126
Broadcast addressall 1sNo. Packets sent here reach every host on the subnet.192.168.10.127

So a subnet with h host bits has 2h total addresses and 2h − 2 usable hosts. For a /26: 2⁶ = 64 total, 62 usable.

Network, broadcast, or host? Six examples

Only the host bits decide, never how the last octet looks. Work out the range first, then check where the address sits in it.

AddressSubnet rangeVerdictWhy
192.168.1.64/26.64 – .127NetworkFirst address of the block (host bits all 0)
192.168.1.127/26.64 – .127BroadcastLast address of the block (host bits all 1)
192.168.1.100/27.96 – .127HostStrictly between .96 and .127
10.0.0.255/2310.0.0.0 – 10.0.1.255HostEnds in .255 but sits in the middle of the range
172.16.4.0/22172.16.4.0 – 172.16.7.255Network4 is a multiple of the block size (4), and the 4th octet is 0
172.16.6.0/22172.16.4.0 – 172.16.7.255HostEnds in .0, but 6 isn't a multiple of 4. It's inside the range.
Convention, not a rule Most networks give the router's LAN interface (the default gateway) the first usable address, .65 here. Some use the last one. Either works as long as the hosts' gateway setting matches.

Foundation · Module 5 refresher

Binary: the only math you need

You just saw that the mask, ANDing, and the network/host split all work one bit at a time. This section gives you the fluency to read those bits. An IPv4 address is 32 bits, written as four 8-bit octets in dotted decimal. To subnet, you only need to be comfortable with one octet at a time.

▶ Story version: The Zoning Office, Episode 02: Eight Switches

Think of it like light switches

An octet is a row of 8 light switches, each labeled with its wattage: 128, 64, 32, 16, 8, 4, 2, 1. Flip some on, and the octet's value is the total wattage. To make 172, you flip on 128, 32, 8, and 4, because those add to 172. That's all binary conversion is: choosing which switches to turn on.

Each switch is worth double the one to its right, so there's exactly one way to make any number from 0 to 255.

The eight place values

Bit position87654321
Power of 22⁷2⁶2⁵2⁴2³2²2¹2⁰
Place value1286432168421

All eight bits on is 128+64+32+16+8+4+2+1 = 255, which is why no octet can go above 255.

Decimal → binary: the subtraction method

Work left to right. If the place value fits in what's left, write 1 and subtract. If it doesn't fit, write 0. Example: 172

Place valueFits in what's left?BitRemainder
128172 ≥ 128 ✓144
6444 < 64044
3244 ≥ 32 ✓112
1612 < 16012
812 ≥ 8 ✓14
44 ≥ 4 ✓10
20 < 200
10 < 100

Read the bit column top to bottom: 172 = 10101100.

Binary → decimal: add up the 1s

11000000 has 1s in the 128 and 64 places, so 128 + 64 = 192. 01001101 has 1s in the 64, 8, 4, and 1 places, so 64 + 8 + 4 + 1 = 77.

Try it: click bits, or type a number from 0 to 255

Binary 10101100

Two things to memorize

All subnet mask octets are built the same way: 1s fill in from the left. So a mask octet can only ever be one of nine values:

Mask octet (binary)Decimal1-bits
0000000000
100000001281
110000001922
111000002243
111100002404
111110002485
111111002526
111111102547
111111112558

You'll also use powers of two constantly to count subnets and hosts:

n123456789101112131416
2ⁿ2481632641282565121,0242,0484,0968,19216,38465,536
Shortcut Each power of two is double the one before it. If you forget 2¹¹, double 1,024 and get 2,048. On an exam, write the row out once and read answers off it.

Analysis · the core technique

The method: block size, a.k.a. the magic number

The analysis job: you're given an address and a mask, and you find where it lives. You don't need to write out 32 bits. Only one octet is "interesting," and one subtraction tells you where every subnet in it starts.

▶ Story version: The Zoning Office, Episode 03: Where Does This Address Live?

Block size is a ruler

Think of the interesting octet as a ruler from 0 to 255, with a tick mark every block-size units. For a /26, the marks are at 0, 64, 128, and 192. To place an address, find the mark at or just below its number: that's the network. The next mark, minus one, is the broadcast. For .77, the mark below is 64 and the next is 128, so the subnet runs .64 to .127.

It's the same thing you do when you ask which inch a 3¾-inch measurement falls in. Here the "inches" are just 64 units wide.

Six steps, every time

  1. Get the mask. Turn the prefix into a dotted mask using the chart.
  2. Find the interesting octet. It's the first octet, reading left to right, where the mask is not 255. (It's usually neither 255 nor 0. On an octet boundary like /24, it's the octet right after the 255s.)
  3. Block size = 256 − mask value in that octet. This is the "magic number."
  4. Count by the block size from 0. The network value is the largest multiple that's ≤ the address's value in that octet. Octets to the left copy across, and octets to the right become 0.
  5. Broadcast = next network − 1. In the interesting octet: network + block − 1. Octets to the right become 255.
  6. First host = network + 1, last host = broadcast − 1 (applied to the last octet). Hosts = 2h − 2.

See it: the subnet slicer

Drag the slider to cut 192.168.10.0/24 into smaller subnets, then type a host number to see which slice it lands in. Click any slice to see its range. Watch how each notch of the slider doubles the slices and halves their size.

.0.64.128.192.255

Worked examples

Example A · 4th octet

192.168.10.77 /26

  1. /26 → 255.255.255.192 (column 2 of the 4th-octet row).
  2. Interesting octet: the 4th (mask 192).
  3. Block size: 256 − 192 = 64.
  4. Count by 64: 0, 64, 128, 192. The address's 4th octet is 77, which falls in 64–127. Network = 192.168.10.64.
  5. Next network is .128, so broadcast = 192.168.10.127.
  6. Hosts: .65 through .126. 6 host bits → 2⁶ − 2 = 62.
Net192.168.10.64Bcast192.168.10.127First192.168.10.65Last192.168.10.126Hosts62
Example B · tiny subnet

192.168.1.134 /30

  1. /30 → 255.255.255.252.
  2. Interesting octet: the 4th (mask 252). Block size: 256 − 252 = 4.
  3. Count by 4 up to the address: …, 128, 132, 136. The value 134 falls in 132–135. Network = 192.168.1.132.
  4. Broadcast = 136 − 1 = 192.168.1.135.
  5. Hosts: .133 and .134. 2 host bits → 2² − 2 = 2. That's exactly one router interface on each end of a point-to-point link.
Net192.168.1.132Bcast192.168.1.135First192.168.1.133Last192.168.1.134Hosts2
Faster counting You don't have to count up from 0. Divide: 134 ÷ 4 = 33.5, round down to 33, then 33 × 4 = 132. That's the network value.
Example C · 3rd octet (where most mistakes happen)

172.16.45.200 /20

  1. /20 → 255.255.240.0 (column 4 of the 3rd-octet row).
  2. Interesting octet: the 3rd (mask 240). The 4th octet is entirely host bits.
  3. Block size: 256 − 240 = 16, and it applies to the 3rd octet.
  4. Count by 16 in the 3rd octet: 0, 16, 32, 48. The value 45 falls in 32–47. Network = 172.16.32.0. The 4th octet is 0 because it's to the right of the interesting octet.
  5. Next network is 172.16.48.0, so the broadcast is one address earlier: 172.16.47.255. The 3rd octet is 32 + 16 − 1 = 47, and the octet to its right becomes 255.
  6. First = 172.16.32.1, last = 172.16.47.254. 12 host bits → 2¹² − 2 = 4,094.
Net172.16.32.0Bcast172.16.47.255First172.16.32.1Last172.16.47.254Hosts4,094
The classic wrong answer Students often write the broadcast as 172.16.45.255. They keep the address's own 3rd octet and just set the last octet to 255. The subnet boundary is in the 3rd octet, so the 3rd octet has to change. Also note that 172.16.40.255 is an ordinary host address in this subnet, and hosts can use it.
Example D · 2nd octet

10.53.129.9 /11

  1. /11 → 255.224.0.0 (column 3 of the 2nd-octet row).
  2. Interesting octet: the 2nd. Block size: 256 − 224 = 32.
  3. Count by 32 in the 2nd octet: 0, 32, 64. The value 53 falls in 32–63. Network = 10.32.0.0. Both octets to the right become 0.
  4. Broadcast: 2nd octet 32 + 32 − 1 = 63, and both octets to the right become 255: 10.63.255.255.
  5. First = 10.32.0.1, last = 10.63.255.254. 21 host bits → 2²¹ − 2 = 2,097,150.
Net10.32.0.0Bcast10.63.255.255First10.32.0.1Last10.63.255.254Hosts2,097,150

Example bank: 14 more, across every octet

Cover the answer, work it on paper, then open it. The steps are generated by the same code as the calculator, so they follow the same six steps every time.

Your turn

Work these on paper, then check. The Practice section generates unlimited problems like these.

Try 1

10.1.1.200 /27

Show answer
Mask 255.255.255.224, block 32 in the 4th octet. Multiples of 32: …, 160, 192, 224. The value 200 falls in 192–223. Network 10.1.1.192, broadcast 10.1.1.223, hosts 10.1.1.193 – 10.1.1.222, 30 usable.
Try 2

172.20.99.5 /22

Show answer
Mask 255.255.252.0, block 4 in the 3rd octet. 99 ÷ 4 = 24.75, round down to 24, and 24 × 4 = 96. Network 172.20.96.0, broadcast 172.20.99.255, hosts 172.20.96.1 – 172.20.99.254, 2¹⁰ − 2 = 1,022 usable.
Try 3

192.168.200.63 /29

Show answer
Mask 255.255.255.248, block 8. 63 ÷ 8 = 7.875, round down to 7, and 7 × 8 = 56. Network 192.168.200.56, broadcast 192.168.200.63. The given address is the broadcast address, so it can't be assigned to a host. Usable range .57 – .62, 6 hosts.

Design · equal-size subnets

Borrowing bits: carving one network into many

The design job works the other way from analysis: take a network, borrow host bits and turn them into subnet bits, and end up with more, smaller networks.

▶ Story version: The Zoning Office, Episode 04: Cutting the Map

Borrowing bits is cutting the map

Lay the network out as one long street and cut it. Each borrowed bit is one more cut through every street: 1 becomes 2, then 4, then 8. The number of streets doubles with each cut, and each street is half as long.

That's also why you can't make exactly 6 subnets. Cutting only ever gives you 2, 4, 8, 16…, so you round up to the next power of two (8) and keep the extras as spares.

Where the picture breaks: paper loses nothing when you cut it, but every new street gives up 2 addresses (its sign and its loudspeaker).

Original  /24  11111111.11111111.11111111.00000000   1 network, 254 hosts
Borrow 2  /26  11111111.11111111.11111111.11000000   4 subnets, 62 hosts each
                                          ↑↑ borrowed subnet bits

The two formulas

You want…FormulaWhere the bits come from
Number of subnets2ⁿn = bits borrowed = new prefix − original prefix
Usable hosts per subnet2ʰ − 2h = host bits left = 32 − new prefix
Subnets: 2ⁿ. Don't subtract 2. The −2 applies only to hosts, because it removes the network and broadcast addresses. Older textbooks also subtracted 2 from the subnet count and skipped the "subnet zero" and "all-ones subnet." Modern routers use both, and Cisco NetAcad teaches 2ⁿ. Borrowing 3 bits gives 8 subnets, not 6.

Every bit you borrow doubles the number of subnets and roughly halves the hosts in each one. That trade-off is the whole design decision.

The 7 holy steps of subnetting (the class method)

The same math as the formulas above, run as a checklist. Use it for "I need N subnets" problems. Printable one-page copy: The 7 Holy Steps of Subnetting (PDF).

  1. Determine the number of subnets you need.
  2. Write out your host bits. For a /24, that's the last octet: 00000000.
  3. Determine how many bits to borrow to get the number of subnets you need: the smallest n where 2ⁿ ≥ subnets needed. (2ⁿ = number of subnets, n = bits borrowed.)
  4. Turn on the borrowed bits (set them to 1, starting with the first host bit right after the existing network bits) and find the decimal value of the octet(s).
  5. Figure the new subnet mask by adding the decimal value from step 4 to the original (given) subnet mask. The original mask is the classful default only when you start from a /8, /16, or /24.
  6. Find the value of the lowest-order bit turned on in the new mask (the last borrowed bit). This is your subnet variable, the block size, and you count by it in the octet where that bit sits.
  7. Use the variable from step 6 to find the subnet ranges. Count up by it: each subnet starts one address after the previous subnet's broadcast.

Then, for any subnet: 2ʰ − 2 = usable hosts per subnet, where h is the number of host bits left.

7 steps · worked

192.168.10.0/24 needs 6 subnets

  1. Subnets needed: 6.
  2. Host bits (4th octet): 00000000.
  3. 2² = 4 is too few, and 2³ = 8 is enough. Borrow 3 bits.
  4. Turn on 3 bits: 11100000 = 128 + 64 + 32 = 224.
  5. Original mask 255.255.255.0 with 224 added to the last octet gives 255.255.255.224 (/27).
  6. The lowest-order bit turned on in 11100000 is the 32s place, so the variable is 32.
  7. Count by 32 to get 8 subnets. 5 host bits remain, so 2⁵ − 2 = 30 hosts each:
#NetworkHost rangeBroadcast
0192.168.10.0/27.1 – .30.31
1192.168.10.32/27.33 – .62.63
2192.168.10.64/27.65 – .94.95
3192.168.10.96/27.97 – .126.127
4192.168.10.128/27.129 – .158.159
5192.168.10.160/27.161 – .190.191
6192.168.10.192/27.193 – .222.223
7192.168.10.224/27.225 – .254.255

You needed 6 and got 8. The 2 spares are room to grow.

7 steps · across an octet

172.16.0.0/16 needs 75 subnets

  1. Subnets needed: 75.
  2. Host bits (3rd and 4th octets): 00000000.00000000.
  3. 2⁶ = 64 is too few, and 2⁷ = 128 is enough. Borrow 7 bits.
  4. Turn on 7 bits: 11111110.00000000. The 3rd octet becomes 128+64+32+16+8+4+2 = 254.
  5. Original mask 255.255.0.0 with 254 added to the 3rd octet gives 255.255.254.0 (/23).
  6. The lowest-order bit turned on is the 2s place in the 3rd octet, so the variable is 2, counted in the 3rd octet.
  7. Count by 2 in the 3rd octet: 172.16.0.0 – 172.16.1.255, then 172.16.2.0 – 172.16.3.255, and so on. The 75th subnet (#74) is 172.16.148.0/23. 9 host bits remain, so 2⁹ − 2 = 510 hosts each.
7 steps · not starting from a default mask

172.16.16.0/20 needs 4 subnets

  1. Subnets needed: 4.
  2. The original mask is /20 = 255.255.240.0. In the 3rd octet that's 11110000: the first 4 bits are already network, and the host bits start at the 5th bit.
  3. 2² = 4 is enough. Borrow 2 bits.
  4. Turn on the 2 bits right after the existing network bits: 00001100 = 8 + 4 = 12. (Not 128 + 64. The borrowed bits start where the host bits start, not at the left edge of the octet.)
  5. Original mask 255.255.240.0 with 12 added to the 3rd octet: 240 + 12 = 252, giving 255.255.252.0 (/22). Adding 12 to the classful default (255.255.0.0) would give 255.255.12.0, which isn't a valid mask. That's why step 5 says the original mask.
  6. The lowest-order bit turned on is the 4s place in the 3rd octet, so the variable is 4.
  7. Count by 4 in the 3rd octet, starting from 16: 172.16.16.0/22, 172.16.20.0/22, 172.16.24.0/22, 172.16.28.0/22. The last broadcast is 172.16.31.255, which is also the end of the original /20. 10 host bits remain, so 2¹⁰ − 2 = 1,022 hosts each.
Same answer, two routes Step 6's "lowest-order bit turned on" is exactly the block size from The Method. The last 1 in 11100000 is worth 32, and 256 − 224 = 32. Use whichever way of finding it sticks for you.

The subnet ladder: 192.168.10.0/24, split further at each step

Each row borrows one more bit. Every block splits cleanly into two, and every subnet starts on a multiple of its own block size. VLSM depends on that alignment.

Worked examples

Design 1 · need N subnets

Split 192.168.10.0/24 into 4 subnets

  1. How many bits give at least 4 subnets? 2² = 4, so borrow 2.
  2. New prefix: /24 + 2 = /26 (255.255.255.192). Block size 64. Hosts: 2⁶ − 2 = 62 each.
  3. List them by counting in 64s:
#NetworkHost rangeBroadcast
0192.168.10.0/26.1 – .62192.168.10.63
1192.168.10.64/26.65 – .126192.168.10.127
2192.168.10.128/26.129 – .190192.168.10.191
3192.168.10.192/26.193 – .254192.168.10.255
Design 2 · crossing into the 3rd octet

172.16.0.0/16 needs 100 subnets

  1. 2⁶ = 64 is too few, and 2⁷ = 128 covers 100. Borrow 7 bits.
  2. New prefix: /16 + 7 = /23 (255.255.254.0). Host bits: 32 − 23 = 9, so 2⁹ − 2 = 510 hosts each.
  3. Block size: 256 − 254 = 2, in the 3rd octet. Subnets step 0, 2, 4, 6… in the 3rd octet, and each one spans two 3rd-octet values.
#NetworkFirst hostLast hostBroadcast
0172.16.0.0/23172.16.0.1172.16.1.254172.16.1.255
1172.16.2.0/23172.16.2.1172.16.3.254172.16.3.255
2172.16.4.0/23172.16.4.1172.16.5.254172.16.5.255
…subnet k starts at 3rd octet 2 × k
99172.16.198.0/23172.16.198.1172.16.199.254172.16.199.255
127172.16.254.0/23172.16.254.1172.16.255.254172.16.255.255
Notice 172.16.0.255 and 172.16.1.0 are both ordinary, usable host addresses in subnet 0. An address ending in .0 or .255 isn't automatically a network or broadcast address. It only is when every host bit is 0 or 1.
Design 3 · need H hosts per subnet

10.0.0.0/8, every subnet must hold 1,000 hosts

  1. Find the smallest h where 2ʰ − 2 ≥ 1,000: 2⁹ − 2 = 510 is too small, and 2¹⁰ − 2 = 1,022 works. Keep 10 host bits.
  2. New prefix: 32 − 10 = /22 (255.255.252.0). Block size 4 in the 3rd octet.
  3. Bits borrowed: 22 − 8 = 14, so 2¹⁴ = 16,384 subnets available.
  4. They run 10.0.0.0/22, 10.0.4.0/22, 10.0.8.0/22, … 10.0.252.0/22, then roll over to 10.1.0.0/22 (subnet #64), and so on up to 10.255.252.0/22.
Design 4 · both requirements

192.168.1.0/24 needs 5 subnets, each with at least 20 hosts

  1. Subnets: 2² = 4 is too few, and 2³ = 8 is enough. Borrow 3 bits, so the prefix must be /27 or longer.
  2. Hosts: 2⁴ − 2 = 14 is too few, and 2⁵ − 2 = 30 is enough. Keep at least 5 host bits, so the prefix must be /27 or shorter.
  3. Only one prefix satisfies both: /27 (255.255.255.224). That gives 8 subnets of 30 hosts: .0, .32, .64, .96, .128, .160, .192, .224.
  4. Sanity check: with 6 subnets of 40 hosts instead, subnets would need /27 or longer and hosts would need /26 or shorter. No prefix does both, so a single /24 can't meet that requirement with equal-size subnets.
Hosts first, or subnets first? When a problem gives both ("at least 8 subnets with 25 hosts each"), work out each requirement separately and check that they fit together. For a /24: 8 subnets needs /27, and 25 hosts needs /27 (30 hosts), so both are satisfied. The subnet count sets the shortest prefix you can use, and the host count sets the longest. Any prefix from one to the other works. If the subnet count needs a longer prefix than the host count allows, the block is too small.

Design · different sizes

VLSM: right-sizing every subnet

Variable Length Subnet Masking means using different prefix lengths inside one address block, so each subnet is sized to what it needs instead of making every subnet as big as the largest one.

▶ Story version: The Zoning Office, Episode 05: Moving Day

VLSM is zoning lots on moving day

Movers put the couch and fridge in first, then the boxes, then the small stuff in the gaps. VLSM is the same: biggest subnets first, smallest last.

One extra rule: every lot has to start on a line painted for its size. A /28 (16 addresses) can only start at .0, .16, .32, and so on. Going largest-first puts every subnet on a valid line automatically.

Why fixed-size subnetting fails

You've been given 192.168.50.0/24 for a small office:

SegmentHosts neededSmallest fit
Sales LAN100/25 (126)
Engineering LAN50/26 (62)
HR LAN25/27 (30)
Guest Wi-Fi10/28 (14)
3 router-to-router WAN links2 each/30 (2)

With one mask for everything, the biggest need (100 hosts) forces /25 on every subnet. A /24 holds only two /25s, and you need seven subnets. It fails. VLSM uses the same /24 and fits all seven, with room to spare.

The three VLSM rules

  1. Sort largest to smallest. Allocate the biggest subnet first, from the start of the block.
  2. Start each subnet on a multiple of its own block size. Going largest-first makes this happen automatically.
  3. Allocate contiguously. Each subnet starts right after the previous broadcast. WAN /30s go last.

NetAcad describes the same idea as subnetting a subnet: split the block into equal subnets for the LANs, then take one unused subnet and split it again (for example, a /27 into eight /30s for WAN links). Largest-first gives the same kind of result, so expect to see both framings on the exam.

The allocation

SegmentNeedPrefixNetworkHost rangeBroadcast
Sales100/25192.168.50.0.1 – .126.127
Engineering50/26192.168.50.128.129 – .190.191
HR25/27192.168.50.192.193 – .222.223
Guest10/28192.168.50.224.225 – .238.239
WAN 12/30192.168.50.240.241 – .242.243
WAN 22/30192.168.50.244.245 – .246.247
WAN 32/30192.168.50.248.249 – .250.251
(unused)/30192.168.50.252spare, available for a 4th link later

The same allocation, drawn to scale across the /24:

Class example: 31, 15, and 6 hosts

From the "holy steps" handout: 192.168.10.0/24, three LANs needing 31, 15, and 6 hosts. Size each one with 2ʰ − 2, largest first:

NeedHost bits (H)PrefixNetworkHost rangeBroadcast
316 (2⁶−2 = 62)/26192.168.10.0.1 – .62.63
155 (2⁵−2 = 30)/27192.168.10.64.65 – .94.95
63 (2³−2 = 6)/29192.168.10.96.97 – .102.103
next free192.168.10.104everything from here on is unallocated
The off-by-one trap in this example 31 hosts looks like a /27 job, but 2⁵ − 2 = 30, one short, so it needs a /26. The same happens with 15: 2⁴ − 2 = 14 is one short, so it needs a /27. Only the 6 fits exactly (2³ − 2 = 6, a /29). The −2 for network and broadcast is exactly what these numbers are chosen to test.

Example 3: VLSM that crosses into the 3rd octet

172.16.0.0/22 (1,024 addresses: 172.16.0.0 – 172.16.3.255) needs a 300-host LAN, a 200-host LAN, a 60-host LAN, and 2 WAN links.

SegmentNeedPrefix (usable)NetworkHost rangeBroadcast
LAN A300/23 (510)172.16.0.0172.16.0.1 – 172.16.1.254172.16.1.255
LAN B200/24 (254)172.16.2.0172.16.2.1 – 172.16.2.254172.16.2.255
LAN C60/26 (62)172.16.3.0172.16.3.1 – 172.16.3.62172.16.3.63
WAN 12/30 (2)172.16.3.64172.16.3.65 – 172.16.3.66172.16.3.67
WAN 22/30 (2)172.16.3.68172.16.3.69 – 172.16.3.70172.16.3.71
free172.16.3.72through 172.16.3.255, in one block
Two things to notice 300 hosts needs a /23, so LAN A spans two 3rd-octet values (.0 and .1), and 172.16.0.255 and 172.16.1.0 are ordinary hosts inside it. Once the big blocks are placed, the small ones all fit inside the last /24 (172.16.3.x).
What goes wrong if you go smallest-first Put the three /30s at .0, .4, and .8, and the next free address is .12. Guest is a /28 (block 16), and 12 isn't a multiple of 16. So 192.168.50.12/28 isn't a real network address. AND it with .240 and you get .0, which means that "subnet" is really .0–.15, and it overlaps all three WAN links. To avoid the overlap you'd have to skip ahead to .16, which leaves a hole at .12–.15. In a tight plan those holes add up and break your free space into scraps. Going largest-first gives you alignment automatically and leaves all the spare space in one block at the end.
Checking a VLSM plan For each subnet, confirm three things. (1) The network address is a multiple of its block size. (2) It starts after the previous subnet's broadcast. (3) Usable hosts ≥ need. If all three hold for every row, the plan has no overlaps. The VLSM drill generates new scenarios for you to work.

Module 12

IPv6 subnetting: easier than it looks

An IPv6 address is 128 bits, which sounds much worse than IPv4. In practice you almost always subnet one 16-bit field, count in hex, and give every LAN a /64. There's no host math, no −2, and no broadcast address.

▶ Story version: The Zoning Office, Episode 06: The Tower

A /48 is a whole office tower

Your ISP hands you an entire building (the /48). It has 65,536 floors, numbered 0000 to ffff (the subnet ID), and each floor has more rooms than you could ever fill (the 64-bit interface ID). Subnetting IPv6 is just choosing which floor each department gets. Nobody measures floors to see if a department fits, because every floor is enormous.

Reading an IPv6 address first

128 bits are written as eight hextets of 4 hex digits each, separated by colons. Two rules shorten them:

RuleWhat it doesExample
1 · Omit leading zerosDrop zeros at the front of any hextet. Never drop trailing zeros.0db8 → db8 · 000a → a · 0000 → 0
2 · Double colonReplace one run of consecutive all-zero hextets with ::. Use it only once per address, or the address becomes ambiguous.2001:db8:acad:0:0:0:0:1 → 2001:db8:acad::1
Full example 2001:0db8:acad:0001:0000:0000:0000:0010 → rule 1 → 2001:db8:acad:1:0:0:0:10 → rule 2 → 2001:db8:acad:1::10

Structure of a global unicast address (GUA)

2001:0db8:acad:0001:0000:0000:0000:0010
└─── 48 bits ──┘ └16┘ └────── 64 bits ──────┘
 Global routing  Subnet     Interface ID
 prefix (/48)    ID         (the "host" part)
global routing prefix, assigned by your ISP / RIRsubnet ID, which you chooseinterface ID

Subnetting a /48: just count in hex

Given 2001:db8:acad::/48, each subnet increments the 4th hextet. The only real skill is counting in hexadecimal:

Subnet # (decimal)Subnet ID (hex)/64 prefix
000002001:db8:acad::/64
100012001:db8:acad:1::/64
200022001:db8:acad:2::/64
900092001:db8:acad:9::/64
10000a2001:db8:acad:a::/64
15000f2001:db8:acad:f::/64
1600102001:db8:acad:10::/64
25500ff2001:db8:acad:ff::/64
65,535ffff2001:db8:acad:ffff::/64
Hex trap After 9 comes a, not 10. :10: in a subnet ID is sixteen. Also note that the first subnet, number 0, compresses to 2001:db8:acad::/64. That's correct, not a typo.
Hex counting is an odometer with 16 digits

A car's odometer wheel shows 0–9 and then rolls over. A hex wheel shows 0–9, then a b c d e f, and only then rolls over to 10. So f is fifteen, 10 is sixteen, 1f is thirty-one, and 20 is thirty-two. Each hex digit is worth 16× the one to its right, just as each decimal digit is worth 10×.

Reading the subnet out of an address

The reverse skill: given an address, which subnet is it on? Read the 4th hextet and convert it from hex.

AddressSubnet ID (4th hextet)Subnet # (decimal)Its /64 prefix
2001:db8:acad:12::500121×16 + 2 = 182001:db8:acad:12::/64
2001:db8:acad:a:1::1000a102001:db8:acad:a::/64
2001:db8:acad:100::9901001×256 = 2562001:db8:acad:100::/64
2001:db8:acad::1000002001:db8:acad::/64

Careful with the second row: 2001:db8:acad:a:1::1. The :1: after the a is the start of the interface ID, not part of the subnet. Only the 4th hextet is the subnet ID.

The same office, in IPv6

Compare this with the VLSM table above. With a 2001:db8:acad::/48, every segment gets its own /64 regardless of size:

SegmentPrefixRouter interface (convention: ::1)
Sales2001:db8:acad:1::/642001:db8:acad:1::1
Engineering2001:db8:acad:2::/642001:db8:acad:2::1
HR2001:db8:acad:3::/642001:db8:acad:3::1
Guest2001:db8:acad:4::/642001:db8:acad:4::1
WAN links2001:db8:acad:ff01::/64 …(one /64 per link)
What's different from IPv4 IPv6 has no broadcast address, since multicast does that job, so there's no "−2." LANs aren't sized smaller than /64, because SLAAC needs a 64-bit interface ID. Finally, IPv6 was designed so that subnets aren't scarce: a /48 alone provides 65,536 LANs.

THE FIELD KIT

Reference, tools, and practice

Everything you'll reach for once the episodes are done: the chart to write at the top of every exam, the address ranges to recognize, a calculator that shows its work, eight drills, the classic traps, flashcards, a quiz, and the glossary.

Field Kit · Reference

The cheat sheet (write it from memory)

Most students who subnet quickly work from a small chart they write out at the start of every quiz. You can rebuild it from scratch in about 30 seconds.

The brain-dump chart

Row12345678
Place value / block size1286432168421
Mask octet value128192224240248252254255
Prefix — 2nd octet/9/10/11/12/13/14/15/16
Prefix — 3rd octet/17/18/19/20/21/22/23/24
Prefix — 4th octet/25/26/27/28/29/30/31/32

How to read it: find your prefix in one of the prefix rows. The column above it gives the mask value for that octet and the block size. For /20: column 4, 3rd octet, so the mask is 255.255.240.0 and the block size is 16. Octets to the left are 255, and octets to the right are 0.

Why the top row doubles as block size The block size is the place value of the last network bit. A /26 mask ends 11000000 in the 4th octet. Its last 1 sits in the 64s place, so subnets step by 64: .0, .64, .128, .192. That's the reason 256 − mask value always equals the block size.

Hosts needed → smallest subnet (longest prefix) that fits

Hosts neededHost bitsPrefixMaskUsable hosts
1 – 22/30255.255.255.2522
3 – 63/29255.255.255.2486
7 – 144/28255.255.255.24014
15 – 305/27255.255.255.22430
31 – 626/26255.255.255.19262
63 – 1267/25255.255.255.128126
127 – 2548/24255.255.255.0254
255 – 5109/23255.255.254.0510
511 – 1,02210/22255.255.252.01,022
1,023 – 2,04611/21255.255.248.02,046
2,047 – 4,09412/20255.255.240.04,094

Every prefix, /8 to /32

Generated by the same code that runs the calculator. Use it to check your work, not as something to memorize. For /8, /16, and /24, the table shows a block of 1 in the last network octet. For example, /24's "1 (3rd octet)" means consecutive /24s step by one in the 3rd octet (192.168.1.0, 192.168.2.0, …). That's the same thing as a block of 256 in the 4th octet, the way The Method's step 2 describes octet boundaries.

PrefixSubnet maskBlock sizeHost bitsTotal addressesUsable hosts
The two oddballs /31 has no room for separate network and broadcast addresses, so RFC 3021 lets both of its addresses be used on point-to-point links. NetAcad teaches /30 for point-to-point links, so answer /30 on the exam. /32 is a single address, used for loopback interfaces and host routes (the L routes you saw in Session 7's routing table).

Field Kit · Reference

Address ranges and legacy classes

Special ranges you need to recognize on sight, and the classful scheme the exam still refers to. Session 8 covers who assigns addresses and why.

Ranges you must recognize

RangeNameWhat it's for
10.0.0.0/8Private (RFC 1918)Internal networks. Not routed on the internet, so NAT is needed to get out. 10.0.0.0 – 10.255.255.255.
172.16.0.0/12Private (RFC 1918)172.16.0.0 – 172.31.255.255. A common trap: 172.32.x.x is public.
192.168.0.0/16Private (RFC 1918)192.168.0.0 – 192.168.255.255. Almost every home network uses this range.
127.0.0.0/8LoopbackThe device itself. ping 127.0.0.1 tests the local TCP/IP stack.
169.254.0.0/16Link-local (APIPA)Windows assigns itself one of these when DHCP fails. Seeing it usually means "no DHCP server answered."
0.0.0.0/8"This network"0.0.0.0 means "no address yet" (a DHCP client's source address). In a route, 0.0.0.0/0 is the default route.
255.255.255.255Limited broadcastEvery host on the local segment. Routers never forward it.
192.0.2.0/24TEST-NET-1Reserved for documentation and examples, like 2001:db8::/32 in IPv6. (Reference only; not on the NetAcad exam.)
224.0.0.0/4Multicast224–239 in the first octet. One sender, a group of receivers. Never assigned to a host as its own address.

Legacy classes (history, but still tested)

Before 1993, the first octet set a network's size (its default mask). That scheme, classful addressing, has been replaced by CIDR (Classless Inter-Domain Routing), where any prefix length is allowed. You still need to recognize the classes, because the exam and older documentation refer to them.

ClassFirst octetFirst bitsDefault maskUse
A0 – 127*0…/8 · 255.0.0.0Huge networks
B128 – 19110…/16 · 255.255.0.0Medium networks
C192 – 223110…/24 · 255.255.255.0Small networks
D224 – 2391110…—Multicast
E240 – 2551111…—Experimental / reserved

* Class A technically spans 0–127, but 0 is reserved and 127 is loopback, so usable Class A networks are 1–126.

Field Kit · Tool

Step-by-step calculator

Type any address and prefix. It shows the bits, the AND operation, the answers, and the same six steps from The Method. Use it to check your paper work after you've done the problem yourself.

Field Kit · Drills

Practice drills

Each drill generates a new random problem every time. Work it on paper first, type your answers, and press Check. A wrong answer shows the full worked solution, not just a red X. Enter checks your answer; press Enter again for the next problem.

Suggested order Warm up with Quick-fire until binary and masks feel automatic. Then do Net / Bcast / Host? and Find the Six until you can solve any address. Move on to 7 Steps and Size It for design, then Same Subnet?, VLSM Plan, and IPv6. The number on each tab is its level.

Field Kit · Troubleshooting

The ten classic traps

Nearly every wrong subnetting answer comes from one of these. When you get something wrong, find which one it was.

#TrapFix
1Forgetting −2 on hosts. Saying a /26 holds 64 hosts.Total addresses = 2ʰ. Usable = 2ʰ − 2.
2Subtracting 2 from subnets. Saying 3 borrowed bits give 6 subnets.Subnets = 2ⁿ. The −2 is for hosts only.
3Wrong interesting octet. Applying a /20's block size of 16 to the 4th octet.The prefix row on the chart tells you the octet: /17–/23 → 3rd octet (/24 is an octet boundary).
4Using the mask value as the block size. "Mask 240, so subnets go up by 240."Block = 256 − mask value = 16.
5Octets to the right of the interesting octet. Writing 172.16.45.255 as the broadcast for 172.16.45.200/20.To the right: network gets 0s, broadcast gets 255s. Always.
6Assigning the network or broadcast address to a host.Check that the address isn't all-0s or all-1s in the host bits.
7Treating every .0 or .255 as special. In a /23, x.x.1.0 can be a valid host.Only all-0 or all-1 host bits matter, not the look of the last octet.
8VLSM smallest-first. Subnets land off their block boundaries and overlap.Sort largest first. Every network address must be a multiple of its block size.
9172.32.x.x is private. (It isn't.)The private range is 172.16 – 172.31 only.
10Decimal counting in IPv6. Writing :10: for subnet ten, or using :: twice.Ten is :a:. Only one :: per address.

Field Kit · Study

Flashcards

Click to flip. Double-click to mark as known.

Field Kit · Check yourself

Sample questions

Exam-style multiple choice. Pick an answer to see whether it's right and why.

Field Kit · Reference

Glossary & index

Every term from this guide, searchable and indexed A–Z.