CyberPath Academy logo
Interactive Lab

Subnetting a Class C Network

Class C gives you 8 bits to work with in the last octet. Every subnet you carve out is a trade: bits you use for networks are bits you give up for hosts. Work through five stages below to see that trade from every angle.

192.168.1.0/24
Stage 1

Binary Bridge

Subnetting is bit manipulation wearing a decimal costume. Before touching a mask, get comfortable flipping bits and watching the decimal value respond — and the reverse.

One octet, two representations

Click any bit to flip it. Place values shown above each bit: 128 · 64 · 32 · 16 · 8 · 4 · 2 · 1.

Decimal
192
Binary
11000000
Bits set to 1
2
Stage 2

How Subnetting Works — The Magic Number Method

Every subnetting problem — Class A, B, or C — can be solved the same way, in under a minute, without memorizing a single table. This is the method network engineers actually use on the job and on certification exams.

1 · What a CIDR number really means

An IP address is 32 bits split into a network portion and a host portion. The CIDR number (the /24 in 192.168.1.0/24) simply tells you how many of those 32 bits belong to the network. Everything left over belongs to hosts. A subnet mask is just that same split written out in dotted-decimal — /24 and 255.255.255.0 are two ways of saying the exact same thing.

2 · Find the "magic number"

Look at the subnet mask and find the interesting octet — the first octet, left to right, that isn't 255. Subtract that octet's value from 256. The result is the magic number: the size of every block in that octet, and the amount the network address jumps by each time.

CIDRSubnet maskMagic numberTotal usable hosts

Notice the pattern: the magic number and the mask value in that octet always add up to 256.
*At /24, the entire last octet is host — network and broadcast simply become .0 and .255.

3 · The four-step method

  1. Find the Network ID. Round the target IP's interesting-octet value down to the nearest multiple of the magic number. Copy every octet to the left as-is; set every octet to the right to 0.
  2. Find the Broadcast address. Take that same interesting octet and add (magic number − 1). Set every octet to the right to 255.
  3. Find First and Last usable host. First usable = Network ID + 1. Last usable = Broadcast − 1.
  4. Find the Next Network. Add the magic number to the Network ID's interesting octet — that's where the next block begins.

Worked example — 172.16.85.30/20

A /20 mask is 255.255.240.0. The interesting octet is the third one (240), so the magic number is 256 − 240 = 16. The multiples of 16 around 85 are 80 and 96 — 85 falls in the 80 block.

Network ID172.16.80.0
Broadcast address172.16.95.255
First usable host172.16.80.1
Last usable host172.16.95.254
Next network172.16.96.0

Same method whether the interesting octet is the 2nd, 3rd, or 4th — only the position changes.

Stage 3

Full Practice Table

Now put the method to work. A new IP address and CIDR every time — solve for all five attributes, octet by octet, exactly like you would on an exam.

Problems attempted: 0 Fully correct: 0
AttributeYour answerResult
Stage 4

Read the Address

You won't always get to choose how a network is subnetted — usually you're handed a host address and a CIDR and have to work out where it lives. Given the target below, fill in the five blanks: network ID, subnet mask, broadcast address, first usable host, and last usable host.

Problems attempted: 0 Correct on first try: 0
Network (fixed, 24 bits) Subnet bits (from the CIDR) Host bits (remaining)

Reference — powers of two

The row matching your current target's CIDR is highlighted. These are the only numbers you actually need to memorize for subnetting.

Bits borrowed2ⁿ (subnets)Bits left for hostsUsable hosts (2ⁿ − 2)

The trade-off, charted

More subnet bits mean more subnets and fewer hosts per subnet. Your current target's position is the bright bar in each chart.

Number of subnets (2ⁿ)
Usable hosts per subnet
Stage 5

Map the Ranges

Take the borrow count from Stage 2 and lay it against a real network address. This table is what you'd hand to a network diagram: every subnet, its usable range, and its broadcast address.

Network to divide

#Network addressFirst usable hostLast usable hostBroadcast address

Stage 6

Check Your Work

A fresh requirement, a fresh network, every time you click "New problem." Work it out on paper first, then fill in your answers below.

Problems attempted: 0 Correct on first try: 0

Loading a problem…

Stage 7 · Bonus

Class B Subnetting

Class B starts you off with more room to work with: the default mask is /16, meaning only the first two octets are fixed as network. That leaves a full 16 bits — spanning the 3rd and 4th octets — for you to divide between subnets and hosts. Addresses in this class run from 128.0.0.0 through 191.255.255.255.

Problems attempted: 0 Correct on first try: 0
Network (fixed, 16 bits) Subnet bits (from the CIDR) Host bits (remaining)

Four worked examples

All four use the same starting network, 172.20.0.0/16, so you can see exactly how the split point changes the outcome. Click a row to load a fresh practice address using that split.

ScenarioBits borrowedNew maskCIDRSubnets createdHosts / subnetBlock size