Changes between Version 14 and Version 15 of GENIFIRE/Labwiki/Part0/Execute


Ignore:
Timestamp:
07/07/14 19:03:54 (5 years ago)
Author:
divyashri.bhat@gmail.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • GENIFIRE/Labwiki/Part0/Execute

    v14 v15  
    116116
    117117The script is also shown here for your reference:
    118 {{{
    119 
    120 defProperty('source1', "nodeb-divpart0", "ID of a resource")
    121 defProperty('thelistener', "nodea-divpart0", "ID of a resource")
    122 defProperty('thesender', "nodeb-divpart0", "ID of a resource")
    123 defProperty('thesender2', "nodeb-divpart0", "ID of a resource")
    124 defProperty('interfaceServer', "wlan0", 'server interface to modify')
    125 defProperty('capacity', 10000000, 'in bits per second')
    126 
    127 defProperty('sinkaddr11', '192.168.1.7', "Ping destination address")
    128 defProperty('sinkaddr12', '192.168.1.6', "Ping destination address")
    129 
    130 defApplication('iperf') do |app|
    131   app.description = 'Iperf traffic generator and bandwidth measurement tool'
    132   app.binary_path = "/usr/bin/iperf-oml2"
    133 
    134   app.defProperty('server', 'run in server mode', '-s',
    135                   :type => :boolean)
    136 
    137   app.defProperty('client', 'run in client mode, connecting to <host>', '-c',
    138                   :type => :string,
    139                   :order => 1)
    140 
    141   app.defMeasurement("transfer"){ |m|
    142     m.defMetric('pid', :integer, 'Main process identifier')
    143     m.defMetric('connection_id', :integer, 'Connection identifier (socket)')
    144     m.defMetric('begin_interval', :double, 'Start of the averaging interval (Iperf timestamp)')
    145     m.defMetric('end_interval', :double, 'End of the averaging interval (Iperf timestamp)')
    146     m.defMetric('size', :uint64, 'Amount of transmitted data [Bytes]')
    147   }
    148    app.defMeasurement("connection"){ |m|
    149     m.defMetric('pid', :integer, 'Main process identifier')
    150     m.defMetric('connection_id', :integer, 'Connection identifier (socket)')
    151     m.defMetric('local_address', :string, 'Local network address')
    152     m.defMetric('local_port', :integer, 'Local port')
    153     m.defMetric('remote_address', :string, 'Remote network address')
    154     m.defMetric('remote_port', :integer, 'Remote port')
    155   }
    156 
    157 end
    158118
    159119
    160 defApplication('ping') do |app|
    161   app.description = 'Simple Definition for the ping-oml2 application'
    162   # Define the path to the binary executable for this application
    163   app.binary_path = '/usr/local/bin/ping-oml2'
    164   # Define the configurable parameters for this application
    165   # For example if target is set to foo.com and count is set to 2, then the
    166   # application will be started with the command line:
    167   # /usr/bin/ping-oml2 -a foo.com -c 2
    168   app.defProperty('target', 'Address to ping', '-a', {:type => :string})
    169   app.defProperty('count', 'Number of times to ping', '-c', {:type => :integer})
    170   # Define the OML2 measurement point that this application provides.
    171   # Here we have only one measurement point (MP) named 'ping'. Each measurement
    172   # sample from this MP will be composed of a 4-tuples (addr,ttl,rtt,rtt_unit)
    173   app.defMeasurement('ping') do |m|
    174     m.defMetric('dest_addr',:string)
    175     m.defMetric('ttl',:uint32)
    176     m.defMetric('rtt',:double)
    177     m.defMetric('rtt_unit',:string)
    178   end
    179 end
    180 defGroup('Source1', property.source1) do |node|
    181   node.addApplication("ping") do |app|
    182     app.setProperty('target', property.sinkaddr12)
    183     app.setProperty('count', 40)
    184     #app.setProperty('interval', 1)
    185     app.measure('ping', :samples => 1)
    186   end
    187 end
    188 defGroup('theReceiver', property.thelistener) do |node|
    189   node.addApplication("iperf") do |app|
    190     app.setProperty('server', true)
    191     app.measure('transfer', :samples => 1)
    192     app.measure('connection', :samples => 1)
    193   end
    194 end
    195 
    196 defGroup('theSender', property.thesender) do |node|
    197   node.addApplication("iperf") do |app|
    198     app.setProperty('client', property.sinkaddr12)
    199     #app.measure('transfer', :samples => 1)
    200   end
    201 end
    202 defGroup('theSender2', property.thesender2) do |node|
    203   node.addApplication("iperf") do |app|
    204     app.setProperty('client', property.sinkaddr12)
    205     #app.measure('transfer', :samples => 1)
    206   end
    207 end
    208 
    209 
    210 
    211 onEvent(:ALL_UP_AND_INSTALLED) do |event|
    212   info(" ------ Setup Traffic Shaping")
    213   group("theReceiver").exec("/sbin/modprobe sch_netem")
    214   group("theReceiver").exec("/sbin/modprobe ifb numifbs=10")
    215   group("theReceiver").exec("/sbin/sysctl -w net.core.rmem_max=8388608")
    216   group("theReceiver").exec("/sbin/sysctl -w net.core.wmem_max=8388608")
    217   group("theReceiver").exec("/sbin/sysctl -w net.core.netdev_max_backlog=2048")
    218   #group("theReceiver").exec("/sbin/ifconfig #{prop.interfaceServer} txqueuelen")
    219   group("theReceiver").exec("/sbin/tc qdisc del dev #{prop.interfaceServer} root")
    220   group("theReceiver").exec("/sbin/tc qdisc del dev #{prop.interfaceServer} ingress")
    221   group("theReceiver").exec("/sbin/tc qdisc add dev #{prop.interfaceServer} handle 130 root htb default 1")
    222   group("theReceiver").exec("/sbin/tc class add dev #{prop.interfaceServer} classid 130:1 parent 130 htb rate #{prop.capacity.to_s} ceil #{prop.capacity.to_s}")
    223   group("theReceiver").exec("/sbin/tc qdisc add dev #{prop.interfaceServer} handle 120 parent 130:1 netem drop 0 delay 0us")
    224   after 2 do
    225     group('theReceiver').startApplications
    226   end
    227   after 5 do
    228     group('theSender').startApplications
    229      info "Starting the ping"
    230     group('Source1').startApplications
    231   end
    232   after 15 do
    233     group('theSender2').startApplications
    234   end
    235   after 70 do
    236     info "Stopping the ping"
    237     group('theSender').stopApplications
    238   end
    239   after 72 do
    240     allGroups.stopApplications
    241     Experiment.done
    242   end
    243 end
    244 
    245 defGraph 'RTT' do |g|
    246   g.ms('ping').select(:oml_seq, :dest_addr, :rtt)
    247   g.caption "RTT of received packets."
    248   g.type 'line_chart3'
    249   g.mapping :x_axis => :oml_seq, :y_axis => :rtt, :group_by => :dest_addr
    250   g.xaxis :legend => 'oml_seq'
    251   g.yaxis :legend => 'rtt', :ticks => {:format => 's'}
    252 end
    253 defGraph 'Iperf' do |g|
    254   g.ms('transfer').select(:oml_seq, :size, :connection_id)
    255   g.caption "Size of received packets."
    256   g.type 'line_chart3'
    257   g.mapping :x_axis => :oml_seq, :y_axis => :size, :group_by => :connection_id
    258   g.xaxis :legend => 'oml_seq [s]'
    259   g.yaxis :legend => 'size [Bytes]', :ticks => {:format => 's'}
    260 end
    261 
    262 }}}
    263120
    264121=== 2.1.3 Start your application from !LabWiki ===