Introduction to Data Communications
Previous Introduction to Subnetting Next

Introduction to Subnetting

The classes of networks do not provide much flexibility in designing a network. Each class of network only provides for a fixed number of networks (125, 16,382 or 2,097,150) and a fixed number of hosts (16,777,214, 65,534 or 254). Using the class system is referred to as having a classful network. In the real world, pretty much all networks do not fit the class system. The solution is to divide the class network into smaller subnetworks or subnets for short. The term for dividing networks into smaller subnets is called subnetting.

There are many reasons for subnetting a network:

Subnet Masks

Subnet masks can divide networks into smaller networks than discussed previously. Using subnet masks to divide networks into smaller networks is called having a classless network. Subnet masks differ from network masks in that they borrow host bits to divide the network. In subnetting a network it is important to recognize the class of the network that we start from. In order to understand the process of borrowing bits used by subnetting, a discussion on binary to decimal number conversion is required.

The typical Class C network mask represents 32 bits or 4 bytes of data. Each number represents 1 byte and is displayed as a decimal number. One byte of information can represent a range of 0 - 255. One byte also consists of 8 bits where 0000 0000 represents 0 in decimal and 1111 1111 represents 255 in decimal.

Note: The convention for displaying bits is to group in nibbles (4 bits) to make it easier to read.

Each bit position in a byte has a decimal weighting, where the weighting is equal to 2 to the power of the position starting at the far right position: b0 (bit 0). The easiest way to determine the decimal weighting is to start on the right with the number 1 (which is 2^0) and double it at each bit position moving to the left. The weighting for each position is follows:

Where the Most Significant bit (MSb) is indicated by bit position b7 and the Least Significant bit (LSb) is indicated by bit position b0. In computer systems, counting begins with the number 0. The significance of lower case b indicates bits, upper case B indicates bytes.

There are many very well done binary to decimal tutorials available already online and discussing binary to decimal conversion here is beyond the scope of this discussion. If you are not familiar with binary to decimal conversion, now is the time to learn it.

Subnet Prefix

The standard network mask dot decimal format is rather cumbersome for subnet masking as it doesn't clearly show how the subnet is divided. A better way is to use a network mask prefix. The network mask prefix shows the number of bits starting from the MSb that are used to indicate the network portion of an IP address. For example:

Borrowing Host Bits

Earlier it was mentioned that in order to subnet a network, we had to borrow bits from the host portion of a network address. This is required because the network portion of an IP address is already defined. If we want to make subnets, we'll have to borrow some host bits. For the following example, a Class C network will be used. It is important to be able to identify the class of a network from it's IP address. This is the first step in subnetting.

A class C network mask is or prefix /24. The 1st quadrant .0 represents the host portion. We will borrow bits from it to form the subnets. The following table shows only the 1st quadrant and the prefix associated with each bit position. It also shows the bit position weighting which will become important soon.

The prefix /24 represents a standard Class C network mask of What does a /25 prefix represent? It indicates that we have borrowed 1 bit from the host portion. We will have to add another row to our table. This row is called the subnet mask and starts with 128 at MSb bit 7 (b7) - this represents the subnet mask for /25 or

To determine what /26 represents, we add the bit weighting of b7 (128) and b6 (64) together. The result of the addition is 192. The prefix /26 represents a subnet mask of

We can easily fill out the rest of the table by adding each successive bit position weighting to the one we just finished. For example: