Changes between Version 5 and Version 6 of GEC20Agenda/LabWiki/ModuleE/DesignSetup
- Timestamp:
- 08/04/14 11:22:29 (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GEC20Agenda/LabWiki/ModuleE/DesignSetup
v5 v6 5 5 === 1.1 Get Flow Statistics you want to measure === 6 6 7 Define stats_reply in /root/learning-switch-copy.rb as follows 8 9 10 {{{ 7 Define stats_reply in /root/learning-switch-copy.rb as follows. This file is the Trema controller script which we ran in ModuleC. For the purpose of this tutorial, the modified script has been downloaded into switch1 prior to this tutorial. [[BR]] 8 You can find this file in the node called switch1. If you need help with logging in to your nodes, please refer [http://groups.geni.net/geni/wiki/HowTo/LoginToNodes How To Login]. [[BR]] 9 10 11 {{{ 12 #!ruby 11 13 def stats_reply (dpid, message) 12 14 puts "[flow stats_reply #{@my_switch}]---------------------------------" … … 41 43 === 1.2 Define Flow Statistics measurement points === 42 44 43 {{{ 45 We now proceed to write the application which collects the measurement points defined in the controller code above. [[BR]] 46 The complete script is already pre-loaded into the node switch1 at /usr/local/bin/learn_ofcollect.rb. The steps provided here are for your reference. 47 48 {{{ 49 #!ruby 44 50 class MPThroughput < OML4R::MPBase 45 51 name :ofthroughput … … 56 62 57 63 {{{ 64 #!ruby 58 65 def processOutput(output) 59 66 column = output.split(" ") … … 66 73 === 1.4 Write application Script === 67 74 {{{ 68 75 #!ruby 69 76 !/usr/bin/env ruby 70 77 require 'rubygems' … … 141 148 == 2. Write OEDL Script to run in !LabWiki == 142 149 150 This script is used to orchestrate the OML application we just wrote. It is pre-loaded into your !LabWiki directory as GEC20_flowstatistics.oedl. [[BR]] 151 The steps provided here are for your reference. 143 152 144 153 === 2.1 Define Resource name === … … 148 157 149 158 {{{ 159 #!ruby 150 160 defProperty('source1', "switch1-rspecforMax", "ID of a resource") 151 161 defProperty('source2', "switch2-rspecforMax", "ID of a resource") … … 162 172 163 173 {{{ 174 #!ruby 164 175 defProperty('pathfile', "/tmp/flowstats.out", "Path to file") 165 176 }}} … … 169 180 170 181 {{{ 182 #!ruby 171 183 defApplication('ofstats') do |app| 172 184 app.description = 'Simple Definition for the of-collect application' … … 186 198 187 199 {{{ 200 #!ruby 188 201 defGroup('Source3', property.source1) do |node| 189 202 node.addApplication("ofstats") do |app| … … 198 211 199 212 {{{ 213 #!ruby 200 214 defGraph 'Throughput' do |g| 201 215 g.ms('wrapper_ofthroughput').select(:oml_ts_client, :throughput, :srcaddr)