74 | | {{{ |
75 | | defProperty('theSender', "outside-loadbaltest", "ID of sender node") |
76 | | defProperty('theReceiver', "inside-loadbaltest", "ID of receiver node") |
77 | | defProperty('theSwitch',"switch-loadbaltest","ID of switch node") |
78 | | defProperty('setinterval','1.0',"Time between iperf") |
79 | | defProperty('serverip', "10.10.10.2","Server interface IP") |
80 | | defProperty('clientip', "10.10.10.1","Client interface IP") |
81 | | defProperty('setbandwidth', "100m", "Throughput of Sender") |
82 | | defApplication('trace') do |app| |
83 | | app.description = 'Packet capture' |
84 | | app.binary_path = "/usr/bin/trace-oml2" |
85 | | app.defProperty('filter', 'Filter expression BPFEXP', '-f', {:type => :string, :mnemonic => 'f'}) |
86 | | app.defProperty('interface', 'Interface to trace', '-i',{:type => :string, :mnemonic => 'i', :default => '"eth0"'}) |
87 | | app.defProperty('config', 'config file to follow', '--oml-config',{:type => :string, :default => '"/tmp/monitor/conf.xml"'}) |
88 | | |
89 | | app.defMeasurement("ip") do |m| |
90 | | m.defMetric('pktid', :uint64, ' internal packet ID to link MPs') |
91 | | m.defMetric('ip_tos', :uint32, ' Type of Service') |
92 | | m.defMetric('ip_len', :uint32, ' Total Length') |
93 | | m.defMetric('ip_id', :int32, ' Identification') |
94 | | m.defMetric('ip_off', :uint32, ' IP Fragment offset (and flags)') |
95 | | m.defMetric('ip_ttl', :uint32, ' Time to Live') |
96 | | m.defMetric('ip_proto', :uint32, ' Protocol') |
97 | | m.defMetric('ip_sum', :uint32, ' Checksum') |
98 | | m.defMetric('ip_src', :string, ' Source Address') |
99 | | m.defMetric('ip_dst', :string, ' Destination Address') |
100 | | m.defMetric('ip_sizeofpacket', :uint32, ' Size of the Packet') |
101 | | m.defMetric('ip_ts', :double, ' timestamp of the measurement') |
102 | | end |
103 | | |
104 | | end |
105 | | defApplication('iperf') do |app| |
106 | | app.description = "Iperf is a traffic generator and bandwidth measurement |
107 | | tool. It provides generators producing various forms of packet streams and port |
108 | | for sending these packets via various transports, such as TCP and UDP." |
109 | | app.binary_path = "/usr/bin/iperf_oml2" |
110 | | |
111 | | #app.defProperty('interval', 'pause n seconds between periodic bandwidth reports', '-i', |
112 | | # :type => :double, :unit => "seconds", :default => '1.') |
113 | | app.defProperty('len', 'set length read/write buffer to n (default 8 KB)', '-l', |
114 | | :type => :integer, :unit => "KiBytes") |
115 | | app.defProperty('print_mss', 'print TCP maximum segment size (MTU - TCP/IP header)', '-m', |
116 | | :type => :boolean) |
117 | | app.defProperty('output', 'output the report or error message to this specified file', '-o', |
118 | | :type => :string) |
119 | | app.defProperty('port', 'set server port to listen on/connect to to n (default 5001)', '-p', |
120 | | :type => :integer) |
121 | | app.defProperty('udp', 'use UDP rather than TCP', '-u', |
122 | | :type => :boolean, |
123 | | :order => 2) |
124 | | app.defProperty('window', 'TCP window size (socket buffer size)', '-w', |
125 | | :type => :integer, :unit => "Bytes") |
126 | | app.defProperty('bind', 'bind to <host>, an interface or multicast address', '-B', |
127 | | :type => :string) |
128 | | app.defProperty('compatibility', 'for use with older versions does not sent extra msgs', '-C', |
129 | | :type => :boolean) |
130 | | app.defProperty('mss', 'set TCP maximum segment size (MTU - 40 bytes)', '-M', |
131 | | :type => :integer, :unit => "Bytes") |
132 | | app.defProperty('nodelay', 'set TCP no delay, disabling Nagle\'s Algorithm', '-N', |
133 | | :type => :boolean) |
134 | | app.defProperty('IPv6Version', 'set the domain to IPv6', '-V', |
135 | | :type => :boolean) |
136 | | app.defProperty('reportexclude', 'exclude C(connection) D(data) M(multicast) S(settings) V(server) reports', '-x', |
137 | | :type => :string, :unit => "[CDMSV]") |
138 | | app.defProperty('reportstyle', 'C or c for CSV report, O or o for OML', '-y', |
139 | | :type => :string, :unit => "[CcOo]", :default => "o") # Use OML reporting by default |
140 | | |
141 | | app.defProperty('server', 'run in server mode', '-s', |
142 | | :type => :boolean) |
143 | | |
144 | | app.defProperty('bandwidth', 'set target bandwidth to n bits/sec (default 1 Mbit/sec)', '-b', |
145 | | :type => :string, :unit => "Mbps") |
146 | | app.defProperty('client', 'run in client mode, connecting to <host>', '-c', |
147 | | :type => :string, |
148 | | :order => 1) |
149 | | app.defProperty('dualtest', 'do a bidirectional test simultaneously', '-d', |
150 | | :type => :boolean) |
151 | | app.defProperty('num', 'number of bytes to transmit (instead of -t)', '-n', |
152 | | :type => :integer, :unit => "Bytes") |
153 | | app.defProperty('tradeoff', 'do a bidirectional test individually', '-r', |
154 | | :type => :boolean) |
155 | | app.defProperty('time', 'time in seconds to transmit for (default 10 secs)', '-t', |
156 | | :type => :integer, :unit => "seconds") |
157 | | app.defProperty('fileinput', 'input the data to be transmitted from a file', '-F', |
158 | | :type => :string) |
159 | | app.defProperty('stdin', 'input the data to be transmitted from stdin', '-I', |
160 | | :type => :boolean) |
161 | | app.defProperty('listenport', 'port to recieve bidirectional tests back on', '-L', |
162 | | :type => :integer) |
163 | | app.defProperty('parallel', 'number of parallel client threads to run', '-P', |
164 | | :type => :integer) |
165 | | app.defProperty('ttl', 'time-to-live, for multicast (default 1)', '-T', |
166 | | :type => :integer, |
167 | | :default => 1) |
168 | | app.defProperty('linux_congestion', 'set TCP congestion control algorithm (Linux only)', '-Z', |
169 | | :type => :boolean) |
170 | | |
171 | | app.defMeasurement("application"){ |m| |
172 | | m.defMetric('pid', :integer) |
173 | | m.defMetric('version', :string) |
174 | | m.defMetric('cmdline', :string) |
175 | | m.defMetric('starttime_s', :integer) |
176 | | m.defMetric('starttime_us', :integer) |
177 | | } |
178 | | |
179 | | app.defMeasurement("settings"){ |m| |
180 | | m.defMetric('pid', :integer) |
181 | | m.defMetric('server_mode', :integer) |
182 | | m.defMetric('bind_address', :string) |
183 | | m.defMetric('multicast', :integer) |
184 | | m.defMetric('multicast_ttl', :integer) |
185 | | m.defMetric('transport_protocol', :integer) |
186 | | m.defMetric('window_size', :integer) |
187 | | m.defMetric('buffer_size', :integer) |
188 | | } |
189 | | |
190 | | app.defMeasurement("connection"){ |m| |
191 | | m.defMetric('pid', :integer) |
192 | | m.defMetric('connection_id', :integer) |
193 | | m.defMetric('local_address', :string) |
194 | | m.defMetric('local_port', :integer) |
195 | | m.defMetric('remote_address', :string) |
196 | | m.defMetric('remote_port', :integer) |
197 | | } |
198 | | |
199 | | app.defMeasurement("transfer"){ |m| |
200 | | m.defMetric('pid', :integer) |
201 | | m.defMetric('connection_id', :integer) |
202 | | m.defMetric('begin_interval', :double) |
203 | | m.defMetric('end_interval', :double) |
204 | | m.defMetric('size', :uint64) |
205 | | } |
206 | | |
207 | | app.defMeasurement("losses"){ |m| |
208 | | m.defMetric('pid', :integer) |
209 | | m.defMetric('connection_id', :integer) |
210 | | m.defMetric('begin_interval', :double) |
211 | | m.defMetric('end_interval', :double) |
212 | | m.defMetric('total_datagrams', :integer) |
213 | | m.defMetric('lost_datagrams', :integer) |
214 | | } |
215 | | |
216 | | app.defMeasurement("jitter"){ |m| |
217 | | m.defMetric('pid', :integer) |
218 | | m.defMetric('connection_id', :integer) |
219 | | m.defMetric('begin_interval', :double) |
220 | | m.defMetric('end_interval', :double) |
221 | | m.defMetric('jitter', :double) |
222 | | } |
223 | | |
224 | | app.defMeasurement("packets"){ |m| |
225 | | m.defMetric('pid', :integer) |
226 | | m.defMetric('connection_id', :integer) |
227 | | m.defMetric('packet_id', :integer) |
228 | | m.defMetric('packet_size', :integer) |
229 | | m.defMetric('packet_time_s', :integer) |
230 | | m.defMetric('packet_time_us', :integer) |
231 | | m.defMetric('packet_sent_time_s', :integer) |
232 | | m.defMetric('packet_sent_time_us', :integer) |
233 | | } |
234 | | |
235 | | end |
236 | | |
237 | | defGroup('Servers', property.theReceiver) do |node| |
238 | | node.addApplication("iperf") do |app| |
239 | | #app.setProperty('interval', property.setinterval) |
240 | | app.setProperty('server',true) |
241 | | app.setProperty('port',6001) |
242 | | app.measure('transfer', :samples => 1) |
243 | | end |
244 | | end |
245 | | |
246 | | |
247 | | defGroup('Sender',property.theSender) do |node| |
248 | | node.addApplication("iperf") do |app| |
249 | | #app.setProperty('interval',property.setinterval) |
250 | | app.setProperty('client',property.serverip) |
251 | | app.setProperty('tradeoff',true) |
252 | | app.setProperty('parallel', 5) |
253 | | app.setProperty('time',30) |
254 | | app.setProperty('port',6001) |
255 | | #app.setProperty('bandwidth',property.setbandwidth) |
256 | | app.measure('transfer', :samples => 1) |
257 | | end |
258 | | |
259 | | end |
260 | | defGroup('Monitor1', property.theSwitch) do |node| |
261 | | node.addApplication("trace") do |app| |
262 | | app.setProperty("interface", 'eth1') |
263 | | app.setProperty("filter", 'tcp') |
264 | | app.setProperty("config", "/tmp/monitor/conf.xml") |
265 | | app.measure("tcp", :samples => 1) |
266 | | end |
267 | | end |
268 | | defGroup('Monitor', property.theSwitch) do |node| |
269 | | node.addApplication("trace") do |app| |
270 | | app.setProperty("interface", 'eth3') |
271 | | app.setProperty("filter", 'tcp') |
272 | | app.setProperty("config", "/tmp/monitor/conf.xml") |
273 | | app.measure("tcp", :samples => 1) |
274 | | end |
275 | | end |
276 | | |
277 | | |
278 | | |
279 | | onEvent(:ALL_UP_AND_INSTALLED) do |event| |
280 | | info "starting" |
281 | | group('Servers').startApplications |
282 | | after 2 do |
283 | | group('Monitor1').startApplications |
284 | | group('Monitor').startApplications |
285 | | group('Sender').startApplications |
286 | | end |
287 | | after 100 do |
288 | | group ('Sender').stopApplications |
289 | | group ('Monitor1').stopApplications |
290 | | group('Servers').stopApplications |
291 | | info "All applications stopped." |
292 | | Experiment.done |
293 | | end |
294 | | end |
295 | | ##define the graphs that we want to display## |
296 | | #defGraph 'Cumulated number of Bytes' do |g| |
297 | | # g.ms('network').select(:oml_ts_server, :tx_bytes, :oml_sender_id) |
298 | | # g.caption "Total Bytes" |
299 | | # g.type 'line_chart3' |
300 | | # g.mapping :x_axis => :oml_ts_server, :y_axis => :tx_bytes, :group_by => :oml_sender_id |
301 | | # g.xaxis :legend => 'time', :ticks => {:format => 's'} |
302 | | # g.yaxis :legend => '', :ticks => {:format => 'Byte'} |
303 | | #end |
304 | | |
305 | | defGraph 'TCP Throughput Bytes-per-Second' do |g| |
306 | | g.ms('tcp').select(:oml_ts_server, :tcp_packet_size, :oml_sender_id) |
307 | | g.caption "TCP throughput" |
308 | | g.type 'line_chart3' |
309 | | g.mapping :x_axis => :oml_ts_server, :y_axis => :tcp_packet_size, :group_by => :oml_sender_id |
310 | | g.xaxis :legend => 'time', :ticks => {:format => 's'} |
311 | | g.yaxis :legend => '', :ticks => {:format => 'Bytes/s'} |
312 | | end |
313 | | |
314 | | |
315 | | }}} |
| 74 | |