You are here -> ADSL Modem Monitor

Click the DOWNLOAD button to download ADSLDataMonitor.zip (V1.0 - 43kb) Download

IMPORTANT DISCLAIMER:
This application works for me. It IS NOT 100% accurate as some data is lost when the ADSL modem is reset and data packages are not always full. It should be used as a GUIDE ONLY. If there is any doubt about your data usage then contact your ISP to check.

Introduction

My ISP caps my internet usage and charges me a small fortune if I exceed it. They do not provide any method of checking the usage other than calling the help line, an 0845 number which costs me more money. My enthusiasm to develop this was driven by an iPad which was left with BBC IPlayer (watching live TV) running in the background for a couple of days (it just keeps going). Unfortunately, the iPad was also left on charge! The resulting bill from my ISP ensured my desire to have the ability to monitor ALL usage from ALL devices on my broadband.

There are several utilities available to monitor the internet usage of a single computer but I can find nothing that allows me to check the usage of all computers on my network. My D-Link DSL-2740R ADSL modem has a ADSL status page which provides information about the number of cells that have been transmitted and received. Unfortunately, this is not in an easily understandable format and the count is reset whenever the link is lost or reset. Investigation of the modem capabilities shows that the ADSL statistics can be obtained via the Telnet interface.

As I use both Windows and Linux I decided to program my own software in JAVA. This enables it to run on either operating system.

A number of ADSL modems have a Telnet capability and the software may also work with these. Configuration settings are available in the software to re-configure it for other modems. The program interrogates the modem using Telnet, decodes the status information and stores a running monthly record. The totals are displayed in a small window as either text or a circular percentage usage graphic.

On 'Reset Day' (normally the first day of the month) the data usage is reset to zero. The previous months usage is recorded in the History for future reference.

Future Updates

Telnet is an old protocol and some newer ADSL modems have replaced it with SSH. At some point in the future I may update my ADSL modem to one that only has SSH. I will probably implement the SSH protocol at that time. My current modem does not have SSH so I have no method of developing and testing it at the moment.

Installation

The application is programmed in Java and requires Java V1.6 or newer to be installed on the computer it is being run on.

Java can be installed from: http://www.java.com/en/download/index.jsp

No installation of ADSL Modem Monitor is required. Simply copy the 'ADSLData.jar' file from the downloaded .zip file to a convenient folder on your computer to which you have write access. It can be run directly by double clicking on it or from the command line by changing to the installation directory and entering: java -jar ADSLData.jar

Usage

On first execution an error message will be displayed. Click the OK button to accept the error and the Settings dialog will then be displayed.

Initial Settings

The following settings must be entered or edited:

Modem IP Address - This is the address of the ADSL modem
Password - The administrator password for the ADSL modem

The following settings should be edited to match the usage limits from your ISP

Maximum - When this value is reached the display will show values in RED. It should be set at a level slightly below your allowance. For example, if your allowance is 100Gb then a value of 98000Mb is probably appropriate as the warning will be displayed with 2Gb remaining.

Warning - When this value is reached the display will show values in ORANGE. This should be set at around 90% of your allowance.

Reset day - This value is the day of the month that your ISP resets your usage allowance. On this day all usage values will be set to zero and the History.log file will be updated with the previous months usage. The History.log is stored in the application directory and can be viewed with a text editor.

The following values should not be changed unless you know what you are doing. Please ensure that you read the section below entitled How to check your ADSL Modem before making changes.

Telnet Query - This is the telnet command sent to the modem to obtain the ADSL data. If this command is not correct then he telnet session will remain open until it times out. Further queries will not work whilst the telnet session remains open as the modem only allows a single telnet session.

Telnet Terminate - The command which disconnects the modem telnet session.

TX Match - A unique part of the line of telnet data returned by the modem that indicates the transmitted data. With the D-Link this will be either ActiveTxCellsInterleaved or ActiveTxCellsFast depending on the ADSL mode.

RX Match - A unique part of the line of telnet data returned by the modem that indicates the received data. With the D-Link this will be either ActiveRxCellsInterleaved or ActiveRxCellsFast depending on the ADSL mode.

The following values can be edited should the need arise

Query Interval - The number of seconds between modem queries. It should not be neccessary to query the modem more often than every 30 seconds. This value can be increased but it is not recommended to decrease it. My ISP resets my modem IP address at irregular intervals resulting in the modem data usage being reset to zero. If this value is set too large than any usage between the last query and the IP reset will not be included in the count.

First response - The time in seconds that the application will wait for the modem to supply the ADSL usage data. My modem usually responds in less than a second but sometimes it takes two or three seconds. A value of 5 seconds is probably more than sufficient for any modem.

Character Wait - This is the maximum time that the application will wait for more character when obtaining the ADSL data. When no characters are received for this time the message is determined to be complete. Normally the modem streams the data continuously. On occasion there is a short delay between characters. A value of 500 milli seconds is probably more than sufficient for any modem. Setting the wait too small may result in the full message not being received.

Textmode display - This checkbox toggles between the Text display mode and the Graphic display mode. If checked than Text mode display is selected. If unchecked the Graphic mode display is selected.

Save - Select Save to write the configuration to the installation directory.

Exit - Select Exit to exit the application. The configuration is NOT written and the Settings dialog will be displayed when the application is next executed.

Text mode display

Text Mode Display

The initial position of the text mode display is at the top left of the screen. It can be moved to the required position by clicking and dragging the window with the left mouse button pressed.

The display shows:
RX equals the number of bytes received over the broadband connection
TX equals the number of bytes transmitted over the broadband connection
Total equals the combined total of all bytes sent and received over the broadband connection

RX, TX and Total are displayed in GREEN text until the Warning limit is reached. Once this level is exceeded they are displayed in ORANGE text. If the Maximum value is exceeded then they are displayed in RED.

Clicking the right mouse button displays the pop-up menu

Graphic mode display

Graphic Mode Display

The initial position of the graphic mode display is at the top left of the screen. It can be moved to the required position by clicking and dragging the window with the left mouse button pressed.

The whole graphic respresents 100% of the available usage (Maximum value). The GREEN section expands and the BLACK section shrinks to indicate the percentage of data used. Once the Warning limit is reached the used portion of the pie is displayed in ORANGE. If the Maximum value is exceeded then it is displayed in RED.

Clicking the right mouse button displays the pop-up menu

Pop-up Menu

PopUp

The pop-up menu shows:
RX equals the number of bytes received over the broadband connection
TX equals the number of bytes transmitted over the broadband connection
Total equals the combined total of all bytes sent and received over the broadband connection

Settings

Clicking the pop-up Settings entry displays the Settings dialog.

The dialog is the same as the inital settings dialog with the exception of the Save and Exit buttons are renamed as OK and Cancel. Clicking OK saves the settings and closes the dialog. Clicking Cancel discards any changes and closes the dialog.

About

Clicking the pop-up About entry displays theAbout message.

About ADSL Modem Monitor

The application version and copyright notice is displayed. Close the window using the window closer (X) or click on the Sabretech website button to open a browser window for the Sabretech website.

Exit

Click the pop-up Exit entry to terminate the application

How to check your ADSL Modem

By default, Windows Vista and Windows 7 do not include the Telnet client, which is a text-based application for communicating with remote systems. You can install it by following these steps:

1. Open the Programs and Features Control Panel applet (Start, Control Panel, Programs and Features).
2. Select "Turn Windows features on or off."
3. Select the Telnet Client option and click OK.
4. A dialog box appears, confirming the installation of new features. After installation is complete, close the main Programs and Features Control Panel applet. The telnet command should now be available.

The following sequence demonstrates the responses on a Windows computer. Other operating systems will provide a similar response. Refer to the operating system documentation for ping and telnet if you are unsure of how to use these utilities.

Open a Command Prompt

To check the modem IP address type ping IP-ADDRESS where IP-ADDRESS is your modem IP

ping 192.168.1.1

The modem should respond:

Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time<1ms TTL=254
Reply from 192.168.1.1: bytes=32 time<1ms TTL=254
Reply from 192.168.1.1: bytes=32 time<1ms TTL=254
Reply from 192.168.1.1: bytes=32 time<1ms TTL=254

Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 0ms, Maximum = 0ms, Average = 0ms

To start telnet type telnet.

At the telnet prompt attempt to connect to your ADSL Modem. The default telnet port is 23. If you have reconfigured this using your modem setup utility then you will need to add the correct port number to the command. The command is open HOST_IP PORT.

telnet> open 192.168.1.1

The modem will normally respond with:

Password:

Enter the modem password and press return

If the password is accepted then the modem will respond with a connection message and prompt

Copyright (c) 2001 - 2006 D-Link Corporation.
D-Link>

Enter ? and press return to obtain a list of valid commands

D-Link> ?
Valid commands are:
sys exit ether wan
rtwlan ip bridge dot1q
pktqos show set lan
D-Link>

To get the ADSL transfer counts enter wan adsl cellcnt

D-Link> wan adsl cellcnt
ActiveRxCellsFast = 0
ActiveRxCellsInterleaved = 92401145
ActiveTxCellsFast = 0
ActiveTxCellsInterleaved = 28246469
D-Link>

The cell count reported is dependant on the ADSL mode. Repeat the command to check which numbers update. Use the relevant text for TX and RX Match. In the example shown set RX Match to ActiveRxCellsInterleaved and TX Match to ActiveTxCellsInterleaved.

Enter exit to close the connection

Enter quit to terminate telnet.

If you cannot get a telnet connection to your ADSL modem then either the IP address or port number is wrong or your modem does not support telnet. If your modem does not support telnet then ADSL Modem Monitor will not work.

If your modem responds as shown above then ADSL Modem Monitor will work without changes with your modem. If it does not then you will need to consult the modem documentation to find out how to obtain the ADSL data transfer counts. The settings can then be edited to match.

 

SabreTech Associates Ltd. Lanview, Bunker Street. Freckleton. Lancashire PR4 1HA