Installation and Program Logic Manual of the SLAC WAN Bandwidth Tests (IEPM-BW) Version 3
Connie Logg, Les Cottrell, Jerrod Williams, Mahesh Chhaparia, Fawad Nazir
Updated: March 6, 2006


Warning: This document as well as the code behind it is in active development.

Index

New PLM* Introduction Hardware Requirements Software System Requirements     Adding a New Probe      Code Documentation      Fetching Data from Iepm-BW on 'iepm-bw'     Fetching Data from Iepm-BW on 'iepm-resp'     Trouble Shooting Hints    
Documentation Conventions     Installation Instructions     Load the IEPM database tables    
Installation Startup Checkout     Database Overview     Install the Source Code     Updating the Database     Install the cgi-bin Scripts     World Map(geoplot)     Geoplot    

Introduction

Work on the SLAC Bandwidth Tests (IEPM-BW) was started in September 2001. There have since been 3 versions. Version 1, the original was superceeded by version 2 in February 2003. Version 2 provided more flexibility in the graphing and analysis, and made it easier to add new tests. Both versions 1 and 2 were built upon a data base of flat files and perl configurations commands. Probe commands were run sequentially. In March 2004, development started on IEPM-BW V3. The main difference is that a MySQL data base is used to store the data and monitoring configuration information, and tests (pathchirp, traceroute, and ping) are run asynchronously rather than sequentially. Heavier weight probes such as thrulay, iperf, and pathload are still run sequentially so that they do not interfere with each other.

Version 3, which this PLM describes, uses a MySQL data base to store the test and node configuration information as well as the data and test logs. It also has a scheduling mechanism so that regularly scheduled "backgound" tests can be run as well as "on demand" tests. This allows the on demand tests to be integerated with the backgound test data, if desired. As of 1/6/06, the on demand tests have not been fully implemented.

The current source directory at SLAC is: /afs/slac/package/netmon/bandwidth-tests/v3src

This system provides facilities for performing tests (aka probes) between monitor hosts and target hosts.

Hardware Requirements

The hardware requirements for monitoring and target hosts are different. The monitoring should be a machine dedicated to the IEPM-BW software. The host must have enough cpu power to run the probes, drive the MySQL database, and run the analysis. It should also have enough disk space to support the database. The recommended monitoring host hardware configuration is:

The target host does not need to be a dedicated machine, but it should not be a busy machine.

Software System Requirements

  • Install the MySQL database. You must have root privileges to install the database. Ensure that /etc/my.cnf is setup correctly, as the installation will use the information for setting up database files.
  • Change the permissions on the mysql directory datadir/mysql/mysql> to mysql:mysql. That is, in this example
    chown mysql:mysql /scratch/mysql/mysql.
  • Now install the data base and bring the mysql system up.

    Error and Diagnostic Messages

    The MySQL database access is very sensitive to incomplete or incorrect calls. There are two code snipits which, if used to perform all reads and writes, will provide the user with diagnostic messages (in STDOUT) which start with the character string "DBIERR". When using these snipits, always check for "DBIERR" in the string returned from them. There is a test program: iepmSrcDir/mysql/mysql-errtst which tests the code snipits iepmSrcDir/mysql/mysqltext-readonly.pl and iepmSrcDir/mysql/mysqltext-create.pl.

    Error messages are of the form:

    Note that the message "(Using password: NO)" or "(Using password: YES)" simply tells whether a password is passed to the connect statement. It is not saying what the password was.

    MySQL (Upgrade / New Install)

    If there is already a MySQL version installed on the system, perform the following steps first: Now we are ready to install a new MySQL version (4.1.7 here).
    - Server
    - Client
    - Libraries and header files
  • Install the downloaded RPMs as:
  • rpm -i MySQL-server-4.1.7-0.i386.rpm (this will restart the mysql daemon)
    rpm -i MySQL-client-4.1.7-0.i386.rpm, and
    rpm -i MySQL-devel-4.1.7-0.i386.rpm.
  • Finally install the new perl modules with : unzip perl.mysql4.1.zip.
  • IMPORTANT: Do not forget to add the path (say /usr/bin)to the new mysql executable in $PATH environment variable as: export PATH=/usr/bin:$PATH
  • Appendix A - The Table Definitions

    The tables defined in the IEPM-BW database are discussed in this section. Not all fields are required, or even relevant in some cases. The actual table definition code is included for each table. Any fields preceeded by a "*" are absolutely required.

    The NODES table

    If the node being entered into the table is just a "slave" node (i.e. it has the required daemons running and never needs to be logged into) only the "*" fields are required. If it is a "partner" node (i.e. the monitoring host logs into it to run code or start daemons, then the '+' fields are required.

    CREATE TABLE NODES 
     (nodeID integer not null auto_increment,
      *aliasv4 varchar(255) UNIQUE, the node's alias name
      aliasv6 varchar(255),ipv6 aliasname
      *ipv4Name varchar(255),ipv4 name 
      *ipv4Addr varchar(15),ipv4 address 
      ipv6Name varchar(255),ipv6 name 
      ipV6Addr varchar (40),ipv6 address 
      *masterTime2run integer,maximum time to allow a probe to run 
      The following fields are highly recommended
      contactName varchar(255),
      contactEmail varchar(255),
      contactPhone varchar(255),
      contactFax varchar(255),
      contactAddr varchar(255),
      country varchar(255), for grouping nodes 
      latitude real,for map placement 
      longitude real,for map placement
      hostType varchar(255),cpu type, OS, nic card settings   
      The following fields are required if the node is a partner node. 
      +homeDir varchar(255),home directory of the remUser 
      +remUser varchar(255),remote user login account 
      +perlPath varchar(255),path to perl 
      +sshOpts varchar(255),options for the ssh command 
      +psOpts varchar(255),options for the ps command 
      defStreams integer, for multistream probes
      defWinSize varchar(255), for setting probe windowsizes 
      siteUrl varchar(255),for example: www.slac.stanford.edu 
      *domain varchar(255),for example: slac.stanford.edu 
      *active integer, 1=yes, 0=no; if 0 node is ignored 
      +grepPath varchar(255), path to grep
      gnuplotPath varchar(255),only if gnuplot scripts will be run on it 
      +pingPath varchar(255), path to ping command 
      mailPath varchar(255), path to mail client
      ploticusPath varchar(255), only if ploticus scripts will be run on it
      +tracePath varchar(255),path to traceroute 
     );	     
    
    

    The MONHOST Table

    The MONHOST table is used to define any monitoring hosts which are logging data to the "iepm" database on "this" machine. Note that any fields preceeded with a "*" are absolutely required. Before a monitoring host can be entered into the MONHOST table, it must have been defined in the NODES table.

    	
    CREATE TABLE MONHOST
     (monhostID integer not null auto_increment,created automatically
      *nodeID integer not null UNIQUE,  The nodeId from the NODES table
      *srcDir     varchar(255) not null,  The source code directory ala v3src
      privateDir varchar(255), 
       a directory for any files that need to be "hidden" fromthe public
      *reportsDir varchar(255) not null, 
       The top directory for web page output
      testDataDir varchar(255), 
      For file transfer probes, this is where the files are stored for use in the file transfer probes
      remoteosDir varchar(255), 
      source directory for any code which is needed for partner probes
      security    varchar(255), security mechanism used for partner probes
      *webPath     varchar(255),  the full web path to reportsDir (http://..)
      *siteName    varchar(255),  Site name for web page titles
      *daysToAnalyze integer, 
      Number of days of data to analyze for canned reports
      *dataToAnalyze text, data analysis and plotting specification
      *cgiPath     varchar(255), the full wepath to CGI scripts (http://...)
      *cgiDir      varchar(255), the full directory path to the cgi-bin directory
     ); 
    

    The TOOLSPECS Table

    The TOOLSPECS table contains the information defining the test(probe) that is to be run. Note that all nodes must be predefined in the NODES table and the source node for the test must be defined in the MONHOST table.

    CREATE TABLE TOOLSPECS
     (toolspecsID  integer not null auto_increment,created automatically
      srcNodeID   integer not null,The nodeId from the NODES table if the monitoring host
      destNodeID  integer not null,The nodeId from the NODES table of the target host            
      toolName varchar(255), The tool "name" (e.g. ping, abwe, traceroute)
      toolPath varchar(255), The full path to the "tool" ala '/bin/ping'
      toolDo char, if 1, the toolspec is performed. If 0, it is inactive
      testtype varchar(255), The type of test. Automated tests are "background"
      toolOpts1 varchar(255), First set of tool options
      toolOpts2 varchar(255), Second set of tool options
      toolOpts3 varchar(255), Third set of tool options
      toolStreams INTEGER,# streams if test is a multistream probe
      toolWinSize varchar(255), TCP windowsize, if applicable
      toolSrcDataFile varchar(255), data file for data transfer
      toolDestDataFile varchar(255), path on the remote host where the transferred data is
      written
      toolPort integer,  TCP or UDP port, if applicable
      time2run integer, Allowable duration time to run the probe
      daysToAnalyze integer,
      Number of days of data to analyze for canned reports  
      dataToAnalyze text,  data analysis and plotting specification
      runInterval integer, not yet implemented
      lastRunEpoch integer, Updated by system run the tool runs
     ); 
    
    Note that "daysToAnalyze" and "dataToAnalyze" are initially defined in the MONHOST table. This is to override the global definitions in MONHOST for a particular tool specification. "runInterval" is not yet implemented, but will be the time between when tool specification is scheduled to run.

    The World Map

    The world map is created by using the Geoplot applet from CAIDA. Each monitoring host has a directory $REPORTSDIR/$aliasName/geoplot where the html, jar, and configuration files are stored. For example: for the monitoring host IEPM-BW, the directory is /nfs/slac/g/net/iepm-bw/iepm-bw.slac.stanford.edu/geoplot. The $REPORTSDIR is "/nfs/slac/g/net/iepm-bw/", $aliasName is "iepm-bw.slac.stanford.edu", and the geoplot directory is "geoplot". The relevant files in this directory are:

    To modify the look (add more info, etc) to the main plot page, modify the geoplot.html file.

    Geoplot

    GeoPlot is a light-weight java applet which allows users to create a geographical image of a data set. The applet provides the user with many options to represent the data set. Basically, GeoPlot plots a set of nodes and a set of lines that connect these nodes on an image specified by the user. To deploy Geoplot on any web-server, we need three files.

    1. GeoPlot.jar
    2. HTML to display the GeoPlot applet.
    3. The image file to display on the applet.

    Geoplot.jar

    The Geoplot.jar file consists of six java code files.

    1. Geoplot.java
    2. Key.java
    3. Line.java
    4. Node.java
    5. NodLin.java
    6. StatusBar.java

    Geoplot.java file get nodes and lines data to display from a URL specified in applet parameters in the HTML page. In our case when GeoPlot.java was trying to get information from that specified URL it sometime comes up with blank-lines. This problem was crashing the whole application. So we decided to modify the GeoPlot.java code.

    In Geoplot.java code there is a method parseData. This method is used to parse the data creating a node and line object for node/line definition. If the data is specified as a URL, then the functions reads the file and then does the parsing.

    1. str = tokenizer.nextToken();
    2. str = str.trim();
    3. ch = Character.toLowerCase(str.charAt(0));

    The above mentioned code in the parseData method is responsible to get one line of that data file and get the first character to check what its value is. Line 1 gets the next token. Line 2 trims the token to remove spaces. Line 3 gets the character at location 0 and covert it to lowercase. Now it is quite possible that the token which we are trying to get in line 1 has null value. So we modified the code to following

    1. str = tokenizer.nextToken();
    2. str = str.trim();
    3. if(str.length() == 0)continue;
    4. ch = Character.toLowerCase(str.charAt(0));

    The only addition which we made to the code was to add Line 4. Line 4 actually say that if the length of the line is 0 don't process that line and continue with the next one.

    HTML to Display Applet

    Place the following applet tag in your html file. GeoPlot.class is the main class file that should be placed in your applet tag. The basic outline is shown below:

    < applet code="GeoPlot.class" archive="GeoPlot.jar" width=??? height=???>
    < param name=????? value=?????>
    :
    :
    :
    < /applet>

    The width and height attributes of the applet tag refer to the width and height of the applet in the browser window. All the param tags follow the opening applet tag.

    Image File

    Image file will be displayed as a background on the applet. This image will contain all the nodes and lines on it.

    Adding nodes

    Nodes are added by editing the file iepmlocations.txt. This contains one line for each node.

    More notes to be editted

    For loading from a csv file see the section on from The csv file format is:
    TABLENAME=tablename
    #field1,field2,field3,...,fieldn
    data1,data2,data3,...,datan
    
    Note that the fields can be empty. For example:
    TABLENAME=NODES
    #aliasv4,aliasv6,ipv4name,ipv4addr,ipv6name,ipv6addr,domain,contactName,contactEmail,contactphone,contactfax,contactaddr,hosttype,siteurl
    node6.slac.stanford.edu,,nettest4.slac.stanford.edu,134.79.240.28,,,slac.stanford.edu,Connie Logg,cal@slac.stanford.edu,650-926-2879,650-926-3329,SLAC; 2575 Sand Hill Road; Menlo Park; ca; 94024,,
    node1.slac.stanford.edu,,nettest5.slac.stanford.edu,134.79.240.50,,,slac.stanford.edu,Connie Logg,cal@slac.stanford.edu,650-926-2879,650-926-3329,SLAC; 2575 Sand Hill Road; Menlo Park; ca; 94024,,
    
    Note that these files can be created with a spreadsheet program like excel.

    The NODES table must be loaded first. After loading the NODES table, run $iepmSrcDir/report-nodes to generate a web page to show you the nodes and the nodeid. You will need the nodeid's at this point to load the MONHOST and TOOLSPECS tables via csv files.

    Next load the MONHOST table.

    TABLENAME=MONHOST
    #nodeid,srcdir,privatedir,reportsdir,testdatadir,remoteosdir,security,cgipath,cgidir,webpath,sitename,daystoanalyze,datatoanalyze
    2,/afs/slac/package/netmon/v3src,/u1/mydir,/var/www/html,,,,http://nettest2.slac.stanford.edu/cgi-bin,/var/www/cgi-bin,http://www.stanford.edu,SLAC,28,ping:avg=w i lt 1;ping:min=w i lt 0;abwe:avdbcap=w p lt 5;abwe:avabw=w p lt 12;abwe:avxtr=w p lt 8
    
    For MONHOST the required fields are nodeid,srcdir,reportsdir,cgipath,cgidir,webpath,sitename,daystoanalyze,datatoanalyze

    Now load the TOOLSPECS table. This is the table where the tests to be done on a regular basis are defined. There is one entry for each (source node,destination node, testtool) triplet. The format of this csv file is:

    TABLENAME=TOOLSPECS
    #srcnodeid,destnodeid,toolname,toolpath,tooldo,testtype,toolopts1,toolopts2,toolopts3,toolstreams,toolwinsize,runinterval,lastrunepoch,toolsrcdatafile,tooldestdatafile,toolport,time2run,daystoanalyze,datatoanalyze
    2,6,ping,/bin/ping,1,background,-s 1000 -c 10 -w 20,,,,,600,,,,15,,,
    
    Note that the nodeid's for the monitoring host and target node must be input. Valid 'toolname's at this point are 'ping', 'abwe' and 'trace'. Also required are: toolname, toolpath, tooldo=1,testtype=background,any tool options (toolopts1), runinterval (in seconds), and time2run. runinterval is not yet used, but its deployment is under implementation.

    Troubleshooting