== 2. Instrument your Application using !LabWiki == In this part you will learn how you can use !LabWiki to execute an experiment on the slice you reserved in the [http://groups.geni.net/geni/wiki/GENIFIRE/Labwiki/Part1/DesignSetup previous step]. === 2.1 Design and Execute measurement in !LabWiki === === 2.1.1. The "Plan" Window === To get started point your browser to [http://labwiki.test.atlantis.ugent.be:4000/labwiki]. Labwiki has three major windows. We will focus on the leftmost window first. This is the "Planning" window in which you document your experiment. (This is somewhat the equivalent of an electronic lab journal.) Documents are written in [http://daringfireball.net/projects/markdown/ Markdown]. At the top of that window is a text field which you can use to search for existing MD scripts. Type "firegenipart1" in the field and then select "firegenipart1.md" from the list of files that are offered. This document has some information on the experiment that will be performed in the tutorial. Copy the contents of the Markdown script (Command Line options should work) [[BR]] '''Note''': Create a new script by clicking on the wheel and prepend your username to the name of the script. Paste the contents of firegenipart1.md to create a copy of your own (For example, my script is called dbhat_firegenipart1.md). [[BR]] '''Please do not modify the original script.''' The markdown script is given here for your reference: {{{ # Learning Switch Today we will run a learning-switch controller: * Run pings to test if our controller is running * Get Flow Statistics from LabWiki ## My Topology ## Define Property Example: ## Define Application
## Experiment
* Define Learning Switch Controller
* Define Application Events
## Ping Graph (Connectivity Test)
![](_)
__Figure 1__. Round-trip Time.
## Iperf Graph (TCP Throughput)
![](_)
__Figure 2__. Throughput.
## Iperf Graph (UDP Throughput)
![](_)
__Figure 3__. Throughput.
}}}
=== 2.1.2 The "Prepare" Window ===
In the Search bar in the prepare window, find the script firegenipart1.oedl and click on it to load it. [[BR]]
Copy the contents of the OEDL script (Command Line options should work) [[BR]]
'''Note''': Create a new script by clicking on the wheel and prepend your username to the name of the script. Paste the contents of firegenipart1.oedl to create a copy of your own. [[BR]]
'''Please do not modify the original script.'''
[[Image(Lw-createscript2.png, 90%)]]
The script is also shown here for your reference:
{{{
defProperty('source1', "nodea-div2part1", "ID of a resource")
defProperty('source2', "switch1-div2part1", "ID of a resource")
defProperty('source3', "switch2-div2part1", "ID of a resource")
defProperty('sinkaddr12', '192.168.1.7', "Ping destination address")
defProperty('sinkaddr13', '192.168.1.8', "Ping destination address")
defProperty('sinkaddr21', '192.168.1.13', "Ping destination address")
defProperty('sinkaddr23', '192.168.1.14', "Ping destination address")
defProperty('sinkaddr24', '192.168.1.15', "Ping destination address")
defApplication('ping') 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/local/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
defApplication('trema') do |app|
app.description = 'This app runs trema from command line'
app.binary_path = '/bin/sh /root/ovs-setup2.sh'
end
defGroup('Source2', property.source2, property.source3) do |node|
node.addApplication("trema")
end
defGroup('Source1', property.source1) do |node|
node.addApplication("ping") do |app|
app.setProperty('target', property.sinkaddr12)
app.setProperty('count', 30)
#app.setProperty('interval', 1)
app.measure('ping', :samples => 1)
end
node.addApplication("ping") do |app|
app.setProperty('target', property.sinkaddr13)
app.setProperty('count', 30)
#app.setProperty('interval', 1)
app.measure('ping', :samples => 1)
end
node.addApplication("ping") do |app|
app.setProperty('target', property.sinkaddr21)
app.setProperty('count', 30)
#app.setProperty('interval', 1)
app.measure('ping', :samples => 1)
end
node.addApplication("ping") do |app|
app.setProperty('target', property.sinkaddr23)
app.setProperty('count', 30)
#app.setProperty('interval', 1)
app.measure('ping', :samples => 1)
end
node.addApplication("ping") do |app|
app.setProperty('target', property.sinkaddr24)
app.setProperty('count', 30)
#app.setProperty('interval', 1)
app.measure('ping', :samples => 1)
end
end
onEvent(:ALL_UP_AND_INSTALLED) do |event|
info "Starting the ping"
after 2 do
group('Source2').startApplications
end
after 20 do
group('Source1').startApplications
end
after 80 do
info "Stopping the ping"
allGroups.stopApplications
Experiment.done
end
end
defGraph 'RTT' do |g|
g.ms('ping').select(:oml_seq, :dest_addr, :rtt)
g.caption "RTT of received packets."
g.type 'line_chart3'
g.mapping :x_axis => :oml_seq, :y_axis => :rtt, :group_by => :dest_addr
g.xaxis :legend => 'oml_seq'
g.yaxis :legend => 'rtt', :ticks => {:format => 's'}
end
}}}
=== 2.1.3 Start your application from !LabWiki ===
To start your experiment, simply drag the icon that is to the left of the file name (see figure below) from the middle (Prepare) to the right (Execute) window.
Explanation of the fields in the Execute window:
* name: In this field you specify the name of your experiment.
* slice: Type the name of the slice you would like to run your experiment on
*Change source1, source2 and source3 fields to include your slice name similar to nodea-