Tutorials/g0WmLTE/Tutorial2: iperf.rb

File iperf.rb, 9.1 KB (added by ffund01, 11 years ago)

iperf app definition

Line 
1defApplication('iperf') do |app|
2 app.path = "/usr/bin/oml2-iperf"
3 app.version(2,0,5)
4 app.shortDescription = "Iperf traffic generator and bandwidth measurement tool"
5 app.description = %{
6 Iperf is a traffic generator and bandwidth measurement tool. It provides
7 generators producing various forms of packet streams and port for sending
8 these packets via various transports, such as TCP and UDP.
9 }
10
11 app.defProperty('interval', 'pause n seconds between periodic bandwidth reports',
12 'i', {:type => :integer, :dynamic => false})
13 app.defProperty('len', 'set length read/write buffer to n (default KB)',
14 'l', {:type => :string, :dynamic => false})
15 app.defProperty('print_mss', 'print TCP maximum segment size (MTU - TCP/IP header)',
16 'm', {:type => :boolean, :dynamic => false})
17 app.defProperty('output', 'output the report or error message to this specified file',
18 'o', {:type => :string, :dynamic => false})
19 app.defProperty('port', 'set server port to listen on/connect to to n (default)',
20 'p', {:type => :integer, :dynamic => false})
21 app.defProperty('udp', 'use UDP rather than TCP',
22 'u', {:order => 2, :type => :boolean, :dynamic => false})
23 app.defProperty('window', 'TCP window size (socket buffer size)',
24 'w', {:type => :integer, :dynamic => false})
25 app.defProperty('bind', 'bind to <host>, an interface or multicast address',
26 'B', {:type => :string, :dynamic => false})
27 app.defProperty('compatibility', 'for use with older versions does not sent extra msgs',
28 'C', {:type => :boolean, :dynamic => false})
29 app.defProperty('mss', 'set TCP maximum segment size (MTU - bytes)',
30 'M', {:type => :integer, :dynamic => false})
31 app.defProperty('nodelay', 'set TCP no delay, disabling Nagle\'s Algorithm',
32 'N', {:type => :boolean, :dynamic => false})
33 app.defProperty('IPvVersion', 'set the domain to IPv',
34 'V', {:type => :boolean, :dynamic => false})
35 app.defProperty('reportexclude', '[CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports',
36 'x', {:type => :string, :dynamic => false})
37 app.defProperty('reportstyle', 'C or c for CSV report, O or o for OML',
38 'y', {:type => :string, :dynamic => false})
39
40 app.defProperty('server', 'run in server mode',
41 's', {:type => :boolean, :dynamic => false})
42
43 app.defProperty('bandwidth', 'set target bandwidth to n bits/sec (default Mbit/sec)',
44 'b', {:type => :string, :dynamic => false})
45 app.defProperty('client', 'run in client mode, connecting to <host>',
46 'c', {:order => 1, :type => :string, :dynamic => false})
47 app.defProperty('dualtest', 'do a bidirectional test simultaneously',
48 'd', {:type => :boolean, :dynamic => false})
49 app.defProperty('num', 'number of bytes to transmit (instead of -t)',
50 'n', {:type => :integer, :dynamic => false})
51 app.defProperty('tradeoff', 'do a bidirectional test individually',
52 'r', {:type => :boolean, :dynamic => false})
53 app.defProperty('time', 'time in seconds to transmit for (default secs)',
54 't', {:type => :integer, :dynamic => false})
55 app.defProperty('fileinput', 'input the data to be transmitted from a file',
56 'F', {:type => :string, :dynamic => false})
57 app.defProperty('stdin', 'input the data to be transmitted from stdin',
58 'I', {:type => :boolean, :dynamic => false})
59 app.defProperty('listenport', 'port to recieve bidirectional tests back on',
60 'L', {:type => :integer, :dynamic => false})
61 app.defProperty('parallel', 'number of parallel client threads to run',
62 'P', {:type => :integer, :dynamic => false})
63 app.defProperty('ttl', 'time-to-live, for multicast (default)',
64 'T', {:type => :integer, :dynamic => false})
65 app.defProperty('linux-congestion', 'set TCP congestion control algorithm (Linux only)',
66 'Z', {:type => :boolean, :dynamic => false})
67
68 app.defMeasurement("application"){ |m|
69 m.defMetric('pid', :long, 'Main process identifier')
70 m.defMetric('version', :string, 'Iperf version')
71 m.defMetric('cmdline', :string, 'Iperf invocation command line')
72 m.defMetric('starttime_s', :long, 'Time the application was received (s)')
73 m.defMetric('starttime_us', :long, 'Time the application was received (us)')
74 }
75
76 app.defMeasurement("settings"){ |m|
77 m.defMetric('pid', :long, 'Main process identifier')
78 m.defMetric('server_mode', :long, ' if in server mode, otherwise')
79 m.defMetric('bind_address', :string, 'Address to bind')
80 m.defMetric('multicast', :long, ' if listening to a Multicast group')
81 m.defMetric('multicast_ttl', :long, 'Multicast TTL if relevant')
82 m.defMetric('transport_protocol', :long, 'Transport protocol (IANA number)')
83 m.defMetric('window_size', :long, 'TCP window size')
84 m.defMetric('buffer_size', :long, 'UDP buffer size')
85 }
86
87 app.defMeasurement("connection"){ |m|
88 m.defMetric('pid', :long, 'Main process identifier')
89 m.defMetric('connection_id', :long, 'Connection identifier (socket)')
90 m.defMetric('local_address', :string, 'Local network address')
91 m.defMetric('local_port', :long, 'Local port')
92 m.defMetric('foreign_address', :string, 'Remote network address')
93 m.defMetric('foreign_port', :long, 'Remote port')
94 }
95
96 app.defMeasurement("transfer"){ |m|
97 m.defMetric('pid', :long, 'Main process identifier')
98 m.defMetric('connection_id', :long, 'Connection identifier (socket)')
99 m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)')
100 m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)')
101 m.defMetric('size', :long, 'Amount of transmitted data [Bytes]')
102 }
103
104 app.defMeasurement("losses"){ |m|
105 m.defMetric('pid', :long, 'Main process identifier')
106 m.defMetric('connection_id', :long, 'Connection identifier (socket)')
107 m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)')
108 m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)')
109 m.defMetric('total_datagrams', :long, 'Total number of datagrams')
110 m.defMetric('lost_datagrams', :long, 'Number of lost datagrams')
111 }
112
113 app.defMeasurement("jitter"){ |m|
114 m.defMetric('pid', :long, 'Main process identifier')
115 m.defMetric('connection_id', :long, 'Connection identifier (socket)')
116 m.defMetric('begin_interval', :float, 'Start of the averaging interval (Iperf timestamp)')
117 m.defMetric('end_interval', :float, 'End of the averaging interval (Iperf timestamp)')
118 m.defMetric('jitter', :float, 'Average jitter [ms]')
119 }
120
121 app.defMeasurement("packets"){ |m|
122 m.defMetric('pid', :long, 'Main process identifier')
123 m.defMetric('connection_id', :long, 'Connection identifier (socket)')
124 m.defMetric('packet_id', :long, 'Packet sequence number for datagram-oriented protocols')
125 m.defMetric('packet_size', :long, 'Packet size')
126 m.defMetric('packet_time_s', :long, 'Time the packet was processed (s)')
127 m.defMetric('packet_time_us', :long, 'Time the packet was processed (us)')
128 m.defMetric('packet_sent_time_s', :long, 'Time the packet was sent (s) for datagram-oriented protocols')
129 m.defMetric('packet_sent_time_us', :long, 'Time the packet was sent (us) for datagram-oriented protocols')
130 }
131 app.defMeasurement("TCP_Info"){ |m|
132 m.defMetric('ID', :long)
133 m.defMetric('Begin_interval', :float)
134 m.defMetric('End_interval', :float)
135 m.defMetric('Transfer', :float)
136 m.defMetric('Bandwidth', :float)
137 }
138
139
140 app.defMeasurement("UDP_Rich_Info"){ |m|
141 m.defMetric('ID', :long)
142 m.defMetric('Begin_interval', :float)
143 m.defMetric('End_interval', :float)
144 m.defMetric('Transfer', :float)
145 m.defMetric('Bandwidth', :float)
146 m.defMetric('Jitter', :float)
147 m.defMetric('Packet_Lost', :long)
148 m.defMetric('Total_Packet', :long)
149 m.defMetric('PLR', :float)
150 }
151
152 end