Build your desktop application using Tkinter
The examples we will be talking about will look and feel the same as the ones we did in the last articles but there is a major twist that makes it different. Let's get right into it!
Let's assume a company has purchased the class C address 216.21.5.0 with the subnet mask 255.255.255.0 and we are asked to break that address into 30 hosts per network.The good news is that the process is almost exactly the same with the one based on network requirements. Let me define "almost";
The difference here is that instead of converting the desired number of networks, we convert the number of hosts we want per network back to binary.
This is where it can get kind of tricky if we are not focused enough. In the previous articles we were after networks, thus 1s, but this time we are after hosts, hence 0s. Remember;
1s represent the network and 0s represent the hosts
In this case, all changes now. Keep in mind we are still subnetting. However, our main focus this time is not how many networks I get but how many hosts I get per network. 30's binary representation takes up to 5 bits, right?
Our new subnet mask is 255.255.255.224 or /27. Do you see what I did there? 30 needs 5 bits so we need to save 5 host bits. Did you also notice how I "saved" those bits? Instead of going from left to right like we did with the network requirements, I went from right to left because that's where my 0s exist, that's where the client bits are at. So as long as we have 5 host bits, we know that we can get 30 hosts per network and I will prove it to you. The rest of the unsaved bits become 1s, thus the "11100000", because I don't need them for the clients. We meet our requirements and we are good to go. The rest ones can go to the network side because guess what, I'm still subnetting and I just want to make sure that each subnet has 30 hosts per network.
Everything else is the same. That's the main story of it. Our focus is just on the 0s. So let's figure out our network ranges. Our increment is 32 because the lowest network bit converted back to a decimal number is 32 in our case. Let me give you a tip. If the increment's number is less than the hosts number, be concerned, something may got messed up on the way.
The first and the last address of each range aren't usable so we actually have exactly 30 usable hosts per network. Isn't that awesome?
So the small tweak is at the 1st and 2nd step where we aren't primarily focused on adding 1s, we are focused on saving 0s. "Save the hosts!" That's the sentence I have in my mind while I subnet based on host requirements.
Let's have a look at another example, shall we?
This time we are dealing with a class B address 150.5.0.0 and the subnet mask 255.255.0.0 and we want to have 500 hosts per network. As you may have thought, 500 can't be represented with the 8 bits we have available so that's why I added one more power of 2, thus the 256 decimal value. Do you see that I haven't completely written the full binary representation of 500? I think by now you understand that we just care about the number of bits and in our case it's 9. All you need to do is find the decimal value to start with and then stop and count how many bits would that take. Step 1 incoming!
Remember! Are we creating more networks, meaning focusing on the 1s or are we saving the hosts? "Save the hosts!". We have to save 9 host bits because we can't get the number 500 with any less than 9 bits. So;
As promised, we saved the hosts! Our increment is 2. Remember, each octet restarts the increment.
Are you up for another example? I'm not. It's time to get a paper and a pencil in front of you and start practicing.
Assignment: Break the 10.0.0.0 network into 100 hosts per network
That's all for now guys. We finished the subnetting concept but we are not completely done with it! The next articles are going to be even more interesting and more practical. I hope this article has been informative for you and thank you for taking the time to read it. Feel free to post your comments down below and as always, have an amazing day and stay awesome.
Later...
Comments
Post a Comment