wiki:802.11/wlan_exp/examples/txrx_log_capture

Version 4 (modified by welsh, 10 years ago) (diff)

--

802.11 Reference Design: TX/RX Log Capture Example

This example of the Experiments Framework uses two WARP v3 nodes, one configured as an AP, the other as a STA. The log_capture_two_node_two_flow.py will capture a log of LTG traffic flows between the AP and STA and write the data to an HDF5 log file for later processing. This example demonstrates how to:

  • Control two WARP v3 nodes from one wlan_exp script
  • Use the wlan_exp framework Local Traffic Generator (LTG) to create traffic
  • Capture an HDF5 log file from the data logged by each node

The flow of the log_capture_two_node_two_flow.py script is:

  1. Initialize two WARP v3 nodes
  2. Ensure nodes are configured as one AP, one STA and that the STA is associated with AP
  3. Start a fully-backlogged locally generated traffic (LTG) flow from AP -> STA
  4. Wait 30 seconds
  5. Start a fully-backlogged locally generated traffic (LTG) flow from STA -> AP
  6. Wait 30 seconds
  7. Stop the locally generated traffic (LTG) flow from STA -> AP
  8. Wait 30 seconds
  9. Stop the locally generated traffic (LTG) flow from AP -> AP
  10. Read the log data from each node and write an HDF5 log file

To run this example:

  • Setup wlan_exp (see Getting Started for details)
  • Configure two WARP v3 nodes with the 802.11 Reference Design bitstream- one AP, one STA
  • Open the file in a text editor and change the NODE_SERIAL_LIST to match your serial numbers
  • Open a Python shell
  • CD to the Python_Reference/examples/txrx_log directory from the expanded 802.11 Reference design archive
  • Run python log_capture_two_node_two_flow.py

The script will run for 2 minutes, then display its results:

Initializing experiment

Reseting the network config for all nodes on subnet 10.0.0.
Initializing W3-a-00006 as Node 0
Initializing W3-a-00183 as Node 1
Initializing the time of all nodes on 10.0.0 to: 0.0

Experimental Setup:
Adding current time to log for nodes on 10.0.0

Run Experiment:

Start LTG - AP -> STA

Start LTG - STA -> AP

Stop  LTG - STA -> AP

Stop  LTG - AP -> STA

Log Sizes:  AP  = 19,258,096 bytes
            STA = 32,143,640 bytes

Writing Log Files...
    log_files/ap_log_stats.hdf5
    log_files/sta_log_stats.hdf5
Done.

NOTE: The log file names, i.e. the AP_HDF5_FILENAME and STA_HDF5_FILENAME variables in the script, use relative paths from the Python_Reference/examples/txrx_log/ directory so if you are trying to run the script from a different directory, you may see:

ERROR: Logfile log_files/ap_log_stats.hdf5 not able to be created

in this case, either change to the correct directory, or modify the file name variables.


Source: the script is included in the 802.11 Reference Design archive at Python_Reference/examples/txrx_log/log_capture_two_node_two_flow.py.