Table of Contents |
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.
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.
CIDR is a flexible way to define the size of a network.
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.
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.
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³ | 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.
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 subnet192.168.1.0/24:
192.168.1.0. 192.168.1.1 to 192.168.1.254. 192.168.1.255 (all host bits set to 1). 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:
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.
For this system to work, every subnet needs the following:
EXAMPLE
Here are the details of the subnet192.168.1.0/26:
192.168.1.0.192.168.1.63. 192.168.1.1 to 192.168.1.62. Source: THIS TUTORIAL WAS AUTHORED BY SOPHIA LEARNING. PLEASE SEE OUR TERMS OF USE.