defApplication('iperf', 'iperf') do |a| a.binary_path = "/usr/bin/oml2-iperf" # a.description = < :string, :dynamic => false, :default => '1.0'}) a.defProperty('len', 'set length read/write buffer to n (default 8 KB)', '-l', {:type => :string, :dynamic => false}) a.defProperty('print_mss', 'print TCP maximum segment size (MTU - TCP/IP header)', '-m', {:type => :boolean, :dynamic => false}) a.defProperty('output', 'output the report or error message to this specified file', '-o', {:type => :string, :dynamic => false}) a.defProperty('port', 'set server port to listen on/connect to to n (default 5001)', '-p', {:type => :integer, :dynamic => false}) a.defProperty('udp', 'use UDP rather than TCP', '-u', {:order => 2, :type => :boolean, :dynamic => false}) a.defProperty('window', 'TCP window size (socket buffer size)', '-w', {:type => :integer, :dynamic => false}) a.defProperty('bind', 'bind to host, an interface or multicast address', '-B', {:type => :string, :dynamic => false}) a.defProperty('compatibility', 'for use with older versions does not sent extra msgs', '-C', {:type => :boolean, :dynamic => false}) a.defProperty('mss', 'set TCP maximum segment size (MTU - 40 bytes)', '-M', {:type => :integer, :dynamic => false}) a.defProperty('nodelay', 'set TCP no delay, disabling Nagle\'s Algorithm', '-N', {:type => :boolean, :dynamic => false}) a.defProperty('IPv6Version', 'set the domain to IPv6', '-V', {:type => :boolean, :dynamic => false}) a.defProperty('reportexclude', '[CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports', '-x', {:type => :string, :dynamic => false}) a.defProperty('reportstyle', 'C or c for CSV report, O or o for OML', '-y', {:type => :string, :dynamic => false}) a.defProperty('server', 'run in server mode', '-s', {:type => :boolean, :dynamic => false}) a.defProperty('bandwidth', 'set target bandwidth to n bits/sec (default 1 Mbit/sec)', '-b', {:type => :string, :dynamic => false, :unit => "Mbps"}) a.defProperty('client', 'run in client mode, connecting to host', '-c', {:order => 1, :type => :string, :dynamic => false}) a.defProperty('dualtest', 'do a bidirectional test simultaneously', '-d', {:type => :boolean, :dynamic => false}) a.defProperty('num', 'number of bytes to transmit (instead of -t)', '-n', {:type => :integer, :dynamic => false}) a.defProperty('tradeoff', 'do a bidirectional test individually', '-r', {:type => :boolean, :dynamic => false}) a.defProperty('time', 'time in seconds to transmit for (default 10 secs)', '-t', {:type => :integer, :dynamic => false}) a.defProperty('fileinput', 'input the data to be transmitted from a file', '-F', {:type => :string, :dynamic => false}) a.defProperty('stdin', 'input the data to be transmitted from stdin', '-I', {:type => :boolean, :dynamic => false}) a.defProperty('listenport', 'port to recieve bidirectional tests back on', '-L', {:type => :integer, :dynamic => false}) a.defProperty('parallel', 'number of parallel client threads to run', '-P', {:type => :integer, :dynamic => false}) a.defProperty('ttl', 'time-to-live, for multicast (default 1)', '-T', {:type => :integer, :dynamic => false}) a.defProperty('linux-congestion', 'set TCP congestion control algorithm (Linux only)', '-Z', {:type => :boolean, :dynamic => false}) a.defMeasurement("application") do |m| m.defMetric('pid', :long, 'Main process identifier') m.defMetric('version', :string, 'Iperf version') m.defMetric('cmdline', :string, 'Iperf invocation command line') m.defMetric('starttime_s', :long, 'Time the application was received (s)') m.defMetric('starttime_us', :long, 'Time the application was received (us)') end a.defMeasurement("settings") do |m| m.defMetric('pid', :long, 'Main process identifier') m.defMetric('server_mode', :long, '1 if in server mode, 0 otherwise') m.defMetric('bind_address', :string, 'Address to bind') m.defMetric('multicast', :long, '1 if listening to a Multicast group') m.defMetric('multicast_ttl', :long, 'Multicast TTL if relevant') m.defMetric('transport_protocol', :long, 'Transport protocol (IANA number)') m.defMetric('window_size', :long, 'TCP window size') m.defMetric('buffer_size', :long, 'UDP buffer size') end a.defMeasurement("connection")do |m| m.defMetric('pid', :long, 'Main process identifier') m.defMetric('connection_id', :long, 'Connection identifier (socket)') m.defMetric('local_address', :string, 'Local network address') m.defMetric('local_port', :long, 'Local port') m.defMetric('foreign_address', :string, 'Remote network address') m.defMetric('foreign_port', :long, 'Remote port') end a.defMeasurement("transfer") do |m| m.defMetric('pid', :long, 'Main process identifier') m.defMetric('connection_id', :long, 'Connection identifier (socket)') m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)') m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)') m.defMetric('size', :long, 'Amount of transmitted data [Bytes]') end a.defMeasurement("losses") do |m| m.defMetric('pid', :long, 'Main process identifier') m.defMetric('connection_id', :long, 'Connection identifier (socket)') m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)') m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)') m.defMetric('total_datagrams', :long, 'Total number of datagrams') m.defMetric('lost_datagrams', :long, 'Number of lost datagrams') end a.defMeasurement("jitter") do |m| m.defMetric('pid', :long, 'Main process identifier') m.defMetric('connection_id', :long, 'Connection identifier (socket)') m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)') m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)') m.defMetric('jitter', :float, 'Average jitter [ms]') end a.defMeasurement("packets") do |m| m.defMetric('pid', :long, 'Main process identifier') m.defMetric('connection_id', :long, 'Connection identifier (socket)') m.defMetric('packet_id', :long, 'Packet sequence number for datagram-oriented protocols') m.defMetric('packet_size', :long, 'Packet size') m.defMetric('packet_time_s', :long, 'Time the packet was processed (s)') m.defMetric('packet_time_us', :long, 'Time the packet was processed (us)') m.defMetric('packet_sent_time_s', :long, 'Time the packet was sent (s) for datagram-oriented protocols') m.defMetric('packet_sent_time_us', :long, 'Time the packet was sent (us) for datagram-oriented protocols') end end defGroup('Receiver', 'node031') do |node| node.addApplication("iperf") do |app| app.setProperty('port', 5200) app.setProperty('server', true) app.setProperty('interval', '1') app.measure('transfer', :interval => 1) end node.net.w0.mode = "adhoc" node.net.w0.type = 'g' node.net.w0.channel = "6" node.net.w0.essid = "helloworld" node.net.w0.ip = "192.168.0.3/24" end defGroup('Sender', 'node030') do |node| node.addApplication("iperf") do |app| app.setProperty('port', 5200) app.setProperty('client', "192.168.0.3") app.setProperty('time', 30) app.setProperty('bandwidth', '50000000') end node.net.w0.mode = "adhoc" node.net.w0.type = 'g' node.net.w0.channel = "6" node.net.w0.essid = "helloworld" node.net.w0.ip = "192.168.0.2/24" end onEvent(:ALL_UP_AND_INSTALLED) do |event| info "This is my first OMF experiment with iperf" after 1 do group('Receiver').startApplications info "Server has started now..." end after 3 do group('Sender').startApplications info "Client has started now..." end after 34 do allGroups.stopApplications info "All my Applications are stopped now." Experiment.done end end # Local Variables: # mode:ruby # vim: ft=ruby:sw=2 # End: