← All Guides LAN Switching & VLANs Routing & Device Layers Subnetting Diagrams & Troubleshooting
Cyber Communications Fundamentals · Block 3, Unit 5

Subnetting

Why we carve up networks, how subnet masks and CIDR notation work, and the borrow-the-bits math for finding network IDs, host ranges, and broadcast addresses.

01
Why We SubnetTOPIC 01 OF 8

Every device (host) that talks on a network needs an IP address. A subnet (sub-network) is a logical division of a network based on IP addressing — a "network within a network." Grouping hosts into subnets (e.g., a Marketing subnet vs. a Sales subnet) keeps traffic organized, isolates broadcast domains, and improves efficiency.

Subnetting works by borrowing bits from the host portion of an IP address and reassigning them to identify a subnet. This splits an IP address into three logical pieces instead of two:

PortionWhat It Identifies
NetworkWhich overall network the host belongs to
SubnetWhich logical sub-division of that network (the borrowed bits)
HostThe specific device within that subnet
// ExampleBorrow just one bit from a Class C host address: a 0 means the first subnet, a 1 means the second. One borrowed bit = 2 possible subnets, each with 126 usable host addresses (down from 254 on the un-subnetted network).
02
Classful AddressingTOPIC 02 OF 8

Before CIDR, IP address space was divided into "classes," each with a fixed default subnet mask. Classes aren't used to route traffic anymore, but understanding them makes the borrowing math easier to picture.

// Default Classful Masks
Class1st Octet RangeDefault MaskCIDRNetwork / Host Bits
A1–126255.0.0.0/88 network / 24 host
B128–191255.255.0.0/1616 network / 16 host
C192–223255.255.255.0/2424 network / 8 host
// Borrowing the First Bit From Each Class
ClassNew MaskNew CIDRSubnetsUsable Hosts / Subnet
A255.128.0.0/928,388,606
B255.255.128.0/17232,766
C255.255.255.128/252126
// Key ideaEvery class follows the same borrowing math — only the starting point (number of host bits available to borrow from) changes.
03
Subnet Masks & CIDR NotationTOPIC 03 OF 8

A subnet mask is a 32-bit number that marks which bits of an IP address are the network/subnet portion versus the host portion. It "masks out" the borrowed host bits. If you remember nothing else about subnetting, remember this — it's the foundation of the whole topic.

A mask/address pair can be written two ways:

FormatExample
Address + separate mask205.112.45.60, Mask = 255.255.255.128
CIDR (Classless Inter-Domain Routing)205.112.45.60/25

The /25 is the CIDR prefix — it's shorthand for "25 bits of this 32-bit address are network/subnet bits." Reading a CIDR example:

Step205.112.45.60/25
1. Classful default205 is a Class C address → default is /24 (24 network bits, nothing borrowed)
2. Bits borrowed/25 − /24 = 1 bit borrowed from the host portion
3. Subnets created21 = 2 subnets
4. Equivalent mask255.255.255.128, max 126 usable hosts per subnet
Step130.10.120.5/20
1. Classful default130 is a Class B address → default is /16
2. Bits borrowed/20 − /16 = 4 bits borrowed (from the 3rd octet)
3. Subnets created24 = 16 subnets
4. Equivalent mask255.255.240.0, max 4,094 usable hosts per subnet
04
Subnet Mask Reference ChartTOPIC 04 OF 8

The last-octet values below are the ones you'll use constantly — they apply whenever you're subnetting inside a single octet (the most common case on the exam and in the worked example below). Subnet count assumes borrowing starts from a /24 base.

CIDRDotted Mask (last octet)Subnets (from /24)Total Addrs / SubnetUsable Hosts
/24255.255.255.01256254
/25255.255.255.1282128126
/26255.255.255.19246462
/27255.255.255.22483230
/28255.255.255.240161614
/29255.255.255.2483286
/30255.255.255.2526442
/31255.255.255.25412820*
/32255.255.255.25525610**
// Footnotes*/31 has no room for a network/broadcast address under classic rules, but RFC 3021 permits using both addresses as a 2-host point-to-point link. **/32 identifies a single host (a "host route") — no subnetting possible.
05
CIDR & SupernettingTOPIC 05 OF 8

IP classes aren't used to route traffic anymore — CIDR replaced them. CIDR applies the same bit-borrowing logic in reverse: instead of breaking one network into many subnets, it can aggregate (combine) multiple smaller networks into one larger block. This is called supernetting.

CIDR's real payoff is efficient address allocation — a network admin can hand out a block sized much closer to what's actually needed instead of being stuck with fixed classful sizes.

ScenarioValue
Assigned block207.0.64.0/18 (16,384 addresses)
Actual hosts needed900
Addresses wasted at /1816,384 − 900 = 15,484
Better-fit CIDR block207.0.68.0/22 (1,024 addresses)
ResultFar less address space wasted, still room to grow
06
VLSM — Variable Length Subnet MaskingTOPIC 06 OF 8

When a network is assigned more than one subnet mask, it's said to use a Variable Length Subnet Mask (VLSM) — this is what happens when you "subnet a subnet." VLSM lets each subnet be sized for exactly how many hosts it needs, instead of forcing every subnet to use the same fixed mask, which reduces wasted addresses.

Routing ProtocolVLSM Support
RIPv1No — sends no mask info with routes; assumes the local interface's mask or falls back to the classful default
RIPv2Yes — advertises the prefix length/mask with each route
OSPFYes — advertises the prefix length/mask with each route
// Why it mattersA RIPv1 router receiving a packet has no idea what mask was used to build the address — it can only guess. RIPv2 or OSPF must be used to get the full benefit of VLSM across a network.
07
The Subnetting Calculation MethodTOPIC 07 OF 8

Build a quick "cheat sheet" before subnetting any /24 network. Write the powers of two across the top, then stack a Subnets row, a Hosts row, and a CIDR row underneath:

CIDR/24/25/26/27/28/29/30/31/32
Subnets1248163264128256
Hosts (total)2561286432168421
Subnets created = 2n   |   n = number of bits borrowed
Usable hosts per subnet = 2h − 2   |   h = remaining host bits (network ID and broadcast ID are reserved)

The process, step by step:

#Step
1Determine the requirement: how many subnets and/or how many hosts per subnet are needed.
2Find the starting classful/CIDR mask for the given network.
3On the cheat sheet, find the Subnets column that meets or exceeds the number of subnets needed (round up if it's not an exact match — e.g. use 8 for a requirement of 5).
4Read the CIDR value in that column — that's the new subnet mask.
5Read the Hosts value in that column, subtract 2, to get usable hosts per subnet.
6The Hosts (total) value is also the subnet's block size — each new subnet's network ID increases by that amount.
08
Worked ExamplesTOPIC 08 OF 8
// Simple Case — Two Departments

192.168.1.0/25 splits one Class C network into two subnets of 126 hosts each (1 bit borrowed → 2 subnets).

SubnetNetwork IDHost RangeBroadcast ID
Marketing192.168.1.0192.168.1.1 – .126192.168.1.127
Sales192.168.1.128192.168.1.129 – .254192.168.1.255
// Full Case — 215.60.192.0/24, Need 4 Subnets (max 3 hosts each)

Requirement: 4 subnets → borrow 2 bits (22 = 4) → new mask is /26 (255.255.255.192). Remaining 6 host bits → 26 = 64 total addresses per subnet, block size 64, usable hosts = 64 − 2 = 62 (plenty of headroom over the 3 needed).

Network IDMaskHost ID RangeUsable HostsBroadcast ID
215.60.192.0/26215.60.192.1 – .6262215.60.192.63
215.60.192.64/26215.60.192.65 – .12662215.60.192.127
215.60.192.128/26215.60.192.129 – .19062215.60.192.191
215.60.192.192/26215.60.192.193 – .25462215.60.192.255
// Pattern to noticeEach Network ID increases by the block size (64). Each Broadcast ID is exactly one less than the next subnet's Network ID. The Host ID Range is everything between the Network ID and Broadcast ID.