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:

• Security:

Each department in a company can be logically and physically separated from the other departments. Engineering has limited access to Accounting and so on.

• Traffic shaping:

Each department's network traffic is restricted to its own network. Only interdepartmental traffic is allowed between networks.

• Ownership:

Networks can be subnetted based on the ownership of the subnets. A service provider can subnet its network and lease its subnets to other entities.

• Geography:

Subnets can be geographically separate but still be part of the network. A network can cover a large geographical area with branch offices in other physical locations.

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 255.255.255.0 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:

• Class A network mask: 255.0.0.0 - the first 8 Most Significant bits of the 32 bit address. This is represented as /8

• Class B network mask: 255.255.0.0 - the first 16 Most Significant bits of the 32 bit address. This is represented as /16

• Class C network mask: 255.255.255.0 - the first 24 Most Significant bits of the 32 bit address. This is represented as /24

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 255.255.255.0 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 255.255.255.0. 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 255.255.255.128.

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 255.255.255.192.

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:

• /27 represents 192 + 32 = 224
• /28 represents 224 + 32 = 240
• /29 represents 240 + 32 = 248
• /30 represents 248 + 32 = 252
• /31 represents 252 + 32 = 254
• /32 represents 254 + 32 = 255

The Magic Subnet Chart

From the above table, you can see that we have successively borrowed bits from the host portion until no host bits remain. You'll be glad to know that the hard part of subnet masking has been completed - making the above table. The table is refered to as the Magic Subnetting Chart and was created by SAIT Polytechnic instructor Doug Spurgeon (an amazing and brilliant person) who called it "Subnetting My Way" (I took the liberty of re-naming it). So if you run into Doug, you owe him a cup of coffee big-time!

The following pages will discuss how to use the Magic Subnetting Chart to subnet a Class C network.

Note: At first the subnet mask numbers used in making the chart seem quite strange and unusual. These are numbers that are not normally used in the decimal world. You will find that in the binary world and networks, they appear and reappear quite regularly.

Here's a perfect example of the same numbers showing up again and again: How to make the Network Class Chart for dummies

## New Improved Method

Like all things that must pass, I came across a new better simpler method to create subnets. It is called the Simple Binary Graphical Subnetting method. I don't know who invented it and the person who showed me didn't know either. Kudos to the one who figured it out. If you click on the Next Arrow in the lower right hand corner of the screen it will take you there.

For archive purposes, I've left the Magic Subnet Chart method up for those who want to see another method.

Previous

##### If this page has helped you, consider donating \$1.00 to cover the cost of hosting this site. Thanks
Introduction to Data Communications