Use Sophia to knock out your gen-ed requirements quickly and affordably. Learn more
×

Subnetting

Author: Sophia

what's covered
Managing large networks can become complex, especially as the number of connected devices grows. This tutorial explores how subnetting and CIDR notation help organize and scale networks by dividing them into smaller, more efficient parts. You’ll learn how subnet masks define network boundaries, how to identify network and host addresses, and how these components work together to guide data accurately. By the end, you’ll have a clearer understanding of how networks are structured and managed. Specifically, this lesson will cover the following:

Table of Contents

1. Subnetting and CIDR

As networks grow, so does the challenge of managing them. A single, large network with hundreds of devices can quickly become difficult to organize and secure. That is where subnetting comes in.

Subnetting is the process of dividing a larger network into smaller, more manageable segments called subnets. Each subnet acts like a smaller neighborhood within a city, making it easier to assign addresses, limit traffic, and improve security. Subnets help networks run more smoothly by keeping related devices grouped together and reducing unnecessary communication between unrelated parts of the network.

A city map divided into four colored regions labeled Subnet 1, Subnet 2, Subnet 3, and Subnet 4, representing how subnetting breaks one large network into smaller, organized sections.

Although IP address classes created some organization, this system often wasted addresses. For example, a small office might be stuck with hundreds of extra, unused IPs just because the class it was assigned was too large.

To solve this problem, engineers developed CIDR notation, which stands for Classless Inter-Domain Routing. CIDR replaced rigid classes with a flexible system that allows networks to be sized exactly as needed. It is like being able to custom-build shelves that fit your books perfectly, instead of settling for one-size-fits-all.

Together, subnetting and CIDR help network engineers organize addresses in a way that is efficient, scalable, and easier to manage. You will find them at work in everything from your home Wi-Fi network to large corporate systems.

terms to know
Subnetting
The practice of dividing a larger IP network into smaller, more efficient segments called subnets.
Subnet
A smaller, logically defined section of a larger network, created through subnetting to improve organization, performance, and security.
Classless Inter-Domain Routing (CIDR)
A flexible IP addressing method that uses slash notation (e.g., /24) to define the network and host portions of an IP address.


2. CIDR Notation

CIDR is a flexible way to define the size of a network.

recall
In earlier systems, networks were assigned fixed blocks of addresses based on classes (A, B, or C), which often gave organizations far more addresses than they needed.

CIDR allows network administrators to create subnets that fit the actual number of devices required. This helps avoid wasting IP addresses and allows more efficient use of the available address space.

CIDR uses slash notation to show how an IP address is divided between the network portion and the host portion. The number after the slash tells us how many bits of the 32-bit IP address are used to identify the network. For example, in the address 192.168.1.0/24, the “/24” means that the first 24 bits are used for the network portion. The remaining 8 bits are available for hosts, which are the individual devices on the network.

Think of it like a mailing address. The network portion is like the street name; it tells you which neighborhood or area the address belongs to. The host portion is like the house number; it tells you which specific building or apartment to deliver to on that street. CIDR notation tells routers exactly where to split the address between the two parts, so the data can be delivered efficiently and accurately.

term to know
Slash Notation
A shorthand format used in CIDR that follows an IP address with a slash (/) and a number, such as /24, to show how many bits are used for the network portion of the address.


3. Subnet Masks

Now that you understand classful addressing and CIDR, and the difference between them, let’s return to subnet masks.

A subnet mask, a special 32-bit number that works alongside an IP address to identify which part of the address refers to the network and which part refers to the host (the specific device). Like an IP address, a subnet mask is written in four octets, such as 255.255.255.0.

You can think of the subnet mask as a filter. It tells devices which portion of an IP address to read as the network and which portion to read as the host. The mask does this by marking the network bits with 1s and the host bits with 0s. In binary, the mask 255.255.255.0 looks like this:

11111111.11111111.11111111.00000000

This mask means the first 24 bits of the address are reserved for the network, and the remaining 8 bits are for host devices. That setup supports up to 254 usable hosts in that subnet.

Subnet masks are essential because they define the boundaries of a subnet. When you apply subnetting, you change the mask to “borrow” some bits from the host portion and use them to create additional subnets. This reduces the number of hosts per subnet but allows you to organize the network more efficiently.

Diagram showing IP address 192.168.1.10 with subnet mask 255.255.255.0, dividing binary into network (first 24 bits) and host (last 8 bits).

EXAMPLE

CIDR lets you right-size your network to match your actual number of devices. Let’s say you are setting up a network for a small office that needs to support up to 60 devices. A standard Class C mask is 255.255.255.0, which allows for 254 usable host addresses, but that is far more than is needed. If you change the mask to 255.255.255.192 (/26 in CIDR notation), you’re borrowing 2 bits from the host portion. This gives your subnet 64 total addresses, 62 of which are usable. (The first and last are reserved for other purposes.) That is a perfect fit.
Position 2⁷ 2⁶ 2⁵ 2⁴ 2⁰
Value 128 64 32 16 8 4 2 1

CIDR notation and subnet masks are two ways of expressing the same idea: how much of an IP address is used for the network portion and how much is used for the host portion. The subnet mask shows this using decimal numbers, such as 255.255.255.0. CIDR uses a slash followed by a number, such as /24, to show how many bits are used for the network portion.

CIDR Notation Subnet Mask Network Bits Host Bits Usable Hosts
/24 255.255.255.0 24 8 254
/25 255.255.255.128 25 7 126
/26 255.255.255.192 26 6 62
/27 255.255.255.224 27 5 30
/28 255.255.255.240 28 4 14
/29 255.255.255.248 29 3 6
/30 255.255.255.252 30 2 2

Network devices, such as routers and switches, use this information to determine whether an IP address belongs inside the same network or if it should be sent outside to another network. CIDR notation is easier to read and use, especially when designing or organizing networks. Instead of writing out a full subnet mask, you can simply say “this is a /26 network,” and any networking device will know how to handle it. Understanding both formats helps when working with different tools or reading network documentation. Some systems use CIDR notation, while others still show subnet masks in dotted decimal form.

3a. Network Addresses

A network address is the IP address in a subnet where every host bit is zero. It is used to identify the entire subnet itself, not a specific device. Routers and other networking devices use the network address to route traffic to the subnet. When a router receives a data packet, it compares the destination IP address to known network addresses to decide where to send the packet next. Without the network address, the router would not know which subnet to forward the data to.

EXAMPLE

Here are the details of the subnet 192.168.1.0/24:

  • The network address is 192.168.1.0.
  • The usable host range is from 192.168.1.1 to 192.168.1.254.
  • The broadcast address is 192.168.1.255 (all host bits set to 1).
The network address defines the entire group of 254 usable host addresses.

term to know
Network Address
The first address in a subnet, used to identify the entire network. It has all host bits set to 0 and is not assigned to any individual device.

3b. Host Addresses

A host address is any IP address within a subnet that is assigned to an individual device, such as a computer, printer, router, or smartphone. While the network address identifies the entire subnet, host addresses are used to identify and communicate with specific devices inside that subnet. A host address includes both the network portion and a unique host portion. The network portion tells devices which subnet the host belongs to, and the host portion identifies the specific device on that subnet.

In every subnet, two addresses are reserved and cannot be used for hosts:

  • The network address, where all host bits are set to 0, identifies the subnet itself.
  • The broadcast address, where all host bits are set to 1, is used to send messages to all devices in the subnet at once.
The broadcast address allows one device to quickly contact every other device on the same subnet. Since it serves a special purpose, it cannot be assigned to a specific host. Because of these two reserved addresses, the number of usable host addresses in a subnet is always two less than the total number of possible addresses.

term to know
Host Address
An IP address assigned to a specific device on a network. It must be unique within its subnet and falls between the network and broadcast addresses.

3c. Working Together

Let's review. The network portion, defined by the subnet mask or CIDR notation, tells a device which subnet an IP address belongs to. Routers use the network portion to decide where to forward data.

The host portion identifies a specific device within that subnet. When a device sends data to another IP address, it first checks the network portion to see if the destination is in the same subnet. If it is, the data is sent directly. If it is not, the data is sent to the router, which uses the destination’s network address to route the packet correctly.

Diagram showing the packet flow from Device A. If the destination is in the same subnet, the packet goes directly to Device B. If it is in a different subnet, the packet goes through the router to reach Device C. Broadcast packets go from Device A to all devices in the subnet.

For this system to work, every subnet needs the following:

  • A network address, to identify the subnet
  • A range of host addresses, for devices
  • A broadcast address, to send messages to all hosts on the subnet
Subnetting allows network administrators to control this structure by defining how many bits are used for the network and how many are left for hosts. This helps improve organization, performance, and security across the network.

EXAMPLE

Here are the details of the subnet 192.168.1.0/26:

  • The network address is 192.168.1.0.
  • The broadcast address is 192.168.1.63.
  • The usable host addresses are from 192.168.1.1 to 192.168.1.62.
Each device in that subnet must be assigned a unique address from within that usable range.

summary
In this lesson, you learned that subnetting and CIDR provide a way to divide larger networks into smaller, more efficient subnets. You explored how CIDR notation replaces traditional class-based addressing with a flexible, slash-based system that defines the size of each subnet. Through the use of subnet masks, you saw how IP addresses are split into network and host components, enabling devices to identify whether a destination is local or remote. The concept of network addresses helped you understand how each subnet is defined, while host addresses represented the individual devices within that subnet. Finally, you examined how all these elements are working together to support structured, scalable, and effective network communication.

Source: THIS TUTORIAL WAS AUTHORED BY SOPHIA LEARNING. PLEASE SEE OUR TERMS OF USE.

Terms to Know
Classless Inter-Domain Routing (CIDR)

A flexible IP addressing method that uses slash notation (e.g., /24) to define the network and host portions of an IP address.

Host Address

An IP address assigned to a specific device on a network. It must be unique within its subnet and falls between the network and broadcast addresses.

Network Address

The first address in a subnet, used to identify the entire network. It has all host bits set to 0 and is not assigned to any individual device.

Slash Notation

A shorthand format used in CIDR that follows an IP address with a slash (/) and a number, such as /24, to show how many bits are used for the network portion of the address.

Subnet

A smaller, logically defined section of a larger network, created through subnetting to improve organization, performance, and security.

Subnetting

The practice of dividing a larger IP network into smaller, more efficient segments called subnets.