Chesapeake's Subnet Calculator Version 1.0 1. What is Chesapeake's Subnet Calculator? 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. Many thanks to the following people for their help, hints, and support: Terry Slattery - and - Jim Boney 2. Trying out Chesapeake's Subnet Calculator 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 havn't tried running on a Macintosh with Java support; please let us know what you find if you try it on a Mac. First, you will need a Java capable browser, such as Netscape 3.0 or Internet Explorer 3.0 or later. If you do not yet have a Java capable browser, please skip down to 'Step 3a. Download the Appropriate Version of Netscape 3.0 or Internet Explorer' before continuing. Now that you have a Java capable browser installed, go to . You can browse through this page, or try the Calculator by clicking on the 'Test Drive' link. After clicking on this link, if you have the browser software properly installed, you will (after a few seconds of download time) see the input window on your main browser window, and an additional window that will be displayed with the initial subnet calculation results. A high resolution display (800 by 600 or greater) will of course 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 is not 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. Once you have these two windows displayed, the calculations will be much faster (based on the speed of your machine) since calculations are now being done locally. If you wish to install Chesapeake's Subnet Calculator on your machine, continue with 'Step 3. Installing Chesapeake's Subnet Calculator'. If you would like to learn more about the operation of the calculator and how subnetting works, skip to 'Step 4. Operation'. 3. Installing Chesapeake's Subnet Calculator The provided source should run 'out of the box' on : SPARC Solaris x86 Solaris Windows 95 Windows NT MacOS* * - The Subnet Calculator has not been tested on the MacOS. Please send mail to if you are using the Calculator on this OS and send us some feedback. a. Download and Install Java Developper's Kit (JDK) 1.0.2 - OR - Download the Appropriate Version of Netscape 3.0 or Internet Explorer If you wish to do some of your own Java Development, or would like to use the JDK's appletviewer as opposed to Netscape or the Internet Explorer, simply download the JDK 1.0.2 Final Release which is available from : . If you wish to acquire an evaluation copy of the latest version of Netscape, it is available from : * * - When installing Netscape on a workstation, don't forget to put the 'java_301' file in the location outlined in the README for Netscape. If you wish to acquire the latest version of the Internet Explorer, it is available from: b. Download the Appropriate Tar/Zip File Now that you have a Java capable browser installed, you can download the appropriate format file to install on your machine. Create a directory where you want the files installed such as on a PC, or on a workstation. Next, click on the 'Register and Download' link to register yourself to be able to download the files. Submit your information then read and agree to the license agreement. If you have filled out the form correctly, and agree to our license agreement, you will be on our download page. Click on the desired file format. Suggested formats to retrieve: -rw-rw-r-- 1 jcamp 177152 Jan 31 15:22 subcalc.tar -rw-rw-r-- 1 jcamp 74319 Jan 31 15:22 subcalc.tar.Z Operating System Suggested File Format Approximate Size ---------------- --------------------- ---------------- SPARC Solaris subcalc.tar -or- 177K subcalc.tar.Z 74K x86 Solaris subcalc.tar -or- 177K subcalc.tar.Z 74K Windows 95 subcalc.exe* N/A Windows NT subcalc.exe* N/A MacOS subcalc.tar -or- 177K subcalc.tar.Z** 74K * - This is a self-extracting zip file. This file will not be available for download until February 4, 1997. ** - When downloading the version for the Mac, there should be a utility similar to WinZip available to help uncompress and unarchive the file you download. If you find one, please mail it to me and I shall post it here (giving you credit of course). Now simply expand the file you just downloaded which will give you a copy of the class files, html files and images used in conjunction with the subnet calculator. The following is a listing of the files you should see after uncompressing and unarchiving the file: Filename Last Modified Approx Size(b) -------- ------------- -------------- Assert.class Jan 31 13:42 766 Border.class Jan 31 13:42 2272 Box.class Jan 31 13:42 2776 DrawnRectangle.class Jan 31 13:42 3267 DynamicChoice.class Jan 31 13:42 2250 EtchedRectangle.class Jan 31 13:42 2399 Etching.class Jan 31 13:42 727 MessageDialog.class Jan 31 13:42 1507 README Jan 31 13:42 17680 SubCalc.class Jan 31 13:42 12752 SubCalc.htm Jan 31 14:01 425 SubCalcApp.class Jan 31 13:42 15856 ThreeDBorder.class Jan 31 13:42 1050 ThreeDBorderStyle.class Jan 31 13:42 777 ThreeDRectangle.class Jan 31 13:42 2611 binary.htm Jan 31 14:01 30667 buglist.htm Jan 31 14:01 2065 bugrep.htm Jan 31 14:01 4847 download.htm Jan 31 14:01 2854 faq.htm Jan 31 14:01 5075 feedback.htm Jan 31 14:01 1209 footer.htm Jan 31 14:01 613 header.htm Jan 31 14:01 574 index.htm Jan 31 14:01 15797 logo.gif Jan 30 16:14 3191 subcalc.htm Jan 31 14:01 425 suggest.htm Jan 31 14:01 2021 tn-001.htm Jan 31 14:01 3269 tools-register.htm Jan 31 14:01 4641 whatsnew.htm Jan 31 14:01 1319 Simply point your Java capable browser at the subcalc.htm file, and a local version of the calculator should come right up. 4. Operation If you have already read 'Step 2. Trying out Chesapeake's Subnet Calculator', you can skip to 'Step 5. The Data Input Window'. 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 havn't tried running on a Macintosh with Java support; please let us know what you find if you try it on a Mac. A high resolution display (800 by 600 or greater) will of course 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 is not 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. 5. The Data Input Window The data input window 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. 6. The Calculation Results Window The calculation results window 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. 7. 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. 8. 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. 9. 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. 10. 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. 11. Possible enhancements Please let us know what you think of our Subnet Calculator. We will be improving functionality and form as a result of your feedback. Possible future enhancements include: - Listing all possible subnets and host ranges in a table format; - Providing Variable Length Subnet Mask (VLSM) calculations; Please send all questions/concerns/suggestions to or fill out a bug report or suggestion form on our web page at or respectively. Thank you for trying Chesapeake's Subnet Calculator, John Camp