| 1 | = Module E Flow Statistics Experiment in !LabWiki (on extended topology) = |
| 2 | |
| 3 | == 3. Instrument your Application using !LabWiki == |
| 4 | |
| 5 | In this part we will run the OEDL script that we wrote in the previous step. The OEDL script called GEC21_flowstatistics.oedl |
| 6 | |
| 7 | === 3.1.1. The "Plan" Window === |
| 8 | Now you can use the original MD script and modify it with new information on the flow statistics and the |
| 9 | experiment that measures the flow statistics using the Trema controller API |
| 10 | |
| 11 | |
| 12 | Look [wiki:GEC20Agenda/LabWiki/ModuleA/Execute here] if you have to refresh your memory on how to use the prepare window. |
| 13 | === 3.1.2 The "Prepare" Window === |
| 14 | |
| 15 | This experiment will do the following: [[BR]] |
| 16 | |
| 17 | ==== 3.1.2a. Start Trema controllers on the two switch nodes in the topology shown in [http://groups.geni.net/geni/wiki/GEC20Agenda/LabWiki/ModuleC/DesignSetup ModuleC] ==== |
| 18 | |
| 19 | If you have run Module C before this (recommended), your controllers are already running and there is no need to do this step. |
| 20 | |
| 21 | ==== 3.1.2b. Start an Iperf server on nodef ==== |
| 22 | |
| 23 | {{{ |
| 24 | #!ruby |
| 25 | defApplication('iperfserv') do |app| |
| 26 | app.description = "manually run Iperf server" |
| 27 | app.binary_path = "/usr/bin/iperf -s" |
| 28 | end |
| 29 | defGroup('Receiver', property.theReceiver) do |node| |
| 30 | node.addApplication("iperfserv") do |app| |
| 31 | end |
| 32 | end |
| 33 | }}} |
| 34 | |
| 35 | |
| 36 | ==== 3.1.2c. Start Iperf clients on nodea -nodee ==== |
| 37 | |
| 38 | |
| 39 | {{{ |
| 40 | #!ruby |
| 41 | defApplication('iperfclient') do |app| |
| 42 | app.description = "manually run Iperf client" |
| 43 | app.binary_path = "/usr/bin/iperf -c 192.168.1.15 -t 100 -P 2 -i 2" |
| 44 | end |
| 45 | |
| 46 | defGroup('Sender2', property.theSender2) do |node| |
| 47 | node.addApplication("iperfclient") do |app| |
| 48 | end |
| 49 | end |
| 50 | }}} |
| 51 | |
| 52 | ==== 3.1.2d. Start Flow Statistics Measurement Application written in Step 1 ==== |
| 53 | |
| 54 | ==== 3.1.2e. For reference, we show the Flow Statistics script here: ==== |
| 55 | OEDL script |
| 56 | {{{ |
| 57 | #!ruby |
| 58 | defProperty('source1', "switch1-egtest7", "ID of a resource") |
| 59 | defProperty('theSender1', "nodeb-egtest7", "ID of a resource") |
| 60 | defProperty('theSender2', "nodec-egtest7", "ID of a resource") |
| 61 | defProperty('theSender3', "noded-egtest7", "ID of a resource") |
| 62 | defProperty('theSender4', "nodea-egtest7", "ID of a resource") |
| 63 | defProperty('theSender5', "nodee-egtest7", "ID of a resource") |
| 64 | defProperty('theReceiver', "nodef-egtest7", "ID of a resource") |
| 65 | |
| 66 | defProperty('intervalcol',"1", "Interval to Tail") |
| 67 | |
| 68 | defProperty('pathfile', "/tmp/flowstats.out", "Path to file") |
| 69 | |
| 70 | defApplication('ofstats') do |app| |
| 71 | app.description = 'Simple Definition for the of-collect application' |
| 72 | # Define the path to the binary executable for this application |
| 73 | app.binary_path = '/usr/local/bin/learn_ofcollect.rb' |
| 74 | app.defProperty('target', 'Address to output file', '-f', {:type => :string}) |
| 75 | app.defProperty("interval","Interval",'-i', {:type => :string}) |
| 76 | app.defMeasurement('wrapper_ofthroughput') do |m| |
| 77 | m.defMetric(':srcaddr', :string) |
| 78 | m.defMetric('throughput',:int64) |
| 79 | end |
| 80 | end |
| 81 | |
| 82 | defApplication('iperfserv') do |app| |
| 83 | app.description = "manually run Iperf server" |
| 84 | app.binary_path = "/usr/bin/iperf -s" |
| 85 | end |
| 86 | defApplication('iperfclient') do |app| |
| 87 | app.description = "manually run Iperf client" |
| 88 | app.binary_path = "/usr/bin/iperf -c 192.168.1.15 -t 200 -P 5 -i 2" |
| 89 | end |
| 90 | defApplication('clean_iperf') do |app| |
| 91 | app.description = 'Some commands to ensure that we start with a clean slate' |
| 92 | app.binary_path = 'killall -s9 iperf' |
| 93 | app.quiet = true |
| 94 | end |
| 95 | defGroup('Source3', property.source1) do |node| |
| 96 | node.addApplication("ofstats") do |app| |
| 97 | app.setProperty('target', property.pathfile) |
| 98 | app.setProperty('interval', property.intervalcol) |
| 99 | app.measure('wrapper_ofthroughput', :samples => 1) |
| 100 | end |
| 101 | end |
| 102 | defGroup('Sender1', property.theSender1) do |node| |
| 103 | node.addApplication("iperfclient") do |app| |
| 104 | end |
| 105 | end |
| 106 | defGroup('Sender2', property.theSender2) do |node| |
| 107 | node.addApplication("iperfclient") do |app| |
| 108 | end |
| 109 | end |
| 110 | defGroup('Sender3', property.theSender3) do |node| |
| 111 | node.addApplication("iperfclient") do |app| |
| 112 | end |
| 113 | end |
| 114 | defGroup('Sender4', property.theSender4) do |node| |
| 115 | node.addApplication("iperfclient") do |app| |
| 116 | end |
| 117 | end |
| 118 | defGroup('Sender5', property.theSender5) do |node| |
| 119 | node.addApplication("iperfclient") do |app| |
| 120 | end |
| 121 | end |
| 122 | defGroup('Receiver', property.theReceiver) do |node| |
| 123 | node.addApplication("iperfserv") do |app| |
| 124 | end |
| 125 | end |
| 126 | |
| 127 | onEvent(:ALL_UP_AND_INSTALLED) do |event| |
| 128 | info "Starting the collect" |
| 129 | info "Starting the collect" |
| 130 | after 2 do |
| 131 | group('Receiver').startApplications |
| 132 | end |
| 133 | after 10 do |
| 134 | group('Sender1').startApplications |
| 135 | group('Source3').startApplications |
| 136 | end |
| 137 | after 20 do |
| 138 | group('Sender2').startApplications |
| 139 | end |
| 140 | after 40 do |
| 141 | group('Sender3').startApplications |
| 142 | end |
| 143 | after 60 do |
| 144 | group('Sender4').startApplications |
| 145 | end |
| 146 | after 80 do |
| 147 | group('Sender5').startApplications |
| 148 | end |
| 149 | after 120 do |
| 150 | info "Stopping the collect" |
| 151 | allGroups.stopApplications |
| 152 | Experiment.done |
| 153 | end |
| 154 | end |
| 155 | |
| 156 | defGraph 'Throughput' do |g| |
| 157 | g.ms('wrapper_ofthroughput').select(:oml_ts_client, :throughput, :srcaddr) |
| 158 | g.caption "Throughput of Flows" |
| 159 | g.type 'line_chart3' |
| 160 | g.mapping :x_axis => :oml_ts_client, :y_axis => :throughput, :group_by => :srcaddr |
| 161 | g.xaxis :legend => 'oml_ts' |
| 162 | g.yaxis :legend => 'Throughput', :ticks => {:format => 's'} |
| 163 | end |
| 164 | |
| 165 | |
| 166 | }}} |
| 167 | === 3.1.3 Start your application from !LabWiki === |
| 168 | |
| 169 | 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. |
| 170 | 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. |
| 171 | |
| 172 | [[Image(http://groups.geni.net/geni/raw-attachment/wiki/GEC20Agenda/LabWiki/ModuleE/Execute/LW_wiki_flowstats1.png, 50%)]] |
| 173 | |
| 174 | Explanation of the fields in the Execute window: |
| 175 | |
| 176 | * name: In this field you specify the name of your experiment. |
| 177 | |
| 178 | * 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. |
| 179 | |
| 180 | * 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. |
| 181 | |
| 182 | * slice: This pull down menu lists all slice that have been created under "project". Select the slice you to run your experiment on. |
| 183 | |
| 184 | === 3.1.4 During experiment execution === |
| 185 | |
| 186 | After pressing the "Start" button, the Execute window will change and start showing status information about your experiment. |
| 187 | The figure below gives an example for the Execute window during experiment execution. |
| 188 | |
| 189 | [[Image(http://groups.geni.net/geni/raw-attachment/wiki/GEC20Agenda/LabWiki/ModuleE/Execute/LW_wiki_flowstats2.png, 50%)]] |
| 190 | |
| 191 | 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. |
| 192 | |
| 193 | |
| 194 | |
| 195 | = [wiki:GEC21Agenda/LabWiki/ModuleE/Finish Next: Finish] = |
| 196 | = [wiki:GEC21Agenda/LabWiki/ModuleE/DesignSetup Design] = |