[wiki:WikiStart Orbit] > [wiki:Documentation/OtherApps Other Applications] > Integrating Iperf with ORBIT {{{ #!rst ================== Iperf Integration ================== This document covers the general details of integrating sample applications with the ORBIT tesbed setup. A specific example (Iperf) is chosen as a candidate application and the steps are described in the document. The readers are referred to the ORBIT architecture document for the individual software component details. To summarize, nodeHandler is the experiment controller software that is used to choreograph the experiment. It is used to power on, initialize interfaces, launch the applications simultaneously on the nodes involved in the experiment, as well as create databases consistent with the measurements for that particular experiment. OML (ORBIT Measurement Library) is used to collect measurements at run-time from the nodes. It consists of an OML-client on the nodes and the collection server on the experiment controller machine that is used to collect the measurements sent by the clients and insert into appropriate columns of the database. Integrating a new application with this setup mainly consists of the following steps. Please note that these are details not needed if you just want to use the application. These are meant to cover how Iperf was integrated with nodehandler and OML framework. .. contents:: .. sectnum:: ----- I want to use Iperf without knowing the following details ========================================================== Simply check out Iperf from the SVN repository svn co http://svn.orbit-lab.org/svn/orbit/iperf/tags/rel-1.0.0 iperf Run ./configure;make; Integrating with measurement collection ======================================== In order to initiate measurement collection using OML, the following steps need to be taken Identifying the measurements reported by Iperf ------------------------------------------------ The first step is to identify what are the measurements reported by the application and finding the right files in the source code corresponding to these measurement reports. For Iperf, the statistics for UDP are throughput, packet loss and jitter and for TCP: throughput For Iperf, this was traced to the file ReportDefault.c Create the application definition XML file -------------------------------------------- The application definition file for Iperf is defined to capture the outputs that the program reports. This file is later used to auto-generate OML library and headers for this application. The following application definition file has been written for Iperf (using a subset of command line inputs) [http://www.orbit-lab.org/wiki/Documentation/OtherApps/Iperf/IperfAppDefXML Iperf Application Definition Schema] Verify that the XML file is syntactically correct by correct by checking if it opens correctly in an XML enabled browser (IE or Mozilla) Creating OML shared library and headers for Iperf --------------------------------------------------- After defining the application definition file as above, use the following command to submit the application definition file to a wrapper utility '''wget -q http://www.orbit-lab.org/oml/client_wrapper --post-file ''' In response to the .xml file, the OML application service returns a tar file containing: oml_.h and liboml_.a. Iperf is then compiled against this library. Include header files and function calls in source code -------------------------------------------------------- In the main method of Iperf (found in main.cpp), ''#include "oml_orbit_winlab_iperf.h"'' ''initialize_oml(&argc, argv, null)'' In the file ReportDefault.c ''oml_receiverport(stats->transferID,tput,jitter,loss)'' Modify Makefile and build application --------------------------------------- Linker options: -loml_client -lomltx LDFLAGS = -L/usr/lib/ -Lpath_to/liboml_orbit_winlab_iperf.a The oml client package with the required libraries can be obtained from the orbit repository (apt-get oml-client). It will install oml-client and oml_transport libraries in /usr/lib/ Note that the OML client is already present on the nodes (so the second step can be ignored) Now, Iperf can be rebuilt using the Makefile. Miscellaneous --------------- Note that the application will need the following environment variables to be set '''LD_LIBRARY_PATH = /usr/lib/''' '''OML_NAME=''' '''OML_CONFIG=''' All these variables are set automatically when the experiment is run using the nodeHandler. Integrating with Nodehandler – Launching the application ========================================================== This section includes the details of how to integrate Iperf with the experiment controller (nodeHandler) so that it can be launched on all the nodes involved in the experiment. Create application definitions for Iperf client and server ------------------------------------------------------------ The following two sample files for Iperf sender and receiver show the details of how to create definitions for any application. The definition mainly contains the command line options that can be set during launching the application as well as the output statistics reported by the application Iperf Sender -------------- [http://www.orbit-lab.org/wiki/Documentation/OtherApps/Iperf/IperfSender Iperf Sender Application Script] Iperf Receiver ----------------- [http://www.orbit-lab.org/wiki/Documentation/OtherApps/Iperf/IperfReceiver Iperf Receiver Application Script] Create prototypes using previously defined applications ---------------------------------------------------------- Using the previously defined Iperf client and server application definitions, the next step is to create prototypes that use these applications. For e.g using the basic Iperf application, we define four prototypes, udpsender, udpreceiver, tcpsender and tcpreceiver. Each of these will use Iperf as the underlying application; however their properties can be customized as shown below Iperf UDP Sender ------------------ [http://www.orbit-lab.org/wiki/Documentation/OtherApps/Iperf/IperfUDPSender Iperf UDP Sender Prototype Script] Iperf UDP Receiver -------------------- [http://www.orbit-lab.org/wiki/Documentation/OtherApps/Iperf/IperfUDPReceiver Iperf UDP Receiver Prototype Script] Iperf TCP Sender ------------------ [http://www.orbit-lab.org/wiki/Documentation/OtherApps/Iperf/IperfTCPSender Iperf TCP Sender Prototype Script] Iperf TCP Receiver -------------------- [http://www.orbit-lab.org/wiki/Documentation/OtherApps/Iperf/IperfTCPReceiver Iperf TCP Receiver Prototype Script] Write experiment script using the previously defined application and prototype definitions --------------------------------------------------------------------------------------------- The final step is to write the actual experiment script as shown below Experiment Script ------------------- [http://www.orbit-lab.org/wiki/Documentation/OtherApps/Iperf/ExperimentScript Experiment Script] Parameters and statistics supported ======================================= Sender Side -------------- * UDP or TCP flow * Sender port number * TCP Send Window size (for TCP flows) * Payload length (for UDP flows) * Bandwidth (offered load for UDP flows) * Duration of traffic generation * Number of parallel flows Receiver Side --------------- * UDP or TCP flow * Receiver port number * TCP Receive window size (for TCP flows) * Duration of run * Payload length (to expect from sender for UDP flows) * Interval (periodic duration between report generation) Statistics Reported ----------------------- * Throughput (TCP and UDP) * Jitter (UDP) * Packet Loss (UDP) }}}