Is Your Network Class A?
NetworkNewz.com

03.30.01
There are many reasons why you may be subnetting. You may be using subnetting as an easy way to control bandwidth utilization on your network. Subnetting can be used for security purposes (it is more difficult for a hacker to have to cross routers during his/her attack). You may be subnetting so that you can more efficiently use a block of IP addresses. Whatever your reason may be, it is important that you understand what you are doing when subnetting, so read on and enjoy.

Best Wishes,

Jay Fougere
NetworkNewz Editor

Today on eZined.com

Start Fast in Flash!
Learn about Flash in a single day... for free. The inventors of Flash are putting on a free seminar. Don't miss this Macromedia event. WebSiteNotes.com

Writing Effective Ad Copy
Everything you need to know about writing ad copy that really works. In this excellent article you will find that research is the key. PromoteNewz.com

Flashing Professionally
So many sites using Flash look like a 12 year-old designed them. Find out how you can make your site look professional when using Flash! FlashNewz.com

For more articles on eBusiness and Technology go to eZined.com

Is Your Network Class A?
I am sure that most of you have heard of Class A IP addresses, Class B IP addresses, and Class C IP addresses. I am also sure that you know that Class A IP addresses have a subnet mask of 255.0.0.0, Class B IP addresses have a subnet mask of 255.255.0.0, and that Class C IP addresses have a subnet mask of 255.255.255.0. What you may not know is where these numbers come from and what they represent.

An IP address is a 32-bit number separated into 4 "octets", which are simply 8 bits. Each octet can have a value from 0 to 255. A subnet mask looks very similar to an IP address. Basically, a subnet mask represents the ratio of available networks to the number of available hosts per network.

In order to understand how to subnet, one must know a little about using binary. OK, don't run away just yet. There are really only two things that you will need to do with binary in order to subnet. The first involves converting decimal numbers to binary and vice-versa. The second is called "binary ANDing". We will touch a bit more on that a little further on.

Following is an example of converting binary to decimal. Keep in mind that each of these numbers is obtained by counting the position from right to left, subtracting one from the total, and then raising 2 to the resulting power. For instance, in my example below, if you count from right to left 5 positions you will see the decimal number 16. This is derived by raising 2 to the power (5-1=4; remember that you are starting at 0). Also keep in mind that the first position involves raising 2 to the power of 0. Any number raised to the power of 0 is 1, hence the right-most value is one. All that remains is to add all of your positive values (ones) to obtain the decimal value. If all of the values are positive, you will have 128+64+32+16+8+4+2+1 = 255. As an example:

decimal: 128 64 32 16 8 4 2 1
binary: 1 0 0 1 1 1 0 0 = 128+16+8+4 = 156

See, that is not so bad. Converting the other way is very similar. Simply subtract the largest (decimal; leftmost position) number that you can from the number that you want to convert, repeating until you reach 0. Using our example of 156, start with the leftmost number and if you can subtract that number enter a one. If that number is larger than what remains, enter a 0 and continue to the next number. Since you can subtract 128 you will enter a 1. This will leave you with 28. Since you cannot subtract 64 from 28 you will enter a zero. Continue with this process until you are left with 0. If there are still free positions to the right after you have reached 0, they will have the value of 0. Once you understand the theory behind all of this you will probably want to use a scientific calculator or a specifically designed subnet calculator such as one that can be found here: http://solarwinds.net

The next concept for you to grasp is the idea of binary ANDing (or bitwise logical AND operation, if you prefer). This is a logical technique used on binary numbers and is not a difficult concept; 1+1 = 1, 0+1 = 0 and 0+0 = 0. This is used in conjunction with the IP address and the subnet mask to determine the "network address". For instance, if you have an IP address of 192.168.100.1 with a subnet mask of 255.255.255.0 you can determine the network address from here. This is what separates networks from hosts. For instance:

11000000.10101000.01100100.00000001 
= 192.168.100.1
= IP address
+
11111111.11111111.11111111.00000000 
= 255.255.255.0
= subnet mask
---------------------------------------------------------
11000000.10101000.01100100.00000000 
= 192.168.100.0
= network address

Click Here!
Click Here!


Oracle Portal - Zero to Portal @ Web Speed

Oracle Portal is the fastest way to provide a personalized web view and manage corporate assets. As part of the Oracle Internet Platform, it provides security, reliability, and scalability.

GET STARTED.

Click for more info about ads

Now you can see that the network address uses (from left to right) three octets or 24 bits. This is also what is most commonly known as a Class C addressing scheme. It leaves the last octet for use in addressing hosts. In other words, in this example you would have 256 numbers (0-255) that could be placed at the end of the network address to differentiate between hosts; hence their name, host addresses. When doing this, keep in mind that the first and last addresses in a block of addresses are reserved (because at the binary level, no address can have all zeros or all ones). In our example, you cannot use a host address of 0 or 255, leaving you with 254 valid host addresses. No matter what values you use in the IP address, with the subnet mask shown, your network address will always be the same. What does this really mean to us? Well, we know that in our example, 8 bits are reserved to determine the number of hosts, while 24 bits determine the number of networks.

In this example, if you raise 2 to the power of (24-2) the result is 4194304 (Remember that all ones or all zeros are invalid, hence 24-2). This is the number of networks available that each have 254 valid host addresses. Let me point out that that is not entirely accurate because certain address ranges are reserved and because certain network addresses will not be valid for similar reasons that the first and last IP addresses are not valid.

That is great, but let's say you have to buy a block of IP addresses and 254 is much more than you will need. This is where CIDR (Classless Inter-Domain Routing) subnetting comes to play. Let's suppose that all that you need are 50 addresses; based on a Class C subnet mask you would have to use the entire block of 256 addresses, wasting many addresses. If you look at our previous example, the last octet in the subnet mask is all zeros. Remember, also, that that is what determines the number of hosts. Let's make the last octet of the subnet mask look something like this: 11000000 = 192, so that the entire subnet mask would look like this: 255.255.255.192. You can see that if you consider all of the 32 available bits, you have used 26 (binary notation, counting ones from the left). This can be represented as: 192.168.100.y/26, where 'y' represents the beginning number of the block of addresses.

You can see that you now have 6 bits left to determine the number of hosts. If you add the decimal totals for those 6 bits you will see that you have a range of 0-63 or 64 addresses. In our example we have divided one block of 256 addresses into four blocks of 64 addresses (0-63,64-127,128-191,192-255) of which 62 addresses per block are valid (1-62,65-126,192-190,193-254). Keep in mind that the first and last addresses are not valid and as such you end up with 62 valid addresses. The same idea applies to the networks, where the two bits that make up the 192 octet cannot be all zeros or all ones; thus the ranges 0-63 and 192-255 are invalid.

In order to subnet well you will need practice. The best practice is to make up a chart determining the number of hosts and the number of networks for the entire range of possible subnet masks. An excellent online tutorial for those who would like to know more can be found at http://www.ralphb.net/IPSubnet/

I hope this helps you, and remember, comments, suggestions, etc... are always welcome.


We at the Editorial Team would like to thank all our readers for reading NetworkNewz. We hope you find this information useful. Be sure to check http://NetworkNewz.com for more great information.

Sincerely,

Jay Fougere NetworkNewz Editor 

Signup FREE for NetworkNewz
Text HTML
Enter your email address below

iEntry.com | Sign-Up | Comments | More Issues
Send this page to a Friend | Advertise | Links | Printable Version

eZined.com
 ©2001 iEntry Inc. All Rights Reserved