In the previous lesson I showed you a lot of binary numbers so let’s work some more with decimal numbers. We can do subnetting just by working with decimal numbers.
As you have seen in the binary examples, the rule of “powers of 2” is very useful. By taking an extra bit the decimal value doubles every time:
- For every host bit you borrow the number of subnets you can create doubles.
- Every host bit left doubles the size of the subnet.
Instead of thinking/working in binary, we’ll start thinking in “blocks”.
Take this 192.168.1.0 network with subnet mask 255.255.255.0 as an example:
We know because the subnet mask is 255.255.255.0 we have 8 bits left, and with 8 bits the highest “number” we can create is 256.
128 + 64 + 32 + 16 + 8 + 4 + 2 + 1 = 255.
Don’t forget about the 0! The 0 is being used so the highest value you can create is 256.
Visualize this as a block:
We want to subnet our 192.168.1.0 network, so we’ll chop our “block” in two pieces.
When we chop this block in two pieces, this is what we get:
So now we created 2 subnets out of our Class C network, the next questions are:
- What are the network addresses?
- What are the broadcast addresses?
- What is the subnet mask?
- What are the usable host IP addresses?
We can write down the network addresses, they are both blocks of “128”. We’ll start at 192.168.1.0 and the second subnet will be 192.168.1.128 (.0 – .127 = 128)
- Subnet 1:
- network address: 192.168.1.0
- Subnet 2:
- network address: 192.168.1.128
The second question is: what are the broadcast addresses? We know that the broadcast address is the last address within a subnet, so we can just write those down:
- Subnet 1:
- network address: 192.168.1.0
- broadcast address: 192.168.1.127
- Subnet 2:
- network address: 192.168.1.128
- broadcast address: 192.168.1.255
The third question: what is the subnet mask?To solve this question I’ll teach you a new trick:
256 – “block size” = subnet mask.
So in our example that will be:
256 – 128 = 128.
The subnet mask will be 255.255.255.128
One question left: what are the usable host IP addresses?
- The first usable host IP address comes after the network address.
- The last usable host IP address comes before the broadcast address.
- Everything in between is a usable host IP address.
Let’s fill this in:
- Subnet 1:
- network address: 192.168.1.0
- first host: 192.168.1.1
- last host: 192.168.1.126
- broadcast address: 192.168.1.127
- Subnet 2:
- network address: 192.168.1.128
- first host: 192.168.1.129
- last host: 192.168.1.254
- broadcast address: 192.168.1.255
That was pretty fast right? We just subnetted this class C network, calculated the network address, broadcast address and the usable host IP addresses.
Let’s try one more!
We’ll take the 192.168.1.0 class C network but now we’ll chop it into four pieces so we get 4 “blocks”:
We have the same set of questions to answer:
- What are the network addresses?
- What are the broadcast addresses?
- What is the subnet mask?
- What are the usable host IP addresses?
Let’s write down the networks, all “blocks” of 64:
- Subnet 1:
- network address: 192.168.1.0
- Subnet 2:
- network address: 192.168.1.64
- Subnet 3:
- network address: 192.168.1.128
- Subnet 4:
- network address: 192.168.1.192
Now we know the networks we can write down the broadcast addresses:
- Subnet 1:
- network address: 192.168.1.0
- broadcast address: 192.168.1.63
- Subnet 2:
- network address: 192.168.1.64
- broadcast address: 192.168.1.127
- Subnet 3:
- network address: 192.168.1.128
- broadcast address: 192.168.1.191
- Subnet 4:
- network address: 192.168.1.192
- broadcast address: 192.168.1.255
What is the subnet mask?
256 – “block size” = subnet
In our example: 256 – 64 = 192
The subnet mask will be 255.255.255.192
One more step, we need to fill in the usable host IP addresses:
- Subnet 1:
- network address: 192.168.1.0
- first host: 192.168.1.1
- last host: 192.168.1.62
- broadcast address: 192.168.1.63
- Subnet 2:
- network address: 192.168.1.64
- first host: 192.168.1.65
- last host: 192.168.1.126
- broadcast address: 192.168.1.127
- Subnet 3:
- network address: 192.168.1.128
- first host: 192.168.1.129
- last host: 192.168.1.190
- broadcast address: 192.168.1.191
- Subnet 4:
- network address: 192.168.1.192
- first host: 192.168.1.193
- last host: 192.168.1.254
- broadcast address: 192.168.1.255
And that’s it. Once you understand the rules, calculating in decimal is a lot faster than doing it in binary.
Can we apply this same method for class B networks? Sure! The only difference with a class C network is we have more space because we are now playing with the third octet.
Let’s take the 172.16.0.0 network and create eight subnets.
We still have the same questions to answer:
- What are the network addresses?
- What are the broadcast addresses?
- What is the subnet mask?
- What are the usable host IP addresses?
We start with our block of “256” but now we are playing with the third octet:
If we chop “256” into 8 blocks we get blocks with a size of “32”:
Let’s write down the first four subnets and their network addresses:
- Subnet 1:
- network address: 172.16.0.0
- Subnet 2:
- network address: 172.16.32.0
- Subnet 3:
- network address: 172.16.64.0
- Subnet 4:
- network address: 172.16.96.0
Let’s write down the broadcast addresses, remember this is the last address within the subnet:
- Subnet 1:
- network address: 172.16.0.0
- broadcast address: 172.16.31.255
- Subnet 2:
- network address: 172.16.32.0
- broadcast address: 172.16.63.255
- Subnet 3:
- network address: 172.16.64.0
- broadcast address: 172.16.95.255
- Subnet 4:
- network address: 172.16.96.0
- broadcast address: 172.16.127.255
What will the subnet mask be?
256 – block size = subnet mask
256 – 32 = 224
So the subnet mask will be 255.255.224.0. Keep in mind we are working with the third octet here.
Last question, what are the usable host IP addresses?
- Subnet 1:
- network address: 172.16.0.0
- first host: 172.16.0.1
- last host: 172.16.31.254
- broadcast address: 172.16.31.255
- Subnet 2:
- network address: 172.16.32.0
- first host: 172.16.32.1
- last host: 172.16.63.254
- broadcast address: 172.16.63.255
- Subnet 3:
- network address: 172.16.64.0
- first host: 172.16.64.1
- last host: 172.16.95.254
- broadcast address: 172.16.95.255
- Subnet 4:
- network address: 172.16.96.0
- first host: 172.16.96.1
- last host: 172.16.127.254
- broadcast address: 172.16.127.255
That’s it. We do the exact same thing as with a class C network but this time we played with the third octet. What about class A? Let’s take a look!
Let’s take the 10.0.0.0 network and create 4 subnets.
Same questions, different answers:
- What are the network addresses?
- What are the broadcast addresses?
- What is the subnet mask?
- What are the usable host IP addresses?
We start with our block of “256” but now we are playing with the second octet:
Let’s chop it into 4 blocks:
Let’s write down the networks, all “blocks” of 64:
- Subnet 1:
- network address: 10.0.0.0
- Subnet 2:
- network address: 10.64.0.0
- Subnet 3:
- network address: 10.128.0.0
- Subnet 4:
- network address: 10.192.0.0
Step two, write down the broadcast addresses:
- Subnet 1:
- network address: 10.0.0.0
- broadcast address: 10.63.255.255
- Subnet 2:
- network address: 10.64.0.0
- broadcast address: 10.127.255.255
- Subnet 3:
- network address: 10.128.0.0
- broadcast address: 10.191.255.255
- Subnet 4:
- network address: 10.192.0.0
- broadcast address: 10.255.255.255
What will the subnet mask be?
256 – block size = subnet mask
That will be 256 – 64 = 192. Our subnet mask will be 255.192.0.0 (keep in mind we are playing with the second octet).
Last question, what are the usable host IP addresses?
- Subnet 1:
- network address: 10.0.0.0
- first host: 10.0.0.1
- last host: 10.63.255.254
- broadcast address: 10.63.255.255
- Subnet 2:
- network address: 10.64.0.0
- first host: 10.64.0.1
- last host: 10.127.255.254
- broaccast address: 10.127.255.255
- Subnet 3:
- network address: 10.128.0.0
- first host: 10.128.0.1
- last host: 10.191.255.254
- broadcast address: 10.191.255.255
- Subnet 4:
- network address: 10.192.0.0
- first host: 10.192.0.1
- last host: 10.255.255.254
- broadcast address: 10.255.255.255
Right now you should have a good understanding how you can create subnets without touching any binary numbers and work with decimal only, this method is a lot faster.
If you still feel like you don’t completely understand it I would suggest rereading this lesson and practice this a LOT. Just write down some network and subnet requirements for yourself and see if you solve them. If you need some inspiration, try these:
- Create 8 subnets from class C network address 192.168.1.0.
- Create 16 subnets from class C network address 192.168.1.0.
- Create 4 subnets from class B network address 172.16.0.0.
- Create 2 subnets from class A network address 10.0.0.0.
Write down the network addresses, broadcast addresses and usable host IP addresses for each of those.
If you have any questions, feel free to leave a comment!
Wonderful explanation. thanks
I finally found my ‘ah ha!’ moment with subnetting. Thank you so much!
Thank you for this, first time someone described subnetting in a way that makes sense. I also had that aha moment with this lesson.
Pretty minor, but just to point out on your class B and A examples subnet 2 has network address twice instead of broadcast. Just a heads up, thanks for the explanation.
Thanks for letting me know, just fixed them!