Chesapeake Computer Consultants, Inc. Main Banner

The Chesapeake Subnet Calculator

[ Test Drive | FAQ | Buglist | Download | Installation | Binary-Decimal Table ]


WELCOME

Welcome to the Chesapeake Subnet Calculator, the first in a series of Java(TM) based networking tools from Chesapeake Computer Consultants, Inc. Here, you will find the documentation on how to effectively use the tool, see what's new, find answers to frequent questions, report bugs (hopefully, not many), make suggestions, download new versions, and register to be informed as new versions are released or when new tools are released.

Please read the README file that comes with Chesapeake's Subnet Calculator. Installation Instructions tell you how to download the tool and run it on your local machine.

Click here-> Chesapeake Subnet Calculator to run directly from our web site.

Click here-> Download to download a copy to your machine. The downloaded version includes the web page documentation and all the Java files needed to run the Chesapeake Subnet Calculator.

Contents

Introduction

Current Version

Operation

The Data Input Window

The Calculation Results Window

Learning How IP Subnetting Works

Determining Subnet Numbers

View Valid Subnet Addresses

Finding a Subnet Mask from the Number of Subnets or the Number of Hosts

Click here to test drive the Chesapeake Subnet Calculator.

Introduction

The Chesapeake Subnet Calculator is a Java based tool (an applet) to help network administrators and designers determine the subnet number from an IP address and subnet mask, or see the change in the number of hosts and subnets when modifying the subnet mask for a given network. We developed it based on our experience teaching subnetting in our Cisco Certified internetworking classes. The result is a tool that you can use for performing useful network administrative functions as well as learning more about how subnetting works.

There are several uses for the Chesapeake Subnet Calculator. The first is to learn how IP subnetting works. The second is to determine in which subnet a given IP address resides. The third is to view the range of valid IP addresses within a given IP subnet. Another is to calculate the proper subnet mask when the number of subnets or the number of hosts per subnet is known. We'll cover each of these uses below. An option is provided to include subnet zero, which is allowed on Cisco routers by use of a special configuration command.

Let us know what you think of the Chesapeake Subnet Calculator. We'll be improving it in the future as a result of your feedback and features that we think will make it more useful to you.

Top

Current Version

The current version is 1.0.

Top

Operation

First, you will need a Java capable browser, such as Netscape 3.0 or Internet Explorer 3.0 or later. Since Java only runs on Windows 95, Windows NT, or Unix, you will need one of these operating systems. Sorry, but Windows 3.1 isn't supported. We have not tried running on a Macintosh with Java support; please let us know what you find if you try it on a Mac. Obviously, a high resolution display (800 by 600 or greater) will provide better viewing. We have used both color and non-color markers to denote the difference between the base network address, the subnet bits, and the host bits of the IP address. So you don't need a color display if one isn't available, although color will make the presentation of the detailed binary calculations a little easier to follow.

The display is divided into two windows, one for data input, and one which displays the subnet calculation results. Each window automatically sizes to match the size of the display on which you are running. The data input window appears within your browser while the calculation results window will appear elsewhere on your screen. If only the calculation window appears, it has appeared on top of your browser window. Simply move the calculations window aside to find the data input window.

Top

The Data Input Window

The data input window (see Figure 1) is where you interact with the Chesapeake Subnet Calculator. You enter the IP address in the first block, then select one of the options that sets the number of subnet bits. There is also an option to allow the use of subnet zero. There are several ways to select the number of subnet bits.

The first is to select the IP subnet mask itself from the pull-down menu. Each possible subnent mask is provided for the IP address selected.

The second subnet selection option allows you to select the number of subnet bits. The number of subnet bits is the number of bits by which you are extending the base network mask. For example, an 8-bit mask on a Class B IP address will result in a subnet mask of 255.255.255.0.

The third method is to select either the maximum number of subnets or the maximum number of hosts per subnet in the network you specified. The number of subnets will increase by two if you select the Allow Subnet Zero option.

Top

The Calculation Results Window

The calculation results window (see Figure 2) displays the results of applying your selected subnet mask to the IP address you specified. There are two sections to this window. The first section shows the details of the calcuations so that you can use the tool as a method of learning how the subnet calculations are performed. Since IP subnet masking operations must be done in binary, all IP dotted-quad addresses are converted to binary, the calculations performed, and displayed in both binary and dotted-quad format. The base class-ful address is given one color, the subnet bits another color, and the host bits a third color. There are markers at the top of the binary columns to indicate each of these bit fields on non-color displays.

At the bottom of the window you will find a summary section that shows the subnet number, the range of valid IP addresses within the subnet, and the directed boradcast address for the subnet. Note that the range of valid IP addresses appears within the subnet number and the directed broadcast address. The subnet number should never be assigned to any host - it is reserved to identify the subnet itself. The directed broadcast address is a special IP address used to route (direct) broadcast packets to the subnet, where the last router will transmit the packet as a local broadcast. (For more information on subnet calculations and the directed broadcast address, refer to any good IP protocol text such as TCP/IP Illustrated by Stevens, or TCP/IP by Comer.)

Now let's run through the use of the Chesapeake Subnet Calculator for each of the design goals described in the Introduction above.

Top

Learning How IP Subnetting Works

You may use the Chesapeake Subnet Calculator to help you learn how IP subnetting works. Select a set of IP addresses and subnet masks and validate your own IP subnetting calculations. Determine both the IP subnet number and the directed broadcast address using the steps shown below. Note that the range of valid IP addresses for the selected subnet will fall between the IP subnet number and the directed broadcast address. The algorithm for performing the calculations is very simple.

  1. Write down the IP address in dotted-quad notation and convert to binary. Use our Binary Converter to lookup the conversion of each quad into 8 binary bits, if necessary.
  2. Write down the IP subnet mask in dotted quad notation and convert to binary, aligning the binary under the binary representation of the IP address. You will have two rows of 32 binary numbers, one for the IP address and one for the subnet mask.
  3. Perform a logical AND operation between each column of the bits in both binary numbers. The logical AND operation produces a 1 as a result only when the two bits in a column are also 1. The table for each of the combinations of IP address and subnet mask bits looks like this:
    Logical AND Case 1 Case 2 Case 3 Case 4
    IP Address Bit 0 0 1 1
    Subnet Mask Bit 0 1 0 1
    Result (Subnet Number) Bit 0 0 0 1
  4. Convert the 32-bit result back to dotted-quad notation to see the resulting IP subnet number.

The binary calculations necessary to correctly perform IP subnetting are shown on the Calculation Results window. Included are the dotted-quad notation, the corresponding binary equivalent, the result of the logical AND operation, and the resulting IP subnet number.

The calculations continue by calculating the directed broadcast address.

  1. Take the IP subnet mask (in binary) and invert it (converting every 1 into a 0 and every 0 into a 1).
  2. Write down the binary representation of the IP subnet number aligned under the inverted subnet mask.
  3. Perform a logical OR of the IP subnet mask and the IP subnet number. A logical OR operation results in a 1 when either of the two bits is a one. The table for each of the combinations of the inverted subnet mask and IP subnet number looks like this:
    Logical OR Case 1 Case 2 Case 3 Case 4
    Inverted Subnet Mask Bit 0 0 1 1
    Subnet Number Bit 0 1 0 1
    Result (Directed B'cast) Bit 0 1 1 1
  4. Convert the 32-bit result back into dotted-quad notation to see the resulting IP directed broadcast address.

Again, the Calculation Results window shows the result of this set of calculations.

Top

Determining Subnet Numbers

When doing troubleshooting or other network administrative tasks, it is often necessary to determine from which subnet a given IP address originated. Doing this with pencil and paper or mentally is often error-prone. With the Chesapeake Subnet Calculator, it is an easy task that always gives you the right answer.

Enter the IP address in the address field on the Data Input window. Then select your subnet mask and recalculate. The summary section of the Calculation Results window will show you the subnet ID of the IP address you entered.

Top

View Valid Subnet Addresses

At other times, you need to know the range of valid IP addresses within a given subnet. This is normally a requirement when assigning IP addresses, or when doing a network design.

The IP subnet number (or any address within the subnet) is entered in the address field of the Data Input window. Select the subnet mask you are using, then recalculate. The summary section of the Calculation Results window will show the range of valid IP addresses within the subnet.

Top

Finding a Subnet Mask from the Number of Subnets or the Number of Hosts

When doing network designs, we often need to determine the proper subnet mask to use when all we have is the maximum number of subnets required or the number of hosts per subnet. It is easy to find this when using the Chesapeake Subnet Calculator. Just enter the IP address and select either the maximum number of subnets or the number of hosts per subnet in the Data Input window. The proper subnet mask will be displayed in both the Data Input window and the Calculation Results windows.

Top

The Network Monitor and the Chesapeake Subnet Calculator are trademarks of Chesapeake Computer Consultants, Inc. All other products mentioned are registered trademarks of their respective companies.

Back to Tools
Chesapeake Home


Copyright 1997-2002 Chesapeake Computer Consultants, Inc. All rights reserved.