Candela Technologies Logo
Network Testing and Emulation Solutions

Generating a series of attenuations using data in a CSV file.

Goal: Using the script and a specially formatted csv file, you will be able to re-play an arbitrary series of attenuations.

Playing back a series of WiFi attenuation levels using the and a CSV file of attenuations make it possible to emulate the motion of a station (or stations) moving among a series APs. Or it could emulate interference in a crowd of moving people. Requires a LANforge CT703 (or better) and a LANforge CT520 (or better) system, and an access point.

Testing 1x1 with one attenuator

Our LANforge manager (resource 1.1) has an attenuator serial number 3 (resource 1.1.3) connected to the Device Under Test. The attenuator will be There will be station sta100 on LANforge resource 1 and AP vap0 on LANforge resource 2. Cables connect the radios to the the attenator. The radios are configured in 1x1 mode. The corresponding channel on the attenuator is

[See LANforge Entity IDs for more on numbering.]

Let's script it with a simple data file: /home/lanforge/atten_test1.csv


We run the script in our terminal:

$ cd /home/lanforge/scripts
$ ./ -f ../atten_test1.csv

Watching a Layer-3 connection in the Dynamic Display, we will see a dip, rise and dip at 10 second intervals.

Testing 2x2 with One Attenuator

Next we cable up the second channel ( We can update the csv test file, by adding a new column for the channel.


We can run the same command and watch the dynamic reports window to see a similar graph.

A 2x2 Example with Two Attenuators

The first radio on each LANforge is connected in 2x2 mode to both attenuators. This example is drawn to illustrate how you design the connection of your channels independently of their radios. Obviously, you don't need two attenuators for this scenario. However, if you had a CT523 with three radios and want to perform 2x2 testing with three client radios, it is possible to do so with only two CT703 attenuators.

We change the data file to specify the first channel on attenuator 14 ( /home/lanforge/atten_test3.csv


We can run the script once in our terminal:

$ cd /home/lanforge/scripts
$ ./ -f ../atten_test3.csv

Watching the port signal in the dynamic display we will see a rise and dip at 10 second intervals.

Connecting up Multiple Radios

There is no different in attenuator control whether you have one radio in 3x3 or three radios in 1x1 to control. If you are testing multiple radios, you will be monitoring their RX Signal in the dynamic report.

File Format

Editing the test data file with a basic spreadsheet program than can save to CSV format is possible. You will want to save with comma format, without double-quoting the cells. These directives are converted to lower-case, so you can type them in UPPER-CASE or Mixed-Case if necessary.

The format of the CSV file allows you to specify many options that might also be specified on the command line.


# comments
Rows that begin with a comment sign (#, ;, !) will be entirely ignored. Cells in column B or beyond will be ignored.
Each cell following this directive specifies an attenuator channel to control.
sleep, nap
The following cell specifies a one-time wait time in milliseconds
delay, naptime
The following cell specifies a standard wait time in milliseconds between each attenuate command
attenuate, _, ,
The following cells specify an attenuation value for channels specified by the last channels command.
minimum, min
Sets the minimum attenuation permitted. Values below this will be set to the minimum directed.
maximum, max
Sets the maximum attenuation permitted. Values above this will be set to the maximum directed.

Attenuation Values

Script Options

The script uses these arguments. They support long and short argument switch names:

   --mgr             LANforge manager host, like localhost or
   --file            CSV file with attenuation data
   --delay           Override of DELAY variable, milliseconds between applying rows
   --loop            Repeat indefinitely
   --channel         Override of channels variable, eg:,
   --minimum         Set minimum attenuation value (not lower than zero)
   --maximum         Set maximum attenuation value (not higher than 955)
   --dry_run         Do not apply attenuation, just parse file, ignore nap times

Example CSV File

This CSV shows a working example that gives warnings.

  1. # example csv
  2. channels,,,,,,,
  3. DELAY,2000,,,,,,
  4. ATTENUATE,950,850,750,950,850,750,
  5. attenuate,940,-10,-10,-10,-10,-10,
  6. attenuate,930,-10,NA,-10,-10,,
  7. attenuate,=B4-10,=C4+10,NA,-15,-15,,
  8. attenuate,-15,_,-15,,NA,-15,
  9. sleep,1000,,,,,,
  10. attenuate,110,115,215,315,415,515,
  11. _,=B10-20,=C10+20,=D10+20,=E10+20,=F10+20,=G10-20,
  12. _,@+10,@+10,@-10,10,10,10,
  13. # eof

Attenuators Tab

Here's the Attenuators tab used for the examples:

Opening and Saving CSV

Here are options used for the open dialog in LibreOffice Calc:

Here are the options used for the save dialog in LibreOffice Calc:

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA | | +1.360.380.1618
Facebook | LinkedIn | Blog