Changes between Version 22 and Version 23 of GEC18Agenda/GettingStartedWithGENI_III_GIMI/Procedure/Execute


Ignore:
Timestamp:
01/09/14 03:52:25 (5 years ago)
Author:
divyashri.bhat@gmail.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GEC18Agenda/GettingStartedWithGENI_III_GIMI/Procedure/Execute

    v22 v23  
    4949
    5050{{{
    51 defProperty('source1', "nodeA", "ID of a resource")
    52 defProperty('source2', "nodeB", "ID of a resource")
    53 defProperty('source3', "nodeC", "ID of a resource")
    54 defProperty('source4', "nodeD", "ID of a resource")
    55 defProperty('source5', "nodeE", "ID of a resource")
    56 
    57 #defProperty('sink1', "nodeA", "ID of a sink")
    58 #defProperty('sink2', "nodeB", "ID of a sink")
    59 #defProperty('sink3', "nodeC", "ID of a sink")
    60 #defProperty('sink4', "nodeD", "ID of a sink")
    61 #defProperty('sink5', "nodeE", "ID of a sink")
    62 
    63 defProperty('sinkaddr11', '192.168.4.10', "Ping destination address")
     51defProperty('source1', "nodeA-fivenodeping", "ID of a resource")
     52defProperty('source2', "nodeB-fivenodeping", "ID of a resource")
     53defProperty('source3', "nodeC-fivenodeping", "ID of a resource")
     54defProperty('source4', "nodeD-fivenodeping", "ID of a resource")
     55defProperty('source5', "nodeE-fivenodeping", "ID of a resource")
     56#defProperty('graph', true, "Display graph or not")
     57
     58
     59defProperty('sinkaddr11', '192.168.1.2', "Ping destination address")
     60defProperty('sinkaddr12', '192.168.1.4', "Ping destination address")
     61
     62defProperty('sinkaddr11', '192.168.6.10', "Ping destination address")
    6463defProperty('sinkaddr12', '192.168.5.12', "Ping destination address")
    6564
     
    7877defProperty('sinkaddr51', '192.168.6.12', "Ping destination address")
    7978
    80 defApplication('ping_app', 'pingmonitor') do |a|
    81     a.path = "/root/pingWrap.rb"
    82     a.version(1, 2, 0)
    83     a.shortDescription = "Wrapper around ping"
    84     a.description = "ping application"
    85     a.defProperty('dest_addr', 'Address to ping', '-a', {:type => :string, :dynamic => false})
    86     a.defProperty('count', 'Number of times to ping', '-c', {:type => :integer, :dynamic => false})
    87     a.defProperty('interval', 'Interval between pings in s', '-i', {:type => :integer, :dynamic => false})
    88 
    89     a.defMeasurement('myping') do |m|
    90      m.defMetric('dest_addr',:string)
    91      m.defMetric('ttl',:int)
    92      m.defMetric('rtt',:float)
    93      m.defMetric('rtt_unit',:string)
    94    end
    95 end
    96 
     79defApplication('ping') do |app|
     80  app.description = 'Simple Definition for the ping-oml2 application'
     81  # Define the path to the binary executable for this application
     82  app.binary_path = '/usr/local/bin/ping-oml2'
     83  # Define the configurable parameters for this application
     84  # For example if target is set to foo.com and count is set to 2, then the
     85  # application will be started with the command line:
     86  # /usr/bin/ping-oml2 -a foo.com -c 2
     87  app.defProperty('target', 'Address to ping', '-a', {:type => :string})
     88  app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
     89  # Define the OML2 measurement point that this application provides.
     90  # Here we have only one measurement point (MP) named 'ping'. Each measurement
     91  # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
     92  app.defMeasurement('ping') do |m|
     93    m.defMetric('dest_addr',:string)
     94    m.defMetric('ttl',:uint32)
     95    m.defMetric('rtt',:double)
     96    m.defMetric('rtt_unit',:string)
     97  end
     98end
    9799defGroup('Source1', property.source1) do |node|
    98   node.addApplication("ping_app") do |app|
    99     app.setProperty('dest_addr', property.sinkaddr11)
    100     app.setProperty('count', 30)
    101     app.setProperty('interval', 1)
    102     app.measure('myping', :samples => 1)
    103   end
    104 
    105   node.addApplication("ping_app") do |app|
    106     app.setProperty('dest_addr', property.sinkaddr12)
    107     app.setProperty('count', 30)
    108     app.setProperty('interval', 1)
    109     app.measure('myping', :samples => 1)
    110   end
    111 end
     100  node.addApplication("ping") do |app|
     101    app.setProperty('target', property.sinkaddr12)
     102    app.setProperty('count', 30)
     103    #app.setProperty('interval', 1)
     104    app.measure('ping', :samples => 1)
     105  end
     106end
     107
    112108
    113109defGroup('Source2', property.source2) do |node|
    114   node.addApplication("ping_app") do |app|
    115     app.setProperty('dest_addr', property.sinkaddr21)
    116     app.setProperty('count', 30)
    117     app.setProperty('interval', 1)
    118     app.measure('myping', :samples => 1)
    119   end
    120 
    121   node.addApplication("ping_app") do |app|
    122     app.setProperty('dest_addr', property.sinkaddr22)
    123     app.setProperty('count', 30)
    124     app.setProperty('interval', 1)
    125     app.measure('myping', :samples => 1)
    126   end
    127 
    128   node.addApplication("ping_app") do |app|
    129     app.setProperty('dest_addr', property.sinkaddr23)
    130     app.setProperty('count', 30)
    131     app.setProperty('interval', 1)
    132     app.measure('myping', :samples => 1)
     110  node.addApplication("ping") do |app|
     111    app.setProperty('target', property.sinkaddr11)
     112    app.setProperty('count', 30)
     113    #app.setProperty('interval', 1)
     114    app.measure('ping', :samples => 1)
     115  end
     116  node.addApplication("ping") do |app|
     117    app.setProperty('target', property.sinkaddr21)
     118    app.setProperty('count', 30)
     119    #app.setProperty('interval', 1)
     120    app.measure('ping', :samples => 1)
     121  end
     122
     123  node.addApplication("ping") do |app|
     124    app.setProperty('target', property.sinkaddr22)
     125    app.setProperty('count', 30)
     126    #app.setProperty('interval', 1)
     127    app.measure('ping', :samples => 1)
     128  end
     129
     130  node.addApplication("ping") do |app|
     131    app.setProperty('target', property.sinkaddr23)
     132    app.setProperty('count', 30)
     133    #app.setProperty('interval', 1)
     134    app.measure('ping', :samples => 1)
    133135  end
    134136end
    135137
    136138defGroup('Source3', property.source3) do |node|
    137   node.addApplication("ping_app") do |app|
    138     app.setProperty('dest_addr', property.sinkaddr31)
    139     app.setProperty('count', 30)
    140     app.setProperty('interval', 1)
    141     app.measure('myping', :samples => 1)
    142   end
    143 
    144   node.addApplication("ping_app") do |app|
    145     app.setProperty('dest_addr', property.sinkaddr32)
    146     app.setProperty('count', 30)
    147     app.setProperty('interval', 1)
    148     app.measure('myping', :samples => 1)
    149   end
    150 
    151   node.addApplication("ping_app") do |app|
    152     app.setProperty('dest_addr', property.sinkaddr33)
    153     app.setProperty('count', 30)
    154     app.setProperty('interval', 1)
    155     app.measure('myping', :samples => 1)
    156   end
    157 
    158   node.addApplication("ping_app") do |app|
    159     app.setProperty('dest_addr', property.sinkaddr34)
    160     app.setProperty('count', 30)
    161     app.setProperty('interval', 1)
    162     app.measure('myping', :samples => 1)
     139  node.addApplication("ping") do |app|
     140    app.setProperty('target', property.sinkaddr31)
     141    app.setProperty('count', 30)
     142    #app.setProperty('interval', 1)
     143    app.measure('ping', :samples => 1)
     144  end
     145
     146  node.addApplication("ping") do |app|
     147    app.setProperty('target', property.sinkaddr32)
     148    app.setProperty('count', 30)
     149    #app.setProperty('interval', 1)
     150    app.measure('ping', :samples => 1)
     151  end
     152
     153  node.addApplication("ping") do |app|
     154    app.setProperty('target', property.sinkaddr33)
     155    app.setProperty('count', 30)
     156    #app.setProperty('interval', 1)
     157    app.measure('ping', :samples => 1)
     158  end
     159
     160  node.addApplication("ping") do |app|
     161    app.setProperty('target', property.sinkaddr34)
     162    app.setProperty('count', 30)
     163    #app.setProperty('interval', 1)
     164    app.measure('ping', :samples => 1)
    163165  end
    164166end
    165167
    166168defGroup('Source4', property.source4) do |node|
    167 
    168   node.addApplication("ping_app") do |app|
    169     app.setProperty('dest_addr', property.sinkaddr41)
    170     app.setProperty('count', 30)
    171     app.setProperty('interval', 1)
    172     app.measure('myping', :samples => 1)
    173   end
    174 
    175   node.addApplication("ping_app") do |app|
    176     app.setProperty('dest_addr', property.sinkaddr42)
    177     app.setProperty('count', 30)
    178     app.setProperty('interval', 1)
    179     app.measure('myping', :samples => 1)
     169  node.addApplication("ping") do |app|
     170    app.setProperty('target', property.sinkaddr41)
     171    app.setProperty('count', 30)
     172    #app.setProperty('interval', 1)
     173    app.measure('ping', :samples => 1)
     174  end
     175
     176  node.addApplication("ping") do |app|
     177    app.setProperty('target', property.sinkaddr42)
     178    app.setProperty('count', 30)
     179    #app.setProperty('interval', 1)
     180    app.measure('ping', :samples => 1)
    180181  end
    181182end
    182183
    183184defGroup('Source5', property.source5) do |node|
    184   node.addApplication("ping_app") do |app|
    185     app.setProperty('dest_addr', property.sinkaddr51)
    186     app.setProperty('count', 30)
    187     app.setProperty('interval', 1)
    188     app.measure('myping', :samples => 1)
    189   end
    190 end
     185  node.addApplication("ping") do |app|
     186    app.setProperty('target', property.sinkaddr51)
     187    app.setProperty('count', 30)
     188    #app.setProperty('interval', 1)
     189    app.measure('ping', :samples => 1)
     190  end
     191end
     192
     193
     194
     195
     196#defGroup('Sink1', property.sink1) do |node|
     197#end
     198
     199#defGroup('Sink2', property.sink2) do |node|
     200#end
     201
     202#defGroup('Sink3', property.sink3) do |node|
     203#end
     204
     205#defGroup('Sink4', property.sink4) do |node|
     206#end
     207
     208#defGroup('Sink5', property.sink5) do |node|
     209#end
    191210
    192211onEvent(:ALL_UP_AND_INSTALLED) do |event|
    193212  info "Starting the ping"
    194   allGroups.startApplications
    195   wait 5
    196   info "Stopping the ping"
    197   allGroups.stopApplications
    198   Experiment.done
    199 end
     213  after 5 do
     214    allGroups.startApplications
     215  end
     216  after 70 do
     217    info "Stopping the ping"
     218    allGroups.stopApplications
     219    Experiment.done
     220  end
     221end
     222
     223defGraph 'RTT' do |g|
     224  g.ms('ping').select(:oml_seq, :dest_addr, :rtt)
     225  g.caption "RTT of received packets."
     226  g.type 'line_chart3'
     227  g.mapping :x_axis => :oml_seq, :y_axis => :rtt, :group_by => :dest_addr
     228  g.xaxis :legend => 'oml_seq'
     229  g.yaxis :legend => 'rtt', :ticks => {:format => 's'}
     230end
     231
    200232}}}
    201233
     
    208240
    209241{{{
    210 defGroup('Node1', "nodeA")
    211 defGroup('Node2', "nodeB")
    212 defGroup('Node3', "nodeC")
    213 defGroup('Node4', "nodeD")
    214 defGroup('Node5', "nodeE")
     242#defProperty('source1', 'omf.nicta.node11', 'ID of a resource')
     243#defProperty('source2', 'omf.nicta.node13', 'ID of a resource')
     244#defProperty('target', 'emmy9.casa.umass.edu/expect_wget_script.sh', 'download target1')
     245#defProperty('target1', 'emmy9.casa.umass.edu/expect_script.sh', 'download target2')
     246
     247defGroup('Node1', "nodeA-fivenodetest")
     248defGroup('Node2', "nodeB-fivenodetest")
     249defGroup('Node3', "nodeC-fivenodetest")
     250defGroup('Node4', "nodeD-fivenodetest")
     251defGroup('Node5', "nodeE-fivenodetest")
    215252
    216253
    217254onEvent(:ALL_UP) do |event|
    218   wait 1
     255  after 1 do
     256#  group('All').startApplications
    219257  info 'Changing routing setup'
    220258
    221   group('Node1').exec("route add -net 192.168.1.0/24 gw 192.168.4.10")
    222   group('Node1').exec("route add -net 192.168.2.0/24 gw 192.168.4.10")
    223   group('Node1').exec("route add -net 192.168.3.0/24 gw 192.168.5.12")
    224   group('Node1').exec("route add -net 192.168.6.0/24 gw 192.168.5.12")
     259  group('Node1').exec("/sbin/route add -net 192.168.1.0/24 gw 192.168.4.10")
     260  group('Node1').exec("/sbin/route add -net 192.168.2.0/24 gw 192.168.4.10")
     261  group('Node1').exec("/sbin/route add -net 192.168.3.0/24 gw 192.168.5.12")
     262  group('Node1').exec("/sbin/route add -net 192.168.6.0/24 gw 192.168.5.12")
    225263  group('Node1').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
    226264
    227   group('Node2').exec("route add -net 192.168.3.0/24 gw 192.168.1.13")
    228   group('Node2').exec("route add -net 192.168.5.0/24 gw 192.168.4.11")
    229   group('Node2').exec("route add -net 192.168.6.0/24 gw 192.168.2.12")
     265  group('Node2').exec("/sbin/route add -net 192.168.3.0/24 gw 192.168.1.13")
     266  group('Node2').exec("/sbin/route add -net 192.168.5.0/24 gw 192.168.4.11")
     267  group('Node2').exec("/sbin/route add -net 192.168.6.0/24 gw 192.168.2.12")
    230268  group('Node2').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
    231269
    232   group('Node3').exec("route add -net 192.168.1.0/24 gw 192.168.3.13")
    233   group('Node3').exec("route add -net 192.168.4.0/24 gw 192.168.5.11")
     270  group('Node3').exec("/sbin/route add -net 192.168.1.0/24 gw 192.168.3.13")
     271  group('Node3').exec("/sbin/route add -net 192.168.4.0/24 gw 192.168.5.11")
    234272  group('Node3').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
    235273
    236   group('Node4').exec("route add -net 192.168.2.0/24 gw 192.168.3.12")
    237   group('Node4').exec("route add -net 192.168.4.0/24 gw 192.168.1.10")
    238   group('Node4').exec("route add -net 192.168.5.0/24 gw 192.168.3.12")
    239   group('Node4').exec("route add -net 192.168.6.0/24 gw 192.168.3.12")
     274  group('Node4').exec("/sbin/route add -net 192.168.2.0/24 gw 192.168.3.12")
     275  group('Node4').exec("/sbin/route add -net 192.168.4.0/24 gw 192.168.1.10")
     276  group('Node4').exec("/sbin/route add -net 192.168.5.0/24 gw 192.168.3.12")
     277  group('Node4').exec("/sbin/route add -net 192.168.6.0/24 gw 192.168.3.12")
    240278  group('Node4').exec("echo 1 >  /proc/sys/net/ipv4/ip_forward")
    241279
    242   group('Node5').exec("route add -net 192.168.2.0/24 gw 192.168.6.12")
    243   group('Node5').exec("route add -net 192.168.1.0/24 gw 192.168.6.12")
    244   group('Node5').exec("route add -net 192.168.3.0/24 gw 192.168.6.12")
    245   group('Node5').exec("route add -net 192.168.4.0/24 gw 192.168.6.12")
    246   group('Node5').exec("route add -net 192.168.5.0/24 gw 192.168.6.12")
     280  group('Node5').exec("/sbin/route add -net 192.168.2.0/24 gw 192.168.6.12")
     281  group('Node5').exec("/sbin/route add -net 192.168.1.0/24 gw 192.168.6.12")
     282  group('Node5').exec("/sbin/route add -net 192.168.3.0/24 gw 192.168.6.12")
     283  group('Node5').exec("/sbin/route add -net 192.168.4.0/24 gw 192.168.6.12")
     284  group('Node5').exec("/sbin/route add -net 192.168.5.0/24 gw 192.168.6.12")
    247285
    248286  info 'Routing setup finished'
    249   wait 5
     287  end
     288
     289  after 6 do
    250290  info 'Stopping applications'
    251291  allGroups.stopApplications
    252   wait 1
     292  end
     293  after 7 do
    253294  Experiment.done
    254 end
     295  end
     296end
     297
    255298}}}
    256299
     
    267310
    268311{{{
    269 defProperty('source1', "nodeA", "ID of a resource")
    270 defProperty('source2', "nodeB", "ID of a resource")
    271 defProperty('source3', "nodeC", "ID of a resource")
    272 defProperty('source4', "nodeD", "ID of a resource")
    273 defProperty('source5', "nodeE", "ID of a resource")
     312defProperty('source1', "nodeA-fivenodeping", "ID of a resource")
     313defProperty('source2', "nodeB-fivenodeping", "ID of a resource")
     314defProperty('source3', "nodeC-fivenodeping", "ID of a resource")
     315defProperty('source4', "nodeD-fivenodeping", "ID of a resource")
     316defProperty('source5', "nodeE-fivenodeping", "ID of a resource")
     317
    274318
    275319defProperty('sinkaddr11', '192.168.1.13', "Ping destination address")
     
    287331defProperty('sinkaddr53', '192.168.3.13', "Ping destination address")
    288332
    289 defApplication('ping_app', 'pingmonitor') do |a|
    290         a.path = "/root/pingWrap.rb"
    291         a.version(1, 2, 0)
    292         a.shortDescription = "Wrapper around ping"
    293         a.description = "ping application"
    294         a.defProperty('dest_addr', 'Address to ping', '-a', {:type => :string, :dynamic => false})
    295         a.defProperty('count', 'Number of times to ping', '-c', {:type => :integer, :dynamic => false})
    296         a.defProperty('interval', 'Interval between pings in s', '-i', {:type => :integer, :dynamic => false})
    297        
    298         a.defMeasurement('myping') do |m|
    299             m.defMetric('dest_addr',:string)
    300             m.defMetric('ttl',:int)
    301             m.defMetric('rtt',:float)
    302             m.defMetric('rtt_unit',:string)
    303         end
     333defApplication('ping') do |app|
     334  app.description = 'Simple Definition for the ping-oml2 application'
     335  # Define the path to the binary executable for this application
     336  app.binary_path = '/usr/local/bin/ping-oml2'
     337  # Define the configurable parameters for this application
     338  # For example if target is set to foo.com and count is set to 2, then the
     339  # application will be started with the command line:
     340  # /usr/bin/ping-oml2 -a foo.com -c 2
     341  app.defProperty('target', 'Address to ping', '-a', {:type => :string})
     342  app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
     343  # Define the OML2 measurement point that this application provides.
     344  # Here we have only one measurement point (MP) named 'ping'. Each measurement
     345  # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
     346  app.defMeasurement('ping') do |m|
     347    m.defMetric('dest_addr',:string)
     348    m.defMetric('ttl',:uint32)
     349    m.defMetric('rtt',:double)
     350    m.defMetric('rtt_unit',:string)
     351  end
    304352end
    305353
    306354defGroup('Source1', property.source1) do |node|
    307       node.addApplication("ping_app") do |app|
    308           app.setProperty('dest_addr', property.sinkaddr11)
    309           app.setProperty('count', 30)
    310           app.setProperty('interval', 1)
    311           app.measure('myping', :samples => 1)
     355  node.addApplication("ping") do |app|
     356        app.setProperty('target', property.sinkaddr11)
     357        app.setProperty('count', 30)
     358        #app.setProperty('interval', 1)
     359        app.measure('ping', :samples => 1)
    312360      end
    313361     
    314       node.addApplication("ping_app") do |app|
    315           app.setProperty('dest_addr', property.sinkaddr12)
    316           app.setProperty('count', 30)
    317           app.setProperty('interval', 1)
    318           app.measure('myping', :samples => 1)
    319       end
    320 
    321       node.addApplication("ping_app") do |app|         
    322           app.setProperty('dest_addr', property.sinkaddr13)
    323           app.setProperty('count', 30)             
    324           app.setProperty('interval', 1)                 
    325           app.measure('myping', :samples => 1)
    326       end
     362  node.addApplication("ping") do |app|
     363    app.setProperty('target', property.sinkaddr12)
     364    app.setProperty('count', 30)
     365    #app.setProperty('interval', 1)
     366    app.measure('ping', :samples => 1)
     367  end
     368
     369  node.addApplication("ping") do |app|
     370    app.setProperty('target', property.sinkaddr13)
     371    app.setProperty('count', 30)
     372    #app.setProperty('interval', 1)
     373    app.measure('ping', :samples => 1)
     374  end
    327375end
    328376
    329377defGroup('Source2', property.source1) do |node|
    330     node.addApplication("ping_app") do |app|             
    331         app.setProperty('dest_addr', property.sinkaddr21)       
    332         app.setProperty('count', 30)           
    333         app.setProperty('interval', 1)               
    334         app.measure('myping', :samples => 1)                 
    335     end                
     378  node.addApplication("ping") do |app|
     379    app.setProperty('target', property.sinkaddr21)
     380    app.setProperty('count', 30)
     381    #app.setProperty('interval', 1)
     382    app.measure('ping', :samples => 1)
     383  end               
    336384end
    337385
    338386defGroup('Source4', property.source3) do |node|
    339       node.addApplication("ping_app") do |app|
    340           app.setProperty('dest_addr', property.sinkaddr41)
    341           app.setProperty('count', 30)
    342           app.setProperty('interval', 1)
    343           app.measure('myping', :samples => 1)
    344       end
    345 
    346       node.addApplication("ping_app") do |app|
    347           app.setProperty('dest_addr', property.sinkaddr42)
    348           app.setProperty('count', 30)
    349           app.setProperty('interval', 1)
    350           app.measure('myping', :samples => 1)
    351       end
    352 
    353       node.addApplication("ping_app") do |app|
    354           app.setProperty('dest_addr', property.sinkaddr43)
    355           app.setProperty('count', 30)
    356           app.setProperty('interval', 1)
    357           app.measure('myping', :samples => 1)
    358       end
     387  node.addApplication("ping") do |app|
     388    app.setProperty('target', property.sinkaddr41)
     389    app.setProperty('count', 30)
     390    #app.setProperty('interval', 1)
     391    app.measure('ping', :samples => 1)
     392  end
     393
     394  node.addApplication("ping") do |app|
     395    app.setProperty('target', property.sinkaddr42)
     396    app.setProperty('count', 30)
     397    #app.setProperty('interval', 1)
     398    app.measure('ping', :samples => 1)
     399  end
     400
     401  node.addApplication("ping") do |app|
     402    app.setProperty('target', property.sinkaddr43)
     403    app.setProperty('count', 30)
     404    #app.setProperty('interval', 1)
     405    app.measure('ping', :samples => 1)
     406  end
    359407end
    360408
    361409defGroup('Source5', property.source3) do |node|
    362           node.addApplication("ping_app") do |app|
    363               app.setProperty('dest_addr', property.sinkaddr51)
    364               app.setProperty('count', 30)
    365               app.setProperty('interval', 1)
    366               app.measure('myping', :samples => 1)
    367           end
    368 
    369           node.addApplication("ping_app") do |app|
    370               app.setProperty('dest_addr', property.sinkaddr52)
    371               app.setProperty('count', 30)
    372               app.setProperty('interval', 1)
    373               app.measure('myping', :samples => 1)
    374           end
    375 
    376           node.addApplication("ping_app") do |app|
    377               app.setProperty('dest_addr', property.sinkaddr53)
    378               app.setProperty('count', 30)
    379               app.setProperty('interval', 1)
    380               app.measure('myping', :samples => 1)
    381           end
     410  node.addApplication("ping") do |app|
     411    app.setProperty('target', property.sinkaddr51)
     412    app.setProperty('count', 30)
     413    #app.setProperty('interval', 1)
     414    app.measure('ping', :samples => 1)
     415  end
     416
     417  node.addApplication("ping") do |app|
     418    app.setProperty('target', property.sinkaddr52)
     419    app.setProperty('count', 30)
     420    #app.setProperty('interval', 1)
     421    app.measure('ping', :samples => 1)
     422  end
     423
     424   node.addApplication("ping") do |app|
     425    app.setProperty('target', property.sinkaddr53)
     426    app.setProperty('count', 30)
     427    #app.setProperty('interval', 1)
     428    app.measure('ping', :samples => 1)
     429  end
    382430end
    383431
    384432onEvent(:ALL_UP_AND_INSTALLED) do |event|
    385       info "Starting the ping"
    386       allGroups.startApplications
    387       wait 5
    388       info "Stopping the ping"
    389       allGroups.stopApplications
    390       Experiment.done
    391 end
     433   info "Starting the ping"
     434  after 5 do
     435    allGroups.startApplications
     436  end
     437  after 70 do
     438    info "Stopping the ping"
     439    allGroups.stopApplications
     440    Experiment.done
     441  end
     442end
     443
     444
     445defGraph 'RTT' do |g|
     446  g.ms('ping').select(:oml_seq, :dest_addr, :rtt)
     447  g.caption "RTT of received packets."
     448  g.type 'line_chart3'
     449  g.mapping :x_axis => :oml_seq, :y_axis => :rtt, :group_by => :dest_addr
     450  g.xaxis :legend => 'oml_seq'
     451  g.yaxis :legend => 'rtt', :ticks => {:format => 's'}
     452end
     453
     454
     455
    392456}}}
    393457
     
    404468
    405469==== OEDL Script ====
    406 '''step4-otg_nmetrics.rb''
     470'''step4-iperf.rb''
    407471
    408472
    409473{{{
    410 defProperty('theSender','nodeB','ID of sender node')
    411 defProperty('theReceiver1', 'nodeE', "ID of receiver node")
    412 defProperty('theReceiver2', 'nodeA', "ID of receiver node")
    413 defProperty('theReceiver3', 'nodeD', "ID of receiver node")
    414 defProperty('packetsize', 128, "Packet size (byte) from the sender node")
    415 defProperty('bitrate', 2048, "Bitrate (bit/s) from the sender node")
    416 defProperty('runtime', 40, "Time in second for the experiment is to run")
    417 
    418 defGroup('Sender',property.theSender) do |node|
    419     options = { 'sample-interval' => 2 }
    420     node.addPrototype("system_monitor", options)
    421     node.addApplication("test:app:otg2") do |app|
    422         app.setProperty('udp:local_host', '192.168.2.10')
    423         app.setProperty('udp:dst_host', '192.168.6.14')
    424         app.setProperty('udp:dst_port', 3000)
    425         app.setProperty('cbr:size', property.packetsize)
    426         app.setProperty('cbr:rate', property.bitrate * 2)
    427         app.measure('udp_out', :samples => 1)
    428     end
    429    
    430     node.addApplication("test:app:otg2") do |app|
    431         app.setProperty('udp:local_host', '192.168.4.10')
    432         app.setProperty('udp:dst_host', '192.168.4.11')
    433         app.setProperty('udp:dst_port', 3000)
    434         app.setProperty('cbr:size', property.packetsize)
    435         app.setProperty('cbr:rate', property.bitrate * 2)
    436         app.measure('udp_out', :samples => 1)
    437     end
    438    
    439     node.addApplication("test:app:otg2") do |app|
    440         app.setProperty('udp:local_host', '192.168.1.10')
    441         app.setProperty('udp:dst_host', '192.168.1.13')
    442         app.setProperty('udp:dst_port', 3000)                                   
    443         app.setProperty('cbr:size', property.packetsize)                                           
    444         app.setProperty('cbr:rate', property.bitrate * 2)                                                   
    445         app.measure('udp_out', :samples => 1)                                                       
    446     end
    447 end
    448 
    449 defGroup('Receiver1',property.theReceiver1) do |node|
    450     options = { 'sample-interval' => 2 }
    451     node.addPrototype("system_monitor", options)
    452 
    453     node.addApplication("test:app:otr2") do |app|
    454         app.setProperty('udp:local_host', '192.168.6.14')
    455         app.setProperty('udp:local_port', 3000)
    456         app.measure('udp_in', :samples => 1)
    457     end
    458 end
    459 
    460 defGroup('Receiver2',property.theReceiver2) do |node|
    461     options = { 'sample-interval' => 2 }
    462     node.addPrototype("system_monitor", options)
    463     node.addApplication("test:app:otr2") do |app|
    464         app.setProperty('udp:local_host', '192.168.4.11')
    465         app.setProperty('udp:local_port', 3000)
    466         app.measure('udp_in', :samples => 1)
    467     end
    468 end
    469 
    470 defGroup('Receiver3',property.theReceiver3) do |node|     
    471     options = { 'sample-interval' => 2 }
    472     node.addPrototype("system_monitor", options)
    473     node.addApplication("test:app:otr2") do |app|                   
    474         app.setProperty('udp:local_host', '192.168.1.13')
    475         app.setProperty('udp:local_port', 3000)                               
    476         app.measure('udp_in', :samples => 1)                                   
     474defProperty('source1', "nodeA-fivenodetest", "ID of a resource")
     475defProperty('source2', "nodeB-fivenodetest", "ID of a resource")
     476defProperty('source3', "nodeC-fivenodetest", "ID of a resource")
     477defProperty('source4', "nodeD-fivenodetest", "ID of a resource")
     478defProperty('source5', "nodeE-fivenodetest", "ID of a resource")
     479
     480
     481defProperty('sinkaddr11', '192.168.1.13', "Ping destination address")
     482defProperty('sinkaddr12', '192.168.3.13', "Ping destination address")
     483defProperty('sinkaddr13', '192.168.6.14', "Ping destination address")
     484
     485defProperty('sinkaddr21', '192.168.6.14', "Ping destination address")
     486
     487defProperty('sinkaddr41', '192.168.4.11', "Ping destination address")
     488defProperty('sinkaddr42', '192.168.5.11', "Ping destination address")
     489defProperty('sinkaddr43', '192.168.6.14', "Ping destination address")
     490
     491defProperty('sinkaddr51', '192.168.5.11', "Ping destination address")
     492defProperty('sinkaddr52', '192.168.2.10', "Ping destination address")
     493defProperty('sinkaddr53', '192.168.3.13', "Ping destination address")
     494
     495defApplication('iperf') do |app|
     496  app.description = "Iperf is a traffic generator and bandwidth measurement
     497tool. It provides generators producing various forms of packet streams and port
     498for sending these packets via various transports, such as TCP and UDP."
     499  app.binary_path = "/usr/bin/iperf_oml2"
     500
     501  #app.defProperty('interval', 'pause n seconds between periodic bandwidth reports', '-i',
     502   # :type => :double, :unit => "seconds", :default => '1.')
     503  app.defProperty('len', 'set length read/write buffer to n (default 8 KB)', '-l',
     504                  :type => :integer, :unit => "KiBytes")
     505  app.defProperty('print_mss', 'print TCP maximum segment size (MTU - TCP/IP header)', '-m',
     506                  :type => :boolean)
     507  app.defProperty('output', 'output the report or error message to this specified file', '-o',
     508                  :type => :string)
     509  app.defProperty('port', 'set server port to listen on/connect to to n (default 5001)', '-p',
     510                  :type => :integer)
     511  app.defProperty('udp', 'use UDP rather than TCP', '-u',
     512                  :type => :boolean,
     513                  :order => 2)
     514  app.defProperty('window', 'TCP window size (socket buffer size)', '-w',
     515                  :type => :integer, :unit => "Bytes")
     516  app.defProperty('bind', 'bind to <host>, an interface or multicast address', '-B',
     517                  :type => :string)
     518  app.defProperty('compatibility', 'for use with older versions does not sent extra msgs', '-C',
     519                  :type => :boolean)
     520  app.defProperty('mss', 'set TCP maximum segment size (MTU - 40 bytes)', '-M',
     521                  :type => :integer, :unit => "Bytes")
     522  app.defProperty('nodelay', 'set TCP no delay, disabling Nagle\'s Algorithm', '-N',
     523                  :type => :boolean)
     524  app.defProperty('IPv6Version', 'set the domain to IPv6', '-V',
     525                  :type => :boolean)
     526  app.defProperty('reportexclude', 'exclude C(connection) D(data) M(multicast) S(settings) V(server) reports', '-x',
     527                  :type => :string, :unit => "[CDMSV]")
     528  app.defProperty('reportstyle', 'C or c for CSV report, O or o for OML', '-y',
     529                  :type => :string, :unit => "[CcOo]", :default => "o") # Use OML reporting by default
     530
     531  app.defProperty('server', 'run in server mode', '-s',
     532                  :type => :boolean)
     533
     534  app.defProperty('bandwidth', 'set target bandwidth to n bits/sec (default 1 Mbit/sec)', '-b',
     535                  :type => :string, :unit => "Mbps")
     536  app.defProperty('client', 'run in client mode, connecting to <host>', '-c',
     537                  :type => :string,
     538                  :order => 1)
     539  app.defProperty('dualtest', 'do a bidirectional test simultaneously', '-d',
     540                  :type => :boolean)
     541  app.defProperty('num', 'number of bytes to transmit (instead of -t)', '-n',
     542                  :type => :integer, :unit => "Bytes")
     543  app.defProperty('tradeoff', 'do a bidirectional test individually', '-r',
     544                  :type => :boolean)
     545  app.defProperty('time', 'time in seconds to transmit for (default 10 secs)', '-t',
     546                  :type => :integer, :unit => "seconds")
     547  app.defProperty('fileinput', 'input the data to be transmitted from a file', '-F',
     548                  :type => :string)
     549  app.defProperty('stdin', 'input the data to be transmitted from stdin', '-I',
     550                  :type => :boolean)
     551  app.defProperty('listenport', 'port to recieve bidirectional tests back on', '-L',
     552                  :type => :integer)
     553  app.defProperty('parallel', 'number of parallel client threads to run', '-P',
     554                  :type => :integer)
     555  app.defProperty('ttl', 'time-to-live, for multicast (default 1)', '-T',
     556                  :type => :integer,
     557                  :default => 1)
     558  app.defProperty('linux_congestion', 'set TCP congestion control algorithm (Linux only)', '-Z',
     559                  :type => :boolean)
     560
     561  app.defMeasurement("application"){ |m|
     562    m.defMetric('pid', :integer)
     563    m.defMetric('version', :string)
     564    m.defMetric('cmdline', :string)
     565    m.defMetric('starttime_s', :integer)
     566    m.defMetric('starttime_us', :integer)
     567  }
     568
     569  app.defMeasurement("settings"){ |m|
     570    m.defMetric('pid', :integer)
     571    m.defMetric('server_mode', :integer)
     572    m.defMetric('bind_address', :string)
     573    m.defMetric('multicast', :integer)
     574    m.defMetric('multicast_ttl', :integer)
     575    m.defMetric('transport_protocol', :integer)
     576    m.defMetric('window_size', :integer)
     577    m.defMetric('buffer_size', :integer)
     578  }
     579
     580  app.defMeasurement("connection"){ |m|
     581    m.defMetric('pid', :integer)
     582    m.defMetric('connection_id', :integer)
     583    m.defMetric('local_address', :string)
     584    m.defMetric('local_port', :integer)
     585    m.defMetric('remote_address', :string)
     586    m.defMetric('remote_port', :integer)
     587  }
     588
     589  app.defMeasurement("transfer"){ |m|
     590    m.defMetric('pid', :integer)
     591    m.defMetric('connection_id', :integer)
     592    m.defMetric('begin_interval', :double)
     593    m.defMetric('end_interval', :double)
     594    m.defMetric('size', :uint64)
     595  }
     596
     597  app.defMeasurement("losses"){ |m|
     598    m.defMetric('pid', :integer)
     599    m.defMetric('connection_id', :integer)
     600    m.defMetric('begin_interval', :double)
     601    m.defMetric('end_interval', :double)
     602    m.defMetric('total_datagrams', :integer)
     603    m.defMetric('lost_datagrams', :integer)
     604  }
     605
     606  app.defMeasurement("jitter"){ |m|
     607    m.defMetric('pid', :integer)
     608    m.defMetric('connection_id', :integer)
     609    m.defMetric('begin_interval', :double)
     610    m.defMetric('end_interval', :double)
     611    m.defMetric('jitter', :double)
     612  }
     613
     614  app.defMeasurement("packets"){ |m|
     615    m.defMetric('pid', :integer)
     616    m.defMetric('connection_id', :integer)
     617    m.defMetric('packet_id', :integer)
     618    m.defMetric('packet_size', :integer)
     619    m.defMetric('packet_time_s', :integer)
     620    m.defMetric('packet_time_us', :integer)
     621    m.defMetric('packet_sent_time_s', :integer)
     622    m.defMetric('packet_sent_time_us', :integer)
     623  }
     624
     625end
     626
     627
     628defGroup('Serverapp', property.source1, property.source2, property.source4, property.source5) do |node|
     629 node.addApplication("iperf") do |app|
     630        #app.setProperty('interval', property.setinterval)
     631        app.setProperty('server',true)
     632        app.setProperty('port',6001)
     633        app.measure('transfer', :samples => 1)
     634    end
     635end
     636
     637
     638defGroup('Source1', property.source1) do |node|
     639    node.addApplication("iperf") do |app|
     640        #app.setProperty('interval',property.setinterval)
     641        app.setProperty('client',property.sinkaddr11)
     642        app.setProperty('time',30)
     643        app.setProperty('port',6001)
     644        #app.setProperty('bandwidth',property.setbandwidth)
     645        app.measure('transfer', :samples => 1)
     646        app.measure('packets', :samples => 1)
     647    end
     648    node.addApplication("iperf") do |app|
     649        #app.setProperty('interval',property.setinterval)
     650        app.setProperty('client',property.sinkaddr12)
     651        app.setProperty('time',30)
     652        app.setProperty('port',6001)
     653        #app.setProperty('bandwidth',property.setbandwidth)
     654        app.measure('transfer', :samples => 1)
     655        app.measure('packets', :samples => 1)
     656    end
     657    node.addApplication("iperf") do |app|
     658        #app.setProperty('interval',property.setinterval)
     659        app.setProperty('client',property.sinkaddr13)
     660        app.setProperty('time',30)
     661        app.setProperty('port',6001)
     662        #app.setProperty('bandwidth',property.setbandwidth)
     663        app.measure('transfer', :samples => 1)
     664        app.measure('packets', :samples => 1)
     665    end
     666end
     667defGroup('Source2', property.source2) do |node|
     668    node.addApplication("iperf") do |app|
     669        #app.setProperty('interval',property.setinterval)
     670        app.setProperty('client',property.sinkaddr21)
     671        app.setProperty('time',30)
     672        app.setProperty('port',6001)
     673        #app.setProperty('bandwidth',property.setbandwidth)
     674        app.measure('transfer', :samples => 1)
     675        app.measure('packets', :samples => 1)
     676    end
     677end
     678
     679defGroup('Source4', property.source4) do |node|
     680    node.addApplication("iperf") do |app|
     681        #app.setProperty('interval',property.setinterval)
     682        app.setProperty('client',property.sinkaddr41)
     683        app.setProperty('time',30)
     684        app.setProperty('port',6001)
     685        #app.setProperty('bandwidth',property.setbandwidth)
     686        app.measure('transfer', :samples => 1)
     687        app.measure('packets', :samples => 1)
     688    end
     689    node.addApplication("iperf") do |app|
     690        #app.setProperty('interval',property.setinterval)
     691        app.setProperty('client',property.sinkaddr42)
     692        app.setProperty('time',30)
     693        app.setProperty('port',6001)
     694        #app.setProperty('bandwidth',property.setbandwidth)
     695        app.measure('transfer', :samples => 1)
     696        app.measure('packets', :samples => 1)
     697    end
     698    node.addApplication("iperf") do |app|
     699        #app.setProperty('interval',property.setinterval)
     700        app.setProperty('client',property.sinkaddr43)
     701        app.setProperty('time',30)
     702        app.setProperty('port',6001)
     703        #app.setProperty('bandwidth',property.setbandwidth)
     704        app.measure('transfer', :samples => 1)
     705        app.measure('packets', :samples => 1)
     706    end
     707end
     708
     709defGroup('Source5', property.source5) do |node|
     710    node.addApplication("iperf") do |app|
     711        #app.setProperty('interval',property.setinterval)
     712        app.setProperty('client',property.sinkaddr51)
     713        app.setProperty('time',30)
     714        app.setProperty('port',6001)
     715        #app.setProperty('bandwidth',property.setbandwidth)
     716        app.measure('transfer', :samples => 1)
     717        app.measure('packets', :samples => 1)
     718    end
     719     node.addApplication("iperf") do |app|
     720        #app.setProperty('interval',property.setinterval)
     721        app.setProperty('client',property.sinkaddr52)
     722        app.setProperty('time',30)
     723        app.setProperty('port',6001)
     724        #app.setProperty('bandwidth',property.setbandwidth)
     725        app.measure('transfer', :samples => 1)
     726        app.measure('packets', :samples => 1)
     727    end
     728     node.addApplication("iperf") do |app|
     729        #app.setProperty('interval',property.setinterval)
     730        app.setProperty('client',property.sinkaddr53)
     731        app.setProperty('time',30)
     732        app.setProperty('port',6001)
     733        #app.setProperty('bandwidth',property.setbandwidth)
     734        app.measure('transfer', :samples => 1)
     735        app.measure('packets', :samples => 1)
    477736    end
    478737end
    479738
    480739onEvent(:ALL_UP_AND_INSTALLED) do |event|
    481     info "starting"
    482     wait 5
    483     allGroups.exec("ln -s /usr/local/bin/otr2 /usr/bin/otr2")
    484     allGroups.exec("ln -s /usr/local/bin/otg2 /usr/bin/otg2")
    485     allGroups.exec("ln -s /usr/local/bin/oml2-nmetrics /usr/bin/oml2-nmetrics")
    486     allGroups.startApplications
    487     info "All applications started..."
    488     wait property.runtime / 4
    489     property.packetsize = 256
    490     wait property.runtime / 4
    491     property.packetsize = 512
    492     wait property.runtime / 4
    493     property.packetsize = 1024
    494     wait property.runtime / 4
     740   info "Starting the iperf"
     741   wait 1
     742    group('Serverapp').startApplications
     743  wait 3
     744    group('Source1').startApplications
     745    group('Source2').startApplications
     746    group('Source4').startApplications
     747  wait 40
     748    info "Stopping the iperf"
     749    group('Source1').stopApplications
     750    group('Source2').stopApplications
     751    group('Source4').stopApplications
     752  wait 2
    495753    allGroups.stopApplications
    496     info "All applications stopped."
    497754    Experiment.done
    498755end
     756
     757defGraph 'Received bytes' do |g|
     758  g.ms('transfer').select {[ oml_ts_client.as(:ts), :size , :connection_id]}
     759  g.caption "Packet length measurement."
     760  g.type 'line_chart3'
     761  g.mapping :x_axis => :ts, :y_axis => :size, :group_by => :connection_id
     762  g.xaxis :legend => 'time [s]'
     763  g.yaxis :legend => 'packet size', :ticks => {:format => 's'}
     764end
     765
     766
    499767}}}
    500768