Changes between Initial Version and Version 1 of Tutorial/Methodology


Ignore:
Timestamp:
Sep 29, 2005, 9:29:30 PM (19 years ago)
Author:
max
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorial/Methodology

    v1 v1  
     1[wiki:WikiStart Orbit] > [wiki:Tutorial Tutorial] > Methodology
     2
     3= Testbed Experiments =
     4
     5This section begins with a point concerning experimental methodology then describes each of the steps that might be needed to perform an '''ORBIT Radio Grid Testbed''' experiment.  The architecture of the '''ORBIT Radio Grid Testbed''' was designed to support each phase of the lifecycle of an experiment, see [http://www.orbit-lab.org/download/publications/Orbit_Software.pdf '''ORBIT Testbed Software Architecture:  Supporting Experiments as a Service'''].
     6
     7== Experimental Methodology ==
     8During each phase of the design, development, execution and interpretation of an '''ORBIT Radio Grid Testbed''' experiment it is important to keep a written laboratory notebook or at least regularly record blog entries.  The ''Instructions for Keeping Research Records'' in the front of most laboratory notebooks apply to '''ORBIT Radio Grid Testbed''' experiments.  Some instructions may need to be adapted, for example, to record the names and version numbers of procedures, applications and system software or to record commands issued using a GUI interface.
     9
     10While working on ORBIT projects, each student is expected to record regular blog entries.  Lack of blog entries implies the student is no longer working on the associated project.  To add a blog entry follow the "create content" link on the left menu of [http://local.orbit-lab.org local.orbit-lab.org].
     11
     12Laboratory notebook or blog entries should have sufficient information to help the experimenter or a colleague keep track of his or her work, for example, to be able to say a week or a month later how you did something and why you did it that way.  It should not include "editorial" or subjective comments that may limit later claims.
     13
     14== Experimental Design  ==
     15Much of the work in conducting an experiment is in its design and development.  Running it and interpreting the results should be relatively easy when the design is based on a good model of the underlying phenomena, sufficient measurement points are defined, and the application and any system software are properly written.  The design of an experiment will probably evolve during the development of models of the underlying phenomena, development of a strategy to map them to the testbed grid, development of the application software and development of any required system software.
     16
     17During the design of an experiment one may need to develop new techniques specific to it, but a number of standard design features are already in use on the '''ORBIT Radio Grid Testbed''', and many more are expected to be developed in due course.  A number of design issues and approaches are discussed in [http://www.orbit-lab.org/download/publications/Orbit_Software.pdf '''ORBIT Testbed Software Architecture:  Supporting Experiments as a Service'''].
     18
     19==== Mapping ====
     20When designing an experiment, one often has to translate a real-world network topology into specific experimental node assignments.  An ORBIT paper [http://www.orbit-lab.org/download/publications/Orbit_Mapping.pdf '''Wireless Link SNR Mapping Onto An Indoor Testbed'''] addresses the issue of mapping a network topology with given SNR requirements onto the actual ORBIT testbed.
     21
     22This paper illustrates how one might use analysis and simulation to develop some aspects of experimental design.  To emulate communication links of specified quality on the '''ORBIT Radio Grid Testbed''' it was found through analysis and simulation that when the interferer node is located on the corner across from the access point, one can map a communication link with a given received signal-to-interference-and-noise-ratio (SINR) to the corresponding link signal-to-noise-ratio (SNR) with the mapping range on the order of 57dB and average mapping error on the order of 2dB.
     23
     24==== Repeatability ====
     25Ideally, experimental results should be repeatable, and '''ORBIT Radio Grid Testbed''' experiment results should be no different, despite difficulties with complex interactions among physical, medium-access and network layers in wireless environments.  This issue is addressed in [http://www.orbit-lab.org/download/publications/Orbit_Repeatability.pdf '''Addressing Repeatability in Wireless Experiments using ORBIT Testbed'''].  Current results of any available manual or automated calibration procedures should be recorded as part of ones experimental data.
     26
     27==== Design Validation ====
     28If one is only modifying a few parameters in an already well-understood experiment, by reviewing its experimental design one should be able to verify that each of its models of underlying phenomena correspond to physical reality, and by inspecting its application and system software verify that it accurately implements the underlying models and each of the higher-level protocols.  Besides reviewing the design and inspecting the code, one might want to plan to use independent methods like analysis of measurements from RF or spectrum analyzers and passive packet monitors to confirm its intended operation.
     29
     30==== Using the '''ORBIT Radio Grid Testbed''' ====
     31The '''ORBIT Radio Grid Testbed''' was designed to be used as a service.  This section describes how to use the '''ORBIT Radio Grid Testbed''' as a service.  At the highest level, the input to a well-designed experiment on the ORBIT testbed is a script and the output is a database of measurements.  This system architecture enables its efficient operation as a service and makes it possible to run experiments remotely.
     32
     33===== PC or Workstation Requirements =====
     34You will need access to a PC or workstation that can run SSH to login to an ORBIT application server, submit the script for the experiment, use MySQL to browse the experimental results, and run Excel or Matlab to interpret the results.  You may also be able to monitor the progress of your experiment using a browser.
     35
     36===== Getting an Account =====
     37You will need an ORBIT user login (distinct from a WINLAB user login) to use the testbed.  At the very least you will need it to login into an ORBIT server to submit a script to run an experiment and to access an ORBIT server to get the set of measurements recorded during the experiment in order to interpret the results of the experiment.
     38
     39===== Scheduling =====
     40Only one '''ORBIT Radio Grid Testbed''' experiment can be run at a time.  Details of how the testbed will be made available for local and remote experiments are under discussion.
     41
     42===== Audit and Security Issues =====
     43Users working on a specific project will be given access to '''ORBIT Radio Grid Testbed''' resources using role-based access control.  Roles and privileges are expected to change over time or even as an experiment progresses.  The primary resource would be time on the testbed.  Users are expected to backup their own measurements on databases.  These controls and policies are under development and are subject to change.
     44
     45===== Developing the Script for an Experiment =====
     46A script is used to run an '''ORBIT Radio Grid Testbed''' experiment.  The script contains the configuration of the experiment, specifies its application and operating system software, describes its initialization and any parameters, and describes each phase of its operation.
     47
     48'''ORBIT Radio Grid Testbed''' scripts are written in Ruby, an easily understood, extensible, dynamic, object-oriented scripting language.  Ruby has been extended into the testbed user's domain with a number of methods.  Besides its extensibility and object-orientation, Ruby is concise and consistent.  It is a dynamic language supporting closure, that is, a Ruby block can use its original scope information even if the environment in which it was defined would otherwise have disappeared.
     49
     50An '''ORBIT Radio Grid Testbed''' script therefore is written in Ruby primarily using ORBIT-specific methods.  A brief description or Ruby follows, then information on the ORBIT-specific methods used to define and control an '''ORBIT Radio Grid Testbed''' experiment, then a note on script coding techniques.
     51
     52===== Ruby Resources =====
     53There are two primary resources for the Ruby programming language.  The first is [http://www.ruby-lang.org the Ruby Web site].  It contains current information on Ruby and a link to download it for free.  The second is an excellent tutorial and reference book, '''Programming Ruby The Pragmatic Programmer's Guide, Second Edition''', Dave Thomas with Chad Fowler and Andy Hunt, Pragmatic Bookshelf, October 2004, ISBN:0-9745140-5-5, 864 pages;  see [http://www.pragmaticprogrammer.com/titles/ruby].
     54
     55===== Ruby =====
     56Ruby's syntax is similar to other object-oriented languages like Java or C++.  In Ruby everything that is represented is an object, even numbers like 1.  Functions or procedures are termed methods and are called using the name of the object, a period, and the name of the method, e.g., node.prototype.  Methods in ruby are usually small.
     57
     58Variables associated with objects are termed properties and are referred to by the name of the object, a period, and the name of the property, e.g., w.essid.  The formatting of ones use of the language is at the discretion of the programmer, but consistency is helpful, especially in the use of indentation and the placement of the opening and closing braces for code blocks.
     59
     60===== ORBIT-specific Methods =====
     61Four ORBIT-specific methods are available for debugging help:  ''error(
     62)'', ''warn(
     63)'', ''info(
     64)'', and ''debug(
     65)''.  How do they work?  Like assertions?  What arguments do they take?  Besides these debugging methods, there are three classes of ORBIT-specific methods discussed below:  implicit, Experiment, and NodeSet.
     66
     67Among the implicit methods two are used to define resources:
     68{{{
     69      defProperty(name, value, description)
     70      defNodes(setName, nodeList) {}
     71}}}
     72Some ORBIT-specific methods work with node sets to specify a set of nodes for each member of which the associated block of code is executed:
     73{{{
     74      nodes(setName) {}
     75      allNodes {}
     76      nodes("_ALL_") {}
     77}}}
     78Other ORBIT-specific methods use events which delay execution of the associated block of code and sequential execution until that event is true:
     79{{{
     80        whenAll(setTest, nodeTest, interval = 5) {}
     81      whenAllInstalled()
     82      whenAll("_ALL_", "apps/app/status[text()='INSTALLED.OK']") {}
     83      wait time_in_sec
     84}}}
     85
     86The Experiment methods and properties are ORBIT-specific methods and properties associated with the Experiment object.  They have the form Experiment.method.  These methods include:
     87{{{
     88      name = "tutorial-1a"
     89      project = "orbit:tutorial"
     90      props.propName = ""
     91      Done
     92}}}
     93It is anticipated that the 'Experiment' prefix will be removed in future versions.
     94
     95Other ORBIT-specific methods are NodeSet methods that set properties for the specified set of nodes.  They have the form
     96{{{
     97NodeSet ( nodes(setName).method )
     98      image =
     99      pxeImage =
     100      prototype(name) {|node|
     101}
     102      onNodesUp {|node|
     103}
     104      startApplication(appName), startApplications
     105      stopApplication(appName), stopApplications
     106      resource
     107      net.if_name
     108}}}
     109
     110The defNodes method declares the nodes used in the experiment:
     111{{{
     112      defNodes(setName:string, nodeList) {}
     113}}}
     114There are various ways to declare node list:
     115{{{
     116      A single node: [x,y]
     117      multiple nodes: [[x1,y1], [x2, y2], [x3, y3]]
     118      ranges of nodes: [x1..x2, y1..y2]
     119      the entire grid: [1..20, 1..20]
     120      with other node sets: [‘nodeSet1’, ‘nodeSet2’]
     121}}}
     122These methods are useful for declaring common functionality over multiple sets.  The various network parameters that may be configured within a defNodes or allNodes block are shown in Figure 9 below, here the first and second Ethernet interfaces are e0 and e1, and the first and second wireless interfaces are w0 and w1.
     123
     124{{{
     125• net
     126        – e0, e1
     127                • arp = true|false En/disable ARP
     128                • forward = true|false Enable forwarding
     129                • ip = address/netmask IP address of interface
     130                • up = true|false En/disable interface
     131                • route
     132        – w0, w1
     133                • All the above
     134                • channelI = 1..11; 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157, 161
     135                • essid = string
     136                • frequencyI = 2.412 – 2.462 (5 Mhz steps); 5.18Ghz (20Mhz steps)
     137                • mode = master|managed|ad-hocI|monitorI
     138                • rtsA = packetSizeThreshold [bytes]
     139                • rateI = 1, 5, 11; 6, 9, 12, 18, 24, 36, 48, 54
     140                • tx_power = -12 .. 15 dBm (intel), 0 .. 20 dBm (atheros)
     141                • type = a/b/g
     142}}}
     143
     144Figure 9.  Configurable Network Parameters
     145
     146===== ORBIT Script Coding Techniques =====
     147There are many known techniques for defining an experiment with parameters that do not change over the course of the experiment and for controlling experiments with parameters that change while the experiment runs.  These techniques are available in the standard scripts for the baseline ORBIT experiments [where?].  It is also possible to change parameters based on the experiment's own measured behavior, e.g., to run until the observed packet error rate exceeds a given value, see [http://www.orbit-lab.org/download/publications/Orbit_Software.pdf '''ORBIT Testbed Software Architecture:  Supporting Experiments as a Service'''].
     148
     149===== Developing Application Software =====
     150The experimenter may need to develop application software, for example, to emulate the operation of a new network protocol.  An '''ORBIT Radio Grid Testbed''' application operates in the environment shown in Figure 10 below.  An application needs to be integrated into this application harness.  Once an application is developed it needs to have an application description developed and to be loaded onto an application server and assigned an id.  The process for developing this application description and loading the application software is as follows [?].
     151
     152Figure 10.  Experiment Execution Architecture (see page 12 of [http://www.orbit-lab.org/doc/tutorial]).
     153
     154===== Development Tools for Application Software =====
     155Three major tools are provided to the ORBIT experimenter to develop an application in C on Linux:  '''ORBIT Traffic Generator/Receiver (OTG/OTR)''', '''Libmac''' and the '''ORBIT Measurement Framework (OML)'''.  The '''ORBIT traffic generator/receiver (OTG/OTR)''' illustrated in Figure 11 below is a modular traffic generator/receiver that is integrated with '''OML''' and '''Libmac'''.  '''OTG/OTR''' has pluggable traffic models and transport protocols, see [http://www.orbit-lab.org/download/publications/Orbit_OML.pdf '''ORBIT Measurements Framework and Library (OML): Motivations, Design, Implementation, and Features'''].
     156
     157Figure 11.  '''ORBIT Traffic Generator/Receiver (OTG/OTR)'''(on page 53 of [http://www.orbit-lab.org/doc/tutorial]).
     158
     159'''Libmac''' is a user-space C library that brings the wireless driver application program interface (API) into user space allowing one to get or set values of driver parameters.  This library supports operation for a variable number of parameters per call. The call mac_get_params(struct mac_params *h, struct mac_ifinfo_list *if_ptr, int argc,
     160) requests the wireless device driver to GET parameter information.  The call mac_set_params(struct mac_params *h, struct mac_ifinfo_list *if_ptr, int argc,
     161) requests device driver to SET parameter information.
     162
     163The '''ORBIT Measurement Framework (OML)''' was discussed in the first section of this tutorial as one of the ORBIT Services.  It is a distributed software framework enabling real-time collection of data, and, as such, has a client application programming interface (API).  A developer can use this client API through a web interface to define the measurement points and parameters for his or her application.  Measurement points and their frequency of collection are an important part of ones experimental plan.
     164
     165The definition of a measurement point is illustrated in Figure 12 below.  Measurement point definitions are saved as an XML-based configuration file, and source code for the measurement client is automatically generated that contains application-specific methods that handle type-safe data collection.  This source code can be compiled and linked with the application as illustrated by a Makefile in Figure 13 and sample application code in Figure 14 below.
     166
     167{{{
     168<measurement-points>
     169<measurement-point id="group-1">
     170<metric id="rssi" type="float"/>
     171<metric id="noise" type="float"/>
     172</measurement-point>
     173<measurement-point id="group-2">
     174<metric id="throughput" type="int"/>
     175</measurement-point>
     176</measurement-points>
     177}}}
     178
     179Figure 12.  Defining Measurement Points
     180
     181{{{
     182Makefile:
     183$(INC_DIR)/oml_%.h : $(ETC_DIR)/%.xml
     184mkdir -p $(INC_DIR)
     185wget -q http://www.orbit-lab.org/oml/client_wrapper\
     186--post-file $< -O - \
     187| tar -C $(BUILD_DIR) -xzf –
     188oml_foo.h:
     189int oml_group1(float rssi, float noise);
     190int oml_group2(int throughput);
     191}}}
     192
     193Figure 13.  Makefile and include file for Measurement Points
     194
     195{{{
     196oml_init(&argc, &argv, NULL);
     197
     198
     199if (r_data->send_option == 1) {
     200buffer->rssi = recv_packet_params.rssi ;
     201buffer->noise = recv_packet_params.noise;
     202oml_group1(buffer->rssi, buffer->noise);
     203} else {
     204log(LOG_ERR, "Unknown receive option! \n");
     205}
     206lost_packets = pck_id.seqnum - old - 1;
     207oml_group2(lost_packets);
     208}}}
     209
     210Figure 14.  Application Code Sample
     211
     212Because not all measurements are needed and not all measurement samples are needed, '''OML''' supports preprocessing or filtering at source to reduce the amount of reported and recorded data.  Filters are defined by experimenter, and experimenter-provided filters are supported.  Figure 15 below illustrates the client-side data flow.  Collection of and access to the recorded data requires the use of a database schema.  '''OML''' automatically generates the appropriate schema as diagrammed in Figure 16 below.
     213
     214Figure 15.  Client-side Data Flow (see page 66 of [http://www.orbit-lab.org/doc/tutorial]).
     215
     216Figure 16.  Server-side DB Schema Generation (see page 67 of [http://www.orbit-lab.org/doc/tutorial]).
     217
     218===== Developing Device Drivers =====
     219A possibly difficult aspect of having to develop a completely new application would be to have to develop a device driver for Linux or for another operation system to support a new communications device.  Even a simple modification to an existing device driver requires extensive testing.  Once a device driver has been developed it needs to be loaded onto an application server.  The process for loading a device driver is as follows [?].
     220
     221===== '''ORBIT Sandboxes''' =====
     222When developing a new application or modifying system software and especially when developing a device driver, it is best to have an electromagnetically isolated hardware environment.  An '''ORBIT Sandbox''' contains two '''ORBIT Radio Nodes''' and one console node with their 802.11 a/b/g cards connected by coaxial cable.  Each '''ORBIT Sandbox''' is supported by a shared services node.  '''ORBIT Sandboxes''' allow multiple projects to develop multiple '''ORBIT Radio Grid Testbed''' experiments in parallel without interfering with experiments currently running on the testbed.
     223
     224===== Loading Your Own OS =====
     225The '''ORBIT Radio Nodes''' usually run Debian Linux.  If you need to load a different operating system, perhaps to use certain drivers or perhaps to run a harder real-time application, it can be done.  However, the support libraries and services might need to be adapted to work with your operating system.  The operating system needs to be loaded onto an application server.  The process for loading an operating system is as follows [?].
     226
     227===== Running an Experiment =====
     228Besides being operated as a service, another important design goal of the '''ORBIT Radio Grid Testbed''' is for experiments with it to be able to be operated remotely.  For the time being though it is best if the experimenter is present at the site to observe the testbed and its operation.
     229
     230Once you have developed an experimental script and any new application or system software required to run it, from the command line on your computer or an SSH tool, create a secure shell connection to the ORBIT Lab console.  Figure 17 below contains a sample session for the "Hello World" experiment.
     231
     232{{{
     233myMachine> ssh console.orbit-lab.org
     234console> nodeAgent test:exp:tutorial-1a
     235INFO init: NodeHandler Version 1.69
     236
     237INFO init: Experiment ID: 2005-06-07-14-09-38
     238INFO Experiment: load test:exp:tutorial-1a
     239
     240
     241INFO Experiment: DONE!
     242INFO run: Experiment finished after 2:56
     243}}}
     244
     245Figure 17.  "Hello World" Experiment Console Session
     246
     247==== How to Tell If An Experiment is Working Properly ====
     248Because measurements are available in the database as they are received, it is possible to monitor an experiment as it is running using the MySQL browser as shown in Figure 18.  One can monitor the Frisbee, pxe and xml data using a browser and specific port addesses.  What are they?  Which ports?  One also might design some sanity checks into your experiment, that is, initial modes of operation of certain patterns of parameters that have analytically predictable results.
     249
     250Figure 18.  Real-time monitoring (see page 68 of [http://www.orbit-lab.org/doc/tutorial]).
     251
     252===== Analyzing Results =====
     253It is important to understand how measurements were collected to be able to interpret them.  The '''ORBIT Measurement Framework (OML)''' that was described above provides tools to insert points to tap available information and to effectively collect that information in a timely manner.  A number of different tools are available to interpret experimental results.  The choice of tools depends upon availability and the nature of the measurements.  Microsoft Excel can be used to analyze an experiment as shown in Figure 19 below.  Matlab can also be used.  Sample Matlab code is shown in Figure 20 and the resulting graph in Figure 21.
     254
     255Figure 19.  Usage of Microsoft Excel (page 69 of of [http://www.orbit-lab.org/doc/tutorial]).
     256
     257{{{
     258function nsf(dbServer, dbUser, dbPW, database);
     259% Part where we retrieve data from the database;
     260mysql('open',dbServer, dbUser, dbPW);
     261mysql('use', database);
     262output = struct('time',[],'thr_all',[],'node',[]);
     263[output.time, output.thr_all, output.node] = mysql('select timestamp, throughput, node_id from group2');
     264[thru1_4, time1_4, thru3_1, time3_1] = sort_mysql(output);
     265% Finally, the plotting part
     266subplot(2,1,1);
     267plot(time1_4, thru1_4, '-*');
     268title('Throughput On Obstructed Link');
     269xlabel('Time (sec)'); ylabel('Throuhput (bps)'); grid on;
     270subplot(2,1,2);
     271plot(time3_1, thru3_1, '-*');
     272title('Throughput On Monitor Node'); xlabel('Time (sec)');
     273ylabel('Throuhput (bps)'); grid on;
     274}}}
     275
     276Figure 20.  Matlab Code
     277
     278Figure 21.  Matlab Graph (see graph on page 70 of [http://www.orbit-lab.org/doc/tutorial]).
     279