Subnetting without binary
Hey Hey Everyone,
Before you get all jumpy and say, "Hey subnetting tutorials have been done before." I'm going to do this one slightly differently. The past subnetting tutorials: by MsMittens, Mountainman, and breakology as well as the subnet masks tutorial by Terr have all featured subnetting using binary. This makes sense since our IP addresses are just decimal representations of binary numbers and while using binary is the proper way of doing things, I'm going to demonstrate a method that I find much faster. This method isn't for anyone, usually it's about 50/50 for which people prefer, with or without binary. So I'm going to include a poll with this post. I'd enjoy having feedback on the most popular method so I can tailor the tutorials I run with students.
This tutorial will assume you know the basics of subnetting because you should know how to do binary subnetting before jumping into this, so I'll leave it to you to read the aforementioned tutorials.
The only binary you are going to need for this method is determining bits borrowed and remaining bits. So on with an example. I'll do one from each class with an explanation, then I will get into VLSM if this isn't too long, or else I'll leave that for another day.
Code:
Class C
IP Address: 204.193.27.32
Subnet Mask: 255.255.255.240
N N N . xxxxoooo (x = subnet bits (borrowed), o = host bits (remaining)
From this we see that we have 4 subnet bits and 4 host bits (again if you don't know how to do this, read the other tutorials first.. this is just a method to expedite things).
Subnets = 2^4 = 16
Hosts = 2^4 = 16 - 2 = 14 hosts (other 2 are for Subnetwork Address and Subnet Broadcast Address)
Because I wish to demonstrate the entire idea behind this we'll do a full chart for the Class C.
In a full chart you can first mark down your subnet # (0 to Subnets - 1). We subtract the 1 because we start counting at 0 instead of 1.
The SNA (Subnetwork Address) of your 0 subnet is always the same (Class Octets + 0s). (1)
We know that we have 16 hosts / subnet (see above) so we simply add 16 to that number to get the next SNA (2)
We now have the next SNA so we can determine the BA (Broadcast Address) of the previous subnet. Which is SNA 1 less 1 host (3).
This means that our range is the numbers in between SNA0 + 1 host to BA0 - 1 host (4).
This process can be repeated for every subnet (The chart below demonstrates).
Code:
Subnet # Subnetwork Address Host Range Broadcast Address
0 204.193.27.0 (1) 204.193.27.1 - 204.193.27.14 204.193.27.15 (3)
1 204.193.27.16 (2) .17 - .30 .31
2 .32 .33 - .46 .47
3 .48 .49 - .62 .63
4 .64 .65 - .78 .79
5 .80 .81 - .94 .95
6 .96 .97 - .110 .111
7 .112 .113 - .126 .127
8 .128 .129 - .142 .143
9 .144 .145 - .158 .159
10 .160 .161 - .174 .175
11 .176 .177 - .190 .191
12 .192 .193 - .206 .207
13 .208 .209 - .222 .223
14 .224 .225 - .238 .239
15 .240 .241 - .254 .255
This chart took me about 3 minutes to make. The formatting actually took longer than the subnetting. However you say... you had to do the entire chart. What if you just wanted a single subnet. The answer to that question my friend is rather simple. There are paterns. We are dealing with numbers, there are always patterns. Like we discovered earlier the SNA is always increased by the number of hosts (in this case 16). Well the same is true for every number. If you only wanted one subnet. Then pick the subnet you want. Let's say the 5th subnet. Because of the zero-subnet, the 5th subnet is actually subnet #4.
So we get Subnet 4 * 16 hosts/subnet = 64. We take our static class C address portion and plug the 64 into the matching octet that had the bits borrowed in the subnet mask (Last Octet). 204.193.27.64. Check our Chart above, .64 happens to be the SNA for the 5th subnet. Now we need to go 16 hosts above that to get the BA, We include the one we're adding so we go 64 + (16 - 1 hosts) = 64 + 15 = 79. Well .79 just happens to be our BA. And all the numbers in between happen to be our usable hosts. I hope everyone is following, this is somewhat difficult to explain using just text because it is just playing with numbers. You'll definately need a subnetting understanding to follow this.
Now let's look at Class A & B because they are a little trickier.
Code:
Class B Address: 165.50.49.23
Subnet Mask: 255.255.248.0
N . N . xxxooooo.oooooooo
Subnets = 2^3 = 8
Hosts = 2^13 = 8192
Again we only have 8 subnets, so we'll chart this out.
(1) First SNA is always 0s for the SN bits and Host bits
(2) Now for the Second SNA. Well we have a problem, we have more hosts than will fit in our octet. However we have 2 octets to work with. Divide your hosts by 256 (Max hosts per octet) - 8192 / 256 = 32. We move from the Last Octet to the Second Last octet when we do this (the dividing by 256 Moves us over 1 octet). So the 2nd SNA is 32.0
(3) Our First BA then is going to be teh 2nd SNA less 1 host.
(4) Our first Host Range will be 1st SNA + 1 to 1st BA - 1
Code:
Subnet # Subnetwork Address Host Range Broadcast Address
0 165.50.0.0 (1) 165.50.0.1 - 165.50.31.254 (4) 165.50.31.255 (3)
1 165.50.32.0 (1) .32.1 - .63.254 .63.255
2 .64.0 .64.1 - .95.254 .95.255
3 .96.0 .96.1 - .127.254 .127.255
4 .128.0 .128.1 - .159.254 .159.255
5 .160.0 .160.1 - .191.254 .191.255
6 .192.0 .192.1 - .223.254 .223.255
7 .224.0 .224.1 - .255.254 .255.255
Again, it was entirely subnetted with basic addition and subtraction.
Code:
Class A Address: 10.80.80.80
Subnet Mask: 255.255.240.0
N . xxxxxxxx.xxxxoooo.oooooooo
Subnets = 2^12 = 4096
Hosts = 2^12 = 4096
In this case it would be awful to do out the complete chart. Over 4000 lines. No one would read it and I sure as hell am not going to write it. So we'll do a few of them.
We'll do the 1000th subnet (Subnet # 999)
So we'll do this the same as last time
(1) Subnet # 999 X 4096 hosts/subnet which = 4,091,904. Well that's a useless number. What can we do with it? Well let's divide it by 256. 4,091,904 / 256 = 15,984. Damn... still bigger than 256. let's divide again. 15,984 / 256 = 62.4375. Now we've divided by 256 2 times which means we have to move over two octets (starting from the last octet), this will put us in the second octet. Which is where we will locate the 62. Now we have two octets left to work with, and this ungodly .4375. So we'll simply mulitply the decimal by 256 (the third octet) the get the value for our third octet. 256 x .4375 = 112. Therefore our SNA is 10.62.112.0. We know this subnet has 4096 hosts, which is bigger than one subnet obviously, so we divide by 256. 4096 / 256 = 16. This moves us over one subnet, to the second last octet , which is currently at 112. We add 112.0 + 16.0 (in some cases you may get a decimal and you'd work it out like we did above) and get 128.0 (this would be the next network address). which means our Broadcast is 1 less than 128.0 which would be 127.255. Your BA is then 10.62.127.255. This makes your Host Range, 10.62.112.1 - 10.62.127.255.
Now's your chance to try a few. Like I said before, this method isn't for everyone, but a lot of people find it easier.
Sample:
Class A Address: 50.78.129.32
Subnet Mask: 255.255.248.0
Subnet # 4000
Class B Address: 145.72.83.233
Subnet Mask: 255.255.252.0
Subnet # 45
Class C Address: 208.152.142.34
Subnet Mask: 255.255.255.240
Subnet # 12
Opinions? Comments? Suggestions? Flames?
Let's have it all.
Edit (about 10 times): Attempted formattting fix... doesn't seem to work real well, hopefully you still understand.