SUBNETTING

Tom Church
Tech Jobs Academy
Published in
5 min readJan 27, 2016
NOT ALL SUBNETTING IS EASY…

I should start by saying that I’m not planning on going into the different hardware you’d need to split up your networks or anything. You should also understand Binary before you read this. I’m just going to try and focus on the logical aspect of subnetting.

SOMETIMES IT’S BEST TO JUST DIVE IN.

So, what is subnetting? It’s when you take one network and split it into multiple smaller networks. That’s done using the IP Address and Subnet Mask. Generally, these are displayed in decimal notation, but it’s important to understand that the computer reads them in binary.

An example of an IP Address in decimal notation would be 172.16.8.0 (Notice there are 4 numbers separated by periods. Each of these numbers signify an octet, which is a collection of 8 bits in binary). So an IP Address is just a 32-bit number assigned to a host on a network. Translated to binary, 172.16.8.0 looks like this:

  • IP Address written in binary:
    10101100.00010000.00001000.00000000

Now to split your network into multiple sub-networks, first you need to determine what part of the IP Address is the Network ID and what part is the Host ID. The Subnet Mask determines that for you. Like the IP Address, the Subnet Mask is also a 32-bit number, usually written in decimal form. So say you have a Subnet Mask of 255.255.252.0 (notice that just like the IP Address you have 4 numbers or octets). Translated to binary, 255.255.252.0 looks like this:

  • Subnet Mask written in binary:
    11111111.11111111.11111100.00000000
    (Notice that to the left side there are all ones and to the right there are all zeros. The Subnet Mask will always look this way in binary. The ones identify the Network ID of the corresponding IP Address and the zeroes identify the corresponding Host ID)
So in this example, the first 22 bits of of your binary IP Address are the Network ID and the last ten are the Host ID.

Now if wanted to split the network into 2 networks, you would need to extend the Network ID using the Subnet Mask. This is done by borrowing a bit from the Host ID. That bit is now signifying your sub-networks.

In this example, the 23rd bit of the Subnet Mask is changed from a 0 to a 1, which extends the mask and signifies that this bit of the IP Address is now part of the Network ID.

By changing the 23rd bit of the Subnet Mask to a one, you are extending the mask and signifying that this bit is now part of the Network ID. This gives you the option to change that one bit of the IP Address (in this case, in the 3rd octet) to signify a second network. So …00001000… of the IP Address is your first sub-network and …00001010… is your second, as seen below.

  • Sub-network 1 (binary): 10101100.00010000.00001000.00000000
    Sub-network 2 (binary): 10101100.00010000.00001010.00000000
This is an example of borrowing two bits, allowing for 4 sub-networks.

Borrowing a second bit from the Host ID extends the Network ID farther, which allows you to create 4 sub-networks. Notice that when you write out the four different possible options with those 2 bits, you’ve created 4 different sub-networks with 4 different Network IDs:

  • Sub-network 1 (binary): 10101100.00010000.00001000.00000000
    Sub-network 2 (binary): 10101100.00010000.00001001.00000000
    Sub-network 3 (binary): 10101100.00010000.00001010.00000000
    Sub-network 4 (binary): 10101100.00010000.00001011.00000000
    Subnet Mask (binary): 11111111.11111111.11111111.00000000

So by extending the Subnet Mask by 2 bits, it’s signifying that you are using those 2 bits of the IP Address to signify your sub-networks. When converted back to decimal notation, the octets look like this:

  • Sub-network 1 (decimal): 172.16.8.0
    Sub-network 2 (decimal): 172.16.9.0
    Sub-network 3 (decimal): 172.16.10.0
    Sub-network 4 (decimal): 172.16.11.0
    Subnet Mask (decimal): 255.255.255.0

IDENTIFYING THE HOST RANGE AND BROADCAST

Now that you’ve determined your different sub-network IDs, you can easily determine the host range for each sub-network. As shown in earlier examples, the Host ID is signified by the amount of zeroes in the Subnet Mask. Take a look at your fourth sub-network and your Subnet Mask:

  • Sub-network 4 (decimal): 172.16.11.0
    Subnet Mask (decimal): 255.255.255.0

Convert them back to binary:

  • Sub-network 4 (binary): 10101100.00010000.00001011.00000000
    Subnet Mask (binary): 11111111.11111111.11111111.00000000

Your Host ID is determined by the zeroes in the Subnet Mask. In this case, because you have borrowed two bits and split you Network into 4 different sub-networks, your Host ID is the .00000000 part of the IP Address, or the last octet. So take a look at Sub-network 4’s IP Address:

  • Sub-network 4 (binary): 10101100.00010000.00001011.00000000
    Your first host would be: 10101100.00010000.00001011.00000001
    (because it’s the first address after the IP used to signify Sub-network 4)
  • Sub-network 4 (binary): 10101100.00010000.00001011.00000000
    Your last host would be: 10101100.00010000.00001011.11111110
    (This is your last usable address in Sub-Network 4)

Notice that 10101100.00010000.00001011.11111111 (or 172.16.11.255 in decimal notation) wasn’t used. That’s because the Host ID with all ones is always reserved for broadcast. So Sub-network 4 has a host range of:

  • First Host: 10101100.00010000.00001011.00000001 to
    Last Host: 10101100.00010000.00001011.11111110

With a broadcast ID of:

  • Broadcast: 10101100.00010000.00001011.11111111

When converted back to decimal, you have:

  • First Host: 172.16.11.1 to
    Last Host: 172.16.11.254
    Broadcast: 172.16.11.255

And that’s that. I hope this post has been helpful.

TRY IT YOURSELF!

If you want to test yourself, try splitting it into 16 sub-networks.

  • Your IP Address is 172.16.8.0
    Your Subnet Mask is 255.255.252.0
    What are the the first & last hosts and the broadcasts of each network?

The answers are listed below.

--

--

Tom Church
Tech Jobs Academy

I couldn’t fool your mother on the foolingest day of my life if I had an electrified fooling machine.