Become a Subnetting Ninja

Become a Subnetting Ninja
Photo by Abolfazl eslami / Unsplash

Subnetting is a crucial concept in networking. It plays a vital role in efficiently utilizing IP addresses and managing network resources. Whether you're a networking enthusiast or just someone looking to understand the fundamentals of networking, subnetting skills are essential and one of the most requested topics for tutorials. Don’t worry if you don’t “get it” right away. Once you have the basics, you will eventually gain a feel for subnetting. Soon, you will be a subnetting ninja!

What is Subnetting?

Subnetting, short for "subnetworking," is the practice of dividing a larger network into smaller, more manageable segments called subnets. Subnetting offers several benefits, including efficient IP address allocation and enhanced security through traffic separation. It allows network administrators to group devices logically based on their location, user roles, user groups, etc. Subnetting separated those groups into separate networks that cannot reach each other without a router (and its associated access control lists, if present).

There are a range of other benefits you gain from introducing subnets into your network design, ranging from scalability and simplified troubleshooting to ease of management, network design flexibility, and (probably most important) support for VLANs.

Hopefully, you are gaining a sense of how useful subnetting can be and where you can use it. But, keep in mind the words of Dr. Ian Malcolm, “Yeah, but your scientists were so preoccupied with whether or not they could, they didn't stop to think if they should.” Just because you know how to subnet, doesn’t mean should throw subnetting at every possible problem. If you are working with a small network that supports a limited amount of devices, subnetting may not be a solution for you. Likewise, if the network you are trying to subnet has a lack of skilled personnel, you may consider other options. Sometime keeping things simple it the best method. With that said, let’s get into it and see how to do what you came here for.

Subnetting in Action: A Step-by-Step Example

Let's walk through a step-by-step example of subnetting to illustrate the process.

Suppose we have the IP address range 192.168.1.0/24, and we want to divide it into four subnets. Here's how we can do it:

Step 1: Determine the Number of Subnets and Hosts

In this case, we want four subnets. To find out how many hosts each subnet can accommodate, we calculate 2^n - 2, where n is the number of host bits. In a /24 subnet, there are 8 bits available for hosts.

2^8 - 2 = 256 - 2 = 254 hosts per subnet. (Remember that we have to subtract 2, because we need to reserve a broadcast address and a network address.)

Step 2: Calculate the Subnet Mask

To accommodate 4 subnets, we need to borrow 2 bits from the host portion of the IP address. The subnet mask will be /24 + 2 = /26.

Step 3: Determine Subnet Ranges

We'll start with the original IP address and increment by the subnet size (2^2 = 4) to find the ranges for each subnet:

Original Subnet: 192.168.1.0/24 (Range: 192.168.1.0 - 192.168.1.255)

In this example, the network address is: 192.168.1.0, the first host address is: 192.168.1.1, the last host address is: 192.168.1.254, and the broadcast address is: 192.168.1.255.

Subnet 1: 192.168.1.0/26 (Range: 192.168.1.0 - 192.168.1.63)

In Subnet 1, the network address is: 192.168.1.0, the first host address is: 192.168.1.1, the last host address is: 192.168.1.62, and the broadcast address is: 192.168.1.63

Subnet 2: 192.168.1.64/26 (Range: 192.168.1.64 - 192.168.1.127)

Here, the network address is: 192.168.1.64; the broadcast address is: 192.168.1.127.

Subnet 3: 192.168.1.128/26 (Range: 192.168.1.128 - 192.168.1.191)

This subnet has room to support 62 hosts. (Use the formula: 2^6 - 2 = 64 - 2 = 62 host addresses. The 6 in this case refers to the amount of bits in of the octet you’re attempting to subnet that you reserve for host (Save the hosts!  @JeremyCioara)

Subnet 4: 192.168.1.192/26 (Range: 192.168.1.192 - 192.168.1.255)

You’re starting to get it, right?

Step 4: Assign IP Addresses

Now, we can assign IP addresses within each subnet range to devices based on their location or function.

Quiz Questions:

1. Which subnet range corresponds to the IP address 192.168.1.75?

A) Subnet 1: 192.168.1.0 - 192.168.1.63

B) Subnet 2: 192.168.1.64 - 192.168.1.127

C) Subnet 3: 192.168.1.128 - 192.168.1.191

D) Subnet 4: 192.168.1.192 - 192.168.1.255

2. How many hosts would be supported on a /27 subnet?

A) 32

B) 30

C) 27

D) 255.255.255.224

3. Where would you NOT expect to use subnetting? (choose 2)

A) in small home networks

B) in temporary event networks

C) in multi-department campuses

D) in a voice VLAN deployment

Understanding subnetting is essential for anyone working in IT or interested in networking. You're now well on your way to becoming a subnetting ninja—just remember, with great power comes great responsibility.