Changes between Version 2 and Version 3 of Tutorial/HowToAppPrototype


Ignore:
Timestamp:
Dec 5, 2007, 5:12:41 AM (17 years ago)
Author:
thierry
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Tutorial/HowToAppPrototype

    v2 v3  
    161161=== Step 3: The Experiment Script ===
    162162
    163 This experiment is given in the attached script [attachment:a a].
    164 
    165 This file contains extensive comments that should help you understand the different steps involved in running an application on the nodes of a testbed.
     163In this step, we describe the experiment script that demonstrates the use of the above two prototypes.
     164
     165This experiment involves an ad-hoc network of two group of nodes, each containing a single node. The first group "firstWorker" contains node [1,1], which will use the "gentlePing" prototype/application to assert that it can reach node [1,2]. The second group "secondWorker" contains node [1,2], which will use the "agressivePing" prototype/application to get a coarse estimate of the packet drop rate on its link to node [1,1].
     166
     167The following code should be saved into a file "tut_app_3.rb" in the same directory as the above application and prototype definitions:
     168{{{
     169# Define the first group
     170# The node(s) within this group will run the "gentlePing" prototype/application
     171#
     172defGroup('firstWorker', [1,1]) {|node|
     173
     174   # Associate the prototype to use with this group
     175   # and configure any eventual parameters
     176   #
     177   node.prototype("gentlePing", {
     178     'destination' => "192.168.0.2"
     179   })
     180
     181   # Configure the wireless interface on the node(s) in this set
     182   node.net.w0.mode = "ad-hoc"
     183   node.net.w0.type = "g"
     184   node.net.w0.essid = "tutorial"
     185   node.net.w0.ip = "192.168.0.1"
     186}
     187
     188# Define the second group
     189# The node(s) within this group will run the "aggressivePing" prototype/application
     190#
     191defGroup('secondWorker', [1,2]) {|node|
     192
     193   # Here we decide that the default 1000 probes are not enough in our case
     194   # and we give a specific value of 4000 to the 'numPacket' parameter of
     195   # the "aggressivePing" prototype
     196   #
     197   node.prototype("aggressivePing", {
     198     'destination' => "192.168.0.1",
     199     'numPacket' => 4000
     200   })
     201
     202   # Configure the wireless interface on the node(s) in this set
     203   node.net.w0.mode = "ad-hoc"
     204   node.net.w0.type = "g"
     205   node.net.w0.essid = "tutorial"
     206   node.net.w0.ip = "192.168.0.2"
     207}
     208
     209# When all the applications on all the nodes in this experiment are ready
     210#
     211whenAllInstalled() {|node|
     212
     213   # Wait 10 sec to make sure that the wireless interfaces are all
     214   # configured
     215   wait 10
     216
     217   # Start all the applications
     218   allGroups.startApplications
     219
     220   # Wait 10 sec, this will be the experiment duration time
     221   wait 10
     222
     223   # Stop the experiment
     224   Experiment.done
     225}
     226
     227}}}
     228
     229=== Final Step! ===
    166230
    167231To run this example script, use the following command:
    168232
    169233 {{{
    170   orbit exec tut_app_1
     234  orbit exec tut_app_3
    171235 }}}
    172236
    173237=== The Results ===
    174238
    175 The experiment screen output should then look like [attachment:a this]. And the experiment log file should look like  [attachment:a this].
     239The experiment screen output should then look like [attachment:sb5_2007_12_04_22_44_34-Output.txt this]. And the experiment log file should look like  [attachment:sb5_2007_12_04_22_44_34.log this].
    176240
    177241=== More... ===