PriceTag HUB / Networking

Computer Networking

Learn computer networks, Wi-Fi, routers, IP addressing, network protocols, troubleshooting, and network security through practical guides and step-by-step explanations.

Networking Fundamentals · Beginner Guide

Subnetting Explained: A Beginner's Guide

Subnetting is an essential networking skill used to divide a larger IP network into smaller logical networks. It helps administrators organize devices, plan IP addresses, and control how systems communicate.

This guide explains subnet masks, CIDR notation, network addresses, broadcast addresses, and usable host ranges with practical IPv4 examples. You will also learn why subnetting matters when defending a network.

Advertisement

What Is Subnetting?

Subnetting is the process of dividing an IP network into smaller networks called subnets. Each subnet has its own network prefix and address range.

For example, a company may have separate networks for office computers, servers, guest Wi-Fi, and security cameras. Rather than treating every device as part of one large network, an administrator can allocate different subnets to these groups.

Example 1

Office computers

192.168.1.0/24

A possible subnet for employee devices.

Example 2

Security cameras

192.168.2.0/24

A separate address range for camera devices.

Example 3

Guest Wi-Fi

192.168.3.0/24

A separate subnet that can have restricted access.

These are illustrative private IPv4 networks. Creating separate address ranges alone does not isolate devices; routers, VLANs, firewall rules, and other network configurations determine how traffic can move between them.

Why Is Subnetting Used?

Subnetting helps network administrators plan address allocation and organize infrastructure. The exact benefits depend on the network design and how the subnets are configured.

Better address management

Allocate suitable address ranges to different departments, sites, and device groups.

Network organization

Separate logical groups such as servers, employee devices, printers, and guest systems.

Traffic management

Use routing and network design to control communication between different subnets.

Security policy enforcement

Apply access-control lists and firewall policies to limit unnecessary communication between network segments.

Advertisement

Understanding Subnet Masks

An IPv4 subnet mask identifies which bits of an address belong to the network prefix and which bits remain for addresses within that subnet.

Consider the following IPv4 configuration:

SettingExample
IP address192.168.1.10
Subnet mask255.255.255.0
CIDR prefix/24
Network address192.168.1.0
Broadcast address192.168.1.255
Typical usable range192.168.1.1–192.168.1.254

How does 255.255.255.0 work?

In binary, the mask 255.255.255.0 is represented by 24 consecutive ones followed by 8 zeros. The 24 ones identify the network prefix, while the remaining 8 bits provide the subnet's address space.

Remember this relationship

255.255.255.0 = /24 = 24 network-prefix bits

This is one of the most common IPv4 subnet configurations used in learning examples and small networks.

What Is CIDR Notation?

CIDR stands for Classless Inter-Domain Routing. CIDR notation represents an IP network by writing its address followed by a slash and the number of bits in its network prefix.

For example, 192.168.1.0/24 identifies a network with a 24-bit IPv4 prefix. IPv4 addresses contain 32 bits in total, so this prefix leaves 8 bits in the address for the remaining portion.

CIDRSubnet maskHost bits
/24255.255.255.08
/25255.255.255.1287
/26255.255.255.1926
/27255.255.255.2245
/28255.255.255.2404

As the prefix number increases, fewer host bits remain and the subnet becomes smaller. As the prefix number decreases, more host bits remain and the subnet contains a larger address range.

Network Address, Broadcast Address, and Host Range

In a conventional IPv4 subnet, three concepts are especially important: the network address, the broadcast address, and the usable host addresses between them.

1. Network address

192.168.1.0

For the example network 192.168.1.0/24, this address identifies the subnet itself and is not normally assigned to a host.

2. Usable host range

192.168.1.1–192.168.1.254

These are the conventional host addresses available within this /24 subnet, subject to the network's configuration and address allocation.

3. Broadcast address

192.168.1.255

This is the subnet-directed broadcast address for the /24 network. It is used to address eligible hosts on that subnet.

Important exception

The familiar formula that excludes the network and broadcast addresses applies to conventional IPv4 subnets such as /24, /25, and /26. Special cases, including /31 point-to-point links and /32 host routes, follow different rules.

Advertisement

Step-by-Step Subnetting Example

Suppose a computer has the following configuration:

Given configuration

192.168.10.25/26

Our task is to find the subnet mask, network address, broadcast address, and conventional usable host range.

Step 1: Find the subnet mask

A /26 prefix means 26 network bits and 6 remaining bits. The corresponding subnet mask is:

255.255.255.192

Step 2: Calculate the address block size

In the last octet, subtract the mask value from 256:

256 − 192 = 64

Therefore, the subnet ranges in the last octet start at 0, 64, 128, and 192.

Step 3: Identify the subnet

The address ends in 25, which falls in the range from 0 through 63. Therefore, it belongs to the first subnet.

Network address: 192.168.10.0

Step 4: Find the broadcast address

The subnet ends at the address immediately before the next block begins.

Broadcast: 192.168.10.63

Step 5: Find the usable host range

For this conventional /26 subnet, the usable host addresses are between the network and broadcast addresses.

192.168.10.1–192.168.10.62

Final answer

  • IP address: 192.168.10.25
  • Subnet mask: 255.255.255.192
  • Network: 192.168.10.0/26
  • Broadcast: 192.168.10.63
  • Usable hosts: 62
  • Usable range: 192.168.10.1–192.168.10.62

Common IPv4 Subnet Masks and Host Counts

This reference table shows common conventional IPv4 subnet sizes. The usable host counts exclude the network and broadcast addresses.

PrefixSubnet maskTotal addressesUsable hostsTypical example
/24255.255.255.0256254Common small LAN
/25255.255.255.128128126Smaller network segment
/26255.255.255.1926462Small device group
/27255.255.255.2243230Small subnet
/28255.255.255.2401614Very small subnet

A conventional IPv4 subnet's total address count can be calculated as 2 raised to the number of host bits. For example, a /26 prefix leaves 6 host bits, so 2⁶ = 64 total addresses and typically 62 usable host addresses.

How to Calculate a Subnet

When solving a subnetting problem, follow a consistent process rather than trying to memorize every possible address range.

  1. Identify the prefix. For example, /26 means 26 network bits.
  2. Calculate host bits. For IPv4, subtract the prefix length from 32. A /26 leaves 6 host bits.
  3. Find the subnet mask. Convert the prefix to its dotted-decimal mask, such as 255.255.255.192 for /26.
  4. Find the block size. In the relevant octet, subtract the mask value from 256.
  5. Find the network boundary. Identify the block containing the given IP address.
  6. Determine the broadcast and host range. Find the final address in the block, then determine which addresses can be assigned to hosts under the subnet's rules.

Practice question

Given 192.168.5.70/26, calculate the subnet mask, network address, broadcast address, and usable host range.

Answer

  • Subnet mask: 255.255.255.192
  • Network: 192.168.5.64/26
  • Broadcast: 192.168.5.127
  • Usable range: 192.168.5.65–192.168.5.126
  • Usable hosts: 62
Advertisement

Why Subnetting Matters in Cybersecurity

Network defenders need to understand which devices belong to which subnets and how traffic moves between them. Subnetting knowledge is useful when investigating alerts, configuring firewalls, and reviewing network traffic.

Network segmentation

Separate groups of devices into logical network segments and restrict communication where appropriate.

Firewall configuration

Interpret CIDR ranges and create rules for permitted or denied source and destination networks.

Log analysis

Recognize whether an IP address belongs to an internal subnet, a known server network, or another address range.

Incident investigation

Use subnet information alongside timestamps, ports, device records, and traffic evidence to investigate unusual activity.

Subnetting is not a firewall

Different IP subnets do not automatically guarantee security. Effective segmentation requires appropriate network architecture, routing controls, firewall policies, and monitoring. A defender should verify which traffic is actually permitted between segments.

What Should You Learn Next?

Once you understand IPv4 subnetting, compare IPv4 with IPv6 to learn how modern networks handle addressing and larger address spaces.

Frequently Asked Questions

What is subnetting in networking?

Subnetting is the process of dividing an IP network into smaller logical networks called subnets. It helps organize addressing, manage network traffic, and apply network policies.

What is a subnet mask?

A subnet mask identifies the network portion and host portion of an IPv4 address. For example, 255.255.255.0 corresponds to the /24 prefix.

What does /24 mean in an IP address?

The /24 prefix means that the first 24 bits of the IPv4 address identify the network prefix, leaving 8 bits for the remaining address space.

How many usable hosts are in a /24 subnet?

A conventional IPv4 /24 subnet contains 256 total addresses. Typically, 254 are usable host addresses because the network and broadcast addresses are reserved.

What is the difference between a network address and a broadcast address?

The network address identifies the subnet itself. The IPv4 broadcast address is used to send traffic to eligible hosts on that subnet.

Why is subnetting important for cybersecurity?

Subnetting helps network defenders separate systems, organize firewall rules, monitor traffic between network segments, and limit unnecessary access when combined with appropriate security controls.

IP Addressing Learning Path

Continue Learning About Networking

Build your networking knowledge step by step, from IP addressing fundamentals to subnet calculations and IPv4/IPv6.