wtest.pl


Usage

wtest.pl [-d dr_opts] [-m] [-R rts_opts] [-p pwr_opts] [-s pkt_size_opts] [-rtx rtx_opts]

Examples:

wtest.pl
    Run wtest.pl with all the defaults. 

wtest.pl -d 10M -R n -s 2K -rtx 8
    Run wtest.pl, specifying a data rate of 10 Mbps, no RTS/CTS, using packets of 2KB size and setting the maximum number of retries to 8. 

Requirements: 

wtest.pl relies on the existance of three other programs, iwconfig, iperf, and perl.  Without any of these programs, the program will not work. 

Parameters:

-d dr_opts
This switch allows for the user to specify a specific data rate, thus removing it from the available variations of the experiment.  "dr_opts" is the data rate the user wants to use.  If -d is not given on the command line, the default array of data rates is varied over.  Initially these defaults are 1, 2, 5.5 and 11 Mbps.  This can be customized for more protocol relevant settings by editing the script and changing the "@dr" list. 
If -d is specified, the following value (dr_opts) can take two forms, either 'a' which selects a single default data rate (initially 1 Mbps), or the user can give the data rate.  If a specific data rate is specified, the suffixes 'M' and 'K' are understood, but there must be no whitespace between the number and the suffix. 
-m
This switch specifies that the user desires to be in "mobile" mode.  The intended use is for the situation where the user has two laptops and can vary the distance freely.  If this switch is not given, wtest.pl defaults to "server" mode, where it tests a list of wireless links, specified by @remote_wifi_ip. 
-p pwr_opts
The -p switch allows for the user to specify the script's behavior in terms of power settings.  If the switch is not given, the default behavior is to simply use a single power value and to not vary transmit power settings.  (The reason for choosing this default is because not all wireless cards actually respond to setting the transmit power.) 
If -p is specified, "pwr_opts" can take two forms:  1. nothing, 2. a specific setting. 
If nothing is given for "pwr_opts", the script varies the power based on a default list of power settings.  The second option is to specify a power setting.  This second option can take four forms , a number corresponding to the dBm setting, a direct power (e.g. "30mW" - notice no spaces), "auto" or "on"/"off". 
(see txpower section of the iwconfig man page)
-rtx rtx_opts
This switch specifies how the script should handle retries.  There are three modes for operation with this switch specified, depending on the value of rtx_opts.  If rtx_opts is not specified, the behavior of wtest.pl is to vary the maximum number of retries based on an internal list of values.  If rtx_opts is specified as 'a', then the behavior is the auto mode, where one value (4 by default) is chosen for the maximum number of retires.  Alternatively, the user can specify a number for rtx_opts and that will be the maximum number of retries for each transmission. 
-R rts_opts
The -R option specifies the script's usage of RTS/CTS.  If -R is not specified, the default behavior is to turn off RTS/CTS usage.  If rts_opts is not specified, the script varies RTS/CTS behavior between 250 and off, where 250 specifies 250 B as the smallest packet for which RTS/CTS will be used.  (see man iwconfig)  The valid options a user can specify for rts_opts are 'y' and 'n', which correspond to turning RTS/CTS on or off, respectively. 
-s pkt_size_opts
-s Is used by the script to determine its behavior in terms of the packet size(s) it will use.  The default behavior, without using this switch or using the switch but not specifying pkt_size_opts, is to vary packet sizes between 500, 1000, 1500 and 2000 B.  Alternatively, a user may give 'a' or a numerical packet size in bytes as pkt_size_opts.  Using 'a' corresponds to using a single default value of 1000B.  If a number is specified for pkt_size_opts, the script will use that as the single size of packets to use, interpreted as bytes. 

Output: 

The script logs all its data output to a file called "out.txt" in the directory it is run from.  Each time the script is run, it will overwrite the file, so between runs, you must rename or move this file if you do not want to lose your data.  The format of the output is CSV (comma separated value), which is easily importable into many spreadsheets, such as Excel or OpenOffice.org-Calc. 

Save/Restore Function

Because running this script with variations across each of these options can take a decent amount of time, save and restore functionality is also provided by the script.  The state of the script is saved into the "recovery" file in the directory the script is run from.  On restarting the script, if the recovery file exists in the directory, the user is prompted about whether they want to restore the state stored in the file.  If the file has been corrupted or altered from the exptected format, the script will exit. 

Customizing: 

Depending on your particular setup, the defaults and settings provided in this script may or may not meet your needs and desires.  An alternative to continually specifying different settings on the command line, you can edit the variables in the script.  The experimental variables are all located at the top of the file and are decently commented so you can pick them out. 

See Also: