wiki:802.11/wlan_exp/examples/txrx_log_analysis

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

--

802.11 Reference Design: TX/RX Log Process Examples

This set of examples of the Experiments Framework explores the information contained in the HDF5 log files. The first example, log_process_summary.py, will show at a quick summary of the the experiment, packets per rate for both Tx and Rx, Tx MPDU packet counts and number of bytes, and finally Rx packet counts and number of bytes. The second example, log_process_details.py, goes a bit deeper and looks at the number of re-transmissions as well as the average time it took to transmit a packet. Finally, the last example, log_process_throughput_vs_time.py, utilizes the pandas framework to plot the throughput vs time of the AP and station.

By default these scripts will use sample data and you can specify any of the sample data files on the command line. However, to process your own log files, you can override this behavior with a command line argument or by modifying the *_LOGFILE variable in the script.

These examples demonstrates how to:

  • Extract information from an HDF5 log file
  • Use python packages to extract and process the log data

Log Process Summary

The flow of the log_process_summary.py script is:

  1. Extract the log data from the HDF5 file
  2. Extract the raw log index from the HDF5 file
  3. Filter the raw log index to extract log entry types we desire
  4. Convert the log data and filtered log index in to numpy arrays.
  5. Extract and print information from the NODE_INFO and TIME_INFO log entries.
  6. Extract and process information from the TX and RX_OFDM log entries.

To run this example:

  • Setup wlan_exp (see Getting Started for details)
  • Open a Python shell
  • CD to the Python_Reference/examples/txrx_log directory from the expanded 802.11 Reference design archive
  • To see the output from the sample data:
    • Run python log_process_summary.py raw_log_dual_flow_ap.hdf5
    • Run python log_process_summary.py raw_log_dual_flow_sta.hdf5
    • Run python log_process_summary.py raw_log_one_flow.hdf5
  • To see the output from your own log file:
    • Run python log_process_summary.py <my_hdf5_log_file>

The script will run, then display its results:

Reading log file 'raw_log_dual_flow_ap.hdf5' ( 20.2 MB)

Raw Log Index Contents:
         1 of Type 1
    18,243 of Type 10
    93,459 of Type 20
    96,068 of Type 21
         1 of Type 6
--------------------------
   207,772 total entries

Filtered Log Index:
    18,243 of Type RX_OFDM
         1 of Type NODE_INFO
    93,459 of Type TX
         1 of Type TIME_INFO
--------------------------
   111,704 total entries

Node Info:
  Node Type    : WLAN Exp (AP/DCF)
  MAC Address  : 40:d8:55:04:21:3a
  Serial Number: W3-a-00189
  WLAN Exp Ver : 0.9.0

Experiment Started at: Fri Apr 11 15:32:13 2014

Example 1: Pkts per Rate:
  Rate       Tx      Rx
  6 Mbps:     941       0
  9 Mbps:       0       0
 12 Mbps:       0       0
 18 Mbps:   92518   18243
 24 Mbps:       0       0
 36 Mbps:       0       0
 48 Mbps:       0       0
 54 Mbps:       0       0

Example 2: Tx MPDU Counts:
Dest Addr                # Pkts    # Bytes      MAC Addr Type
40:d8:55:04:20:bc         92518  131745632      Mango WARP Hardware
ff:ff:ff:ff:ff:ff           941      65870      Broadcast

Example 3: Rx Counts (including duplicates):
Src Addr                 # Pkts    # Bytes      MAC Addr Type
40:d8:55:04:20:bc         18243   25978032      Mango WARP Hardware

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


Log Process Details

The flow of the log_process_details.py script is:

  1. Extract the log data from the HDF5 file
  2. Extract the raw log index from the HDF5 file
  3. Filter the raw log index to extract log entry types we desire
  4. Convert the log data and filtered log index in to numpy arrays.
  5. Extract and process information from the TX and TX_LOW log entries.
  6. Extract and process information from the TX, TX_LOW and RX_OFDM log entries.

To run this example:

  • Setup wlan_exp (see Getting Started for details)
  • Open a Python shell
  • CD to the Python_Reference/examples/txrx_log directory from the expanded 802.11 Reference design archive
  • To see the output from the sample data:
    • Run python log_process_details.py raw_log_dual_flow_ap.hdf5
    • Run python log_process_details.py raw_log_dual_flow_sta.hdf5
    • Run python log_process_details.py raw_log_one_flow.hdf5
  • To see the output from your own log file:
    • Run python log_process_details.py <my_hdf5_log_file>

The script will run, then display its results:

Reading log file 'raw_log_dual_flow_ap.hdf5' ( 20.2 MB)

Log Index Contents:
         1 of Type 1
    18,243 of Type 10
    93,459 of Type 20
    96,068 of Type 21
         1 of Type 6
--------------------------
   207,772 total entries

Filtered Log Index:
    18,243 of Type RX_OFDM
    96,068 of Type TX_LOW
         1 of Type NODE_INFO
    93,459 of Type TX
--------------------------
   207,771 total entries


Example 1: Tx Information per Rate:
Rate                 # Tx Pkts               Avg Tx time (us)
            CPU High    CPU Low   Re-trans   CPU High
  6 Mbps:        941        941          0        431
  9 Mbps:          0          0          0          0
 12 Mbps:          0          0          0          0
 18 Mbps:      92518      95127       2609        961
 24 Mbps:          0          0          0          0
 36 Mbps:          0          0          0          0
 48 Mbps:          0          0          0          0
 54 Mbps:          0          0          0          0

Total Retransmissions: 2609

Example 2: Tx Counts (CPU High):
Dest Addr                # Pkts    # Bytes      MAC Addr Type
40:d8:55:04:20:bc         92518  131745632      Mango WARP Hardware
ff:ff:ff:ff:ff:ff           941      65870      Broadcast

Example 2: Tx Counts (CPU Low - includes retransmissions):
Dest Addr                # Pkts    # Bytes      MAC Addr Type
40:d8:55:04:20:bc         95127  135460848      Mango WARP Hardware
ff:ff:ff:ff:ff:ff           941      65870      Broadcast

Example 3: Rx Counts (including duplicates):
Dest Addr                # Pkts    # Bytes      MAC Addr Type
40:d8:55:04:20:bc         18243   25978032      Mango WARP Hardware

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


Log Process Throughput vs Time

The flow of the log_process_throughput_vs_time.py script is:

  1. Extract the log data from both the AP and STA HDF5 log files
  2. Extract the raw log index both the AP and STA HDF5 log files
  3. Filter the raw log indexes to extract log entry types we desire
  4. Convert the log data and filtered log indexes in to numpy arrays.
  5. Extract the TX and RX_OFDM information from both log files
  6. Convert the data to pandas series and process to create the thoughput plot.

To run this example:

  • Setup wlan_exp (see Getting Started for details)
  • Open a Python shell
  • CD to the Python_Reference/examples/txrx_log directory from the expanded 802.11 Reference design archive
  • Run python log_process_throughput_vs_time.py

The script will run, then display its results:

AP Rx: 18243, AP Tx: 93459
STA Rx: 93444, STA Tx: 18239

No image "log_process_throughput_vs_time_example.PNG" attached to 802.11/wlan_exp/examples/txrx_log_analysis

To run the script on your own file, for example the one created by the two node, two flow log capture example, then you would need to modify the AP_LOGFILE and STA_LOGFILE variables within the script and re-run.


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


Attachments (1)

Download all attachments as: .zip