wiki:GEC22Agenda/LabWiki/ModuleE/Execute

Version 6 (modified by eswer18@gmail.com, 9 years ago) (diff)

--

Module E Flow Statistics Experiment in LabWiki (on extended topology)

3. Instrument your Application using LabWiki

In this part we will run the OEDL script that we wrote in the previous step. The OEDL script called GEC22_flowstatistics.oedl

3.1.1. The "Plan" Window

Now you can use the original MD script and modify it with new information on the flow statistics and the experiment that measures the flow statistics using the Trema controller API

Look here if you have to refresh your memory on how to use the prepare window.

3.1.2 The "Prepare" Window

This experiment will do the following:

3.1.2a. Start Trema controllers on the two switch nodes in the topology shown in ModuleC

If you have run Module C before this (recommended), your controllers are already running and there is no need to do this step.

3.1.2b. Start an Iperf server on nodef

defApplication('iperfserv') do |app|
  app.description = "manually run Iperf server"
  app.binary_path = "/usr/bin/iperf -s"
end
defGroup('Receiver', property.theReceiver) do |node|
    node.addApplication("iperfserv") do |app|
    end
  end

3.1.2c. Start Iperf clients on nodea -nodee

defApplication('iperfclient') do |app|
  app.description = "manually run Iperf client"
  app.binary_path = "/usr/bin/iperf -c 192.168.1.15 -t 100 -P 2 -i 2"
end

defGroup('Sender2', property.theSender2) do |node|
    node.addApplication("iperfclient") do |app|
    end
  end

3.1.2d. Start Flow Statistics Measurement Application written in Step 1

3.1.2e. For reference, we show the Flow Statistics script here:

OEDL script

defProperty('source1', "switch1-testextend", "ID of a resource")
defProperty('theSender1', "nodeb-testextend", "ID of a resource")
defProperty('theSender2', "nodec-testextend", "ID of a resource")
defProperty('theSender3', "noded-testextend", "ID of a resource")
defProperty('theSender4', "nodea-testextend", "ID of a resource")
defProperty('theSender5', "nodee-testextend", "ID of a resource")
defProperty('theReceiver', "nodef-testextend", "ID of a resource")

defProperty('sinkaddr11', '192.168.1.6', "Ping destination address")
peak_list = []

count =0

defProperty('intervalcol',"1", "Interval to Tail")

defProperty('pathfile', "/tmp/flowstats.out", "Path to file")

defApplication('ofstats') do |app|
  app.description = 'Simple Definition for the of-collect application'
  # Define the path to the binary executable for this application
  app.binary_path = '/usr/local/bin/learn_ofcollect.rb'
  app.defProperty('target', 'Address to output file', '-f', {:type => :string})
  app.defProperty("interval","Interval",'-i', {:type => :string})
  app.defMeasurement('wrapper_ofthroughput') do |m|
    m.defMetric(':srcaddr', :string)
    m.defMetric('throughput',:int64)
  end
end

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('remote',:string)
    m.defMetric('ttl',:uint32)
    m.defMetric('rtt',:double)
    m.defMetric('rtt_unit',:string)
  end
end


defApplication('iperfserv') do |app|
  app.description = "manually run Iperf server"
  app.binary_path = "/usr/bin/iperf -s"
end
defApplication('iperfclient') do |app|
  app.description = "manually run Iperf client"
  app.binary_path = "/usr/bin/iperf -c 192.168.1.15 -t 200 -P 5 -i 2"
end
defApplication('clean_iperf') do |app|
  app.description = 'Some commands to ensure that we start with a clean slate'
  app.binary_path = 'killall -s9 iperf'
  app.quiet = true
end
defGroup('Source3', property.source1) do |node|
  node.addApplication("ofstats") do |app|
    app.setProperty('target', property.pathfile)
    app.setProperty('interval', property.intervalcol)
    app.measure('wrapper_ofthroughput', :samples => 1)
  end
end
 defGroup('Sender1', property.theSender1) do |node|
    node.addApplication("iperfclient") do |app|
    end
  end
  defGroup('Sender2', property.theSender2) do |node|
    node.addApplication("iperfclient") do |app|
    end
  end
  defGroup('Sender3', property.theSender3) do |node|
    node.addApplication("iperfclient") do |app|
    end
  end
  defGroup('Sender4', property.theSender4) do |node|
    node.addApplication("iperfclient") do |app|
    end
  end
  defGroup('Sender5', property.theSender5) do |node|
    node.addApplication("iperfclient") do |app|
    end
  end
  defGroup('Receiver', property.theReceiver) do |node|
    node.addApplication("iperfserv") do |app|
    end
  end
defGroup('Source4', property.source1) do |node|
  node.addApplication("ping") do |app|
    app.setProperty('target', property.sinkaddr11)
    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 collect"
  info "Starting the collect"
  after 2 do
    group('Receiver').startApplications
  end
  after 10 do
    group('Sender1').startApplications
    group('Source3').startApplications
  end
  after 20 do
    group('Sender2').startApplications 
  end
  after 40 do
    group('Sender3').startApplications
  end
  after 60 do
    group('Sender4').startApplications
  end
  after 80 do
    group('Sender5').startApplications
  end
  after 120 do
    info "Stopping the collect"
    allGroups.stopApplications
    Experiment.done
  end
end
defEvent(:MY_EVENT, every: 10) do
# Query for some measurements...
  # returns an array where each element is a hash representing a row from the DB
  query = ms('wrapper_ofthroughput').select { [ :srcaddr] }
  data = defQuery(query)
 

  triggered = false
   if !data.nil?
    data.each do |test|
      next if peak_list.include?(test[:srcaddr]) # Do nothing if we have seen this sample before
        if !peak_list.include?(test[:srcaddr])
        peak_list << test[:srcaddr] # record that sample, so we dont trigger on it again
        end
        if  peak_list.size >= 4 
        triggered = true
        end
        end
   end
  triggered
end
onEvent :MY_EVENT do
  group('Source4').startApplications
end


defGraph 'Throughput' do |g|
  g.ms('wrapper_ofthroughput').select(:oml_ts_client, :throughput, :srcaddr) 
  g.caption "Throughput of Flows"
  g.type 'line_chart3'
  g.mapping :x_axis => :oml_ts_client, :y_axis => :throughput, :group_by => :srcaddr
  g.xaxis :legend => 'oml_ts'
  g.yaxis :legend => 'Throughput', :ticks => {:format => 's'}
end



3.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. That will automatically fill out the experiment relevant information in this window and allow you to start the actual experiment by clicking on the "Start Experiment" button.

http://groups.geni.net/geni/raw-attachment/wiki/GEC20Agenda/LabWiki/ModuleE/Execute/LW_wiki_flowstats1.png

Explanation of the fields in the Execute window:

  • name: In this field you specify the name of your experiment.
  • project: This pull-down menu list all the projects you are currently a member of. Select the project that contains the slice you want to run your experiment on.
  • experiment context: With the context you can specify a certain set of experiments. E.g., a series of experiments you run under a certain set of startup parameters.
  • slice: This pull down menu lists all slice that have been created under "project". Select the slice you to run your experiment on.

3.1.4 During experiment execution

After pressing the "Start" button, the Execute window will change and start showing status information about your experiment. The figure below gives an example for the Execute window during experiment execution.

http://groups.geni.net/geni/raw-attachment/wiki/GEC20Agenda/LabWiki/ModuleE/Execute/LW_wiki_flowstats2.png

Now the window lists experiment properties, one or several live graphs (if they have been specified in the OEDL script), and logging information. The latter would be a good starting point for trouble shooting, should your experiment not run as expected.

Note to Instructors

check http://groups.geni.net/geni/wiki/GEC22Agenda/LabWiki/ModuleA/Execute#NotetoInstructors

Next: Finish

Design

Attachments (2)

Download all attachments as: .zip