Changes between Version 1 and Version 2 of GEC22Agenda/LabWiki/ModuleA/Execute


Ignore:
Timestamp:
03/09/15 14:06:55 (5 years ago)
Author:
eswer18@gmail.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GEC22Agenda/LabWiki/ModuleA/Execute

    v1 v2  
    1212To get started point your browser to [http://labwiki.casa.umass.edu]. 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].
    1313
    14 At the top of that window is a text field which you can use to search for existing MD scripts. Type "GEC21-learningswitch" in the field and then select "GEC21-learningswitch.md" from the list of files that are offered. This document has some information on the experiment that will be performed in Module A of the tutorial.
     14At the top of that window is a text field which you can use to search for existing MD scripts. Type "GEC22-learningswitch" in the field and then select "GEC22-learningswitch.md" from the list of files that are offered. This document has some information on the experiment that will be performed in Module A of the tutorial.
    1515
    1616=== 3.1.2 The "Prepare" Window ===
     
    1818The "Prepare" (middle) window allows you to define your experiment through and [http://mytestbed.net/projects/omf/wiki/OMF_Main_Page OMF] experiment script specified in [http://mytestbed.net/projects/omf6/wiki/OEDLOMF6 OMF Experiment Description Language] (OEDL).
    1919
    20 At the top of that window is a text field which you can use to search for existing OEDL scripts. Type "GEC21" in the field and then select "GEC21-learningswitch.oedl" from the list of files that are offered. This shows the experiment script in the field below.
     20At the top of that window is a text field which you can use to search for existing OEDL scripts. Type "GEC22" in the field and then select "GEC22-learningswitch.oedl" from the list of files that are offered. This shows the experiment script in the field below.
    2121
    2222For reference, we show the experiment script here:
     
    2424#!ruby
    2525
    26 defProperty('resource1', "nodea", "ID of a resource")
    27 defProperty('resource2', "switch", "ID of a resource")
     26defProperty('source1', "nodea-learningswitch", "ID of a resource")
     27defProperty('source2', "switch-learningswitch", "ID of a resource")
    2828
    2929
     
    3232
    3333defProperty('sinkaddr21', '192.168.1.9', "Ping destination address")
    34 
     34defProperty('sinkaddr11', '192.168.1.6', "Ping destination address")
     35peak_list = []
    3536
    3637defApplication('ping') do |app|
     
    5960  app.binary_path = '/bin/sh /root/ovs-setup2.sh'
    6061end
    61 defGroup('Source2', property.resource2) do |node|
     62defGroup('Source2', property.source2) do |node|
    6263  node.addApplication("trema")
    6364end
    64 defGroup('Source1', property.resource1) do |node|
     65defGroup('Source1', property.source1) do |node|
    6566  node.addApplication("ping") do |app|
    6667    app.setProperty('target', property.sinkaddr12)
     
    8384end
    8485
     86defGroup('Source3', property.source1) do |node|
     87  node.addApplication("ping") do |app|
     88    app.setProperty('target', property.sinkaddr11)
     89    app.setProperty('count', 30)
     90    #app.setProperty('interval', 1)
     91    app.measure('ping', :samples => 1)
     92  end
     93end
     94
     95defEvent(:MY_EVENT, every: 0.5) do
     96# Query for some measurements...
     97  # returns an array where each element is a hash representing a row from the DB
     98  query = ms('ping').select { [ :remote] }
     99  data = defQuery(query)
     100  # Alternatively the above line could also be:
     101  # data = defQuery('select oml_ts_client, value from signalgen_sin')
     102  #
     103  # Also if you want to rename 'oml_ts_client' to 'ts'
     104  # query = ms('sin').select { [ oml_ts_client.as(:ts), :value ] }
     105  # data = defQuery('select oml_ts_client as ts, value from signalgen_sin')
     106
     107  triggered = false
     108  if !data.nil? && !(last_row = data.pop).nil? # Make sure we have some data
     109    next if peak_list.include?(last_row[:remote]) # Do nothing if we have seen this sample before
     110    if !peak_list.include?(last_row[:remote])
     111      peak_list << last_row[:remote] # record that sample, so we dont trigger on it again
     112    end
     113    if peak_list.include?('192.168.1.9')&&peak_list.include?('192.168.1.7')&&peak_list.include?('192.168.1.8')
     114     
     115      triggered = true
     116    end
     117  end
     118  triggered
     119end
     120onEvent :MY_EVENT do
     121  #group('switch').exec("ping www.google.com")
     122  group('Source3').startApplications
     123end
    85124
    86125onEvent(:ALL_UP_AND_INSTALLED) do |event|
     
    107146  g.yaxis :legend => 'rtt', :ticks => {:format => 's'}
    108147end
     148
    109149
    110150}}}
     
    146186 * Finished - When your experiment is done, you will see this status
    147187
    148 = [wiki:GEC21Agenda/LabWiki/ModuleA/Finish Next: Finish] =
    149 = [wiki:GEC21Agenda/LabWiki/ModuleA/DesignSetup Design] =
     188== Note to the Instructors ==
     189
     190* Students can be asked to implement a particular functionality of the OpenFlow controller. A template should be given to them[[BR]]
     191
     192* LabWiki has a new feature that enables the instructor to auto-grade the students' experiments. LabWiki allows people to write user-defined event, which is triggered upon an 
     193experiment-generated measurements reaching a specific value. In the above script, the event will be triggered when Node A is able to ping all the other nodes in the topology. It will trigger a ping event to itself on Node A. In this way, you can say that the experiment is run successfully if the Ping on Node A is seen on the graph
     194
     195= [wiki:GEC22Agenda/LabWiki/ModuleA/Finish Next: Finish] =
     196= [wiki:GEC22Agenda/LabWiki/ModuleA/DesignSetup Design] =