⚡ What is subnetting?
Subnetting is the process of dividing a large IP network into smaller, more manageable pieces called subnets. Each subnet is a separate logical network. A /24 network gives you 254 usable hosts. A /25 splits that into two subnets of 126 hosts each. Understanding how to calculate these ranges — and read CIDR notation — is core exam material for both A+ and Network+.

Before you subnet — understand CIDR notation

Every IP address you see in subnetting problems comes with a prefix length written as a slash followed by a number — for example 192.168.1.0/24. This is called CIDR notation (Classless Inter-Domain Routing), and the number after the slash tells you how many bits are used for the network portion of the address.

An IPv4 address has 32 bits total. If 24 bits are the network, the remaining 8 bits are available for hosts. The larger the prefix number, the smaller the network.

CIDR notation — reading it
192.168.1.0/24
          ↑
          24 bits = network portion
          32 - 24 = 8 bits left for hosts
          2⁸ = 256 addresses, 254 usable hosts
📌 CIDR vs Subnet Mask — same thing, different format

/24 and 255.255.255.0 mean exactly the same thing. CIDR counts the network bits. Subnet masks write those bits out as four octets. The exam uses both — make sure you can convert between them.

A /24 = 255.255.255.0  ·  A /16 = 255.255.0.0  ·  A /8 = 255.0.0.0

The binary foundation — why the math works

Subnetting math is based on binary. Each octet of an IP address is 8 bits, and each bit has a value: 128, 64, 32, 16, 8, 4, 2, 1. You don't need to memorize binary to subnet, but understanding where the numbers come from makes the patterns stick.

A subnet mask works by setting network bits to 1 and host bits to 0. Here's what 255.255.255.0 looks like in binary:

255
1
1
1
1
1
1
1
1
255
1
1
1
1
1
1
1
1
255
1
1
1
1
1
1
1
1
0
0
0
0
0
0
0
0
0

Teal bits = network (fixed). Grey bits = host (variable — these are where your device addresses live).

The CIDR reference table — memorise /24 to /30

For A+ you need a solid understanding of /24. For Network+ you need to be comfortable across the full range, especially /25 through /30. This table is your foundation:

CIDR Subnet Mask Hosts per Subnet Block Size Common Use
/8 255.0.0.0 16,777,214 16,777,216 Large ISP / Class A
/16 255.255.0.0 65,534 65,536 Large org / Class B
/24 Most Common 255.255.255.0 254 256 Home / small office LAN
/25 255.255.255.128 126 128 Medium subnet
/26 255.255.255.192 62 64 Smaller subnet
/27 255.255.255.224 30 32 Small workgroup
/28 255.255.255.240 14 16 Small office segment
/29 255.255.255.248 6 8 Small segment / WAN link
/30 255.255.255.252 2 4 Point-to-point links
/31 255.255.255.254 2* 2 Router-to-router (RFC 3021)
/32 255.255.255.255 1 1 Single host / loopback route

Usable hosts = 2ⁿ − 2, where n = host bits. Two addresses are always reserved: the network address (all host bits 0) and the broadcast address (all host bits 1).

How to calculate a subnet — the method

Given any IP address and prefix length, you need to be able to find four things: the network address, the first usable host, the last usable host, and the broadcast address. Here's the reliable method that works on every problem:

The four-step subnet method
Step 1 — Block size
256 minus the last non-255 octet of the subnet mask. This is how far apart subnets are.
Step 2 — Network address
Round the interesting octet DOWN to the nearest multiple of the block size.
Step 3 — Broadcast address
Network address + block size − 1. This is the last address in the subnet.
Step 4 — Usable hosts
First host = network + 1. Last host = broadcast − 1. Everything in between is usable.

Worked example 1 — /24 (A+ level)

Given: 192.168.10.50/24 — find the network, hosts, and broadcast
A+ Level
1
Block size
Subnet mask is 255.255.255.0. Last non-255 octet is 0. Block size = 256 − 0 = 256. The "interesting" octet is the 4th.
2
Network address
4th octet of the IP is 50. Round down to nearest multiple of 256 → 0.
Network address: 192.168.10.0
3
Broadcast address
Network (192.168.10.0) + block size (256) − 1 = 192.168.10.255
Broadcast address: 192.168.10.255
4
Usable host range
First host = network + 1. Last host = broadcast − 1.
Usable hosts: 192.168.10.1 — 192.168.10.254  (254 hosts)

Worked example 2 — /26 (Network+ level)

Given: 192.168.1.130/26 — which subnet is this host in?
Network+ Level
1
Block size
Subnet mask is 255.255.255.192. Last non-255 octet is 192. Block size = 256 − 192 = 64.
2
Find the subnet boundaries (multiples of 64)
0, 64, 128, 192, 256... The IP's 4th octet is 130. 130 falls between 128 and 192.
Network address: 192.168.1.128
3
Broadcast address
192.168.1.128 + 64 − 1 = 192.168.1.191
Broadcast: 192.168.1.191
4
Usable host range
First = 192.168.1.129  ·  Last = 192.168.1.190
Usable hosts: 192.168.1.129 — 192.168.1.190  (62 hosts)

Worked example 3 — /27 (Network+ level)

Given: 10.0.0.65/27 — find all subnet details
Network+ Level
1
Block size
Subnet mask is 255.255.255.224. Block size = 256 − 224 = 32.
2
Subnet boundaries (multiples of 32)
0, 32, 64, 96... The 4th octet is 65. 65 falls between 64 and 96.
Network address: 10.0.0.64
3
Broadcast
10.0.0.64 + 32 − 1 = 10.0.0.95
Broadcast: 10.0.0.95
4
Usable hosts
Usable hosts: 10.0.0.65 — 10.0.0.94  (30 hosts)

The two formulas you must know

Subnetting formulas
Usable hosts per subnet  =  2ⁿ − 2
where n = number of host bits (32 − prefix length)

Number of subnets        =  2ˢ
where s = number of subnet bits borrowed from the host portion

Block size               =  256 − last non-255 subnet mask octet
also equals: 2ⁿ where n = host bits in the interesting octet
⚡ Why subtract 2 from host count?

Two addresses in every subnet are reserved and can't be assigned to devices. The network address (all host bits set to 0) identifies the subnet itself. The broadcast address (all host bits set to 1) sends traffic to every device on the subnet simultaneously. Everything in between is usable.

Example: /24 gives 256 addresses. Minus 2 = 254 usable hosts. This is why 255 is never a host address and .0 is never a host address on a /24 network.

Private IP ranges — what they are and why they matter

Most subnetting you encounter in the real world uses private IP address ranges — addresses that are not routed on the public internet. You'll see these constantly in both exam questions and actual networks:

Private IP ranges (RFC 1918)
10.0.0.0/8       → 10.0.0.0 – 10.255.255.255    (Class A, 16M+ addresses)
172.16.0.0/12    → 172.16.0.0 – 172.31.255.255  (Class B, 1M+ addresses)
192.168.0.0/16   → 192.168.0.0 – 192.168.255.255 (Class C, 65K addresses)

Exam scenarios

💬 "A host has IP 192.168.5.200/25. What is its network address?" → Round 200 down to nearest multiple of 128 → 192.168.5.128
💬 "How many usable hosts does a /28 network support?" → 2⁴ − 2 = 14 usable hosts
💬 "A company needs 50 hosts on a single subnet. Which prefix is the smallest that works?" → /26 gives 62 hosts — /26 is correct (/27 only gives 30)
💬 "Two routers are connected with a point-to-point link. Which prefix minimises wasted addresses?" → /30 — provides exactly 2 usable addresses
💬 "What is the broadcast address for 172.16.4.0/24?" → 172.16.4.255
💬 "A host at 10.10.10.33/27 tries to communicate with 10.10.10.70/27. Are they on the same subnet?" → /27 block size = 32. First subnet: 10.10.10.32–63. Second host is in 10.10.10.64–95. → Different subnets — traffic goes through the router
💬 "Which subnet mask corresponds to /29?" → 255.255.255.248
💬 "How many /26 subnets can you create from a /24 network?" → 2² = 4 subnets (borrowed 2 bits)

Key things to memorise for exam day

Subnetting quick reference
/24  →  255.255.255.0    →  254 hosts   block: 256
/25  →  255.255.255.128  →  126 hosts   block: 128
/26  →  255.255.255.192  →  62 hosts    block: 64
/27  →  255.255.255.224  →  30 hosts    block: 32
/28  →  255.255.255.240  →  14 hosts    block: 16
/29  →  255.255.255.248  →  6 hosts     block: 8
/30  →  255.255.255.252  →  2 hosts     block: 4

Ready to sit the exam?

Pair these guides with a study book and practice exams for the highest chance of passing first try.

See Study Resources →

Related Articles