Terapaths

From MAGGIE

Jump to: navigation, search

Contents

[edit] What is Netflow Monitoring ? - Ahmad Hassan

Netflow is a standardised method of obtaining detailed passive networking information from network routers. SLAC is working in conjunction with BNL (Brookhaven National Laboratory) to provide a flexible and detailed backend and frontend solution to visualise netflow information. Work needs to be conducted to expand the presentation consistency and to iron the bugs in the implementation.

[edit] Netflow Presentation

Yee sent project to Ahmad http://confluence.slac.stanford.edu/display/IEPM/Netflow+Presentation+Frontend:

[edit] Current Challenges

  • --Ahmad 22:44, 1 May 2007 (PKT)
  • To develop a flexible web based front-end for Netflow Data
  • Need to expand the current API implementation
  * Custom Reports
  * Top N Reports
  * Fixing bugs in the current implementation
  • For some input pattern the Error is coming like "ERROR PARSING XML. Need to Fix those issues

[edit] Progress

'--Ahmad 00:34, 13 June 2007 (PKT)

  • Downloaded the required libraries from svn driectly and placed them at appropriate location so that they are accessible from CGI scripts.
  • For the scripts that include "Content-type: text/xml", scripts throws the compilation error
 Can't locate XML/Simple.pm in @INC (INC is an environment variable for perl)
  • Found this Simple.pm module in the perl installed libraries but not in the netflow libraries.
  • Make the directory 'XML' in the one of the paths of @INC. Copied the Simple.pm in XML.
  • XML problem has been solved.
  • Now all the compilation error have been removed but when we execute the script then it says
 Expires: Wed, 13 Jun 2007 02:10:44 GMT
 Date: Wed, 13 Jun 2007 02:10:44 GMT
 Content-Type: text/html

 ERROR: Date::Manip unable to determine TimeZone.
 at /usr/lib/perl5/5.8.8/Date/Manip.pm line 3635
  • Working on resolving this issue.


'Ahmad 01:32, 5 June 2007 (PKT)

  • Completed the Apache server's httpd.conf settings for the "URL TO FILE SYSTEM MAPPING " problem.
  • Stuck at CGI scripts execution problem. The problem was that the scripts were start downloading when access from the browser. Even the file rights were changed to [chmod 755 *.cgi].But problem persists.
  • Got exact error details when i compile those cgi scripts from the command prompt e.g (perl *.cgi)
  • Found libraries dependency problem of following libraries
 *IEPM::NETFLOW::*.pm
 *IEPM::UTILITES::*.pm
 *IEPM::*


*--Ahmad 01:32, 31 May 2007 (PKT)

  • Working on virtual server config for Netflow stuff
  • Understanding the design pattern and interrelationship of various modules

*--Ahmad 02:31, 21 May 2007 (PKT)

  • Completed the terapath installation by manually executing the cammands in order to debug if any error encountered. Saved all logs in the file.
  • Modified the current terapath installation script. Added the functionaility of retrieving the current gcc version installed. If installed version is compatible then proceed the rest of installation otherwise exits the entire installation
  • working on giving the option to the user to install the compatible version of gcc from the same script.
  • Studied about how we can terminate the execution of rest of the

script if error occurs at some point of script due to download/compilation.

  • Suggested a way of detecting error by checking the Exit status of each command after it executed.


*--Ahmad 03:35, 19 May 2007 (PKT)

  • Worked on installing the netflow installation by manually running the individual command of netflow installation script in order to debug the exact error details during installation
  • Found Broken linked URL's for downloading the packages
  • Updated all URL'S in the script
  • LIBPNG, RRDTOOL, FLOWTOOL missing, error has been resolved
  • Still getting errors while compiling *.c files i.e INVALID ARGUMENT ASSIGNMENT
  • Analysed and debug the detailed installation script and found the gcc compiler version mismatch.
  • patching of packages requires gcc 3.4.0. But on my machine it is gcc 4.1.2
  • Downloding and installing the compatible gcc version


*--Ahmad 00:41, 14 May 2007 (PKT)

  • Working on installing the Netflow Monitoring code locally at NIIT.
  • Current Installation script:

http://confluence.slac.stanford.edu/display/IEPM/Netflow+Installation

  • Need to extend the existing installation script and add the functionality to download and install the front-end code as well
  • Need to do documentation of the code as i go along.


*--Ahmad 01:16, 10 May 2007 (PKT)

  • Can make existing prototype of Terapath frontend, compatible with Microsoft Internet Explorer by modifying the existing implementation of Initialization of XMLHTTPREQUEST Object. Because there are seperate ways of using XMLHTTPREQUEST Object in different browsers.
  • Developed the understanding of working of Ajax
  • Tracked flow of the function calls when we request a chart and table.
  • Need help in understanding the Netflow.js. Documentation Needed for understanding of different parameters that request the backend through Ajax.

*--Ahmad 01:14, 7 May 2007 (PKT)

  • Studying netflow.js Script that contains the ajax implementation.
  • Studied four methods of adding graphics to existing netflow front-end prototype.
  • Devoloping the understanding of construction of raw XMLHTTPREQUEST Object
  • studied the CGI::Pretty library for html code generation.
  • Discussed with shahryar about his work on spiderchart.pm, piechart.pm implementation.
  • Need detail documentation of existing perl modules implementation.

* --Ahmad 22:39, 1 May 2007 (PKT)

  • Understanding the Ajax calls in NETLFOW.JS script and got idea of how ajax calls are being made to CGI scripts for plotting of charts.
  • Getting understanding of the interaction between perl modules, CGI scripts and Java scripts.
  • Understanding the Existing Implementation
  • Downloaded the NETFLOW code from SVN Repository

[edit] Documentation

Sun Dec 2, 2007

Netflow Monitoring

Netflow provides a way of getting detailed passive networking information from network routers. The description can be viewed from   
http://confluence.slac.stanford.edu/display/IEPM/Netflow+Monitoring

Active VS Passive Measurements:

  • Passive Measurement
 Passive measurement is a means of tracking the performance and behavior of packet streams by monitoring the traffic without creating or modifying it.
 Advantages: 
  Bit or packet rates
  Packet timing / inter-arrival timing
  Traffic / protocol mixes
 Limitation:
  The main drawback of using this passive measurement is that he assumed that he “owns” all networks.
  • Active Measurement
 Active measurement injects artificial probe packets into the network from which the relevant metrics of the probe traffic can be measured.
 Advantages:
  One of the advantages of active measurement is that it does not require full access to network resources. (e.g. routers)
 Limitation:
  It may disturb the network by injecting artificial probe
  traffic into the network.


  • Projects:
 There are two projects resides beneath Netflow Monitoring category:
   *Netflow Presentation Frontend
   *FlowScan-JKFlow Feature Extensions
  • Netflow Presentation Frontend

This provides interactive web pased front-end to Netflow data collected through JKFlow. So Netflow Presentation Frontend provides a way to visualize the passive networking information of network routers.

The current prototype visualization can be visualized at: http://iepmbw.bnl.org/netflow/index.html

The enhancments which are needed to be made in Netflow visualization includes :

User authentication
Extend and Refactorise backend
 Reauthorization and redesigned to provide a more uniform Api for the front-end to access the information
Provide a flexible user front end
 Main focused would be to provide AJAX based web interface
 Custom Reports
 Top N Reports
 Extend the interactive plotting frontend
Provide robust installation proceedures

The more detailed explaination can be viewed at http://confluence.slac.stanford.edu/display/IEPM/Netflow+Presentation+Frontend


The following step wise procedure will explicate the Neflow Presentation Frontend Prototype deployment:-


  • Code Downloading:

Terapaths Netflow frontend is based on the Netflow backend scripts with Javascript frontend having Ajax capability. The backend and frontend code needed for deployment of Netflow Presentation Frontend can be downloaded from SLAC SVN. You have to do get the source code from Svn with this command. "svn co /afs/slac.stanford.edu/g/scs/net/netmon/repo/svn/"

The procedure to download code from SLAC SVN can be seen from http://confluence.slac.stanford.edu/display/IEPM/Terapaths+Monitoring+Front+End+Developers+Manual. Here You can also find the Code distribution Schema in the form of a tree like structure which will explicate the Directory structure in which Netflow code will reside.

Just go throught this page, It will give you a very good idea of SVN. http://confluence.slac.stanford.edu/display/IEPM/IEPM+SVN+Repository

  • Backend Installation:

After the installation of backend part gets complete, then you can see /opt/terapaths-monitoring directory made by the backend script. The installation script can be downloaded from: http://confluence.slac.stanford.edu/download/attachments/18652/terapaths_netflow_install-20070312.sh?version=1

Execute the above script as : sh terapaths_netflow_install.sh Default Installation directory is: /opt/terapaths-monitoring

Before executing the installation script, you need to open it and make sure that URL's from which above script is downloading packages are accessible. If they are not then you need to update those. One think you need to bear in mind is the GCC version campatibility of linux version you are using. The current implementation only supports two GCC versions gcc 3.4 (Fedora Core 3, 4, Centos 4.0, 4.2)

patch -p0 < JKFlow-v3.5.2/flow-tools_gcc34_patch

gcc 4.0 (Fedora Core 5)

patch -p0 < $JKFLOW/flow-tools_gcc40_patch

Please make sure that, you only use that version of OS which has gcc version 3.4 or 4.0 by default. Otherwise if you will change the GCC version youself than perl libraries will get incompatible with gcc you installed manually and as a result Netflow Presentation Frontend will not work. I have upgraded the old installation script so that it incorporates the required missing packages installation and gcc version compatiblity checks. The new version also check for current gcc version installed on a machine on which you are deploying Netflow. If gcc version is not compatilbe then it exits the installation and reports back the user about the incompatibility. Newer upgraded version is available as well.


  • Apache Installation & Configuration:

First of all, Install the Apache Web server on the machine on which you need to deploy Prototype. When the installation gets successfull then you need to configure it for Netflow:

Download the code from SLAC SVN and then copied these downloaded directories i.e www to /opt/terapaths-monitoring and IEPM, Netflow to /opt/terapaths-monitoring/lib.

Now we need to configure apache paths so that html page can be able to load CGI scripts and CGI scripts can be able to call other CGI scripts and images etc. For that we need URL Redirection Configuration. For that we need to edit httpd.conf and add the followint configuration in that file: The following configuration is taken from http://confluence.slac.stanford.edu/display/IEPM/Terapaths+Monitoring+Front+End+Developers+Manual

AddType application/xhtml+xml .xhtml
AddType application/xml .xml
AddType text/xml .xml
AddType image/svg+xml .svg
AliasMatch /netflow/(.*).html "/opt/terapaths-monitoring/www/html/$1.html"
AliasMatch /netflow/(.*).xhtml "/opt/terapaths-monitoring/www/html/$1.xhtml"
AliasMatch /netflow/(.*).js "/opt/terapaths-monitoring/www/html/$1.js"
AliasMatch /netflow/(.*).css "/opt/terapaths-monitoring/www/html/$1.css"
AliasMatch /netflow/images/(.*) "/opt/terapaths-monitoring/www/html/images/$1"
ScriptAliasMatch /netflow/(.*).cgi "/opt/terapaths-monitoring/www/cgi/$1.cgi"
Inorder to give access of Netflow/IEPM libraries to the CGI scripts, we need to set path of PERL5LIB so that Scrips loaded on Apache can access the  
libraries:
SetEnv PERL5LIB /opt/terapaths-monitoring/lib/IEPM:/opt/terapaths-monitoring/lib/Netflow


  • Incorporate JKFlow Data:

Download RRDs which contains Network Monitoring data collected by JKFlow you can download the rrds that contain upto date data til June 2007 at:

http://www.slac.stanford.edu/~ytl/netflow you should untar/bzip2 them into /var/flows/reports/rrd/.

you will also find the xml conf file which should be put into /opt/ terapaths-monitoring/conf/ which should populate elements of the frontend. IMPORTANT: One point very important is that you need to make sure that the RRDs you downloaded are generated for the same type of Architecuture on which you are deploying your prototype. Forexample if you are deploying Netflow on Fedore 5.0, Then you make sure that rrds must be generated by rrdtool installed on fedora 5.0 as well. RRDTOOL provides the facility of conversting rrds into xml and vice versa.

you can also generate rrds data detail through the following sample script command ./netflow-table.cgi --start=-4w --GROUP_University%20Texas%20at%20Arlington=%2FBNL%20LHCOPN%20-%20University%20Texas%20at%20Arlington_protocol~tcp,%2FGrid%20Services%20-%20University%20Texas%20at%20Arlington_protocol~tcp,%2FUSATLAS%20Computing%20Farm%20-%20University%20Texas%20at%20Arlington_protocol~tcp

Problems Faced and Solutions:

  • CGI Scripts if run from command prompt throws CGI:Pretty Error:
  The error of CGI:Pretty library arise when we set the dual Path of CGI Library that are present in terapath netflow backend and in defualt location
  of perl installation. I addressed this error by removing the path the Tarapath backend directory from the PERL5LIB and added the path of default
  perl libraries to look the CGI/Pretty library. 
  • Setting PERL5LIB path for Apache 2.2.0
  There is an issue of PERL5LIB path in the Apache 2.2.0. we need to explicitly add the entry of PERL5LIB in the httpd.conf so that apache can access   
  the required libraries. But in Apache 2.2.3, we don't need to address thie issue.
  • CGI scripts running on Security Enhanced Linux:
  ALso there is a problem of execution of CGI scripts related to SELinux and suExec. when http daemon is binded with these two properties then we can't
  assume that thse cgi scripts will work unless put the default apache directory. TO use our customized location, we need to disable these two
  parameters so that CGI scripts doen't throw permission denied error.
  • Installation on SELinux :: CFlow Error
  If you did your installation on Security Enhanced Linux then some of your modules didn't get install properly becuase SELinux doesn't allow to run 
  *.so file. It changes it's persmissions. The Remedy for this is:
  find /usr/lib/vmware -name '*.so*' -exec chcon -t texrel_shlib_t {} \;
  • RRDs Generation and Architecture Compatiblity:
  I also looked into bug of throwing 'XML PARSING ERROR ;; unable to generate SVG' which have also been noticed at the 'Netflow Frontend depoyed at  
  BNL".
  This error arise when rrds are not compatible with the architecture of machine on which NETFLOW has been depoloyed. For example when rrd's are
  generated from xml data on 'SUN' architecture then Netflow can't use these rrd's on the 'LInux architecture'. For that we need to recompile all the      
  xml data on new architecture and generate compalible rrd's. 
  • Runtime 'XML PARSING ERROR' & remedy for it:
  Another reason of this error is that when Netflow is unable to find rrd file based on the input given in the form of 'service or protocol'. These    
  issues can be addressed if we can add a condition in the script in which it looks for the
  existence/presence of specefic rrd file to which it is sending query And if that rrd that is not present in our archive then we can show that error    
  in the form that 'DATA UNAVAILABLE' rather than showing default 'XML PARSING ERROR'.
Personal tools