{{{#!comment [[Include(wiki:802.11/beta-note)]] }}} [[TracNav(802.11/TOC)]] = 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 [http://pandas.pydata.org/ pandas framework] to plot the throughput vs time of the AP and station. By default these scripts will use [wiki:../../sample_data 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 1. Extract the raw log index from the HDF5 file 1. Filter the raw log index to extract log entry types we desire 1. Convert the log data and filtered log index in to [http://www.numpy.org/ numpy] arrays. 1. Extract and print information from the NODE_INFO and TIME_INFO log entries. 1. Extract and process information from the TX and RX_OFDM log entries. To run this example: * Setup wlan_exp (see [wiki:../../GettingStarted Getting Started] for details) * Open a Python shell * CD to the '''Python_Reference/examples/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 }}} * For example run: {{{python log_process_summary.py ap_two_node_two_flow_capture.hdf5}}} to see the [wiki:../txrx_log_capture two node, two flow log capture] example. The script will run, then display its results: {{{ Reading log file 'raw_log_dual_flow_ap.hdf5' ( 20.9 MB) Raw Log Index Contents: 1 of Type 1 1 of Type 6 18,174 of Type 10 93,105 of Type 20 95,411 of Type 21 -------------------------- 206,692 total entries Filtered Log Index: 1 of Type NODE_INFO 18,174 of Type RX_OFDM 1 of Type TIME_INFO 93,105 of Type TX -------------------------- 111,281 total entries Node Info: Node Type : WLAN Exp (AP/DCF) MAC Address : 40:d8:55:04:20:0c Serial Number: W3-a-00006 WLAN Exp Ver : 0.9.3 Experiment Started at: Mon May 05 08:23:42 2014 Example 1: Pkts per Rate: Rate Tx Rx 6 Mbps: 940 0 9 Mbps: 0 0 12 Mbps: 0 0 18 Mbps: 92165 18174 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 01:00:5e:00:00:01 13 1014 IP v4 Multicast 40:d8:55:04:21:4a 92114 131170336 Mango WARP Hardware ff:ff:ff:ff:ff:ff 978 70762 Broadcast Example 3: Rx Counts (including duplicates): Src Addr # Pkts # Bytes MAC Addr Type 40:d8:55:04:21:4a 18174 25879776 Mango WARP Hardware }}} ---- '''Source:''' the script is included in the 802.11 Reference Design archive at '''Python_Reference/examples/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 1. Extract the raw log index from the HDF5 file 1. Filter the raw log index to extract log entry types we desire 1. Convert the log data and filtered log index in to [http://www.numpy.org/ numpy] arrays. 1. Extract and process information from the TX and TX_LOW log entries. 1. Extract and process information from the TX, TX_LOW and RX_OFDM log entries. To run this example: * Setup wlan_exp (see [wiki:../../GettingStarted Getting Started] for details) * Open a Python shell * CD to the '''Python_Reference/examples/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 }}} * For example run: {{{python log_process_details.py ap_two_node_two_flow_capture.hdf5}}} to see the [wiki:../txrx_log_capture two node, two flow log capture] example. The script will run, then display its results: {{{ Reading log file 'raw_log_dual_flow_ap.hdf5' ( 20.9 MB) Log Index Contents: 1 of Type 1 1 of Type 6 18,174 of Type 10 93,105 of Type 20 95,411 of Type 21 -------------------------- 206,692 total entries Filtered Log Index: 1 of Type NODE_INFO 18,174 of Type RX_OFDM 93,105 of Type TX 95,411 of Type TX_LOW -------------------------- 206,691 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: 940 940 0 388 9 Mbps: 0 0 0 0 12 Mbps: 0 0 0 0 18 Mbps: 92165 94471 2306 965 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: 2306 Example 2: Tx Counts (CPU High): Dest Addr # Pkts # Bytes MAC Addr Type 01:00:5e:00:00:01 13 1014 IP v4 Multicast 40:d8:55:04:21:4a 92114 131170336 Mango WARP Hardware ff:ff:ff:ff:ff:ff 978 70762 Broadcast Example 2: Tx Counts (CPU Low - includes retransmissions): Dest Addr # Pkts # Bytes MAC Addr Type 01:00:5e:00:00:01 13 1014 IP v4 Multicast 40:d8:55:04:21:4a 94420 134454080 Mango WARP Hardware ff:ff:ff:ff:ff:ff 978 70762 Broadcast Example 3: Rx Counts (including duplicates): Dest Addr # Pkts # Bytes MAC Addr Type 40:d8:55:04:21:4a 18174 25879776 Mango WARP Hardware }}} ---- '''Source:''' the script is included in the 802.11 Reference Design archive at '''Python_Reference/examples/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 1. Extract the raw log index both the AP and STA HDF5 log files 1. Filter the raw log indexes to extract log entry types we desire 1. Convert the log data and filtered log indexes in to [http://www.numpy.org/ numpy] arrays. 1. Extract the TX and RX_OFDM information from both log files 1. Convert the data to [http://pandas.pydata.org/ pandas] series and process to create the thoughput plot. To run this example: * Setup wlan_exp (see [wiki:../../GettingStarted Getting Started] for details) * Open a Python shell * CD to the '''Python_Reference/examples/log''' directory from the expanded 802.11 Reference design archive * Run {{{python log_process_throughput_vs_time.py}}} NOTE: This example uses matplotlib and requires a graphical framework to plot the figure. The figure below was generated by running the example in Spyder which was installed as part of the Anaconda distribution. The script will run, then display its results: {{{ AP Rx: 18243, AP Tx: 93459 STA Rx: 93444, STA Tx: 18239 }}} [[Image(log_process_throughput_vs_time_example.png, width=500)]] To run the script on your own file, for example the one created by the [wiki:../txrx_log_capture 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/log/log_process_throughput_vs_time.py'''. ----