If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Threaded View

Subnetting tutorial

Here is something I put together for my brother who was studying for his CCNA at the time. Subnetting seems to kick peoples arse constantly, so I spent some time with one of our network engineers. This was the outcome of it.

To understand how subnetting works, you must first have a good basic understanding of IP Addresses. An Ip address is set of binary octets broken into quads. That probably made absolutly no sense to you, so we will try it another way. An Ip address follows what is called dotted octet notation. There are 4 sets of numbers in an ip address with dots separating them. (ie., 192.168.0.1) Now lets go a bit further into the binary octet part. Binary numbers are broken down by what is known as positional notation. This works from right to left in increasing place values. Here is an example:

192.168.0.1 in binary octet form would be 11000000.10101000.00000000.00000001

So, 11000000.10101000.00000000.00000001 is the Binary octet breakdown of 192.168.0.1 . Believe it or not this is actually important. Now, let’s delve into the realm of Subnet masks. The subnet mask is what will actually do all of the work of subnetting (read again, subnet mask.) The subnet mask of an ip address is what tells the computer or router or whatever, which part of your ip address belongs to your network and which part belongs to the hosts. Thus, a subnet mask of 255.255.255.0 tells your computer that the first three quads of your ip address belong to the network, and so all of your hosts will be referenced with the last quad in the ip address. This gives us with a standard subnet mask of 255.255.255.0, a possibility of 253 hosts in our network. WHAT? Even though I did fail algebra II, my math does make sense. You are required to have a base network address and a broadcast address for every subnet. So, with our standard subnet mask and our default ip address in our example, our network address is 192.168.0.0, our broadcast address is 192.168.0.255, which leaves us 192.168.0.1-254 for our hosts.
Great! Now the basics are out of the way. Let’s move on to the important stuff. How we subnet an ip range depends first on how large your assigned ip range is to begin with. If you are running a private network going through One static Ip address then your range is: 192.168.xxx.xxx . So there is really no reason to subnet UNLESS you want to cut down on traffic and segment your lan by whatever reason you feel is good enough to undertake this task. Lets assume an ip address of 128.16.8.0 as a base. This is obviously a simplified example, but enough so to get the point of the exercise. Broken down into dotted octet notation 128.16.8.0 is:
10000000.00010000.00001000.00000000
Now, the first step in subnetting, is planning. How many hosts do you want per mask? Is there a chance that you may be expanding any or all of these subnets in the future? These are all things that HAVE to be taken into consideration BEFORE you get everything setup. The reason is this, the amount of hosts you decide upon directly affects all the following steps. Say you want to have 20 hosts available per subnet. This means that you will need a minimum of 22 hosts (Remember, network address and broadcast have to be taken into account also.) Lets zoom in on the last octet of our ip address.

0 0 0 0 0 0 0 0 Remember this from above?
128 64 32 16 8 4 2 1

So, if we want at least 22 hosts on each of our subnets then we are going to need the last 5 bits in our octet quad. This will give us a total available of 16+8+4+2+1 or 31 possible hosts or 29 if you don’t count the network address and broadcast address. This leaves the first three bits of the octet for Network addressing (again, refer to the top on how ips work.) This makes our Subnet Mask for our ENTIRE network 255.255.255.224. How did I come up with this? The positional notation values for the first three bits of our final octet, when added together, equal 224.

Get the picture so far? So lets see where we stand now. We have our ip address of 128.16.8.0. Now lets look at the subnet mask as we figured out above. For our first subnet, we use our subnet mask of 255.255.255.224. This gives us hosts from 128.16.8.1 to 30 with 128.16.8.0 for network address and 128.16.8.31 as broadcast. Our next subnet would be 128.16.8.32 with the same 31 hosts counting broadcast and network. The subnet following that would have anip range of 128.16.8.64-95. The next would be 128.16.8.96-127, then 128-159, then 160-191, 192-223, and finally 224-255.
This is a very simplified example without a lot of why this happens. Here is an attempt on my part to explain how this works. Your Ip address and your subnet mask is bitwise “AND”ed together (read boolean algebrea). “0”s hide the number, while “1”s let it show through. The resulting binary number is your network address that falls out of the addition. Example:

This means anything to the right of the 4th bit in the final octet is a host address. This also means that the first three bits in the final octets are network address’. So, as above, our first subnet would be 192.168.0.0-31. After that we would have to set the third bit from the left in the final octet, which changes the network address and results in our second subnet. Example:

leaving 192.168.0.64-95 as our subnet ip ranges. Hope I didn’t confuse you to terribly, but this is the main gist of Subnetting a network. Feel free to contact me with any questions, I might not be able to answer them off the top of my head, but I will do my best.