Candela Technologies Logo
Network Testing and Emulation Solutions

Basic: Layer4 HTTP Traffic Generation: test_l4.py

Goal: Use Python Script test_l4.py to Generate Layer4 HTTP Traffic

Each LANforge system has Python scripts installed at /home/lanforge/scripts. You can find test_l4.py at /home/lanforge/scripts/py-script/test_l4.py

The script test_l4.py will:

  • Create stations (on the specified radio).
  • Create Layer 4-7 endpoints.
  • Monitor the bytes-rd attribute of the created endpoints.

The test type attribute is configurable:

bytes-rd
monitor the bytes read
urls
monitor the url's per second

The monitored Layer 4-7 attribute statistics are recorded at the end of each polling interval. Test_l4.py will monitor the urls/s, bytes-rd, or bytes-wr attribute of the layer 4-7 endpoints. These attributes can be tested over FTP using a --ftp flag. If the monitored value does not continually increase, this test will not pass. The script cleans up the stations and connections at the end of the test. An HTML and PDF report of the results will be generated and placed in the /home/lanforge/html-reports directory.

 
  1. Start the LANforgeGUI if the GUI is not running:
    To start the LANforgeGUI navigate to : /home/lanforge/LANforgeGUI_5.4.5
    Execute : ./lfclient.bash
    Click the Connect button to connect to: localhost:4002 Local Machine Address

  2. Where Do I Find Scripts?
    Preinstalled Python Scripts Location on LANforge: /home/lanforge/scripts/py-scripts
    Example script test_l4.py location: /home/lanforge/scripts/py-scripts/test_l4.py
  3. Initial Information to Gather as input for the test_l4.py script:
    Note: An example of a Device Under Test is an Access Point. The DUT information is used in report generation. The DUT information may be optional.
    1. The LANforge manager IP address: --mgr [localhost]
    2. The LANforge upstream port: --upstream_port [eth port]
    3. The LANforge radio information :
      --radio 'radio==[radio] stations==[number] ssid==[ssid] ssid_pw==[password] security==[security]'
    4. The LANforge station creation amount: --num_stations [2]
    5. The AP SSID name: --ssid [SSID]
    6. The AP security type: --security [open, wpa, wpa2, wpa3]
    7. The AP SSID password: --passwd [password]
    8. The Test Duration : --test_duration [value] (s - seconds, m - minutes, h - hours)
    9. The Test URL: --url "dl http://upstream_port_ip /dev/null"
    10. The Test Type: --test_type [bytes-rd, urls]
    11. The Service Request Interval: --requests_per_ten [600]
    12. The Test Rig: --test_rig [test system id]
    13. The Test Tag: --test_tag [unique test id]
    14. The Device Under Test Model Number: --dut_model_num [model]
    15. The Device Under Test Hardware Version: --dut_hw_version [hw version]
    16. The Device Under Test Software Version: --dut_sw_version [sw version]
    17. The Device Under Test Serial Number: --dut_serial_num [serial number]
  4. Example Command for a downloaded bytes-rd HTTP test with test_l4.py:
     ./test_l4.py --lfmgr localhost \
    --upstream_port 1.1.eth1 \
    --radio 1.1.wiphy0 \
    --num_stations 2 \
    --ssid AP_SSID \
    --security wpa2 \
    --passwd password \
    --test_duration 1m \
    --url "dl http://upstream_port_ip /dev/null" \
    --test_type bytes-rd \
    --requests_per_ten 600 \
    --test_rig CT_LAB_L4 \
    --test_tag Layer_4_Example \
    --dut_model_num RT-AX88U \
    --dut_hw_version A1.1 \
    --dut_sw_version 3.0.0.4.384 \
    --dut_serial_num M1IAHP000003
  5. Example Command for a downloaded url's/s HTTP test with test_l4.py:
     ./test_l4.py --lfmgr localhost \
    --upstream_port 1.1.eth1 \
    --radio 1.1.wiphy0 \
    --num_stations 2 \
    --ssid AP_SSID \
    --security wpa2 \
    --passwd password \
    --test_duration 1m \
    --url "dl http://upstream_port_ip /dev/null" \
    --test_type urls \
    --requests_per_ten 600 \
    --test_rig CT_LAB_L4 \
    --test_tag Layer_4_Example \
    --dut_model_num RT-AX88U \
    --dut_hw_version A1.1 \
    --dut_sw_version 3.0.0.4.384 \
    --dut_serial_num M1IAHP000003
  6. Results for test_l4.py are located in /home/lanforge/html-reports:

  7. Results for test_l4.py are located in /home/lanforge/html-reports:
    The script produces both HTML and PDF results:Additional script options may be shown by typing ./test_l4.py --help

Candela  Technologies, 2417 Main Street, Suite 201, Ferndale, WA 98248, USA
www.candelatech.com | sales@candelatech.com | +1.360.380.1618
Facebook | LinkedIn | Blog