◆ Study Hub By J

Study Hub › Study Guides

NETWORKS · DCN

IP Addressing and Subnetting for Beginners (with Step-by-Step Examples)

By Janidu Sandaruwan · Updated October 2026 · 4 min read

Subnetting looks scary because it mixes binary with networking terms, but it is really a short, repeatable method. Once you can do the four steps below, most exam subnetting questions become quick, reliable marks.

1. How an IPv4 address is built

An IPv4 address is 32 bits, written as four octets of 8 bits each, separated by dots, for example 192.168.10.77. Each octet ranges from 0 to 255. Every address has two parts: the network part (which network the device is on) and the host part (which device on that network).

You need the 8-bit place values: 128 64 32 16 8 4 2 1. For example, 77 = 64 + 8 + 4 + 1 = 01001101.

2. Subnet masks and CIDR

The subnet mask says how many bits belong to the network. In binary it is a run of 1s (network bits) followed by 0s (host bits). CIDR notation writes the number of 1s after a slash.

With h host bits, a subnet has 2h addresses. The first is the network address and the last is the broadcast address, so usable hosts = 2h − 2.

3. The four-step method

  1. Find the block size in the octet where the mask "breaks": 256 − (mask value in that octet). For /26 the last octet is 192, so the block size is 256 − 192 = 64.
  2. List the subnets by counting up in block sizes from 0: 0, 64, 128, 192.
  3. Find the subnet the address falls into: the largest multiple of the block size that is not bigger than the address's octet.
  4. Work out the range: network address = start of the block, broadcast = next block − 1, usable hosts are everything in between.

4. Example 1: a /26 network

Question: For 192.168.10.0/26, how many subnets of the /24 are there, and what are their ranges?

A /26 borrows 2 bits from the last octet (26 − 24 = 2), giving 22 = 4 subnets. Host bits = 32 − 26 = 6, so each subnet has 26 = 64 addresses and 62 usable hosts. Block size = 64.

SubnetNetworkUsable hostsBroadcast
1192.168.10.0.1 – .62192.168.10.63
2192.168.10.64.65 – .126192.168.10.127
3192.168.10.128.129 – .190192.168.10.191
4192.168.10.192.193 – .254192.168.10.255

5. Example 2: which subnet is a host in?

Question: A device has the address 192.168.10.77/27. Find the network address, broadcast address and usable range.

  1. /27 → last octet of the mask is 224 (11100000). Block size = 256 − 224 = 32.
  2. Subnets: 0, 32, 64, 96, 128 …
  3. 77 falls between 64 and 96, so it is in the 64 subnet.
  4. Network = 192.168.10.64, broadcast = 96 − 1 = 192.168.10.95, usable hosts = .65 to .94 (30 hosts).

You can check with binary: ANDing 01001101 (77) with 11100000 (224) gives 01000000 = 64. Same answer.

6. Example 3: designing subnets

Question: You have 10.0.5.0/24 and need subnets with at least 50 hosts each. What prefix should you use?

Find the smallest h where 2h − 2 ≥ 50. 25 − 2 = 30 is too small; 26 − 2 = 62 works, so h = 6. Prefix = 32 − 6 = /26, which gives 4 subnets of 62 usable hosts each.

7. Quick reference table

CIDRMaskBlock sizeUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242

8. Common mistakes

J

Written by Janidu Sandaruwan, an IT undergraduate at SLIIT and the creator of Study Hub By J. Guides are written from a student's point of view; always confirm official rules with your faculty and module outline.

Study Hub By J: a non-profit student help platform, made for university students. 💙
Study Guides · Study Hub · GPA Calculator · Privacy & Policy · About the creator
Independent student project · not officially affiliated with any university · © 2026 Study Hub By J