BuildTheNet

Opening your workspace

Your learning content and tools are loading.

Learning paths › CCNA › 1. Network Fundamentals

Subnetting Basics

Written reference: Demystify IPv4 subnetting: borrowing host bits, calculating subnets (2^s), calculating usable hosts (2^h - 2), and converting slash notation.

About 9 minutes

Why it matters

Subnetting splits one address block into right-sized networks. Doing it well avoids both wasted space and overlapping ranges.

How Subnetting Works from Scratch

Subnetting is the process of borrowing bits from the host portion of an IP address to create smaller, isolated sub-networks.

Borrowing bits increases the number of networks (2^s) but decreases the number of available hosts per network (2^h - 2).

The Magic Number (Block Size) is 256 minus the interesting subnet mask octet value.

A /24 subnet has 254 usable hosts; a /25 has 126 hosts; a /26 has 62 hosts; a /27 has 30 hosts; a /28 has 14 hosts.

The Core Subnetting Formulas

When subnetting a network:

1. Number of Subnets = 2^s Where s is the number of borrowed bits (1s added to the prefix).

2. Number of Usable Hosts per Subnet = 2^h - 2 Where h is the number of remaining host bits (0s at the end of the mask).

Example: Subnetting 192.168.1.0/24 into /26: • Original prefix = /24, new prefix = /26 -> s = 2 borrowed bits. • Remaining host bits = 32 - 26 = 6 host bits. • Number of subnets = 2^2 = 4 subnets. • Usable hosts per subnet = 2^6 - 2 = 64 - 2 = 62 usable hosts.

Finding the Subnet Boundaries

To find the four subnets for 192.168.1.0/26: • Subnet mask = 255.255.255.192 • Block size = 256 - 192 = 64

Subnet 1: 192.168.1.0 • Usable range: 192.168.1.1 to 192.168.1.62 • Broadcast: 192.168.1.63

Subnet 2: 192.168.1.64 • Usable range: 192.168.1.65 to 192.168.1.126 • Broadcast: 192.168.1.127

Subnet 3: 192.168.1.128 • Usable range: 192.168.1.129 to 192.168.1.190 • Broadcast: 192.168.1.191

Subnet 4: 192.168.1.192 • Usable range: 192.168.1.193 to 192.168.1.254 • Broadcast: 192.168.1.255

Subnetting Cheat Sheet for 4th Octet (/24 to /30)

Prefix: /24 · Subnet Mask: 255.255.255.0 · Borrowed Bits: 0 · Host Bits: 8 · Block Size: 256 · Total IPs: 256 · Usable Hosts: 254

Prefix: /25 · Subnet Mask: 255.255.255.128 · Borrowed Bits: 1 · Host Bits: 7 · Block Size: 128 · Total IPs: 128 · Usable Hosts: 126

Prefix: /26 · Subnet Mask: 255.255.255.192 · Borrowed Bits: 2 · Host Bits: 6 · Block Size: 64 · Total IPs: 64 · Usable Hosts: 62

Prefix: /27 · Subnet Mask: 255.255.255.224 · Borrowed Bits: 3 · Host Bits: 5 · Block Size: 32 · Total IPs: 32 · Usable Hosts: 30

Prefix: /28 · Subnet Mask: 255.255.255.240 · Borrowed Bits: 4 · Host Bits: 4 · Block Size: 16 · Total IPs: 16 · Usable Hosts: 14

Prefix: /29 · Subnet Mask: 255.255.255.248 · Borrowed Bits: 5 · Host Bits: 3 · Block Size: 8 · Total IPs: 8 · Usable Hosts: 6

Prefix: /30 · Subnet Mask: 255.255.255.252 · Borrowed Bits: 6 · Host Bits: 2 · Block Size: 4 · Total IPs: 4 · Usable Hosts: 2 (WAN links)

The words you need

Subnetting — Dividing a single large network into multiple smaller logical network segments to improve security and reduce broadcast traffic.

Borrowed Bits (s) — The bits taken from the host portion and added to the network portion to create subnets.

Host Bits (h) — The remaining 0 bits in the subnet mask used to number individual endpoint devices within the subnet.

Block Size (Magic Number) — The interval by which subnets increment in the interesting octet, calculated as 256 - mask octet.

Takeaways

Next: Finding Subnets Fast

More free lessons in 1. Network Fundamentals