Changes between Initial Version and Version 1 of 802.11/wlan_exp


Ignore:
Timestamp:
Feb 11, 2014, 2:51:48 PM (10 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp

    v1 v1  
     1{{{#!comment
     2[[Include(wiki:802.11/beta-note)]]
     3}}}
     4
     5[[TracNav(802.11/TOC)]]
     6
     7= 802.11 Reference Design: Experiment Framework =
     8
     9In additional the standard 802.11 MAC and PHY, this reference design implements a framework for running experiments with multiple nodes. This framework enables low-level visibility and control of MAC and PHY behaviors in real-time.
     10
     11== Examples ==
     12
     13''' AP-to-STA Throughput: '''
     14
     15This example uses two WARP v3 nodes running the 802.11 Reference Design. One node is configured as an AP, the other as a station. The station node is associates with the AP at boot.
     16
     17This script uses the txrx_stats data in the reference design to calculate through in a unidirectional flow. The AP generates a fully backlogged flow of packets addressed to the station. The station counts how many bytes it has received from the AP. The Python script polls the station twice over a period of 10 seconds, recording the txrx_stats reports before and after. It then computes the number of new bytes received and the time span between reports. The script uses the timestamps reported by the node in the txrx_stats report to calculate the time span. This removes any dependence on the PC-nodes link in computing the denominator for the throughput calculation.
     18
     19{{{#!python
     20#Initialize the 802.11 WARP nodes
     21nodes = wlan_exp_util.wlan_exp_init_nodes(['W3-a-00001', W3-a-00002'])
     22
     23#Find the AP node
     24n_ap = [n for n in nodes if n.node_type == NT_AP][0]
     25
     26#Find the STA node
     27n_sta = [n for n in nodes if n.node_type == NT_STA][0]
     28
     29#Start a flow from the AP's local traffic generator (LTG) to the STA
     30# Set the flow to fully backlogged with 1400 byte payloads
     31n_ap.config_ltg(n_sta, LTG_CBR(1400, 0))
     32
     33#Experiment parameters - trial time and PHY rates to test
     34TRIAL_TIME = 10
     35rates = (R6, R9, R12, R18)
     36
     37#Result arrays (filled in by the loop below)
     38rx_bytes = []
     39rx_time_spans = []
     40
     41for ii,rate in enumerate(rates):
     42  #Configure the AP's Tx rate for the selected station
     43  n_ap.set_tx_rate(n_sta, rate)
     44
     45  #Record the station's initial Tx/Rx stats
     46  rx_stats_start = n_sta.get_txrx_stats(n_ap)
     47
     48  time.sleep(TRIAL_TIME)
     49
     50  #Record the station's final Tx/Rx stats
     51  rx_stats_end = n_sta.get_txrx_stats(n_ap)
     52
     53  #Compute the number of new bytes received and the time span
     54  rx_bytes[ii] = rx_stats_end['rx_bytes'] - rx_stats_start['rx_bytes']
     55  rx_time_spans[ii] = rx_stats_end['timestamp'] - rx_stats_start['timestamp']
     56
     57#Calculate and display the throughput results
     58for ii in len(num_rx[ii]):
     59  #Timestamps are in microseconds; bits/usec == Mbits/sec
     60  xput = (rx_bytes[ii] * 8) / rx_time_spans[ii]
     61  print("Rate = %2.1f Mbps   Throughput = %2.1 Mbps", (rates[ii], xput))
     62
     63}}}