Let’s Dive Into Subnetting!

Subnetting isn’t an easy topic to understand. If you’re here, you probably know that already. It’s a concept that has made many grown men cry, and while its great to be in touch with your emotions, we don’t want anything we do for a living to bring us to tears. Everyone has a different style of learning so this may not be the last post on subnetting you read, but the goal is to get you headed in the right direction by helping you become familiar with the basics. There are a couple of things you should already know heading into this: IP addresses and binary numbers. I am including primers below, but if you are already comfortable with them, skip over them to Subnetting, where we will get into the meat of why you are here. That being said, let’s get started:

IP ADDRESSING

We all know that an address is some type of code that we use to describe a location. There are a LOT of them. Just ask the government. As the population of the U.S. grew exponentially during the post-war housing boom, it became a lot tougher to keep track. In response the US Postal Service created the ZIP code, a new protocol to help divide, organize and route mail more quickly (fun fact: USPS created this amazingly corny video to help promote the ZIP code).

Subnetting does something similar with IP addresses. IP stands for Internet Protocol, and IP addresses are used to describe the location of a device on a network. They usually look like this:

192.168.10.1

This is in decimal notation, four octets divided by dots and converted from binary, but we’ll get to that soon. The important thing to note is that different parts of the address help to indicate the location of a device. The two parts are a Network ID and a Host ID. One network can hold hundreds of millions of hosts, but the average network doesn’t have 100 million users, so originally many IP addresses went unused. Somewhere around 1985, computer technicians realized there is a more efficient way of doing this and, like the Post Office, introduced a system to divide the current network into smaller Subnets. Before we get into how Subnets work, it is important to understand how binary numbers are used.

BINARY NUMBERING

Computers speak in their own language, called machine code. This code is expressed in binary notation. Remember in that movie “the Matrix” where all the green numbers flash across the screen? Remember how they were all 1’s and 0's? That’s binary! A zero digit means “off” and a 1 digit means “on”. It actually wasn’t just for show, that is a real computer language, and this will be a quick and dirty overview of binary.

So, we are used to counting numbers in a decimal notation, where we are using the same ten numbers (0,1,2,3,4,5,6,7,8,9) to count upwards. Binary uses only two digits (0 and 1) to count upwards. In decimal notation, we know that there is a ones place, a tens place, a hundreds place, and so on. In binary notation, the places are in powers of 2 and each one is called a bit. From left to right, our first digit, when turned on, is 128, or 2 to the 7th power. The next digit, when turned on, is 64, then 32, 16, 8, 4, 2, and 1. When all these digits are in the on position the octet equals 255. When they are all off, the octet is just zero. Lets look at the binary number 10110010. Remember when I mentioned that 0 means off and 1 means on? In this number, we have 4 digits that are “on”. Take a look at what places have an “on” bit and try to come up with what decimal number this translates to. If you came up with 178, you’re correct, and you’re getting the hang of binary.

This is important, because binary is the numerical system that is used to describe networks and their masks when it comes to subnetting. If you want to go even deeper, there is a great explanation of binary and how it works here.

SUBNETTING

Now that we have IP addresses and binary numbering down, let’s talk about how to actually subnet a network. The first thing you need to do is look at the network that you want to subnet. Let’s say for example we are administrators at a company called Terrapin Inc. Our office network (that was provided to us by our ISP) is 192.168.110.1 and we need to create 6 subnets, three for the 1st floor and three for the 2nd floor. Now, the second thing we need is the subnet mask. This will allow us to identify what subnets are available for us to use within our network. Our ISP has provided us with a subnet mask of 255.255.255.0.

Still with me? Here comes the fun part. We saw earlier how IP addresses have network IDs and host IDs. Now, we will have to borrow some bits from our host ID in order to create our 2 subnets. The number of subnets correlates directly with the powers of 2 we discussed earlier. If we borrow 5 bits, thats 32 subnets. If we borrow 6 bits? 64 subnets. For our purposes, we only need enough for at least 6 subnets, so that means we’re good with borrowing 3 bits, and getting 8 subnets. We’ll just have 2 extra, nothing wrong with that.

However, that’s not to say those extra addresses won’t be used! Every subnet has 2 reserved host addresses that are used for a network address and a broadcast address. So every time you subnet, just know that 2 of those addresses will be reserved for those purposes.

So let’s summarize! We learned what IP addresses are, and how we use binary numbering to describe those addresses, along with subnets and their masks. We also learned how to split up a network into a smaller network and why doing that would potentially be useful to us. You have started along the path, grasshopper, and though its easy to pick up the basics, it is another thing to master networking as a profession. Remember, to become a true samurai subnetter, its always good to practice. I recommend SubnettingPractice.com to sharpen your skills. They also have an awesome cheatsheet for quick reference. Good luck!

Show your support

Clapping shows how much you appreciated Evan King’s story.