Why Subnet? (Subnetting Basics)
Subnetting is the arithmetic core of the CCNA. Before you can split a network, you must see an IPv4 address as it really is: 32 bits divided into a network part and a host part. This lesson builds that picture and defines the four addresses every subnet owns.
Why subnet at all?
An organisation rarely gets to keep one giant, flat network. Subnetting is the practice of taking one assigned IP network and dividing it into smaller logical networks called subnets. There are three reasons people do it, and every exam question about subnetting ultimately traces back to one of them.
- Reduce the size of the broadcast domain. Every host in one subnet receives another host’s broadcast frames. If you put 1,000 devices in one subnet, all 1,000 are interrupted by every broadcast. Split them into ten subnets of 100 and each broadcast now reaches only 100 hosts. Smaller broadcast domains mean less wasted bandwidth and less noise on every device’s CPU.
- Conserve IPv4 addresses. The IPv4 address space is finite and exhausted. If you hand a whole /24 (256 addresses) to a point-to-point link that only needs two devices, you waste 254 addresses. Subnetting lets you carve exactly the size each segment needs.
- Make the network addressable by design. Subnetting imposes structure. You can say “all of finance lives in this block, all Wi-Fi clients in that block” and then write firewall rules, routes, and monitoring around those blocks. A logically designed address plan is easier to route, secure, and troubleshoot.
Devices in different subnets need a router to communicate. That single sentence is why subnetting matters to a network engineer: it decides where router boundaries must be.
The three-step mental model
Every subnetting calculation in this course uses the same three-step model. Learn it now and you never need to memorise a special case again.
- Write the prefix. The prefix length tells you how many leading bits are the network bits. A “/24” has 24 network bits.
- Count the host bits. Host bits are whatever is left:
host bits = 32 − prefix. A /24 therefore has32 − 24 = 8host bits. - Split the 32-bit address. The first prefix bits identify the subnet; the remaining host bits identify a device inside it.
Consider the address 192.168.10.130 with prefix /24. Written in binary, the address is 11000000.10101000.00001010.10000010. The first 24 bits are the network part; the final 8 bits 10000010 are the host part. Change a network bit and you are in a different subnet. Change a host bit and you stay in the same subnet but move to a different device.
What a subnet mask really marks
A subnet mask is a 32-bit number that sits beside every IPv4 address. Its only job is to mark which bits belong to the network and which belong to the host.
- A 1 in the mask means “this bit is part of the network address”.
- A 0 in the mask means “this bit is part of the host address”.
Masks are always a run of 1s followed by a run of 0s — never a 1 after a 0. The mask 255.255.255.192 is 11111111.11111111.11111111.11000000: twenty-six 1s and six 0s. That is why a mask can always be written as a simple prefix length (the count of 1s) instead of four numbers.
11000000 = 128 + 64 = 192; 11100000 = 128 + 64 + 32 = 224. Being able to do this in your head turns every mask question into a two-second lookup.Prefix and dotted notation
These are two ways of writing the same mask. A /26 and 255.255.255.192 are identical; the exam will mix the two freely, so you must convert instantly.
| Prefix | Dotted-decimal mask | Host bits (32 − prefix) | Addresses per subnet (2h) |
|---|---|---|---|
| /24 | 255.255.255.0 | 8 | 256 |
| /25 | 255.255.255.128 | 7 | 128 |
| /26 | 255.255.255.192 | 6 | 64 |
| /27 | 255.255.255.224 | 5 | 32 |
| /28 | 255.255.255.240 | 4 | 16 |
| /29 | 255.255.255.248 | 3 | 8 |
| /30 | 255.255.255.252 | 2 | 4 |
Every number in subnetting is a power of two. Keep this table in your head: 20=1, 21=2, 22=4, 23=8, 24=16, 25=32, 26=64, 27=128, 28=256, 29=512, 210=1,024, 211=2,048, 212=4,096, 216=65,536, 224=16,777,216.
The four key addresses
Every subnet, no matter its size, owns exactly four addresses that you must be able to name. Two are reserved and two are usable.
| Address | Rule | Can a host use it? |
|---|---|---|
| Network address | all host bits set to 0 | No — names the subnet |
| First usable | network address + 1 | Yes |
| Last usable | broadcast address − 1 | Yes |
| Broadcast address | all host bits set to 1 | No — reaches every host |
That “− 2” is not a convention you can skip. If a question asks how many hosts a subnet supports, the answer is always 2h − 2; if it asks how many addresses the subnet contains, the answer is 2h. Read the wording carefully.
Worked example: a /24
Take the network 192.168.10.0/24. Follow the three-step model and find all four key addresses.
Network: 192.168.10.0 /24 -> mask 255.255.255.0 Host bits: 32 − 24 = 8 Addresses: 2^8 = 256 Usable hosts: 2^8 − 2 = 254 Network address: 192.168.10.0 (host bits all 0) First usable: 192.168.10.1 (network + 1) Last usable: 192.168.10.254 (broadcast − 1) Broadcast: 192.168.10.255 (host bits all 1) Check: usable count = 254 − 1 + 1 = 254 OK
Notice the arithmetic that proves the answer: the usable range runs from .1 to .254 inclusive, which is 254 − 1 + 1 = 254 addresses. Whenever a worked example does not reconcile, you have made an error — the count is your built-in checksum.
Now shrink the same network to /26 to preview where the course is going. A /26 has 32 − 26 = 6 host bits, so 26 = 64 addresses and 64 − 2 = 62 usable hosts. The block size in the last octet is 256 − 192 = 64, giving subnets at .0, .64, .128 and .192. The subnet containing 192.168.10.0 is itself: network 192.168.10.0, broadcast 192.168.10.63, usable .1 to .62. Lessons 2 and 3 turn this preview into a repeatable method.
Key terms & sources
Subnet
A logical subdivision of one IP network, sharing a network address and mask.
Network bits
The leading bits of an IPv4 address that identify the subnet; count = the prefix length.
Host bits
The remaining bits that identify a device within the subnet; count = 32 − prefix.
Subnet mask
A 32-bit value with 1s over network bits and 0s over host bits.
Prefix length
The count of 1s in the mask, written /n (e.g. /26).
Network address
The address with all host bits 0; names the subnet and is not assignable.
Broadcast address
The address with all host bits 1; reaches all hosts and is not assignable.
Usable hosts
Addresses a device may take: 2h − 2, where h = host bits.
- Fuller, V. & Li, T. RFC 4632: Classless Inter-Domain Routing (CIDR) (2006), Section 3 (prefix notation and masks). rfc-editor.org/rfc/rfc4632.
- Pummill, R. & Manning, B. RFC 1878: Variable Length Subnet Table For IPv4 (1995) (usable host counts per mask). rfc-editor.org/rfc/rfc1878.
- Cisco. CCNA (200-301) Exam Topics, IP Connectivity / IPv4 Addressing and Subnetting. cisco.com.
Review
Check what you have learned with these review questions.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.