Share our tools:



 

Step 2: Old-school IP Classes

To understand IP classes, you need to understand that every IP address consists of 4 octets, 8 bits each.

The value of the first octet determines the type of class. Look at the following table to view the different classes.

Class A = 0.x.x.x    to 126.x.x.x
Class B = 128.0.x.x to 191.255.x.x
Class C = 192.0.0.x to 223.255.255.x


The first part of each 32 bit number represents the network, and the remaining part refers to the individual computer (x) or the hosts. To accommodate different network sizes, IP address space was originally divided into three sections; Class A (0.x.x.x to 126.x.x.x) - 8 bit network prefix or the first octet, Class B (128.0.x.x to 191.255.x.x) - 16 bit network prefix or the first two octets and Class C (192.0.0.x to 223.255.255.x) - 24 bit network prefix or the first three octets.

In short, for a Class A network the first octet represents the network part, for a Class B the first two octets and for a Class C the first three octets. If you look really good, you will see that 127.x.x.x is not a part of the classification of the IP address. The ID 127 is used as 'local hosts' or the 'loopback address'. This will be explained in later steps.

When setting up a network, it is important to choose the right IP Class. Class A has little room for networks, but many hosts, Class B is balanced in networks and hosts and Class C has a lot of networks and little room for hosts. Depending on the amount of necessary hosts or networks and the expected growth of your network, make your choice from these three classes.

 Class    # of networks  #of hosts
-------------------------------------------------------------
   A   =        126      6,777,214
   B   =      6,384
         65,534
   C   =  2,097,152
            254


If no subnetting is applied, the range of IP addresses and the standard subnet mask for the following classes will be:

Class      From            To           Subnet Mask
-------------------------------------------------------------
Class A = 0.x.x.x     126.x.x.x           255.0.0.0
Class B = 128.0.x.x   191.255.x.x       255.255.0.0
Class C = 192.0.0.x   223.255.255.x   255.255.255.0


The subnet mask filters out the network bits by using ANDing. ANDing takes the IP address in binary value and uses the binary value of the subnet mask to determine the bits that are left as one or 'active'. This is accomplished by taking the first bit (beginning with octet 1) of the IP address and the first bit of the subnet mask and checking the outcome of the two bits.

If the set is zero and zero, the bit is left zero.
If the set is zero and one, the bit is set to zero.
If the set is one and zero, the bit is set to zero.
If the set is one and one, the bit is set to one.

This is repeated for every following bit of the IP and subnet mask, until the chain of ones in the outcome is broken by a zero, like in the following examples;

192.168.90.24 = 11000000 . 10101000 . 01011010 . 00011000
255.255.255.0 = 11111111 . 11111111 . 11111111 . 00000000

-------------------------------------------------------------

set the bit to  11000000 . 10101000 . 01011010 . 00000000


Now you see that the outcome shows some ones per octet and some octets are empty. This outcome is the network part, which is the standard for a Class C address. If you convert the outcome to a decimal value the network part will look like this : 192.168.90.x, which, in this case, is identical to the first three octets of the IP address.

All hosts on the same network or segment must have the same subnet mask in order to communicate with each other. The subnet masks and the process of subnetting will be explained in later steps.