Changes between Version 1 and Version 2 of GEC22Agenda/LabWiki/ModuleA/Execute
- Timestamp:
- 03/09/15 14:06:55 (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GEC22Agenda/LabWiki/ModuleA/Execute
v1 v2 12 12 To 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]. 13 13 14 At the top of that window is a text field which you can use to search for existing MD scripts. Type "GEC2 1-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.14 At 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. 15 15 16 16 === 3.1.2 The "Prepare" Window === … … 18 18 The "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). 19 19 20 At the top of that window is a text field which you can use to search for existing OEDL scripts. Type "GEC2 1" 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.20 At 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. 21 21 22 22 For reference, we show the experiment script here: … … 24 24 #!ruby 25 25 26 defProperty(' resource1', "nodea", "ID of a resource")27 defProperty(' resource2', "switch", "ID of a resource")26 defProperty('source1', "nodea-learningswitch", "ID of a resource") 27 defProperty('source2', "switch-learningswitch", "ID of a resource") 28 28 29 29 … … 32 32 33 33 defProperty('sinkaddr21', '192.168.1.9', "Ping destination address") 34 34 defProperty('sinkaddr11', '192.168.1.6', "Ping destination address") 35 peak_list = [] 35 36 36 37 defApplication('ping') do |app| … … 59 60 app.binary_path = '/bin/sh /root/ovs-setup2.sh' 60 61 end 61 defGroup('Source2', property. resource2) do |node|62 defGroup('Source2', property.source2) do |node| 62 63 node.addApplication("trema") 63 64 end 64 defGroup('Source1', property. resource1) do |node|65 defGroup('Source1', property.source1) do |node| 65 66 node.addApplication("ping") do |app| 66 67 app.setProperty('target', property.sinkaddr12) … … 83 84 end 84 85 86 defGroup('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 93 end 94 95 defEvent(: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 119 end 120 onEvent :MY_EVENT do 121 #group('switch').exec("ping www.google.com") 122 group('Source3').startApplications 123 end 85 124 86 125 onEvent(:ALL_UP_AND_INSTALLED) do |event| … … 107 146 g.yaxis :legend => 'rtt', :ticks => {:format => 's'} 108 147 end 148 109 149 110 150 }}} … … 146 186 * Finished - When your experiment is done, you will see this status 147 187 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 193 experiment-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] =