# # Tutorial Experiment - WiFi AP & iperf # defProperty('accesspoint', 'node1-1', "node ID for access point") defProperty('client', 'node1-2', "node ID for client nodes") defProperty('duration', 60, "Seconds to run the application.") defApplication('iperf', 'iperf-oml2') do |app| app.version(2, 10, 0) app.shortDescription = 'Iperf traffic generator and bandwidth measurement tool' app.description = %{Iperf is a traffic generator and bandwidth measurement tool. It provides generators producing various forms of packet streams and port for sending these packets via various transports, such as TCP and UDP. } app.path = "/usr/bin/iperf-oml2" app.defProperty('interval', 'pause n seconds between periodic bandwidth reports', '-i', :type => :double, :unit => "seconds", :default => '1.') app.defProperty('len', 'set length read/write buffer to n (default 8 KB)', '-l', :type => :integer, :unit => "KiBytes") app.defProperty('print_mss', 'print TCP maximum segment size (MTU - TCP/IP header)', '-m', :type => :boolean) app.defProperty('output', 'output the report or error message to this specified file', '-o', :type => :string) app.defProperty('port', 'set server port to listen on/connect to to n (default 5001)', '-p', :type => :integer) app.defProperty('udp', 'use UDP rather than TCP', '-u', :type => :boolean, :order => 2) app.defProperty('window', 'TCP window size (socket buffer size)', '-w', :type => :integer, :unit => "Bytes") app.defProperty('bind', 'bind to , an interface or multicast address', '-B', :type => :string) app.defProperty('compatibility', 'for use with older versions does not sent extra msgs', '-C', :type => :boolean) app.defProperty('mss', 'set TCP maximum segment size (MTU - 40 bytes)', '-M', :type => :integer, :unit => "Bytes") app.defProperty('nodelay', 'set TCP no delay, disabling Nagle\'s Algorithm', '-N', :type => :boolean) app.defProperty('IPv6Version', 'set the domain to IPv6', '-V', :type => :boolean) app.defProperty('reportexclude', 'exclude C(connection) D(data) M(multicast) S(settings) V(server) reports', '-x', :type => :string, :unit => "[CDMSV]") app.defProperty('reportstyle', 'C or c for CSV report, O or o for OML', '-y', :type => :string, :unit => "[CcOo]", :default => "o") # Use OML reporting by default app.defProperty('oml-server', 'OML server for collecting data','--oml-server') app.defProperty('oml-id', 'ID for this oml client','--oml-id') app.defProperty('oml-exp-id', 'ID for this experiment','--oml-exp-id') app.defProperty('server', 'run in server mode', '-s', :type => :boolean) app.defProperty('bandwidth', 'set target bandwidth to n bits/sec (default 1 Mbit/sec)', '-b', :type => :string, :unit => "Mbps") app.defProperty('client', 'run in client mode, connecting to ', '-c', :type => :string, :order => 1) app.defProperty('dualtest', 'do a bidirectional test simultaneously', '-d', :type => :boolean) app.defProperty('num', 'number of bytes to transmit (instead of -t)', '-n', :type => :integer, :unit => "Bytes") app.defProperty('tradeoff', 'do a bidirectional test individually', '-r', :type => :boolean) app.defProperty('time', 'time in seconds to transmit for (default 10 secs)', '-t', :type => :integer, :unit => "seconds") app.defProperty('fileinput', 'input the data to be transmitted from a file', '-F', :type => :string) app.defProperty('stdin', 'input the data to be transmitted from stdin', '-I', :type => :boolean) app.defProperty('listenport', 'port to recieve bidirectional tests back on', '-L', :type => :integer) app.defProperty('parallel', 'number of parallel client threads to run', '-P', :type => :integer) app.defProperty('ttl', 'time-to-live, for multicast (default 1)', '-T', :type => :integer, :default => 1) app.defProperty('linux-congestion', 'set TCP congestion control algorithm (Linux only)', '-Z', :type => :boolean) end defGroup('AP', property.accesspoint) do |node| node.addApplication("iperf") do |app| app.setProperty('server', true) end node.net.w0.mode = "master" node.net.w0.type = 'g' node.net.w0.channel = "6" node.net.w0.essid = "TEST1234" node.net.w0.ip = "192.168.0.254" end defGroup('client', property.client) do |node| node.addApplication("iperf") do |app| app.setProperty('client', "192.168.0.254") app.setProperty('time', 20) app.setProperty('interval', 5) end node.net.w0.mode = "managed" node.net.w0.type = 'g' node.net.w0.channel = "6" node.net.w0.essid = "TEST1234" node.net.w0.ip = "192.168.0.%index%" end onEvent(:ALL_UP_AND_INSTALLED) do |event| info "Wifi Multi Client Iperf Experiment" wait 10 allGroups.startApplications info "All my Applications are started now..." wait property.duration allGroups.stopApplications info "All my Applications are stopped now." Experiment.done end