Changes between Version 2 and Version 3 of 802.11/wlan_exp/Porting_v1.5


Ignore:
Timestamp:
Apr 18, 2016, 9:44:22 PM (8 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/Porting_v1.5

    v2 v3  
    1111In order to assist with porting custom scrtips, the sections below highlight some of the changes from v1.4 to v1.5.
    1212
    13 {{{#!comment
     13Setup AP+STA network
    1414
    15 1) Replaced the following:
     15{{{#!td
     16{{{#!python
     17# wlan_exp v1.4
     18n_ap.disassociate_all()
     19n_ap.set_ssid('WARP-AP')
     20n_ap.add_association(n_sta)
     21n_ap.set_channel(6)
     22n_sta.set_channel(6)
     23}}}
     24}}}
     25{{{#!td
     26{{{#!python
     27# wlan_exp v1.5
     28n_ap.configure_bss(ssid='WARP-AP', channel=6)
     29n_ap.add_association(n_sta)
     30}}}
     31}}}
    1632
    17 ------------------
    18 if (((len(n_ap_l) == 1) and (len(n_sta_l) == 1))):
    19     # Extract the two nodes from the lists for easier referencing below
    20     n_ap = n_ap_l[0]
    21     n_sta = n_sta_l[0]
    22 ------------------
    2333
    24 with
     34=== Configuring Tx Rates ===
     35Two key changes for the {{{set_tx_rate}}} methods:
     36 * Require {{{mcs}}} argument for MCS index, instead of using entry from a dictionary of rates
     37 * Require {{{phy_mode}}} argument to select between 11a ({{{'NONHT'}}}) and 11n ({{{'HTMF'}}}) rates
    2538
    26 ------------------
    27 if len(n_ap_l) == 1 and len(n_sta_l) == 1:
    28     # Setup the two nodes
    29     n_ap = n_ap_l[0]
    30     n_sta = n_sta_l[0]
     39{{{#!td
     40{{{#!python
     41# wlan_exp v1.4
     42rate = wlan_exp_util.wlan_rates[x]
     43n.set_tx_rate_unicast(rate, curr_assoc=True, new_assoc=True)
     44n_ap.set_tx_rate_multicast_data(rate)
     45}}}
     46}}}
     47{{{#!td
     48{{{#!python
     49# wlan_exp v1.5
     50n.set_tx_rate_unicast(mcs=x, phy_mode='NONHT', curr_assoc=True, new_assoc=True)
     51n_ap.set_tx_rate_multicast_data(mcs=x, phy_mode='NONHT')
     52}}}
     53}}}
    3154
    32     # Configure the AP to reject authentication requests from wireless clients
    33     #    - Uncomment this line to block any wireless associations during the experiment
    34     # node1.set_authentication_address_filter(allow='NONE')
     55=== Configuring Antenna Modes ===
     56Methods for setting Tx and Rx antenna modes now accept simple string argument values, replacing the dictionaries of antenna modes. The new {{{set_tx_ant_mode}}} helper method sets the Tx antenna mode for all classes of traffic and all partners. Different Tx antenna modes can still be set per traffic class / per partner device - refer to the [//docs/mango-wlan-exp/node.html#antenna-modes wlan_exp antenna modes docs] for details.
    3557
    36     # Configure AP BSS
    37     n_ap.configure_bss(ssid=AP_SSID, channel=CHANNEL, beacon_interval=100)
    3858
    39     # Establish the association between nodes
    40     #     - This will change the STA to the appropriate channel
    41     n_ap.add_association(n_sta)
    42 ------------------
     59{{{#!td
     60{{{#!python
     61# wlan_exp v1.4
     62
     63# Select RF B for all Tx
     64m_tx = wlan_exp_util.wlan_tx_ant_mode[0]
     65n.set_tx_ant_mode_unicast(m, curr_assoc=True, new_assoc=True)
     66n.set_tx_ant_mode_multicast_data(m, curr_assoc=True, new_assoc=True)
     67n.set_tx_ant_mode_multicast_mgmt(m, curr_assoc=True, new_assoc=True)
     68
     69# Select RF B for all Rx
     70m_rx = wlan_exp_util.wlan_rx_ant_mode[0]
     71n.set_rx_ant_mode(m_rx)
     72}}}
     73}}}
     74{{{#!td
     75{{{#!python
     76# wlan_exp v1.5
     77
     78# Select RF B for all Tx and Rx
     79n.set_tx_ant_mode('RF_B')
     80n.set_rx_ant_mode('RF_B')
     81}}}
     82}}}
    4383
    4484
    4585
    46 2) Replaced the following:
    4786
    48 ------------------
    49 # Put each node in a known, good state
    50 for node in nodes:   
    51     node.reset_all()
     87Other new APIs
    5288
    53     # Set all nodes to be on the same channel
    54     node.set_channel(CHANNEL)
    55    
    56     # Remove any current association information
    57     node.disassociate_all()
     89 * AP support for STA power savings: deprecated {{{n_ap.ap_configure(support_power_savings=bool)}}}, use {{{n_ap.enable_DTIM_multicast_buffering(bool)}}}
     90 * STA/IBSS updating MAC time from beacon receptions:
     91  * Deprecated {{{n_sta.configure_sta(?)}}}, use {{{n_sta.enable_beacon_mac_time_update(bool)}}}
     92  * Deprecated {{{n_ibss.configure_ibss(?)}}}, use {{{n_ibss.enable_beacon_mac_time_update(bool)}}}
    5893
    59     # Get some additional information about the experiment
    60     channel  = node.get_channel()
    61    
    62    
    63 
    64     print("\n{0}:".format(node.name))
    65     print("    Channel  = {0}".format(wlan_exp_util.channel_to_str(channel)))
    66 ------------------
    67 
    68 with
    69 
    70 ------------------
    71 # Put each node in a known, good state
    72 for node in nodes:   
    73     node.reset(log=True, txrx_counts=True, ltg=True, queue_data=True)
    74 ------------------     
    75 
    76 set_channel() and get_channel() no longer exist
    77 
    78 3) Removed the following:
    79 
    80 ------------------
    81 # Set the network SSID
    82 ssid = n_ap.set_ssid(AP_SSID)
    83 print("AP SSID: '{0}'\n".format(ssid))
    84 ------------------
    85 
    86 4) Replaced the following:
    87 
    88 ------------------
    89 for idx_r,rate_num in enumerate(rates):
    90     rates_mbps[idx_r] =  wlan_exp_util.wlan_rates[rate_num]['rate']
    91 ------------------
    92 
    93 with
    94 
    95 ------------------
    96 phy_mode  = wlan_exp_util.phy_modes['HTMF']
    97 for idx_r,rate_num in enumerate(rates):
    98     rate_info = wlan_exp_util.get_rate_info(rate_num, phy_mode)
    99     rates_mbps[idx_r] =  rate_info['phy_rate']
    100 ------------------
    101 
    102 5) Replaced the following:
    103 
    104 ------------------
    105 n_ap.ap_configure(support_power_savings=False) #Disable DTIM bcast blanking
    106 ------------------
    107 
    108 with
    109 
    110 ------------------
    111 n_ap.enable_DTIM_multicast_buffering(False) #Disable DTIM bcast blanking
    112 ------------------
    113 
    114 6) Replaced the following:
    115 
    116 ------------------
    117         rate = wlan_exp_util.wlan_rates[rate_num]
    118        
    119         n_ap.set_tx_rate_unicast(rate, curr_assoc=True, new_assoc=True)
    120         n_sta.set_tx_rate_unicast(rate, curr_assoc=True, new_assoc=True)
    121         n_ap.set_tx_rate_multicast_data(rate)
    122         n_sta.set_tx_rate_multicast_data(rate)   
    123 ------------------
    124 
    125 with
    126 
    127 ------------------
    128         n_ap.set_tx_rate_unicast(rate_num, phy_mode, curr_assoc=True, new_assoc=True)     
    129         n_ap.set_tx_rate_multicast_data(rate_num, phy_mode)
    130         n_sta.set_tx_rate_unicast(rate_num, phy_mode, curr_assoc=True, new_assoc=True)       
    131         n_sta.set_tx_rate_multicast_data(rate_num, phy_mode)   
    132 ------------------
    133 
    134 7) Replaced the following:
    135 
    136 ------------------
    137         sta_time_span = float(sta_rx_stats_end['timestamp'] - sta_rx_stats_start['timestamp'])
    138 ------------------
    139 
    140 with
    141 
    142 ------------------
    143         sta_time_span = float(sta_rx_stats_end['retrieval_timestamp'] - sta_rx_stats_start['retrieval_timestamp'])
    144 ------------------
    145 
    146 8) Replaced the following:
    147 
    148 ------------------
    149         # Generate indexes with just Tx and Rx events
    150         entries_filt  = ['NODE_INFO', 'RX_OFDM', 'TX', 'TX_LOW']
    151         entries_merge = {'RX_OFDM': ['RX_OFDM', 'RX_OFDM_LTG'],
    152                                          'TX'     : ['TX', 'TX_LTG'],
    153                                          'TX_LOW' : ['TX_LOW', 'TX_LOW_LTG']}
    154        
    155         log_index_txrx_sta = log_util.filter_log_index(raw_log_index_sta, include_only=entries_filt, merge=entries_merge)
    156        
    157         # Generate numpy arrays
    158         log_np_sta = log_util.log_data_to_np_arrays(log_data_sta, log_index_txrx_sta)
    159        
    160         rx_sta = log_np_sta['RX_OFDM']
    161        
    162         rx_sta_idx     = (rx_sta['addr2'] == n_ap.wlan_mac_address) & ((rx_sta['flags'] & 0x1) == 0)  & (rx_sta['fcs_result'] == 0) & ( (rx_sta['pkt_type'] == 2) | (rx_sta['pkt_type'] == 3) )
    163         rx_sta_from_ap = rx_sta[rx_sta_idx]
    164 ------------------
    165 
    166 with
    167 
    168 ------------------
    169         entries_filt  = ['NODE_INFO', 'RX_OFDM', 'TX_HIGH', 'TX_LOW']
    170         entries_merge = {'RX_OFDM': ['RX_OFDM', 'RX_OFDM_LTG'],
    171                                          'TX_HIGH': ['TX_HIGH', 'TX_HIGH_LTG'],
    172                                          'TX_LOW' : ['TX_LOW', 'TX_LOW_LTG']}
    173        
    174         log_index_txrx_sta = log_util.filter_log_index(raw_log_index_sta, include_only=entries_filt, merge=entries_merge)
    175        
    176         # Generate numpy arrays
    177         log_np_sta = log_util.log_data_to_np_arrays(log_data_sta, log_index_txrx_sta)
    178        
    179         rx_sta = log_np_sta['RX_OFDM']
    180        
    181         rx_sta_idx     = ((rx_sta['addr2'] == n_ap.wlan_mac_address) &
    182                           (((rx_sta['flags'] & RX_CONSTS.flags.DUPLICATE) == 0) &
    183                            ((rx_sta['flags'] & RX_CONSTS.flags.FCS_GOOD) != 0) &
    184                            ((rx_sta['pkt_type'] == RX_CONSTS.pkt_type.DATA) |
    185                                 (rx_sta['pkt_type'] == RX_CONSTS.pkt_type.QOSDATA) |
    186                                 (rx_sta['pkt_type'] == RX_CONSTS.pkt_type.NULLDATA))))
    187                                
    188         rx_sta_from_ap = rx_sta[rx_sta_idx]
    189 ------------------
    190 }}}