A Beginner’s Guide to Subnetting

What Is a Subnet Mask?

This article provides an introduction to subnets and subnet masks, including what they are and how they work. Subnetting is the process of dividing a network into smaller networks (subnets), which can help make data routing more efficient and secure. IP addresses consist of two parts - the network address and the host address - which are indistinguishable without a subnet mask.

Subnetting is the process of dividing a network into two or more subnets. Its primary function is to make the routing of data within a network more efficient and secure. Subnetting also helps make better use of IPv4 addresses.

When you connect a device to a network, the network assigns an IP address to the device. That IP address consists of two parts: the network portion and the host portion. The network portion of the IP address identifies the overall network while the host portion identifies the device.

The network address and host address contained in an IP address are indistinguishable from each other without a subnet mask. The subnet mask allows network traffic to understand IP addresses by splitting them into the network and host addresses.

How does subnetting really work?

Networks use Internet Protocol addresses to identify specific pieces of hardware, like servers or computers. Subnetting allows a network that has one public IP address to split into a number of smaller networks. Each with a unique internal IP address.

Subnetting is a way to divide one large network into multiple smaller networks. By using subnets, data can travel more directly to its destination IP address, which makes the network run faster and smoother. In order for subnetting to work properly, each IP address needs to be matched with a subnet mask.

To make subnetting possible, and to make sure traffic gets to the correct destination address, each IP address needs to be matched to a subnet mask.

How do IP addresses and subnet masks relate?

Devices on an IPv4 network can each be uniquely identified by a 32-bit IP address. These 32 binary bits contain the host address and the network address, which are identified by the subnet mask.

IP addresses play an important role in network communication, and subnet masks help to direct data on specific routes within a network according to its intended destination. In most cases, IP addresses are displayed in dotted-decimal format with numbers ranging from 0 to 255. Subnet masks look very similar to IP addresses but have a different function - they're only used internally within a network and don't serve as public IP addresses.

The role of a public IP address is to direct traffic to the correct network. The role of a subnet mask in subnetting is to direct data on a specific route within the network according to its intended destination.

How do IP classes and subnet masks relate?

Networks come in different sizes and IP Classes dictate how many hosts a network can have. There are three classes of IP addresses- A,B, C. Class D is for multicasting and class E- research purposes so they're not relevant here. In a Class C address, the first 3 octets (24 bits) reflect the network number while the last octet is used to identify 254 host addresses on that network.

Class A network supports over 65,536 hosts. It makes all that access by only having the subnet mask reflect the network address in the first octet, with the second, third, and fourth left free for the administrator to assign as required to hosts and subnets.

Class B network has an IP address where the subnet mask reflects the network address in the first and second octets. Leaving only the third and fourth for assignment with the network. Class B network, therefore, has availability for connections to only between 256 to 65,534 hosts.

How do network addresses and subnet masks relate?

For IPv4 addresses, each of the different classes of the network has a different default mask:

The class A default subnet mask is

The class B default subnet mask is

The class C default subnet mask is

You can see how the default subnet masks reflect how many of the octets are used by the network address.

Looking at the default subnet mask tells you the number and type of IP addresses of any given network. Each subnet contains connected devices with a fixed range of IP addresses.

If you take as an example IP address and pair it with the subnet mask, you can determine that the network address is contained in the portion 10.45.21 while the associated subnet for host addresses is in the range–

In networking, an IP address is a unique identifier assigned to devices participating in a network. A subnet mask is used to divide an IP address into two parts: the network ID and host ID. Together, these two components help determine which part of the world each device belongs to and how it communicates with other devices on the network.


Understanding what a subnet mask is may be impossible until you begin to understand how IP addresses work and why networks use subnetting. That’s why the answer to what a subnet mask is isn’t completely straightforward.

With this said, you should now have basic knowledge of how IPv4 addresses communicate data between and within networks. The administrators of those networks may choose to use subnetting out of concern for security, routing efficiency, network speed or to preserve more public IPv4 addresses. Usually, it’s a combination of multiple reasons.

If you choose to utilize subnetting in your network, you’ll need to use subnet masks to ensure that inbound traffic is routed to and from the correct host devices. Even if you run a relatively small system, subnet masks can play an integral part in its reliable and smooth operation.

This article provides a beginner's guide to understanding subnet masks and their role in IP address networking. It explains why networks use subnets and how they work, as well as describing the benefits of using subnet masks in smaller networks.