diff --git a/.gitignore b/.gitignore index 7107f11d..7cd566dd 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ tags **/coverage documentation -omf_common/example/auth +omf_common/example/auth \ No newline at end of file diff --git a/doc/images/tutorial01-fig1.png b/doc/images/experiment01-fig1.png similarity index 100% rename from doc/images/tutorial01-fig1.png rename to doc/images/experiment01-fig1.png diff --git a/doc/tutorials/TUTORIAL_00.mkd b/doc/tutorials/Experiment01.mkd similarity index 84% rename from doc/tutorials/TUTORIAL_00.mkd rename to doc/tutorials/Experiment01.mkd index c7ab21fb..5194836f 100644 --- a/doc/tutorials/TUTORIAL_00.mkd +++ b/doc/tutorials/Experiment01.mkd @@ -1,9 +1,10 @@ -# Tutorial 00 +# Experiment 01 -1. "Hello World" Tutorial + +1. "Hello World" *Experiment Tutorial* --------------------------- -This simple tutorial presents all the basic steps to develop, run, and +This simple experiment tutorial presents all the basic steps to develop, run, and access the result of an experiment with OMF 6. Subsequent tutorials will build on this one to introduce further OMF features. @@ -27,7 +28,7 @@ Description Language **Files** The experiment description (aka script) is: -{file:doc/tutorials/tutorial00.rb tutorial00.rb} +{file:doc/tutorials/experiment01.rb experiment01.rb} **Experiment Scenario** @@ -135,69 +136,85 @@ of the resources involved in an experiment and the sets of actions to perform in order to realize that experiment. An ED is written using the OMF Experiment Description Language (OEDL). -The ED describing this simple “Hello World” experiment is {file:doc/tutorials/tutorial00.rb tutorial00.rb}. It is composed of 3 distinct +The ED describing this simple “Hello World” experiment is {file:doc/tutorials/experiment01.rb experiment01.rb}. It is composed of 3 distinct parts, described in the following listing and subsections below. - # A. Define an OMF Application Definition for the ping-oml2 application - # The OMF entities are using this definition to know where to find the - # application, what are its configurable parameters, and what are the - # OML2 measurement points that it provides. - # This ping-oml2 application will be known by OMF entities as 'ping_oml2' - # - defApplication('ping_oml2') do |app| - app.description = 'Simple Definition for the ping-oml2 application' - # Define the path to the binary executable for this application - app.binary_path = '/usr/bin/ping-oml2' - # Define the configurable parameters for this application - # For example if target is set to foo.com and count is set to 2, then the - # application will be started with the command line: - # /usr/bin/ping-oml2 -a foo.com -c 2 - app.defProperty('target', 'Address to ping', '-a', {:type => :string}) - app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer}) - # Define the OML2 measurement point that this application provides. - # Here we have only one measurement point (MP) named 'ping'. Each measurement - # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit) - app.defMeasurement('ping') do |m| + +
+#Welcome to Experiment 01
+#This ED allows experimenters to ping a specified host and collect the output it recieves as measurement points
+
+#Section 1
+#Define oml2 application file-paths
+#Define experiment parameters and measurement points
+
+defApplication('ping_oml2') do |app|
+
+ #Application description and binary path
+ app.description = 'Simple definition of ping-oml2 application'
+ app.binary_path = '/usr/bin/ping-oml2'
+
+ #Configurable parameters of Experiment
+ app.defProperty('target', 'Address to ping', '-a', {:type => :string})
+ app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
+
+
+ #Define measurement points that application will output
+ app.defMeasurement('ping') do |m|
m.defMetric('dest_addr',:string)
m.defMetric('ttl',:uint32)
m.defMetric('rtt',:double)
m.defMetric('rtt_unit',:string)
- end
+
end
-
- # B. Define a group of resources which will run the ping-oml2 application
- # Here we define only one group (Sender), which has only one resource in it
- # (omf6.nicta.node8)
- #
- defGroup('Sender', 'omf6.nicta.node8') do |g|
- # Associate the application ping_oml2 defined above to each resources
- # in this group
- g.addApplication("ping_oml2") do |app|
- # Configure the parameters for the ping_oml2 application
+end
+
+#Section 2
+#Define resources and nodes used by oml2 application
+
+#Create the group 'Sender' with specified nodes
+defGroup('Sender', 'omf.nicta.node9') do |g|
+
+ #Associate oml2 application to group (?)
+ g.addApplication("ping_oml2") do |app|
+
+ #Configure target of application (Ping target)
app.setProperty('target', 'www.nicta.com.au')
+
+ #Configure amount of times to ping host
app.setProperty('count', 3)
- # Request the ping_oml2 application to collect measurement samples
- # from the 'ping' measuremnt point (as defined above), and send them
- # to an OML2 collection point
+
+ #Request application to collect measurement point output data
app.measure('ping', :samples => 1)
- end
+
end
+end
+
+#Section 3
+#Execution of application events
+
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+
+ # Print information message on commandline
+ info "Initializing first OMF experiment event"
+
+ # Start all the Applications associated to all the Group
+ allGroups.startApplications
+
+ # Wait for 5 sec (allowing time for 3 pings)
+ after 5
+
+ # Stop all the Applications associated to all the Groups
+ allGroups.stopApplications
+
+ # Tell the Experiment Controller to terminate the experiment now
+ Experiment.done
+end
+
+
+
+
- # C. Define the sequence of tasks to perform when the event
- # "all resources are up and all applications are install" is being triggered
- #
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
- # Print some information message
- info "This is my first OMF experiment"
- # Start all the Applications associated to all the Groups
- allGroups.startApplications
- # Wait for 5 sec
- wait 5
- # Stop all the Applications associated to all the Groups
- allGroups.stopApplications
- # Tell the Experiment Controller to terminate the experiment now
- Experiment.done
- end
### 3a) Application Definition
@@ -208,7 +225,7 @@ information is provided in the block of instructions defined between the
'do' and 'end' markers following the 'defApplication' commands:
defApplication('ping_oml2') do |app|
- app.description = 'Simple Definition for the ping-oml2 application'
+ app.description = 'Simple definition of ping-oml2 application'
...
end
@@ -253,13 +270,13 @@ Groups. A named Group can be itself viewed as a resource holding other
resources. A given resource can belong to many groups at the same time, and
a group itself may be part of another group.
In this example, we define a single group named 'Sender', which contains a
-single resource 'omf6.nicta.node8'.
+single resource 'omf.nicta.node9'.
> **IMPORTANT** When running this experiment using your own resource and testbed
-please change 'omf6.nicta.node8' in the ED to the actual name of your
+please change 'omf.nicta.node9' in the ED to the actual name of your
own resource.
- defGroup('Sender', 'omf6.nicta.node8') do |g|
+ defGroup('Sender', 'omf.nicta.node9') do |g|
...
end
@@ -294,7 +311,7 @@ triggered
For example, your experiment might involve 2 events:
- 'when my PC node is ready' and
-- 'when my application has finished running'. You would then a
+- 'when my application has finished running'.
You would then associate the following tasks to each of these events:
@@ -329,9 +346,9 @@ The set of consecutive tasks that we define are:
- wait for 5 seconds
- stop all the applications associated with all the groups
- info "This is my first OMF experiment"
+ info "Initializing first OMF experiment event"
allGroups.startApplications
- wait 5
+ after 5
allGroups.stopApplications
As OMF experiment are fully event driven, you have to explicitly tell the OMF
@@ -356,14 +373,14 @@ section 2, and that you have the EC software installed on your own computer,
then to run your experiment you have to:
- save its description in a file on your computer, thus either
- - cut-and-paste the above ED listing into a new file named 'tutorial00.rb'
+ - cut-and-paste the above ED listing into a new file named 'experiment01.rb'
- download the ED directly:
-{file:doc/tutorials/tutorial00.rb tutorial00.rb}
+{file:doc/tutorials/experiment01.rb experiment01.rb}
- open a terminal and navigate to the folder/directory where you saved that file
- start the EC software and tell it to execute the experiment described in your ED file, using the command line:
- omf_ec -u xmpp://usr:pwd@my_xmpp.com exec --oml_uri tcp:srv:port tutorial00.rb
+ omf_ec -u xmpp://usr:pwd@my_xmpp.com exec --oml_uri tcp:srv:port experiment01.rb
- **replace** *xmpp://usr:pwd@srv* with the credentials for your user on the
xmpp pubsub server that is used to communicate with the resources
@@ -376,7 +393,7 @@ furthermore want to use the OML2 server with hostname 'my_oml.com at port
3003 to collect the measurement of your experiment, then you would use the
command:
- omf_ec -u xmpp://foo:bar@my_xmpp.com exec --oml_uri tcp:my_oml.com:3003 tutorial00.rb
+ omf_ec -u xmpp://foo:bar@my_xmpp.com exec --oml_uri tcp:my_oml.com:3003 experiment01.rb
If you would like to know more about the other options of the OMF EC software
please run the commands:
@@ -394,15 +411,15 @@ similar to this:
INFO Object: Connected
INFO Object: Start experiment: 2013-03-14T03:48:48Z
INFO OmfEc: Subscribed to 856de74b-6cf7-4de7-aaad-6c842eea209a
- INFO OmfEc: Subscribed to omf6.nicta.node8
- INFO OmfEc: Config omf6.nicta.node8 to join Sender
- INFO OmfEc: Newly discovered resource >> omf6dev.node8
+ INFO OmfEc: Subscribed to omf.nicta.node9
+ INFO OmfEc: Config omf.nicta.node9 to join Sender
+ INFO OmfEc: Newly discovered resource >> omfdev.node9
INFO OmfEc: Event triggered: 'ALL_UP'
INFO OmfEc: Subscribed to 856de74b-6cf7-4de7-aaad-6c842eea209a_application
INFO OmfEc: Resource xmpp://bd9c68d5-1469-41a0-9a33-4bdba501f7b0@norbit.npc.nicta.com.au created
INFO OmfEc: Newly discovered resource >> bd9c68d5-1469-41a0-9a33-4bdba501f7b0
INFO OmfEc: Event triggered: 'ALL_UP_AND_INSTALLED'
- INFO Object: This is my first OMF experiment
+ INFO Object: Initializing first OMF experiment event
INFO Object: Request from Experiment Script: Wait for 10s....
WARN Object: Calling 'wait' or 'sleep' will block entire EC event loop. Please try 'after' or 'every'
INFO OmfEc: APP_EVENT STARTED from app ping_oml2_cxt_0 - msg: env -i /usr/bin/ping-oml2 -a www.nicta.com.au -c 3 --oml-config /tmp/bd9c68d5.xml
@@ -421,8 +438,8 @@ similar to this:
The above screen output was optained when running the EC on the NICTA testbed,
with the experiment described in
-{file:doc/tutorials/tutorial00.rb tutorial00.rb}
-and using the resource named 'omf6.nicta.node8'
+{file:doc/tutorials/experiment01.rb experiment01.rb}
+and using the resource named 'omf.nicta.node9'
### 4c) What does that screen output mean?
@@ -435,17 +452,17 @@ this experiment (ID, xmpp server used, resource used,...):
INFO Object: Connected
INFO Object: Start experiment: 2013-03-14T03:48:48Z
...
- INFO OmfEc: Subscribed to omf6.nicta.node8
- INFO OmfEc: Config omf6.nicta.node8 to join Sender
+ INFO OmfEc: Subscribed to omf.nicta.node9
+ INFO OmfEc: Config omf.nicta.node9 to join Sender
- It also provides us some feedback about its communication with the xmpp
server and other OMF entities:
...
INFO OmfEc: Subscribed to 856de74b-6cf7-4de7-aaad-6c842eea209a
- INFO OmfEc: Subscribed to omf6.nicta.node8
+ INFO OmfEc: Subscribed to omf.nicta.node9
...
- INFO OmfEc: Newly discovered resource >> omf6dev.node8
+ INFO OmfEc: Newly discovered resource >> omfdev.node9
...
INFO OmfEc: Subscribed to 856de74b-6cf7-4de7-aaad-6c842eea209a_application
...
@@ -469,7 +486,7 @@ results/outputs:
...
INFO OmfEc: Event triggered: 'ALL_UP_AND_INSTALLED'
- INFO Object: This is my first OMF experiment
+ INFO Object: Initializing first OMF experiment event
INFO Object: Request from Experiment Script: Wait for 10s....
WARN Object: Calling 'wait' or 'sleep' will block entire ...
INFO OmfEc: APP_EVENT STARTED from app ping_oml2_cxt_0 - ...
@@ -533,7 +550,7 @@ use that tool, please refer to the [omf_web documentation]
6. What should I do next?
-------------------------
-We will soon release more tutorials on how to use all the features of OMF6
+We will soon release more tutorials on how to use all the features of omf
from the experimenter's perspective.
In the meantime, you may have a look at the OMF 5.4 documentation, which
diff --git a/doc/tutorials/TUTORIAL_01.mkd b/doc/tutorials/Experiment02.mkd
similarity index 78%
rename from doc/tutorials/TUTORIAL_01.mkd
rename to doc/tutorials/Experiment02.mkd
index fbf67b04..e35e9015 100644
--- a/doc/tutorials/TUTORIAL_01.mkd
+++ b/doc/tutorials/Experiment02.mkd
@@ -1,6 +1,6 @@
-# Tutorial 01
+# Experiment 02
-1. “Hello World” - Wireless
+2. “Hello World” Wireless *Experiment Tutorial*
---------------------------
This simple tutorial presents all the basic steps to develop, run, and
@@ -27,13 +27,13 @@ Description Language
**Files**
The experiment description (aka OEDL script) is:
-{file:doc/tutorials/tutorial01.rb tutorial01.rb}
+{file:doc/tutorials/experiment02.rb experiment02.rb}
**Experiment Scenario**
The following figure shows the simple experiment scenario for this tutorial:
-
+
- This experiment involves two resources of type PC with wireless capabilities:
Node 1 and Node 2
@@ -108,7 +108,7 @@ This tutorial assumes the latter, i.e. you have installed an EC on your
machine and will use it to orchestrate your experiment
-3. Developing the “Hello World” Experiment
+3. Developing the Experiment Description (ED)
------------------------------------------------------
To run an experiment with OMF, you first need to describe it into an
@@ -118,101 +118,121 @@ of the resources involved in an experiment and the sets of actions to perform
in order to execute that experiment. An ED is written using the
OMF Experiment Description Language (OEDL), which is based on Ruby syntax.
-The ED describing this simple “Hello World” wireless experiment is {file:doc/tutorials/tutorial01.rb tutorial01.rb}:
-
- defApplication('otr2') do |a|
-
- a.binary_path = "/usr/bin/otr2"
- a.description = <
+#Welcome to experiment 02: 'Hello World' Wireless
+#This script creates a simple wireless networking experiment
+
+#Section 1
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+
+defApplication('otr2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otr2"
+ a.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ a.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+ end
+end
+
+#Define otg2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otg2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otg2"
+ a.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ a.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ a.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ a.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ a.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
+ end
+end
+
+#Section 2
+#Define resources and nodes used by application
+
+#Define configuration of wireless 'sender'
+defGroup('Sender', "omf.nicta.node9") do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.2')
+ app.setProperty('udp_dst_host', '192.168.0.3')
+ app.setProperty('udp_dst_port', 3000)
+ app.measure('udp_out', :interval => 3)
+ end
+
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = 'g'
+ node.net.w0.channel = "6"
+ node.net.w0.essid = "Hello World!"
+ node.net.w0.ip = "192.168.0.2/24"
+end
+
+#Define configuration of wireless 'reciever'
+defGroup('Receiver', "omf.nicta.node10") do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.3')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :interval => 3)
+ end
+
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = 'g'
+ node.net.w0.channel = "6"
+ node.net.w0.essid = "Hello World! Experiment02"
+ node.net.w0.ip = "192.168.0.3/24"
+end
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ info "Starting WiFi OMF6 Experiment events"
+
+ after 10 do
+ allGroups.startApplications
+ info "All Applications have started..."
+
+ end
+ after 40 do
+ allGroups.stopApplications
+ info "Applications are stopping... Experiment Complete."
+ Experiment.done
+ end
+end
+
+
### 3a) Application Definition
@@ -273,10 +293,10 @@ In this example, we define a two group named 'Sender' and 'Receiver', which cont
single resource each.
> **IMPORTANT** When running this experiment using your own resources and testbed
-please change `omf.nicta.node36` and `omf.nicta.node37` in the ED to the actual name of your
+please change `omf.nicta.node9` and `omf.nicta.node10` in the ED to the actual name of your
own resource.
- defGroup('Sender', 'omf.nicta.node36') do |g|
+ defGroup('Sender', 'omf.nicta.node9') do |g|
#...
end
@@ -396,13 +416,13 @@ Assuming that you have checked all the prerequisite points in the above
section 2, to run your experiment you have to:
- save the experiment description in a file on your computer, thus either
- - cut-and-paste the above ED listing into a new file named 'tutorial01.rb'
- - download the ED directly: {file:doc/tutorials/tutorial01.rb tutorial01.rb}
+ - cut-and-paste the above ED listing into a new file named 'experiment02.rb'
+ - download the ED directly: {file:doc/tutorials/experiment02.rb experiment02.rb}
- open a terminal and navigate to the directory where you saved that file
- start the EC software and tell it to execute the experiment described in your ED file, using the command line:
- omf_ec -u xmpp://my_xmpp.com exec --oml_uri tcp:my_oml.com:port tutorial01.rb
+ omf_ec -u xmpp://my_xmpp.com exec --oml_uri tcp:my_oml.com:port experiment02.rb
- **replace** *my_xmpp.com* with the hostname of the
XMPP server that is used to communicate with the resources. This is usually provided by your testbed.
@@ -414,7 +434,7 @@ and you want to use the OML2 server at 'my_oml.com with port
3003 to collect the measurements from your experiment, then you would use the
command line:
- omf_ec -u xmpp://my_xmpp.com exec --oml_uri tcp:my_oml.com:3003 tutorial01.rb
+ omf_ec -u xmpp://my_xmpp.com exec --oml_uri tcp:my_oml.com:3003 experiment02.rb
If you would like to know more about the other options of the OMF EC software, please run:
@@ -430,13 +450,13 @@ similar to this:
18:15:35 INFO Object: Connected
18:15:35 INFO Object: Start experiment: 2013-04-18T08:15:35Z
18:15:35 INFO OmfEc: Subscribed to b08025bb-6021-401b-bb55-c80c8a4fc99a
- 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node36
- 18:15:35 INFO OmfEc: Config omf.nicta.node36 to join Sender
+ 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node9
+ 18:15:35 INFO OmfEc: Config omf.nicta.node9 to join Sender
18:15:35 INFO OmfEc: Subscribed to 062ed093-c11e-4039-8b4c-35d007aabc4e
- 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node37
- 18:15:35 INFO OmfEc: Config omf.nicta.node37 to join Receiver
- 18:15:35 INFO OmfEc: Newly discovered resource >> omf.nicta.node36
- 18:15:35 INFO OmfEc: Newly discovered resource >> omf.nicta.node37
+ 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node10
+ 18:15:35 INFO OmfEc: Config omf.nicta.node10 to join Receiver
+ 18:15:35 INFO OmfEc: Newly discovered resource >> omf.nicta.node9
+ 18:15:35 INFO OmfEc: Newly discovered resource >> omf.nicta.node10
18:15:35 INFO OmfEc: Event triggered: 'ALL_UP'
18:15:35 INFO OmfEc: Subscribed to b08025bb-6021-401b-bb55-c80c8a4fc99a_wlan
18:15:35 INFO OmfEc: Subscribed to b08025bb-6021-401b-bb55-c80c8a4fc99a_application
@@ -446,9 +466,9 @@ similar to this:
18:15:40 INFO OmfEc: Newly discovered resource >> bbfba05b-c8ed-458b-8841-c6694135e99e
18:15:42 INFO OmfEc: Newly discovered resource >> 65e5bf73-4085-4d46-b790-2c2e4b719b70
18:15:42 INFO OmfEc: Event triggered: 'ALL_UP_AND_INSTALLED'
- 18:15:42 INFO Object: This is my first OMF experiment
+ 18:15:42 INFO Object: Starting WiFi OMF6 Experiment events
18:15:42 INFO OmfEc: Newly discovered resource >> 4b8644d3-9a45-4091-a147-651c55f4f15b
- 18:15:52 INFO Object: All my Applications are started now...
+ 18:15:52 INFO Object: All Applications have started...
18:15:52 INFO OmfEc: APP_EVENT STARTED from app otg2_cxt_0 - msg: env -i /usr/bin/otg2 --udp:dst_host 192.168.0.3 --udp:dst_port 3000 --udp:local_host 192.168.0.2 --oml-config /tmp/65e5bf73-4085-4d46-b790-2c2e4b719b70-1366272953.xml
18:15:53 INFO OmfEc: APP_EVENT STARTED from app otr2_cxt_0 - msg: env -i /usr/bin/otr2 --udp:local_host 192.168.0.3 --udp:local_port 3000 --oml-config /tmp/bb4c0edf-7167-4c64-9cbe-c9681332749f-1366272953.xml
18:15:53 INFO OmfEc: APP_EVENT STDERR from app otr2_cxt_0 - msg: INFO OTG2 Traffic Sink 2.9.0-dirty
@@ -457,7 +477,7 @@ similar to this:
18:15:54 INFO OmfEc: APP_EVENT STDERR from app otr2_cxt_0 - msg: INFO OML Client V2.9.0 [Protocol V3] Copyright 2007-2012, NICTA
18:15:56 INFO OmfEc: APP_EVENT STDERR from app otg2_cxt_0 - msg: INFO Net_stream: attempting to connect to server at tcp://norbit.npc.nicta.com.au:3003
18:15:56 INFO OmfEc: APP_EVENT STDERR from app otr2_cxt_0 - msg: INFO Net_stream: attempting to connect to server at tcp://norbit.npc.nicta.com.au:3003
- 18:16:22 INFO Object: All my Applications are stopped now.
+ 18:16:22 INFO Object: Applications are stopping... Experiment Complete.
18:16:22 INFO OmfEc: Exit in up to 15 seconds...
18:16:22 INFO OmfEc: APP_EVENT DONE.OK from app otr2_cxt_0 - msg: status: pid 1469 exit 0
18:16:22 INFO OmfEc: APP_EVENT DONE.OK from app otg2_cxt_0 - msg: status: pid 1705 exit 0
@@ -465,8 +485,8 @@ similar to this:
18:16:37 INFO XMPP::Communicator: Disconnecting ...
The above screen output was obtained when running the EC on the NICTA testbed,
-with the experiment described in {file:doc/tutorials/tutorial01.rb tutorial01.rb}
-and using the resources named 'omf.nicta.node36' and 'omf.nicta.node37'.
+with the experiment described in {file:doc/tutorials/experiment02.rb experiment02.rb}
+and using the resources named 'omf.nicta.node9' and 'omf.nicta.node10'.
### 4c) What does that screen output mean?
@@ -479,21 +499,21 @@ this experiment (Experiment ID, XMPP server used, resources used,...):
18:15:35 INFO Object: Connected
18:15:35 INFO Object: Start experiment: 2013-04-18T08:15:35Z
...
- 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node36
- 18:15:35 INFO OmfEc: Config omf.nicta.node36 to join Sender
+ 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node9
+ 18:15:35 INFO OmfEc: Config omf.nicta.node9 to join Sender
- It also provides us some feedback about its communication with the XMPP
server and other OMF entities:
...
18:15:35 INFO OmfEc: Subscribed to b08025bb-6021-401b-bb55-c80c8a4fc99a
- 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node36
+ 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node9
...
18:15:35 INFO OmfEc: Subscribed to 062ed093-c11e-4039-8b4c-35d007aabc4e
- 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node37
+ 18:15:35 INFO OmfEc: Subscribed to omf.nicta.node10
...
- 18:15:35 INFO OmfEc: Newly discovered resource >> omf.nicta.node36
- 18:15:35 INFO OmfEc: Newly discovered resource >> omf.nicta.node37
+ 18:15:35 INFO OmfEc: Newly discovered resource >> omf.nicta.node9
+ 18:15:35 INFO OmfEc: Newly discovered resource >> omf.nicta.node10
...
18:15:35 INFO OmfEc: Subscribed to b08025bb-6021-401b-bb55-c80c8a4fc99a_wlan
18:15:35 INFO OmfEc: Subscribed to b08025bb-6021-401b-bb55-c80c8a4fc99a_application
@@ -519,9 +539,9 @@ results/outputs:
...
18:15:42 INFO OmfEc: Event triggered: 'ALL_UP_AND_INSTALLED'
- 18:15:42 INFO Object: This is my first OMF experiment
+ 18:15:42 INFO Object: Starting WiFi OMF6 Experiment events
18:15:42 INFO OmfEc: Newly discovered resource >> 4b8644d3-9a45-4091-a147-651c55f4f15b
- 18:15:52 INFO Object: All my Applications are started now...
+ 18:15:52 INFO Object: All Applications have started...
18:15:52 INFO OmfEc: APP_EVENT STARTED from app otg2_cxt_0 - msg: env -i /usr/bin/otg2 --udp:dst_host 192.168.0.3 --udp:dst_port 3000 --udp:local_host 192.168.0.2 --oml-config /tmp/65e5bf73-4085-4d46-b790-2c2e4b719b70-1366272953.xml
18:15:53 INFO OmfEc: APP_EVENT STARTED from app otr2_cxt_0 - msg: env -i /usr/bin/otr2 --udp:local_host 192.168.0.3 --udp:local_port 3000 --oml-config /tmp/bb4c0edf-7167-4c64-9cbe-c9681332749f-1366272953.xml
18:15:53 INFO OmfEc: APP_EVENT STDERR from app otr2_cxt_0 - msg: INFO OTG2 Traffic Sink 2.9.0-dirty
@@ -530,7 +550,7 @@ results/outputs:
18:15:54 INFO OmfEc: APP_EVENT STDERR from app otr2_cxt_0 - msg: INFO OML Client V2.9.0 [Protocol V3] Copyright 2007-2012, NICTA
18:15:56 INFO OmfEc: APP_EVENT STDERR from app otg2_cxt_0 - msg: INFO Net_stream: attempting to connect to server at tcp://norbit.npc.nicta.com.au:3003
18:15:56 INFO OmfEc: APP_EVENT STDERR from app otr2_cxt_0 - msg: INFO Net_stream: attempting to connect to server at tcp://norbit.npc.nicta.com.au:3003
- 18:16:22 INFO Object: All my Applications are stopped now.
+ 18:16:22 INFO Object: Applications are stopping... Experiment Complete.
18:16:22 INFO OmfEc: Exit in up to 15 seconds...
18:16:22 INFO OmfEc: APP_EVENT DONE.OK from app otr2_cxt_0 - msg: status: pid 1469 exit 0
18:16:22 INFO OmfEc: APP_EVENT DONE.OK from app otg2_cxt_0 - msg: status: pid 1705 exit 0
diff --git a/doc/tutorials/Experiment03.mkd b/doc/tutorials/Experiment03.mkd
new file mode 100644
index 00000000..23a271df
--- /dev/null
+++ b/doc/tutorials/Experiment03.mkd
@@ -0,0 +1,342 @@
+# Experiment 03
+
+
+3. Dynamic Properties *Experiment Tutorial*
+---------------------------
+
+If you are a new OMF user (i.e. an experimenter), you may want to read
+the [OMF sytem overview]
+(http://omf.mytestbed.net/projects/omf/wiki/An_Introduction_to_OMF)
+or the [experimenter overview]
+(http://omf.mytestbed.net/projects/omf/wiki/UsageOverview)
+pages
+
+**Objectives**
+
+After reading this tutorial you should be able to:
+
+- This tutorial shows you how to define and use Experiment Properties
+ within your experiment.
+
+- Experiment Properties allows you to:
+ - pass parameters to your experiment when it starts its execution,
+ via the use of options to the `omf-
+#Welcome to the Dynamic Properties ED
+#This ED allows the experimenter to pass parameters to the experiment and change them at run-time
+
+###############################################################################################
+###############################################################################################
+#Section 1
+#Define application file-paths
+#Define experiment parameters and measurement points
+
+defApplication('otg2') do |app|
+
+ #Application description and binary path
+ app.description = 'otg2 is a configurable traffic generator'
+ app.binary_path = '/usr/bin/otg2'
+
+ #Configurable parameters of Experiment
+ app.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ app.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ app.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ app.defMeasurement('udp_out') do |m|
+
+ end
+end
+
+defApplication('otr2') do |app|
+
+ #Application description and binary path
+ app.description = 'otr2 is a configurable traffic reciever'
+ app.binary_path = '/usr/bin/otr2'
+
+ #Configurable parameters of Experiment
+ app.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+
+ #Define measurement points that application will output
+ app.defMeasurement('udp_in') do |m|
+
+ end
+end
+###############################################################################################
+###############################################################################################
+#Define dynamic properties to be changed by experimenter
+
+defProperty('theSender', 'omf.nicta.node9', "ID of sender node")
+defProperty('theReceiver', 'omf.nicta.node10', "ID of receiver node")
+defProperty('packetsize', 128, "Packet size (byte) from the sender node")
+defProperty('bitrate', 2048, "Bitrate (bit/s) from the sender node")
+defProperty('runtime', 40, "Time in second for the experiment is to run")
+defProperty('wifiType', "g", "The type of WIFI to use in this experiment")
+defProperty('channel', '6', "The WIFI channel to use in this experiment")
+defProperty('netid', "Hello World! Experiment03", "The ESSID to use in this experiment")
+
+###############################################################################################
+###############################################################################################
+#Section 2
+#Define resources and nodes used by application
+
+#Create the group 'Sender' associated to dynamic property
+defGroup('Sender',property.theSender) do |node|
+
+ #Associate application to group (?)
+ node.addApplication("otg2") do |app|
+
+ #Configure aplication
+ app.setProperty('udp_local_host', '192.168.0.2')
+ app.setProperty('udp_dst_host', '192.168.0.3')
+ app.setProperty('udp_dst_port', 3000)
+ app.setProperty('cbr_size', property.packetsize)
+ app.setProperty('cbr_rate', property.bitrate * 2)
+
+ #Request application to collect measurement point output data
+ app.measure('udp_out', :samples => 1)
+
+ end
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = property.wifiType
+ node.net.w0.channel = property.channel
+ node.net.w0.essid = "foo"+property.netid
+ node.net.w0.ip = "192.168.0.2/24"
+end
+
+#Create the group 'Reciever' associated to dynamic property
+defGroup('Reciever',property.theReceiver) do |node|
+
+ #Associate application to group (?)
+ node.addApplication("otr2") do |app|
+
+ #Configure application
+ app.setProperty('udp_local_host', '192.168.0.3')
+ app.setProperty('udp_local_port', 3000)
+
+ #Request application to collect measurement point output data
+ app.measure('udp_in', :samples => 1)
+
+ end
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = property.wifiType
+ node.net.w0.channel = property.channel
+ node.net.w0.essid = "foo"+property.netid
+ node.net.w0.ip = "192.168.0.3/24"
+end
+###############################################################################################
+###############################################################################################
+#Section 3
+#Execution of application events
+
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+
+ info "Starting dynamic properties ED..."
+ wait 10
+
+ allGroups.startApplications
+ info "Applications have started..."
+
+ wait property.runtime / 4
+ property.packetsize = 256
+ wait property.runtime / 4 *2
+ property.packetsize = 512
+ wait property.runtime / 4 *3
+ property.packetsize = 1024
+ wait property.runtime
+
+ allGroups.stopApplications
+ info "Applications are stopping... Experiment complete."
+ Experiment.done
+end
+
+
+
+
+
+
+4. Running the experiment
+-------------------------
+
+- You should see an output similar to the following:
+
+
+
+
+ INFO NodeHandler: OMF Experiment Controller 5.4 (git 97ed1a2)
+ INFO NodeHandler: Slice ID: default_slice (default)
+ INFO NodeHandler: Experiment ID: default_slice-2013-03-06t16.52.50+11.00
+ INFO NodeHandler: Message authentication is disabled
+ INFO Experiment: load system:exp:stdlib
+ INFO property.resetDelay: resetDelay = 210 (Fixnum)
+ INFO property.resetTries: resetTries = 1 (Fixnum)
+ INFO Experiment: load system:exp:eventlib
+ INFO Experiment: load dynamic-properties.rb
+ INFO property.theSender: theSender = "omf.nicta.node9" (String)
+ INFO property.theReceiver: theReceiver = "omf.nicta.node10" (String)
+ INFO property.packetsize: packetsize = 128 (Fixnum)
+ INFO property.bitrate: bitrate = 2048 (Fixnum)
+ INFO property.runtime: runtime = 40 (Fixnum)
+ INFO property.wifiType: wifiType = "g" (String)
+ INFO property.channel: channel = "6" (String)
+ INFO property.netid: netid = "Hello World! Experiment03" (String)
+ INFO Topology: Loading topology 'omf.nicta.node9'.
+ INFO Topology: Loading topology 'omf.nicta.node10'.
+ INFO Experiment: Switching ON resources which are OFF
+ INFO omf.nicta.node9: Device 'net/w0' reported Not-Associated
+ INFO ALL_UP_AND_INSTALLED: Event triggered. Starting the associated tasks.
+ INFO exp: Starting dynamic properties ED...
+ INFO exp: Request from Experiment Script: Wait for 10s....
+ INFO omf.nicta.node10: Device 'net/w0' reported Not-Associated
+ INFO omf.nicta.node9: Device 'net/w0' reported 46:32:28:8A:DA:DD
+ INFO exp: Applications have started...
+ INFO exp: Request from Experiment Script: Wait for 10s....
+ INFO omf.nicta.node10: Device 'net/w0' reported 46:32:28:8A:DA:DD
+ INFO property.packetsize: packetsize = 256 (Fixnum)
+ INFO exp: Request from Experiment Script: Wait for 10s....
+ INFO property.packetsize: packetsize = 512 (Fixnum)
+ INFO exp: Request from Experiment Script: Wait for 10s....
+ INFO property.packetsize: packetsize = 1024 (Fixnum)
+ INFO exp: Request from Experiment Script: Wait for 10s....
+ INFO exp: Applications are stopping... Experiment complete.
+ INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
+ INFO NodeHandler:
+ INFO NodeHandler: Shutting down experiment, please wait...
+ INFO NodeHandler:
+ INFO run: Experiment default_slice-2013-03-06t16.52.50+11.00 finished after 1:3
+
+
+5. The Results
+--------------
+
+During the execution of the experiment, the OTG and OTR applications
+have collected some measurements, as we requested them to do, and sent them to
+the OML2 server that we selected (the --oml-uri option of the EC command line).
+
+### How do you access the measurements?
+
+This depends on how the OML2 server which received your measurements is set up. It can be
+configured to use either a SQLite3 or a PostgreSQL database backend, moreover additional tools
+may have been put in place by your testbed operator to facilitate the access to the result database.
+
+For a detailed description of OML2 server's configuration modes, please
+refer to [the OML2 Documentation](http://mytestbed.net/projects/oml/wiki)
+
+Here is a short example on how you would access your data on the NICTA testbed:
+
+- assuming that the OML2 server was running on the host 'my_oml.com' and was configured to use SQLite3 and stores the result databases in `/var/lib/oml2/`
+- first you need to get access to a console on that host, assuming you have an account 'foo' with the password 'bar':
+
+ ssh foo@my_oml.com # then enter the password 'bar'
+
+- then you use the sqlite3 command to dump your experiment database, which
+is in the file `/var/lib/oml2/your_experiment_id.sq3`. Thus assuming the experiment ID above
+(2013-03-06t16.52.50+11.00):
+
+ sqlite3 /var/lib/oml2/2013-03-06t16.52.50+11.00.sq3 .dump
+
+This will dump the database contents in SQL format to the console. For more information on SQLite3, please refer to its [documentation website]
+(http://www.sqlite.org/docs.html)
+
+### How do I display my measurements in some nice graphs?
+
+We have a separate tool named [**omf_web**]
+(https://github.com/mytestbed/omf_web) which allows you to build
+some custom visualisation of the data collected within your experiment and
+display them within your web browser. For more information on how to
+use that tool, please refer to the [omf_web documentation]
+(https://github.com/mytestbed/omf_web)
+
+6. What should I do next?
+-------------------------
+
+We will soon release more tutorials on how to use all the features of OMF6
+from the experimenter's perspective.
+
+In the meantime, you may have a look at the OMF 5.4 documentation, which
+will not be completely accurate and applicable to OMF 6, but would still give you
+some ideas of the OMF features available for experimenters.
+
+Finally, if you have any questions on how to use OMF 6 or any problems running
+this 'Hello World' wireless tutorial, please join the [OMF Mailing List]
+(https://lists.nicta.com.au/wws/info/omf-user) and post your questions there.
\ No newline at end of file
diff --git a/doc/tutorials/TUTORIAL_04.draft b/doc/tutorials/Experiment04.mkd.draft
similarity index 57%
rename from doc/tutorials/TUTORIAL_04.draft
rename to doc/tutorials/Experiment04.mkd.draft
index 775f6dfe..8a509b8b 100644
--- a/doc/tutorials/TUTORIAL_04.draft
+++ b/doc/tutorials/Experiment04.mkd.draft
@@ -1,3 +1,7 @@
+TUTORIAL
+# Experiment 04
+
+
How to configure or address all resources within a defined group, and use simple substitutions
==============================================================================================
@@ -35,45 +39,110 @@ How to configure or address all resources within a defined group, and use simple
The Experiment Description (ED) describing this simple experiment is
(download it here: attachment:using-groups.rb):
-
- defGroup('Sender', "omf.nicta.node2") do |node|
- node.addApplication("test:app:otg2") do |app|
- app.setProperty('udp:local_host', '%net.w0.ip%')
- app.setProperty('udp:dst_host', '192.168.255.255')
- app.setProperty('udp:broadcast', 1)
- app.setProperty('udp:dst_port', 3000)
- app.measure('udp_out', :samples => 1)
- end
+
+#Welcome to Experiment 04
+#This script allows experimenters to configure or address all resources within a defined group ane use simple substitutions
+
+#Section 1
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otr2') do |app|
+
+ #Application description and binary path
+ app.binary_path = "/usr/bin/otr2"
+ app.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ app.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ app.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
end
-
- defGroup('Receiver', "omf.nicta.node3") do |node|
- node.addApplication("test:app:otr2") do |app|
- app.setProperty('udp:local_host', '192.168.255.255')
- app.setProperty('udp:local_port', 3000)
- app.measure('udp_in', :samples => 1)
- end
+end
+
+#Define otg2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otg2') do |app|
+
+ #Application description and binary path
+ app.binary_path = "/usr/bin/otg2"
+ app.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ app.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ app.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ app.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ app.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ app.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ app.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ app.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ app.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ app.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ app.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ app.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
end
-
- allGroups.net.w0 do |interface|
- interface.mode = "adhoc"
- interface.type = 'g'
- interface.channel = "6"
- interface.essid = "helloworld"
- interface.ip = "192.168.0.%index%"
+end
+
+#Section 2
+#Define resources and nodes used by application
+defGroup('Sender', "omf.nicta.node9") do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '%net.w0.ip%')
+ app.setProperty('udp_dst_host', '192.168.255.255')
+ app.setProperty('udp_broadcast', 1)
+ app.setProperty('udp_dst_port', 3000)
+ app.measure('udp_out', :samples => 1)
end
+end
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
- wait 10
- group("Receiver").startApplications
- wait 5
- group("Sender").startApplications
- wait 30
- group("Sender").stopApplications
- wait 5
- group("Receiver").stopApplications
- Experiment.done
+defGroup('Receiver', "omf.nicta.node10,omf.nicta.node11") do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.255.255')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :samples => 1)
end
-
+end
+
+#Not implemented in OMF6 - New syntax required for experiment to work
+allGroups.net.w0 do |interface|
+ interface.mode = "adhoc"
+ interface.type = 'g'
+ interface.channel = "6"
+ interface.essid = "Hello World! Experiment04"
+ interface.ip = "192.168.0.%index%"
+end
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ after 10
+ group("Receiver").startApplications
+ after 15
+ group("Sender").startApplications
+ after 45
+ group("Sender").stopApplications
+ after 50
+ group("Receiver").stopApplications
+ Experiment.done
+end
+
+
The Experiment Description (ED) describing this simple experiment is
(download it here: attachment:using-groups.rb):
diff --git a/doc/tutorials/TUTORIAL_05.draft b/doc/tutorials/Experiment05.mkd.draft
similarity index 87%
rename from doc/tutorials/TUTORIAL_05.draft
rename to doc/tutorials/Experiment05.mkd.draft
index 6eb29c89..da2cf30f 100644
--- a/doc/tutorials/TUTORIAL_05.draft
+++ b/doc/tutorials/Experiment05.mkd.draft
@@ -1,3 +1,6 @@
+TUTORIAL
+# Experiment 05
+
How to use your own or a 3rd party application with OMF
=======================================================
@@ -43,44 +46,49 @@ How to use your own or a 3rd party application with OMF
-
- defApplication('test:app:otg2', 'otg2') do |a|
-
- a.path = "/usr/bin/otg2"
- app.appPackage = "/home/myUsername/myArchive.tar"
- a.version(1, 1, 3)
- a.shortDescription = "Programmable traffic generator v2"
- a.description = "OTG is a configurable traffic generator."
-
- # Define the properties that can be configured for this application
- #
- # syntax: defProperty(name = :mandatory, description = nil, parameter = nil, options = {})
- #
- a.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
- a.defProperty('udp:broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
- a.defProperty('udp:dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
- a.defProperty('udp:dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
- a.defProperty('udp:local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
- a.defProperty('udp:local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
- a.defProperty("cbr:size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
- a.defProperty("cbr:rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
- a.defProperty("exp:size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
- a.defProperty("exp:rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
- a.defProperty("exp:ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
- a.defProperty("exp:offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
-
- # Define the Measurement Points and associated metrics that are available for this application
- #
- a.defMeasurement('udp_out') do |m|
+
+#Welcome to Experiment 05
+#This ED will allow the experimenter to install a 3rd party application on specified nodes
+#The otg2 application will be used as an example in this ED
+
+#Section 1
+#Define the file path of application
+#Define experiment parameters and measurement points
+
+defApplication('otg2') do |app|
+
+ app.binary_path = "/usr/bin/otg2"
+ app.appPackage = "http://extant.me/dev/path/to/archive.tar"
+ app.description = "Programmable traffic generator v2"
+ app.description = "OTG is a configurable traffic generator."
+
+ #Define the properties that can be configured for this application
+ #syntax: defProperty(name = :mandatory, description = nil, parameter = nil, options = {})
+ app.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ app.defProperty('udp:broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ app.defProperty('udp:dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp:dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ app.defProperty('udp:local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp:local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ app.defProperty("cbr:size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ app.defProperty("cbr:rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ app.defProperty("exp:size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ app.defProperty("exp:rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ app.defProperty("exp:ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ app.defProperty("exp:offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define the Measurement Points and associated metrics that are available for this application
+ app.defMeasurement('udp_out') do |m|
m.defMetric('ts',:float)
m.defMetric('flow_id',:long)
m.defMetric('seq_no',:long)
m.defMetric('pkt_length',:long)
m.defMetric('dst_host',:string)
m.defMetric('dst_port',:long)
- end
end
-
+end
+
+
- **Line 1**: declares the URI and name for your OMF Application
definition:
diff --git a/doc/tutorials/TUTORIAL_06.draft b/doc/tutorials/Experiment06.mkd.draft
similarity index 66%
rename from doc/tutorials/TUTORIAL_06.draft
rename to doc/tutorials/Experiment06.mkd.draft
index 418fc833..63a4308f 100644
--- a/doc/tutorials/TUTORIAL_06.draft
+++ b/doc/tutorials/Experiment06.mkd.draft
@@ -1,3 +1,6 @@
+TUTORIAL
+# Experiment 06
+
How to use Filters to customise your Measurement Collection
===========================================================
@@ -50,55 +53,125 @@ How to use Filters to customise your Measurement Collection
The Experiment Description (ED) describing this simple experiment is
(download it here: attachment:using-filters.rb):
-
- defProperty('theSender', 'omf.nicta.node1', "ID of sender node")
- defProperty('theReceiver', 'omf.nicta.node2', "ID of receiver node")
- defProperty('packetsize', 256, "Packet size (byte) from the sender node")
- defProperty('runtime', 30, "Time in second for the experiment is to run")
-
- defGroup('Sender',property.theSender) do |node|
- node.addApplication("test:app:otg2") do |app|
- app.setProperty('udp:local_host', '192.168.0.2')
- app.setProperty('udp:dst_host', '192.168.0.3')
- app.setProperty('udp:dst_port', 3000)
- app.setProperty('cbr:size', property.packetsize)
+
+#Welcome to Experiment 06
+#This ED will allow the experimenter to create a filter to customise measurements collected
+#Section 1
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+
+defApplication('otr2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otr2"
+ a.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ a.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+ end
+end
+
+#Define otg2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otg2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otg2"
+ a.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ a.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ a.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ a.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ a.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
+ end
+end
+
+#Section 2
+#Define resources and nodes used by application
+defProperty('theSender', 'omf.nicta.node9', "ID of sender node")
+defProperty('theReceiver', 'omf.nicta.node10', "ID of receiver node")
+defProperty('packetsize', 256, "Packet size (byte) from the sender node")
+defProperty('runtime', 30, "Time in second for the experiment is to run")
+
+defGroup('Sender',property.theSender) do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.2')
+ app.setProperty('udp_dst_host', '192.168.0.3')
+ app.setProperty('udp_dst_port', 3000)
+ app.setProperty('cbr_size', property.packetsize)
app.measure('udp_out', :samples => 3) do |mp|
- mp.filter('seq_no', 'avg')
+ mp.filter('seq_no', 'avg')
end
- end
- node.net.w0.mode = "adhoc"
- node.net.w0.type = 'g'
- node.net.w0.channel = "6"
- node.net.w0.essid = "helloworld"
- node.net.w0.ip = "192.168.0.2"
end
-
- defGroup('Receiver',property.theReceiver) do |node|
- node.addApplication("test:app:otr2") do |app|
- app.setProperty('udp:local_host', '192.168.0.3')
- app.setProperty('udp:local_port', 3000)
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = 'g'
+ node.net.w0.channel = "6"
+ node.net.w0.essid = "Hello World! Experiment06"
+ node.net.w0.ip = "192.168.0.2/24"
+end
+
+defGroup('Receiver',property.theReceiver) do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.3')
+ app.setProperty('udp_local_port', 3000)
app.measure('udp_in', :samples => 2) do |mp|
- mp.filter('pkt_length', 'sum')
- mp.filter('seq_no', 'avg')
+ mp.filter('pkt_length', 'sum')
+ mp.filter('seq_no', 'avg')
end
- end
- node.net.w0.mode = "adhoc"
- node.net.w0.type = 'g'
- node.net.w0.channel = "6"
- node.net.w0.essid = "helloworld"
- node.net.w0.ip = "192.168.0.3"
- end
-
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
- wait 10
- allGroups.startApplications
- wait property.runtime / 2
- property.packetsize = 512
- wait property.runtime / 2
- allGroups.stopApplications
- Experiment.done
end
-
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = 'g'
+ node.net.w0.channel = "6"
+ node.net.w0.essid = "Hello World! Experiment06"
+ node.net.w0.ip = "192.168.0.3/24"
+end
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ info "Starting experiment events..."
+
+ after 10
+ allGroups.startApplications
+ info "All Applications have started..."
+
+ after property.runtime / 2
+ property.packetsize = 512
+ after property.runtime / 2
+
+ allGroups.stopApplications
+ info "Applications are stopping... Experiment Complete."
+ Experiment.done
+end
+
+ exec` command line
- - change values of these parameters dynamically, while your
- experiment is running
-
-3. Scenario
------------
-
-- Here we are using the same simple scenario as in the
- [[BasicTutorialStage0-5-4|basic “Hello World” tutorial]].
-
-- We will modify this example, to allow us to:
- - define some of the attributes of this experiment as parameters,
- aka *properties*
- - assign values to these *properties*
- - change these values at runtime, i.e. while the experiment is
- running
-
-4. The New “Hello World” Experiment Description
------------------------------------------------
-
-The Experiment Description (ED) describing this simple experiment is:
-
-
- defProperty('theSender', 'omf.nicta.node1', "ID of sender node")
- defProperty('theReceiver', 'omf.nicta.node2', "ID of receiver node")
- defProperty('packetsize', 128, "Packet size (byte) from the sender node")
- defProperty('bitrate', 2048, "Bitrate (bit/s) from the sender node")
- defProperty('runtime', 40, "Time in second for the experiment is to run")
- defProperty('wifiType', "g", "The type of WIFI to use in this experiment")
- defProperty('channel', '6', "The WIFI channel to use in this experiment")
- defProperty('netid', "example2", "The ESSID to use in this experiment")
-
- defGroup('Sender',property.theSender) do |node|
- node.addApplication("test:app:otg2") do |app|
- app.setProperty('udp:local_host', '192.168.0.2')
- app.setProperty('udp:dst_host', '192.168.0.3')
- app.setProperty('udp:dst_port', 3000)
- app.setProperty('cbr:size', property.packetsize)
- app.setProperty('cbr:rate', property.bitrate * 2)
- app.measure('udp_out', :samples => 1)
- end
- node.net.w0.mode = "adhoc"
- node.net.w0.type = property.wifiType
- node.net.w0.channel = property.channel
- node.net.w0.essid = "foo"+property.netid
- node.net.w0.ip = "192.168.0.2"
- end
-
- defGroup('Receiver',property.theReceiver) do |node|
- node.addApplication("test:app:otr2") do |app|
- app.setProperty('udp:local_host', '192.168.0.3')
- app.setProperty('udp:local_port', 3000)
- app.measure('udp_in', :samples => 1)
- end
- node.net.w0.mode = "adhoc"
- node.net.w0.type = property.wifiType
- node.net.w0.channel = property.channel
- node.net.w0.essid = "foo"+property.netid
- node.net.w0.ip = "192.168.0.3"
- end
-
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
- info "This is my first OMF experiment"
- wait 10
- allGroups.startApplications
- info "All my Applications are started now..."
- wait property.runtime / 4
- property.packetsize = 256
- wait property.runtime / 4
- property.packetsize = 512
- wait property.runtime / 4
- property.packetsize = 1024
- wait property.runtime / 4
- allGroups.stopApplications
- info "All my Applications are stopped now."
- Experiment.done
- end
-
-
-This ED is available for download here: attachment:dynamic-properties.rb
-
-- **Line 1-8**: define 8 Experiment Properties, i.e. parameters to the
- experiment, and set their default values and descriptions
- - Line 1: defines a property named `theSender`, which has a
- default value `omf.nicta.node1`. This parameter represents the
- ID of the node to use as a sender in “Hello World”.
- - Line 3: defines the `packetsize` property, which has a default
- integer value `128`. It represents the packet size in bytes
- which the sender in “Hello World” will use to generates its UDP
- traffic.
- - Line 7: we define the `channel` property, which as a default
- string value `6`, i.e. the 802.11 channel to use in “Hello
- World”
- - etc…
-
-\* **Line 10-24**: we use these Experiment Properties in our definition
-and configuration of the `Sender` group. These lines show you multiple
-examples on how to use Experiment Properties. For example:\
-**\* we use the syntax: `property.name` to access the value of the
-property called `name` \
-**\* we use the same syntax to assign an Experiment Property to an
-application parameter (e.g. Line 15)\
-**\* we use operations with Experiment Properties as arguments\
-****\* Line 22: the addition of a property to a string returns this
-string concatenated with the string representation of that property.\
-****\* Line 16: arithmetic operations involving a properties and an
-integer/float are allowed .
-\
-** **Line 39-54**: we dynamically change the value of the `packetsize`
-property during the execution of the experiment.\
-**\* Line 44: we let the experiment run for a quarter of the time with
-the initial “packetsize” value\
-**\* Line 45: we change the value of the “packetsize” property\
-**\* Line 46: we let the experiment run for another quarter of the time\
-**\* etc…
-
-- **How does the dynamic update of a property work?**
- - First you assign an Experiment Property to an application
- parameters (line 15)
- - Later, when you change the value of that property (line 45), a
- string line is sent to the Standard-In input of that application
- - Here for example, line 45 triggers the string line “cbr:size
- 256” to be written to the Standard-In input of the application
- otg2 used by the “Sender” group
- - Prerequisites for this to work:
- - Your application (otg2 in this example) needs to be able to
- received and interprets strings on its Standard-In input,
- while it is running. This should be easy to implement in
- your own applications.
- - This mechanism **only** works when you assign directly the
- Experiment Property as the application parameter as in Line
- 15!
- - If you use an operation as part of this assignment (e.g.line
- 16), then your application parameter will be assigned the
- resulting value of that operation. Thus, any change in the
- used Experiment Property **will not** result in a dynamic
- application parameter change
- - for example, calling `property.bitrate = 1024` in the
- tasks declaration (line 39-54) will not result in the
- dynamic update of the application’s bitrate parameter.
-
-- **Important**
- - There are a few reserved names that are used by the EC or Ruby,
- and which **cannot** be used to name Experiment Properties
- - A list of these names can be found on [[ReservedKeywords|the
- reserved names and keywords list]].
-
-- **Finally…** Please refer to the [[BasicTutorialStage0-5-4|basic
- “Hello World” tutorial]] if you do not understand the remaining
- lines of the above ED.
-
-5. Running the experiment
--------------------------
-
-### 5.1. How to run it
-
-Please refer to the [[BasicTutorialStage0-5-4|basic “Hello World”
-tutorial]] and the [[GettingStarted|Getting Started page]] to find out
-how to run an experiment with OMF. Here we assume that you have the
-above ED saved in the file named `dynamic-properties.rb`.
-
-\* if you want to run the experiment using the default values for all
-the properties (as defined in line 1-8):\
-
- omf-
- INFO NodeHandler: OMF Experiment Controller 5.4 (git 97ed1a2)
- INFO NodeHandler: Slice ID: default_slice (default)
- INFO NodeHandler: Experiment ID: default_slice-2013-03-06t16.52.50+11.00
- INFO NodeHandler: Message authentication is disabled
- INFO Experiment: load system:exp:stdlib
- INFO property.resetDelay: resetDelay = 210 (Fixnum)
- INFO property.resetTries: resetTries = 1 (Fixnum)
- INFO Experiment: load system:exp:eventlib
- INFO Experiment: load dynamic-properties.rb
- INFO property.theSender: theSender = "omf.nicta.node36" (String)
- INFO property.theReceiver: theReceiver = "omf.nicta.node37" (String)
- INFO property.packetsize: packetsize = 128 (Fixnum)
- INFO property.bitrate: bitrate = 2048 (Fixnum)
- INFO property.runtime: runtime = 40 (Fixnum)
- INFO property.wifiType: wifiType = "g" (String)
- INFO property.channel: channel = "6" (String)
- INFO property.netid: netid = "example2" (String)
- INFO Topology: Loading topology 'omf.nicta.node36'.
- INFO Topology: Loading topology 'omf.nicta.node37'.
- INFO Experiment: Switching ON resources which are OFF
- INFO omf.nicta.node36: Device 'net/w0' reported Not-Associated
- INFO ALL_UP_AND_INSTALLED: Event triggered. Starting the associated tasks.
- INFO exp: This is my first OMF experiment
- INFO exp: Request from Experiment Script: Wait for 10s....
- INFO omf.nicta.node37: Device 'net/w0' reported Not-Associated
- INFO omf.nicta.node36: Device 'net/w0' reported 46:32:28:8A:DA:DD
- INFO exp: All my Applications are started now...
- INFO exp: Request from Experiment Script: Wait for 10s....
- INFO omf.nicta.node37: Device 'net/w0' reported 46:32:28:8A:DA:DD
- INFO property.packetsize: packetsize = 256 (Fixnum)
- INFO exp: Request from Experiment Script: Wait for 10s....
- INFO property.packetsize: packetsize = 512 (Fixnum)
- INFO exp: Request from Experiment Script: Wait for 10s....
- INFO property.packetsize: packetsize = 1024 (Fixnum)
- INFO exp: Request from Experiment Script: Wait for 10s....
- INFO exp: All my Applications are stopped now.
- INFO EXPERIMENT_DONE: Event triggered. Starting the associated tasks.
- INFO NodeHandler:
- INFO NodeHandler: Shutting down experiment, please wait...
- INFO NodeHandler:
- INFO run: Experiment default_slice-2013-03-06t16.52.50+11.00 finished after 1:3
-
-
-6. The Results
---------------
-
-- Please refer to the [[BasicTutorialStage0-5-4|“Hello World”
- tutorial]] to find out how to access and use your result database
- - you can download an example of a database produced by this
- experiment here: attachment:myDatabase
-
-- Following the same example as in the
- [[BasicTutorialStage0-5-4|“Hello World” tutorial]], where you can
- configure and run visualisation server for this experiment
-
-- To create a new widget to show packet size variation, simple add
- following to the config yaml file.
-
-
- \
-- name: Incoming UDP packet size \
-type: line\_chart \
-data: otg2\_udp\_out \
-mapping: \
-x: oml\_seq \
-y: pkt\_length \
-group\_by: oml\_sender\_id
-
-
-
-
-- Once visualisation server started, the widget we just defined should
- look like this:
-
- ![]()
-
-- On this graph, we can see the packet size of the incoming UDP
- traffic increasing in steps every 10 sec during our 40-sec
- experiment.
-
-7. What is Next?
-----------------
-
-Now that you know how to use Experiment Properties, you may want to read
-the following basic OMF tutorials. Each one of them is introducing an
-OMF feature, using the simple “Hello World” experiment as a base. You do
-not need to follow them in the order suggested below.
-
-- [[BasicTutorialStage0-5-4|How to describe and run a simple wireless
- experiment]] - ([[BasicTutorialStage0-5-4|wired version]])
-
-- [[BasicTutorialStage1-5-4|How to pass parameters to your experiment,
- and change them at run-time]]
-
-- [[BasicTutorialStage2-5-3|How to configure or address all resources
- within a defined group, and use simple substitutions]]
-
-- [[BasicTutorialStage3-5-3|How to use your own or a 3rd party
- application with OMF]]
-
-- [[BasicTutorialStage4-5-3|How to use Measurement Filters to
- customise your Measurement]]
-
-- [[BasicTutorialStage5-5-3|How to use Prototypes to specify
- particular Applications]]
-
-- [[BasicTutorialStage6-5-3|How to save a disk image]]
-
-- [[BasicTutorialStage7-5-3|How to load a disk image]]
-
-And finally, a “Conference Room” scenario which combines all of the
-above features:
-
-- [[BasicTutorialStage8-5-3|The Conference Room tutorial]]
-
-* * * * *
diff --git a/doc/tutorials/experiment01.rb b/doc/tutorials/experiment01.rb
new file mode 100644
index 00000000..4769b7b4
--- /dev/null
+++ b/doc/tutorials/experiment01.rb
@@ -0,0 +1,72 @@
+#Welcome to Experiment 01
+#This ED allows experimenters to ping a specified host and collect the output it recieves as measurement points
+
+
+#Section 1
+#Define oml2 application file-paths
+#Define experiment parameters and measurement points
+
+defApplication('ping_oml2') do |app|
+
+ #Application description and binary path
+ app.description = 'Simple definition of ping-oml2 application'
+ app.binary_path = '/usr/bin/ping-oml2'
+
+ #Configurable parameters of Experiment
+ app.defProperty('target', 'Address to ping', '-a', {:type => :string})
+ app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
+
+
+ #Define measurement points that application will output
+ app.defMeasurement('ping') do |m|
+ m.defMetric('dest_addr',:string)
+ m.defMetric('ttl',:uint32)
+ m.defMetric('rtt',:double)
+ m.defMetric('rtt_unit',:string)
+
+ end
+end
+
+#Section 2
+#Define resources and nodes used by oml2 application
+
+#Create the group 'Sender' with specified nodes
+defGroup('Sender', 'omf.nicta.node9') do |g|
+
+ #Associate oml2 application to group (?)
+ g.addApplication("ping_oml2") do |app|
+
+ #Configure target of application (Ping target)
+ app.setProperty('target', 'www.nicta.com.au')
+
+ #Configure amount of times to ping host
+ app.setProperty('count', 3)
+
+ #Request application to collect measurement point output data
+ app.measure('ping', :samples => 1)
+
+ end
+end
+
+#Section 3
+#Execution of application events
+
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+
+ # Print information message on commandline
+ info "Initializing first OMF experiment event"
+
+ # Start all the Applications associated to all the Group
+ allGroups.startApplications
+
+ # Wait for 5 sec (allowing time for 3 pings)
+ after 5
+
+ # Stop all the Applications associated to all the Groups
+ allGroups.stopApplications
+
+ # Tell the Experiment Controller to terminate the experiment now
+ Experiment.done
+end
+
+
diff --git a/doc/tutorials/experiment02.rb b/doc/tutorials/experiment02.rb
new file mode 100644
index 00000000..a916fba5
--- /dev/null
+++ b/doc/tutorials/experiment02.rb
@@ -0,0 +1,110 @@
+#Welcome to experiment 02: 'Hello World' Wireless
+#This script creates a simple wireless networking experiment
+
+#Section 1
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+
+defApplication('otr2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otr2"
+ a.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ a.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+ end
+end
+
+#Define otg2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otg2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otg2"
+ a.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ a.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ a.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ a.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ a.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
+ end
+end
+
+#Section 2
+#Define resources and nodes used by application
+
+#Define configuration of wireless 'sender'
+defGroup('Sender', "omf.nicta.node9") do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.2')
+ app.setProperty('udp_dst_host', '192.168.0.3')
+ app.setProperty('udp_dst_port', 3000)
+ app.measure('udp_out', :interval => 3)
+ end
+
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = 'g'
+ node.net.w0.channel = "6"
+ node.net.w0.essid = "Hello World!"
+ node.net.w0.ip = "192.168.0.2/24"
+end
+
+#Define configuration of wireless 'reciever'
+defGroup('Receiver', "omf.nicta.node10") do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.3')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :interval => 3)
+ end
+
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = 'g'
+ node.net.w0.channel = "6"
+ node.net.w0.essid = "Hello World! Experiment02"
+ node.net.w0.ip = "192.168.0.3/24"
+end
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ info "Starting WiFi OMF6 Experiment events"
+
+ after 10 do
+ allGroups.startApplications
+ info "All Applications have started..."
+
+ end
+ after 40 do
+ allGroups.stopApplications
+ info "Applications are stopping... Experiment Complete."
+ Experiment.done
+ end
+end
\ No newline at end of file
diff --git a/doc/tutorials/experiment03.rb b/doc/tutorials/experiment03.rb
new file mode 100644
index 00000000..3763cfc2
--- /dev/null
+++ b/doc/tutorials/experiment03.rb
@@ -0,0 +1,130 @@
+#Welcome to the Dynamic Properties ED
+#This ED allows the experimenter to pass parameters to the experiment and change them at run-time
+
+###############################################################################################
+###############################################################################################
+#Section 1
+#Define application file-paths
+#Define experiment parameters and measurement points
+
+defApplication('otg2') do |app|
+
+ #Application description and binary path
+ app.description = 'otg2 is a configurable traffic generator'
+ app.binary_path = '/usr/bin/otg2'
+
+ #Configurable parameters of Experiment
+ app.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ app.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ app.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ app.defMeasurement('udp_out') do |m|
+
+ end
+end
+
+defApplication('otr2') do |app|
+
+ #Application description and binary path
+ app.description = 'otr2 is a configurable traffic reciever'
+ app.binary_path = '/usr/bin/otr2'
+
+ #Configurable parameters of Experiment
+ app.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+
+ #Define measurement points that application will output
+ app.defMeasurement('udp_in') do |m|
+
+ end
+end
+###############################################################################################
+###############################################################################################
+#Define dynamic properties to be changed by experimenter
+
+defProperty('theSender', 'omf.nicta.node9', "ID of sender node")
+defProperty('theReceiver', 'omf.nicta.node10', "ID of receiver node")
+defProperty('packetsize', 128, "Packet size (byte) from the sender node")
+defProperty('bitrate', 2048, "Bitrate (bit/s) from the sender node")
+defProperty('runtime', 40, "Time in second for the experiment is to run")
+defProperty('wifiType', "g", "The type of WIFI to use in this experiment")
+defProperty('channel', '6', "The WIFI channel to use in this experiment")
+defProperty('netid', "Hello World! Experiment03", "The ESSID to use in this experiment")
+
+###############################################################################################
+###############################################################################################
+#Section 2
+#Define resources and nodes used by application
+
+#Create the group 'Sender' associated to dynamic property
+defGroup('Sender',property.theSender) do |node|
+
+ #Associate application to group (?)
+ node.addApplication("otg2") do |app|
+
+ #Configure aplication
+ app.setProperty('udp_local_host', '192.168.0.2')
+ app.setProperty('udp_dst_host', '192.168.0.3')
+ app.setProperty('udp_dst_port', 3000)
+ app.setProperty('cbr_size', property.packetsize)
+ app.setProperty('cbr_rate', property.bitrate * 2)
+
+ #Request application to collect measurement point output data
+ app.measure('udp_out', :samples => 1)
+
+ end
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = property.wifiType
+ node.net.w0.channel = property.channel
+ node.net.w0.essid = "foo"+property.netid
+ node.net.w0.ip = "192.168.0.2/24"
+end
+
+#Create the group 'Reciever' associated to dynamic property
+defGroup('Reciever',property.theReceiver) do |node|
+
+ #Associate application to group (?)
+ node.addApplication("otr2") do |app|
+
+ #Configure application
+ app.setProperty('udp_local_host', '192.168.0.3')
+ app.setProperty('udp_local_port', 3000)
+
+ #Request application to collect measurement point output data
+ app.measure('udp_in', :samples => 1)
+
+ end
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = property.wifiType
+ node.net.w0.channel = property.channel
+ node.net.w0.essid = "foo"+property.netid
+ node.net.w0.ip = "192.168.0.3/24"
+end
+###############################################################################################
+###############################################################################################
+#Section 3
+#Execution of application events
+
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+
+ info "Starting dynamic properties ED..."
+ wait 10
+
+ allGroups.startApplications
+ info "Applications have started..."
+
+ wait property.runtime / 4
+ property.packetsize = 256
+ wait property.runtime / 4 *2
+ property.packetsize = 512
+ wait property.runtime / 4 *3
+ property.packetsize = 1024
+ wait property.runtime
+
+ allGroups.stopApplications
+ info "Applications are stopping... Experiment complete."
+ Experiment.done
+end
\ No newline at end of file
diff --git a/doc/tutorials/experiment04.rb b/doc/tutorials/experiment04.rb
new file mode 100644
index 00000000..7b474d42
--- /dev/null
+++ b/doc/tutorials/experiment04.rb
@@ -0,0 +1,101 @@
+#Welcome to Experiment 04
+#This script allows experimenters to configure or address all resources within a defined group ane use simple substitutions
+
+#Section 1
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otr2') do |app|
+
+ #Application description and binary path
+ app.binary_path = "/usr/bin/otr2"
+ app.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ app.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ app.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+ end
+end
+
+#Define otg2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otg2') do |app|
+
+ #Application description and binary path
+ app.binary_path = "/usr/bin/otg2"
+ app.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ app.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ app.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ app.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ app.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ app.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ app.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ app.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ app.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ app.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ app.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ app.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
+ end
+end
+
+#Section 2
+#Define resources and nodes used by application
+defGroup('Sender', "omf.nicta.node9") do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '%net.w0.ip%')
+ app.setProperty('udp_dst_host', '192.168.255.255')
+ app.setProperty('udp_broadcast', 1)
+ app.setProperty('udp_dst_port', 3000)
+ app.measure('udp_out', :samples => 1)
+ end
+end
+
+defGroup('Receiver', "omf.nicta.node10,omf.nicta.node11") do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.255.255')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :samples => 1)
+ end
+end
+
+#Not implemented in OMF6 - New syntax required for experiment to work
+allGroups.net.w0 do |interface|
+ interface.mode = "adhoc"
+ interface.type = 'g'
+ interface.channel = "6"
+ interface.essid = "Hello World! Experiment04"
+ interface.ip = "192.168.0.%index%"
+end
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ after 10
+ group("Receiver").startApplications
+ after 15
+ group("Sender").startApplications
+ after 45
+ group("Sender").stopApplications
+ after 50
+ group("Receiver").stopApplications
+ Experiment.done
+end
diff --git a/doc/tutorials/experiment05.rb b/doc/tutorials/experiment05.rb
new file mode 100644
index 00000000..291e48a1
--- /dev/null
+++ b/doc/tutorials/experiment05.rb
@@ -0,0 +1,40 @@
+#Welcome to Experiment 05
+#This ED will allow the experimenter to install a 3rd party application on specified nodes
+#The otg2 application will be used as an example in this ED
+
+#Section 1
+#Define the file path of application
+#Define experiment parameters and measurement points
+
+defApplication('otg2') do |app|
+
+ app.binary_path = "/usr/bin/otg2"
+ app.appPackage = "http://extant.me/dev/path/to/archive.tar"
+ app.description = "Programmable traffic generator v2"
+ app.description = "OTG is a configurable traffic generator."
+
+ #Define the properties that can be configured for this application
+ #syntax: defProperty(name = :mandatory, description = nil, parameter = nil, options = {})
+ app.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ app.defProperty('udp:broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ app.defProperty('udp:dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp:dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ app.defProperty('udp:local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ app.defProperty('udp:local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ app.defProperty("cbr:size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ app.defProperty("cbr:rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ app.defProperty("exp:size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ app.defProperty("exp:rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ app.defProperty("exp:ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ app.defProperty("exp:offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define the Measurement Points and associated metrics that are available for this application
+ app.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+ end
+end
diff --git a/doc/tutorials/experiment06.rb b/doc/tutorials/experiment06.rb
new file mode 100644
index 00000000..7b0deac1
--- /dev/null
+++ b/doc/tutorials/experiment06.rb
@@ -0,0 +1,116 @@
+#Welcome to Experiment 06
+#This ED will allow the experimenter to create a filter to customise measurements collected
+#Section 1
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+
+defApplication('otr2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otr2"
+ a.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ a.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+ end
+end
+
+#Define otg2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otg2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otg2"
+ a.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ a.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ a.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ a.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ a.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
+ end
+end
+
+#Section 2
+#Define resources and nodes used by application
+defProperty('theSender', 'omf.nicta.node9', "ID of sender node")
+defProperty('theReceiver', 'omf.nicta.node10', "ID of receiver node")
+defProperty('packetsize', 256, "Packet size (byte) from the sender node")
+defProperty('runtime', 30, "Time in second for the experiment is to run")
+
+defGroup('Sender',property.theSender) do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.2')
+ app.setProperty('udp_dst_host', '192.168.0.3')
+ app.setProperty('udp_dst_port', 3000)
+ app.setProperty('cbr_size', property.packetsize)
+ app.measure('udp_out', :samples => 3) do |mp|
+ mp.filter('seq_no', 'avg')
+ end
+ end
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = 'g'
+ node.net.w0.channel = "6"
+ node.net.w0.essid = "Hello World! Experiment06"
+ node.net.w0.ip = "192.168.0.2/24"
+end
+
+defGroup('Receiver',property.theReceiver) do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.3')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :samples => 2) do |mp|
+ mp.filter('pkt_length', 'sum')
+ mp.filter('seq_no', 'avg')
+ end
+ end
+ node.net.w0.mode = "adhoc"
+ node.net.w0.type = 'g'
+ node.net.w0.channel = "6"
+ node.net.w0.essid = "Hello World! Experiment06"
+ node.net.w0.ip = "192.168.0.3/24"
+end
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ info "Starting experiment events..."
+
+ after 10
+ allGroups.startApplications
+ info "All Applications have started..."
+
+ after property.runtime / 2
+ property.packetsize = 512
+ after property.runtime / 2
+
+ allGroups.stopApplications
+ info "Applications are stopping... Experiment Complete."
+ Experiment.done
+end
\ No newline at end of file
diff --git a/doc/tutorials/experiment07.rb b/doc/tutorials/experiment07.rb
new file mode 100644
index 00000000..86e85f52
--- /dev/null
+++ b/doc/tutorials/experiment07.rb
@@ -0,0 +1,54 @@
+#Welcome to Experiment 07
+#This ED will allow the experimenter to use OMF Prototypes to specify the Application
+#A Prototype is a specialized version of your applicationwith preset parameters and measurement collection points
+
+defGroup('CBR_Sender', "omf.nicta.node9") do |node|
+ options = { 'localHost' => '%net.w0.ip%',
+ 'destinationHost' => '192.168.255.255',
+ 'packetSize' => 256 }
+ node.addPrototype("cbr_generator", options)
+end
+
+defGroup('EXPO_Sender', "omf.nicta.node9") do |node|
+ options = { 'localHost' => '%net.w0.ip%',
+ 'destinationHost' => '192.168.255.255',
+ 'packetSize' => 1024 }
+ node.addPrototype("expo_generator", options)
+end
+
+defGroup('Receiver', "omf.nicta.node10") do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.255.255')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :samples => 1)
+ end
+end
+
+#Currently not working
+allGroups.net.w0 do |interface|
+ interface.mode = "adhoc"
+ interface.type = 'g'
+ interface.channel = "6"
+ interface.essid = "Hello World! Experiment07"
+ interface.ip = "192.168.0.%index%"
+end
+
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ after 10
+ info "Starting the Receiver"
+ group("Receiver").startApplications
+ info "Starting the EXPO-traffic Sender"
+ group("EXPO_Sender").startApplications
+ after 50
+ info "Stopping the EXPO-traffic Sender"
+ group("EXPO_Sender").stopApplications
+ after 55
+ info "Starting the CBR-traffic Sender"
+ group("CBR_Sender").startApplications
+ after 95
+ info "Now stopping all everything"
+ #allGroups.stopApplications
+ group("CBR_Sender").stopApplications
+ group("Receiver").stopApplications
+ Experiment.done
+end
\ No newline at end of file
diff --git a/doc/tutorials/experiment08.rb b/doc/tutorials/experiment08.rb
new file mode 100644
index 00000000..ad69712e
--- /dev/null
+++ b/doc/tutorials/experiment08.rb
@@ -0,0 +1,141 @@
+#Welcome to Experiment 08: THE CONFERENCE ROOM
+
+#Section 1
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otr2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otr2"
+ a.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ a.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+ end
+end
+
+#Define otg2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otg2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otg2"
+ a.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ a.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ a.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ a.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ a.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
+ end
+end
+
+#Section 2
+#Define resources and nodes used by application
+defProperty('hrnPrefix', "omf.nicta.node", "Prefix to use for the HRN of resources")
+defProperty('resources', "[1,2,3,4,5,8,9,10,11,12,13]", "List of IDs for the resources to use as senders")
+defProperty('receiver', "6", "ID for the resource to use as a receiver")
+defProperty('groupSize', 4, "Number of resources to put in each group of senders")
+defProperty('rate', 300, 'Bits per second sent from senders')
+defProperty('packetSize', 256, 'Byte size of packets sent from senders')
+defProperty('wifiType', "g", "The type of WIFI to use in this experiment")
+defProperty('channel', '6', "The WIFI channel to use in this experiment")
+defProperty('netid', "confroom", "The ESSID to use in this experiment")
+defProperty('stepDuration', 60, "The duration of each step of this conf-room")
+
+#Define the Receiver
+defGroup('Receiver', "#{property.hrnPrefix}#{property.receiver}") do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '%net.w0.ip%')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :samples => 1)
+ end
+ node.net.w0.mode = "master"
+ node.net.w0.type = property.wifiType
+ node.net.w0.channel = property.channel
+ node.net.w0.essid = property.netid
+ node.net.w0.ip = "192.168.0.254"
+end
+
+#Define each Sender groups
+groupList = []
+res = eval(property.resources.value)
+groupNumber = res.size >= property.groupSize ? (res.size.to_f / property.groupSize.value.to_f).ceil : 1
+(1..groupNumber).each do |i|
+ list = []
+ (1..property.groupSize).each do |j| popped = res.pop ; list << popped if !popped.nil? end
+ senderNames = list.collect do |id| "#{property.hrnPrefix}#{id}" end
+ senders = senderNames.join(',')
+
+ info "Group Sender #{i}: '#{senders}'"
+ groupList << "Sender#{i}"
+ defGroup("Sender#{i}", senders) do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '%net.w0.ip%')
+ app.setProperty('udp_dst_host', '192.168.0.254')
+ app.setProperty('udp_dst_port', 3000)
+ app.setProperty('cbr_size', property.packetSize)
+ app.setProperty('cbr_rate', property.rate)
+ app.measure('udp_out', :samples => 1)
+ end
+
+ #Currently not working - new syntax required for experiment to work
+ node.net.w0.mode = "managed"
+ node.net.w0.type = property.wifiType
+ node.net.w0.channel = property.channel
+ node.net.w0.essid = property.netid
+ node.net.w0.ip = "192.168.0.%index%"
+ end
+end
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ info "Initializing the Conference Room..."
+
+ after 10
+ group('Receiver').startApplications
+ info "The Conference Room has started..."
+
+ after 20
+ (1..groupNumber).each do |i|
+ group("Sender#{i}").startApplications
+ after property.stepDuration
+ end
+ (1..groupNumber).each do |i|
+ group("Sender#{i}").stopApplications
+ after property.stepDuration
+ end
+ group('Receiver').stopApplications
+ info "Applications are stopping... Conference Room experiment Complete."
+ Experiment.done
+end
+
+
+
diff --git a/doc/tutorials/TUTORIAL_02.draft b/doc/tutorials/forget/TUTORIAL_02.mkd
similarity index 82%
rename from doc/tutorials/TUTORIAL_02.draft
rename to doc/tutorials/forget/TUTORIAL_02.mkd
index 3b956401..3e5e96fc 100644
--- a/doc/tutorials/TUTORIAL_02.draft
+++ b/doc/tutorials/forget/TUTORIAL_02.mkd
@@ -116,37 +116,117 @@ experiment. An ED is written using the
The ED describing this simple “Hello World” experiment is (download it
here: attachment:hello-world.rb):
-
- defGroup('Sender', "omf.nicta.node2") do |node|
- node.addApplication("test:app:otg2") do |app|
- app.setProperty('udp:local_host', '192.168.0.2')
- app.setProperty('udp:dst_host', '192.168.0.3')
- app.setProperty('udp:dst_port', 3000)
- app.measure('udp_out', :samples => 1)
- end
- node.net.e0.ip = "192.168.0.2"
+```ruby
+
+#Welcome to 'Hello World' Wired
+#This script creates a simple wired networking experiment
+
+
+#Section 1
+#Define otg2 application
+#Define experiment parameters and measurement points
+defApplication('otg2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otg2"
+ a.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ a.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ a.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ a.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ a.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
end
+end
+
+
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otr2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otr2"
+ a.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ a.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
- defGroup('Receiver', "omf.nicta.node3") do |node|
- node.addApplication("test:app:otr2") do |app|
- app.setProperty('udp:local_host', '192.168.0.3')
- app.setProperty('udp:local_port', 3000)
- app.measure('udp_in', :samples => 1)
- end
- node.net.e0.ip = "192.168.0.3"
end
-
- onEvent(:ALL_UP_AND_INSTALLED) do |event|
- info "This is my first OMF experiment"
- wait 10
- allGroups.startApplications
- info "All my Applications are started now..."
- wait 30
- allGroups.stopApplications
- info "All my Applications are stopped now."
- Experiment.done
+end
+
+
+
+#Section 2
+#Define recources and nodes used by application
+
+#Define configuration of wired 'sender'
+defGroup('Sender', "omf.nicta.node9") do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.2')
+ app.setProperty('udp_dst_host', '192.168.0.3')
+ app.setProperty('udp_dst_port', 3000)
+ app.measure('udp_out', :samples => 1)
+ end
+
+ node.net.e0.ip = "192.168.0.2/24"
+end
+
+
+#Define configuration of wired 'reciever'
+defGroup('Receiver', "omf.nicta.node10") do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.3')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :samples => 1)
+ end
+
+ node.net.e0.ip = "192.168.0.3/24"
+end
+
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ info "Starting OMF6 Experiment events"
+
+
+ after 10
+ allGroups.startApplications
+ info "All Applications have started..."
end
-
+
+ after 30
+ allGroups.stopApplications
+ info "Applications are stopping... Experiment Complete."
+ Experiment.done
+
+```
+
### 3.1 Resource Description and Configuration (Line 1 to 26)
diff --git a/doc/tutorials/forget/tutorial02.rb b/doc/tutorials/forget/tutorial02.rb
new file mode 100644
index 00000000..e66f1522
--- /dev/null
+++ b/doc/tutorials/forget/tutorial02.rb
@@ -0,0 +1,108 @@
+#Welcome to 'Hello World' Wired
+#This script creates a simple wired networking experiment
+
+
+#Section 1
+#Define otg2 application
+#Define experiment parameters and measurement points
+defApplication('otg2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otg2"
+ a.description = "otg is a configurable traffic generator that sends packet streams"
+
+ #Define configurable parameters of otg2
+ a.defProperty('generator', 'Type of packet generator to use (cbr or expo)', '-g', {:type => :string, :dynamic => false})
+ a.defProperty('udp_broadcast', 'Broadcast', '--udp:broadcast', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_dst_host', 'IP address of the Destination', '--udp:dst_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_dst_port', 'Destination Port to send to', '--udp:dst_port', {:type => :integer, :dynamic => false})
+ a.defProperty('udp_local_host', 'IP address of this Source node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Local Port of this source node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defProperty("cbr_size", "Size of packet [bytes]", '--cbr:size', {:dynamic => true, :type => :integer})
+ a.defProperty("cbr_rate", "Data rate of the flow [kbps]", '--cbr:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_size", "Size of packet [bytes]", '--exp:size', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_rate", "Data rate of the flow [kbps]", '--exp:rate', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_ontime", "Average length of burst [msec]", '--exp:ontime', {:dynamic => true, :type => :integer})
+ a.defProperty("exp_offtime", "Average length of idle time [msec]", '--exp:offtime', {:dynamic => true, :type => :integer})
+
+ #Define measurement points that application will output
+ a.defMeasurement('udp_out') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
+ end
+end
+
+
+#Define otr2 application file-paths
+#Define experiment parameters and measurement points
+defApplication('otr2') do |a|
+
+ #Application description and binary path
+ a.binary_path = "/usr/bin/otr2"
+ a.description = "otr is a configurable traffic sink that recieves packet streams"
+
+ #Define configurable parameters of otr2
+ a.defProperty('udp_local_host', 'IP address of this Destination node', '--udp:local_host', {:type => :string, :dynamic => false})
+ a.defProperty('udp_local_port', 'Receiving Port of this Destination node', '--udp:local_port', {:type => :integer, :dynamic => false})
+ a.defMeasurement('udp_in') do |m|
+ m.defMetric('ts',:float)
+ m.defMetric('flow_id',:long)
+ m.defMetric('seq_no',:long)
+ m.defMetric('pkt_length',:long)
+ m.defMetric('dst_host',:string)
+ m.defMetric('dst_port',:long)
+
+ end
+end
+
+
+
+#Section 2
+#Define recources and nodes used by application
+
+#Define configuration of wired 'sender'
+defGroup('Sender', "omf.nicta.node9") do |node|
+ node.addApplication("otg2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.2')
+ app.setProperty('udp_dst_host', '192.168.0.3')
+ app.setProperty('udp_dst_port', 3000)
+ app.measure('udp_out', :samples => 1)
+ end
+
+ node.net.e0.ip = "192.168.0.2/24"
+end
+
+
+#Define configuration of wired 'reciever'
+defGroup('Receiver', "omf.nicta.node10") do |node|
+ node.addApplication("otr2") do |app|
+ app.setProperty('udp_local_host', '192.168.0.3')
+ app.setProperty('udp_local_port', 3000)
+ app.measure('udp_in', :samples => 1)
+ end
+
+ node.net.e0.ip = "192.168.0.3/24"
+end
+
+
+#Section 3
+#Execution of application events
+onEvent(:ALL_UP_AND_INSTALLED) do |event|
+ info "Starting OMF6 Experiment events"
+
+
+ after 10
+ allGroups.startApplications
+ info "All Applications have started..."
+ end
+
+ after 30
+ allGroups.stopApplications
+ info "Applications are stopping... Experiment Complete."
+ Experiment.done
+
+
diff --git a/doc/tutorials/tutorial00.rb b/doc/tutorials/tutorial00.rb
deleted file mode 100644
index 03b0062a..00000000
--- a/doc/tutorials/tutorial00.rb
+++ /dev/null
@@ -1,60 +0,0 @@
-# 1. Define an OMF Application Definition for the ping-oml2 application
-# The OMF entities are using this definition to know where to find the
-# application, what are its configurable parameters, and what are the
-# OML2 measurement points that it provides.
-# This ping-oml2 application will be known by OMF entities as 'ping_oml2'
-#
-defApplication('ping_oml2') do |app|
- app.description = 'Simple Definition for the ping-oml2 application'
- # Define the path to the binary executable for this application
- app.binary_path = '/usr/bin/ping-oml2'
- # Define the configurable parameters for this application
- # For example if target is set to foo.com and count is set to 2, then the
- # application will be started with the command line:
- # /usr/bin/ping-oml2 -a foo.com -c 2
- app.defProperty('target', 'Address to ping', '-a', {:type => :string})
- app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
- # Define the OML2 measurement point that this application provides.
- # Here we have only one measurement point (MP) named 'ping'. Each measurement
- # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
- app.defMeasurement('ping') do |m|
- m.defMetric('dest_addr',:string)
- m.defMetric('ttl',:uint32)
- m.defMetric('rtt',:double)
- m.defMetric('rtt_unit',:string)
- end
-end
-
-# 2. Define a group of resources which will run the ping-oml2 application
-# Here we define only one group (Sender), which has only one resource in it
-# (omf6.nicta.node8)
-#
-defGroup('Sender', 'omf6dev.node8') do |g|
- # Associate the application ping_oml2 defined above to each resources
- # in this group
- g.addApplication("ping_oml2") do |app|
- # Configure the parameters for the ping_oml2 application
- app.setProperty('target', 'www.nicta.com.au')
- app.setProperty('count', 3)
- # Request the ping_oml2 application to collect measurement samples
- # from the 'ping' measuremnt point (as defined above), and send them
- # to an OML2 collection point
- app.measure('ping', :samples => 1)
- end
-end
-
-# 3. Define the sequence of tasks to perform when the event
-# "all resources are up and all applications are install" is being triggered
-#
-onEvent(:ALL_UP_AND_INSTALLED) do |event|
- # Print some information message
- info "This is my first OMF experiment"
- # Start all the Applications associated to all the Groups
- allGroups.startApplications
- # Wait for 5 sec
- wait 5
- # Stop all the Applications associated to all the Groups
- allGroups.stopApplications
- # Tell the Experiment Controller to terminate the experiment now
- Experiment.done
-end
diff --git a/doc/tutorials/tutorial01.rb b/doc/tutorials/tutorial01.rb
deleted file mode 100644
index 804fb72e..00000000
--- a/doc/tutorials/tutorial01.rb
+++ /dev/null
@@ -1,92 +0,0 @@
-defApplication('otr2') do |a|
-
- a.binary_path = "/usr/bin/otr2"
- a.description = <