{{{ #!html
Image Map
}}} = How to use OML4R to write your OML application = == 1. Setup your Application == === 1.1 Download the tar file of your application === {{{ sudo su wget http://www.gpolab.bbn.com/experiment-support/gec17/pingPlus/pingPlus_v3.tar.gz tar xvzf pingPlus_v3.tar.gz cd pingPlus_v3 make }}} === 1.2 Test connectivity === On the receiver {{{ chmod +x pingPlusListener ping -c 5 10.10.10.1 ifconfig eth1 0.0.0.0 ping -c 5 10.10.10.1 ./pingPlusListener 10002 }}} The format for the pingPlusListener is sudo ./pingPlusListener On the sender {{{ ping -c 5 10.10.10.2 ifconfig eth1 0.0.0.0 ping -c 5 10.10.10.2 chmod +x pingPlus ./pingPlus 02:26:ae:0e:9b:3e eth1 10002 }}} The format for the sender is ./pingPlus == 1. Observe your Output == {{{ root@sender:/users/dbhat/pingPlus_v3# ./pingPlus 02:26:ae:0e:9b:3e eth1 10002 5 RQ:'9641+4173' to 2:26:ae:e:9b:3e. RL:9641+4173=13814 from 2:26:ae:e:9b:3e. RTT = 0.920166 RQ:'2271+7533' to 2:26:ae:e:9b:3e. RL:2271+7533=9804 from 2:26:ae:e:9b:3e. RTT = 0.654053 RQ:'8858+353' to 2:26:ae:e:9b:3e. RL:8858+353=9211 from 2:26:ae:e:9b:3e. RTT = 0.489014 RQ:'447+5696' to 2:26:ae:e:9b:3e. RL:447+5696=6143 from 2:26:ae:e:9b:3e. RTT = 0.290039 RQ:'7238+5082' to 2:26:ae:e:9b:3e. RL:7238+5082=12320 from 2:26:ae:e:9b:3e. RTT = 0.252930 }}} == 2. Write your Parser == {{{ }}} == 3. Instrument your Application using LabWiki == {{{ defProperty('source1', "sender-gimiinsta", "ID of a resource") defProperty('sinkaddr11', '02:ee:1a:a2:51:11', "Ping destination address") defProperty('eth11','eth1',"Output Eth interface") defApplication('pingl2') do |app| app.description = 'Simple Definition for the pingl2 application' # Define the path to the binary executable for this application app.binary_path = '/usr/local/bin/pingl2.rb' # 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}) app.defProperty('if_num', 'interface number', '-i', {:type => :integer}) app.defProperty('eth', 'Ethernet Type', '-e', {:type => :string}) # 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('pingrl') do |m| m.defMetric('dest_hw_addr',:string) end app.defMeasurement('pingrtt') do |m| m.defMetric('rtt',:double) end end defGroup('Source1', property.source1) do |node| node.addApplication("pingl2") do |app| app.setProperty('target', property.sinkaddr11) app.setProperty('count', 30) app.setProperty('if_num', 10002) app.setProperty('eth',property.eth11) app.measure('pingrl', :samples => 1) app.measure('pingrtt', :samples => 1) end end onEvent(:ALL_UP_AND_INSTALLED) do |event| info "Starting the ping" after 5 do allGroups.startApplications end after 70 do info "Stopping the ping" allGroups.stopApplications Experiment.done end end defGraph 'RTT' do |g| g.ms('pingrtt').select(:rtt__oml_seq, :rtt__rtt, :rl__dest_hw_addr)\ .from(:pingl2_pingrtt___rtt, :pingl2_pingrl___rl)\ .where(:rtt__oml_seq => :rl__oml_seq) g.caption "RTT of received packets." g.type 'line_chart3' g.mapping :x_axis => :oml_seq, :y_axis => :rtt, :group_by => :dest_hw_addr g.xaxis :legend => 'oml_seq' g.yaxis :legend => 'rtt', :ticks => {:format => 's'} end }}}