Changes between Version 1 and Version 2 of 802.11/wlan_exp/bss


Ignore:
Timestamp:
Mar 28, 2016, 11:02:38 AM (8 years ago)
Author:
welsh
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/bss

    v1 v2  
    1313|| channel || Primary channel ||
    1414|| channel_type || Channel Type ||
     15|| ssid || SSID (32 chars max) ||
    1516|| latest_beacon_rx_time || Value of System Time in microseconds of last beacon Rx ||
    16 || ssid || SSID (32 chars max) ||
    1717|| latest_beacon_rx_power || Last observed Rx Power (dBm) ||
    1818|| flags || BSS flags ||
     
    2323=== Python ===
    2424
    25 The 802.11 Reference Design Experiments Framework provides methods to interact with BSS information.  In addition to the fields above, the BSS information structures in Python also contain a {{{timestamp}}} field which is the value of the MAC time in microseconds when the structure was created.  The following methods are used to interact with BSS information:
     25The 802.11 Reference Design Experiments Framework provides methods to interact with BSS information.  In addition to the fields above, the BSS information structures in Python also contain a {{{timestamp}}} field which is the value of the MAC time in microseconds when the structure was requested from the node.  The following methods are used to interact with BSS information:
    2626
    2727  * [http://warpproject.org/docs/mango-wlan-exp-dev/node.html#wlan_exp.node.WlanExpNode.get_bss_info get_bss_info()]
     
    5151'''Arguments:'''
    5252
    53  * {{{bssid}}}: depends on node type; {{{None}}} means wipe BSS state; {{{False}}} means no change
     53 * {{{bssid}}}: depends on node type; {{{None}}} means to remove all BSS state; {{{False}}} means no change
    5454  * '''AP''': must be node's wireless MAC address
    5555  * '''STA''': must be BSSID of BSS with which to associate
     
    8484=== Example: Configuring BSS ===
    8585
    86 
    8786{{{#!python
    8887# Setup a new network with 1 AP, 1 STA
    89 #     - Assumes that both nodes started with no default BSS (i.e.
     88#     - Assumes that both nodes started with no default BSS
    9089>>> n_ap.configure_bss(ssid='My Network', beacon_interval=100, channel=6, ht_capable=True)
    9190>>> n_ap.get_bss_info()
     
    9695
    9796>>> n_ap.add_association(n_sta)
    98 
    9997>>> n_sta.get_bss_info()
    10098{'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 100, 'channel': 6, 'ht_capable': True, ...}
     99}}}
    101100
     101=== Example:  Changing Channel ===
     102
     103{{{#!python
     104# Re-tune both nodes by adjusting the BSS channel
     105#     - Assumes both AP and STA are already part of a BSS
     106>>> for n in [n_ap, n_sta]:
     107...     n.configure_bss(channel=7)
     108}}}
     109
     110=== Example:  Adjusting Beacon Interval ===
     111
     112{{{#!python
    102113# Update the beacon interval
     114#     - Assumes both AP and STA are part of a BSS
    103115>>> n_ap.configure_bss(beacon_interval=250)
    104116>>> n_ap.get_bss_info()
     
    114126{'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 250, 'channel': 6, 'ht_capable': True, ...}
    115127
    116 # Retune both nodes by adjusting the BSS channel
    117 for n in [n_ap, n_sta]:
    118     n.configure_bss(channel=7)
    119 
    120128# Disable AP beacon Tx
    121129>>> n_ap.configure_bss(beacon_interval=None)
     130
     131# When beacons are disabled, the STA will not receive any new information to update
     132# beacon interval.  Therefore, it will retain its previous value.
     133>>> n_sta.get_bss_info()
     134{'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 250, 'channel': 6, 'ht_capable': True, ...}
    122135}}}
    123136
    124 === Example:  Changing Channel ===
    125 
    126 
     137=== Example: Configuring IBSS ===
    127138
    128139{{{#!python
    129 # No command arguments, no response payload
    130 my_node.send_user_command(CMDID_USER_MYCMD, args=None)
     140# Setup an IBSS network for all IBSS nodes
     141bssid = util.create_locally_administered_bssid(node1.wlan_mac_address)
     142
     143>>> for n in ibss_nodes:
     144...    n.configure_bss(bssid=bssid, ssid='WARP-IBSS', beacon_interval=100, channel=6)
     145
     146# Change the IBSS network beacon interval
     147>>> for n in ibss_nodes:
     148...    n.configure_bss(beacon_interval=250)
     149
     150# Disable beacon Tx by all but the first node
     151>>> for n in ibss_nodes[1:]:
     152...    n.configure_bss(beacon_interval=None)
    131153}}}
    132154
    133 
    134 === Example:  Adjusting Beacon Interval ===
     155=== Example:  Reset ===
    135156
    136157{{{#!python
    137 # No command arguments, no response payload
    138 my_node.send_user_command(CMDID_USER_MYCMD, args=None)
     158>>> n_ap.configure_bss(ssid='My Network', beacon_interval=100, channel=6, ht_capable=True)
     159>>> n_ap.add_association(n_sta1)
     160>>> n_ap.add_association(n_sta2)
     161
     162# Clear STA1 station info and BSS
     163#     - Will send OTA disassociate packet to AP
     164>>> n_sta1.get_bss_info()
     165{'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 100, 'channel': 6, 'ht_capable': True, ...}
     166
     167>>> n_sta1.reset(bss=True)
     168>>> n_sta1.get_bss_info()
     169None
     170
     171>>> n_ap.get_station_info()
     172[{'mac_addr': STA2_MAC_ADDR, 'AID': 2, ...}]
    139173}}}
    140 
    141174
    142175=== Example:  Scanning for Networks ===
    143176
    144177{{{#!python
    145 # No command arguments, no response payload
    146 my_node.send_user_command(CMDID_USER_MYCMD, args=None)
    147  args=[ARG0 ARG1])
     178# To perform a scan using the current scan parameters, get the
     179# resulting network list and restore the current BSS:
     180
     181my_bss = n.get_bss_info()             # Get current BSS info
     182n.configure_bss(None)                 # Set BSS info to None
     183n.start_network_scan()               # Start network scan
     184time.sleep(5)                         # Wait for node to scan
     185n.stop_network_scan()                # Stop network scan
     186networks = n.get_network_list()       # Get networks seen in scan
     187               
     188# Restore BSS
     189n.configure_bss(bssid=my_bss['bssid'], ssid=my_bss['ssid'], channel=my_bss['channel'],
     190                beacon_interval=my_bss['beacon_interval'], ht_capable=my_bss['ht_capable'])
    148191}}}
    149192
    150 
    151