Changes between Version 1 and Version 2 of GEC19Agenda/GIMI/Procedure/Execute


Ignore:
Timestamp:
03/18/14 11:30:15 (9 years ago)
Author:
divyashri.bhat@gmail.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GEC19Agenda/GIMI/Procedure/Execute

    v1 v2  
    1414</div>
    1515}}}
     16
     17= How to use OML4R to write your OML application =
     18== 1. Setup your Application ==
     19
     20=== 1.1 Download the tar file of your application ===
     21
     22{{{
     23
     24sudo su
     25wget http://www.gpolab.bbn.com/experiment-support/gec17/pingPlus/pingPlus_v3.tar.gz
     26tar xvzf pingPlus_v3.tar.gz
     27cd pingPlus_v3
     28make
     29
     30}}}
     31=== 1.2 Test connectivity ===
     32
     33On the receiver
     34{{{
     35
     36chmod +x pingPlusListener
     37ping -c 5 10.10.10.1
     38ifconfig eth1 0.0.0.0
     39ping -c 5 10.10.10.1
     40# ./pingPlusListener 10002
     41
     42
     43}}}
     44On the sender 
     45
     46{{{
     47
     48ping -c 5 10.10.10.2
     49ifconfig eth1 0.0.0.0
     50ping -c 5 10.10.10.2
     51chmod +x pingPlus
     52 ./pingPlus 02:26:ae:0e:9b:3e eth1 10002
     53}}}
     54
     55
     56== 1. Observe your Output ==
     57
     58
     59
     60{{{
     61
     62root@sender:/users/dbhat/pingPlus_v3# ./pingPlus 02:26:ae:0e:9b:3e eth1 10002 5
     63RQ:'9641+4173' to 2:26:ae:e:9b:3e.
     64RL:9641+4173=13814 from 2:26:ae:e:9b:3e.
     65RTT = 0.920166
     66RQ:'2271+7533' to 2:26:ae:e:9b:3e.
     67RL:2271+7533=9804 from 2:26:ae:e:9b:3e.
     68RTT = 0.654053
     69RQ:'8858+353' to 2:26:ae:e:9b:3e.
     70RL:8858+353=9211 from 2:26:ae:e:9b:3e.
     71RTT = 0.489014
     72RQ:'447+5696' to 2:26:ae:e:9b:3e.
     73RL:447+5696=6143 from 2:26:ae:e:9b:3e.
     74RTT = 0.290039
     75RQ:'7238+5082' to 2:26:ae:e:9b:3e.
     76RL:7238+5082=12320 from 2:26:ae:e:9b:3e.
     77RTT = 0.252930
     78
     79}}}
     80
     81== 2. Write your Parser ==
     82
     83{{{
     84
     85}}}
     86
     87
     88
     89== 3. Instrument your Application using LabWiki ==
     90
     91
     92{{{
     93defProperty('source1', "sender-gimiinsta", "ID of a resource")
     94
     95defProperty('sinkaddr11', '02:ee:1a:a2:51:11', "Ping destination address")
     96defProperty('eth11','eth1',"Output Eth interface")
     97
     98
     99defApplication('pingl2') do |app|
     100  app.description = 'Simple Definition for the pingl2 application'
     101  # Define the path to the binary executable for this application
     102  app.binary_path = '/usr/local/bin/pingl2.rb'
     103  # Define the configurable parameters for this application
     104  # For example if target is set to foo.com and count is set to 2, then the
     105  # application will be started with the command line:
     106  # /usr/bin/ping-oml2 -a foo.com -c 2
     107  app.defProperty('target', 'Address to ping', '-a', {:type => :string})
     108  app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
     109  app.defProperty('if_num', 'interface number', '-i', {:type => :integer})
     110  app.defProperty('eth', 'Ethernet Type', '-e', {:type => :string})
     111  # Define the OML2 measurement point that this application provides.
     112  # Here we have only one measurement point (MP) named 'ping'. Each measurement
     113  # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
     114  app.defMeasurement('pingrl') do |m|
     115    m.defMetric('dest_hw_addr',:string)
     116  end
     117    app.defMeasurement('pingrtt') do |m|
     118    m.defMetric('rtt',:double)
     119  end
     120end
     121defGroup('Source1', property.source1) do |node|
     122  node.addApplication("pingl2") do |app|
     123    app.setProperty('target', property.sinkaddr11)
     124    app.setProperty('count', 30)
     125    app.setProperty('if_num', 10002)
     126    app.setProperty('eth',property.eth11)
     127    app.measure('pingrl', :samples => 1)
     128    app.measure('pingrtt', :samples => 1)
     129  end
     130end
     131
     132
     133
     134onEvent(:ALL_UP_AND_INSTALLED) do |event|
     135  info "Starting the ping"
     136  after 5 do
     137    allGroups.startApplications
     138  end
     139  after 70 do
     140    info "Stopping the ping"
     141    allGroups.stopApplications
     142    Experiment.done
     143  end
     144end
     145
     146defGraph 'RTT' do |g|
     147  g.ms('pingrtt').select(:rtt__oml_seq, :rtt__rtt, :rl__dest_hw_addr)\
     148     .from(:pingl2_pingrtt___rtt, :pingl2_pingrl___rl)\
     149     .where(:rtt__oml_seq => :rl__oml_seq)
     150  g.caption "RTT of received packets."
     151  g.type 'line_chart3'
     152  g.mapping :x_axis => :oml_seq, :y_axis => :rtt, :group_by => :dest_hw_addr
     153  g.xaxis :legend => 'oml_seq'
     154  g.yaxis :legend => 'rtt', :ticks => {:format => 's'}
     155end
     156}}}