| 17 | defProperty('source1', "client-lwtest6", "ID of a resource") |
| 18 | defProperty('thelistener', "server-lwtest6", "ID of a resource") |
| 19 | defProperty('thesender', "client-lwtest6", "ID of a resource") |
| 20 | defProperty('thesender2', "client-lwtest6", "ID of a resource") |
| 21 | defProperty('interfaceServer', "eth3", 'server interface to modify') |
| 22 | defProperty('capacity', 10000000, 'in bits per second') |
| 23 | |
| 24 | defProperty('sinkaddr11', '10.0.5.102', "Ping destination address") |
| 25 | defProperty('sinkaddr12', '10.0.5.101', "Ping destination address") |
| 26 | |
20 | | |
21 | | === 2.3 Define Group === |
| 30 | The entire application definition for OML-Iperf is given [http://mytestbed.net/projects/omlapp/repository/iperf/entry/oml/iperf.rb.in?rev=oml%2Fmaster here] |
| 31 | |
| 32 | Select the definition you will use in your experiment. The Application definition includes the properties and measurement parameters |
| 33 | |
| 34 | |
| 35 | {{{ |
| 36 | defApplication('iperf') do |app| |
| 37 | app.description = 'Iperf traffic generator and bandwidth measurement tool' |
| 38 | app.binary_path = "/usr/bin/iperf-oml2" |
| 39 | |
| 40 | app.defProperty('server', 'run in server mode', '-s', |
| 41 | :type => :boolean) |
| 42 | |
| 43 | app.defProperty('client', 'run in client mode, connecting to <host>', '-c', |
| 44 | :type => :string, |
| 45 | :order => 1) |
| 46 | |
| 47 | app.defMeasurement("transfer"){ |m| |
| 48 | m.defMetric('pid', :integer, 'Main process identifier') |
| 49 | m.defMetric('connection_id', :integer, 'Connection identifier (socket)') |
| 50 | m.defMetric('begin_interval', :double, 'Start of the averaging interval (Iperf timestamp)') |
| 51 | m.defMetric('end_interval', :double, 'End of the averaging interval (Iperf timestamp)') |
| 52 | m.defMetric('size', :uint64, 'Amount of transmitted data [Bytes]') |
| 53 | } |
| 54 | app.defMeasurement("connection"){ |m| |
| 55 | m.defMetric('pid', :integer, 'Main process identifier') |
| 56 | m.defMetric('connection_id', :integer, 'Connection identifier (socket)') |
| 57 | m.defMetric('local_address', :string, 'Local network address') |
| 58 | m.defMetric('local_port', :integer, 'Local port') |
| 59 | m.defMetric('remote_address', :string, 'Remote network address') |
| 60 | m.defMetric('remote_port', :integer, 'Remote port') |
| 61 | } |
| 62 | |
| 63 | end |
| 64 | }}} |
| 65 | |
| 66 | We follow the same for the ping application |
| 67 | === 2.3 Define Group and add Applications=== |
29 | | |
30 | | === 2.3 Adding Applications === |
31 | | |
32 | | |
33 | | === 2.4 Define Experiment Event === |
34 | | |
35 | | |
36 | | === 2.5 Complete OEDL script === |
| 86 | {{{ |
| 87 | defGroup('theSender', property.thesender) do |node| |
| 88 | node.addApplication("iperf") do |app| |
| 89 | app.setProperty('client', property.sinkaddr12) |
| 90 | #app.measure('transfer', :samples => 1) |
| 91 | end |
| 92 | end |
| 93 | }}} |
| 94 | |
| 95 | c) Ping Group |
| 96 | |
| 97 | {{{ |
| 98 | defGroup('Source1', property.source1) do |node| |
| 99 | node.addApplication("ping") do |app| |
| 100 | app.setProperty('target', property.sinkaddr12) |
| 101 | app.setProperty('count', 40) |
| 102 | #app.setProperty('interval', 1) |
| 103 | app.measure('ping', :samples => 1) |
| 104 | end |
| 105 | end |
| 106 | }}} |
| 107 | === 2.3 Define Experiment Event === |
| 108 | |
| 109 | ==== 2.3.1 Traffic Control ==== |
| 110 | |
| 111 | |
| 112 | {{{ |
| 113 | group("theReceiver").exec("/sbin/modprobe sch_netem") |
| 114 | group("theReceiver").exec("/sbin/modprobe ifb numifbs=10") |
| 115 | group("theReceiver").exec("/sbin/sysctl -w net.core.rmem_max=8388608") |
| 116 | group("theReceiver").exec("/sbin/sysctl -w net.core.wmem_max=8388608") |
| 117 | group("theReceiver").exec("/sbin/sysctl -w net.core.netdev_max_backlog=2048") |
| 118 | #group("theReceiver").exec("/sbin/ifconfig #{prop.interfaceServer} txqueuelen") |
| 119 | group("theReceiver").exec("/sbin/tc qdisc del dev #{prop.interfaceServer} root") |
| 120 | group("theReceiver").exec("/sbin/tc qdisc del dev #{prop.interfaceServer} ingress") |
| 121 | group("theReceiver").exec("/sbin/tc qdisc add dev #{prop.interfaceServer} handle 130 root htb default 1") |
| 122 | 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}") |
| 123 | group("theReceiver").exec("/sbin/tc qdisc add dev #{prop.interfaceServer} handle 120 parent 130:1 netem drop 0 delay 0us") |
| 124 | }}} |
| 125 | |
| 126 | |
| 127 | ==== 2.3.2 Define Events ==== |
| 128 | |
| 129 | |
| 130 | {{{ |
| 131 | after 2 do |
| 132 | group('theReceiver').startApplications |
| 133 | end |
| 134 | after 5 do |
| 135 | group('theSender').startApplications |
| 136 | info "Starting the ping" |
| 137 | group('Source1').startApplications |
| 138 | end |
| 139 | after 15 do |
| 140 | group('theSender2').startApplications |
| 141 | end |
| 142 | after 70 do |
| 143 | info "Stopping the ping" |
| 144 | group('theSender').stopApplications |
| 145 | end |
| 146 | after 72 do |
| 147 | allGroups.stopApplications |
| 148 | Experiment.done |
| 149 | end |
| 150 | }}} |
| 151 | |
| 152 | |
| 153 | === 2.4 Complete OEDL script === |