{{{#!comment [[Include(wiki:802.11/beta-note)]] }}} [[TracNav(802.11/TOC)]] = 802.11 Reference Design Experiments Framework Basic Service Set (BSS) = The 802.11 Reference design uses a structure to record information about a [https://en.wikipedia.org/wiki/Service_set_(802.11_network) basic service set (BSS)]. This information can be for the node's current BSS (i.e. network) or networks that the node has seen by either receiving a beacon or from [http://warpproject.org/docs/mango-wlan-exp-dev/node.html#network-scan scanning for networks]. Each node is either a member of no BSS (colloquially "unassociated") or a member of one BSS. The following fields are recorded in the BSS information structure to describe a BSS: ||= Field Name =||= Description =|| || bssid || BSS ID || || channel || Primary channel || || channel_type || Channel Type || || latest_beacon_rx_time || Value of System Time in microseconds of last beacon Rx || || ssid || SSID (32 chars max) || || latest_beacon_rx_power || Last observed Rx Power (dBm) || || flags || BSS flags || || capabilities || Supported capabilities of the BSS || || beacon_interval || Beacon interval - In time units of 1024 us || === Python === 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: * [http://warpproject.org/docs/mango-wlan-exp-dev/node.html#wlan_exp.node.WlanExpNode.get_bss_info get_bss_info()] This method will return the BSS information about the node's current BSS. The value returned can be {{{None}}} if the node is not a member of a BSS. * [http://warpproject.org/docs/mango-wlan-exp-dev/node.html#wlan_exp.node.WlanExpNode.get_network_list get_network_list()] This method will return a list of BSS information about all the networks that the node has seen. This list can include the node's current BSS if the node is a member of a BSS. This list could be empty. * '''{{{configure_bss()}}}''' for [http://warpproject.org/docs/mango-wlan-exp-dev/node_ap.html#wlan_exp.node_ap.WlanExpNodeAp.configure_bss AP], for [http://warpproject.org/docs/mango-wlan-exp-dev/node_sta.html#wlan_exp.node_sta.WlanExpNodeSta.configure_bss STA], for [http://warpproject.org/docs/mango-wlan-exp-dev/node_ibss.html#wlan_exp.node_ibss.WlanExpNodeIBSS.configure_bss IBSS] This method will configure the node's current BSS. For each node type, there is a specific implementation of {{{configure_bss}}} that has different argument requirements. See below for more details. === Configuring the BSS === A node requires a minimum set of information to be a member of a BSS. The minimum set of information is: * BSSID: 48-bit MAC address * Channel: logical channel for Tx/Rx by BSS members * SSID: variable length string * Beacon Interval: time between TBTTs in units of TUs (not required by STA) A node's current BSS can be populated by default in C, by active scanning, or by wlan_exp. The DIP switch on the WARP v3 node can be used to control the default BSS at boot (see [http://warpproject.org/trac/wiki/802.11/Usage/UserIO user I/O documentation] for each MAC project). '''Arguments:''' * {{{bssid}}}: depends on node type; {{{None}}} means wipe BSS state; {{{False}}} means no change * '''AP''': must be node's wireless MAC address * '''STA''': must be BSSID of BSS with which to associate * '''IBSS''': must be valid locally-administered BSSID (use [http://warpproject.org/docs/mango-wlan-exp-dev/wlan_exp_util.html#wlan_exp.util.create_locally_administered_bssid create_locally_administered_bssid()] utility to create locally-administered BSSIDs from MAC addresses) * {{{ssid}}}: string; {{{None}}} means no change * {{{beacon_interval}}}: integer in ![10, 65534]; {{{None}}} means no beacon Tx; {{{False}}} means no change * {{{channel}}}: Integer channel index; {{{None}}} means no change * {{{ht_capable}}}: Does the node advertise HT processing capabilities; {{{None}}} means no change === Changes to code from 802.11 Reference Design v1.4 === * '''Replaces:''' * {{{node.set_channel()}}}: New method [http://warpproject.org/docs/mango-wlan-exp-dev/node.html#wlan_exp.node.WlanExpNode.set_radio_channel set_radio_channel()] only affects hardware, not BSS * {{{node_ap.get/set_ssid()}}}: Use {{{get_bss_info()}}} as getter * {{{node_ap.get/set_beacon_interval()}}}: Use {{{get_bss_info()}}} as getter * {{{node_sta.set_association()}}} * {{{node_ibss.join()}}} * {{{util.create_bss_info()}}} * '''Affected:''' * {{{node.reset()}}} has new arguments: * {{{bss=bool}}}: nullifies the node's BSS state but does not remove any entries from the BSS information list; wipes station_info list * {{{n.reset(bss=True)}}}, unlike {{{n.configure_bss(bssid=None)}}}, shall produce the following OTA transmission: * For AP, a deauthentication frame to each associated station * For STA, a disassociation frame to its AP * For IBSS, nothing. {{{n_ibss.reset(bss=True)}}} == {{{n_ibss.configure_bss(bssid=None)}}} * {{{network_list=bool}}}: wipes the node's list of overheard BSS information, excluding the bss_info entry for the node's current network (if any) * Removed arguments {{{associations=bool}}}, {{{bss_info=bool}}} * {{{node.reset_all()}}} includes {{{(bss=True, network_list=True)}}} === Example: Configuring BSS === {{{#!python # Setup a new network with 1 AP, 1 STA # - Assumes that both nodes started with no default BSS (i.e. >>> n_ap.configure_bss(ssid='My Network', beacon_interval=100, channel=6, ht_capable=True) >>> n_ap.get_bss_info() {'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 100, 'channel': 6, 'ht_capable': True, ...} >>> n_sta.get_bss_info() None >>> n_ap.add_association(n_sta) >>> n_sta.get_bss_info() {'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 100, 'channel': 6, 'ht_capable': True, ...} # Update the beacon interval >>> n_ap.configure_bss(beacon_interval=250) >>> n_ap.get_bss_info() {'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 250, 'channel': 6, 'ht_capable': True, ...} # Query STA before it receives a new beacon >>> n_sta.get_bss_info() {'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 100, 'channel': 6, 'ht_capable': True, ...} # Query STA after it receives a new beacon >>> time.sleep(250*1024*1e-6) >>> n_sta.get_bss_info() {'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 250, 'channel': 6, 'ht_capable': True, ...} # Retune both nodes by adjusting the BSS channel for n in [n_ap, n_sta]: n.configure_bss(channel=7) # Disable AP beacon Tx >>> n_ap.configure_bss(beacon_interval=None) }}} === Example: Changing Channel === {{{#!python # No command arguments, no response payload my_node.send_user_command(CMDID_USER_MYCMD, args=None) }}} === Example: Adjusting Beacon Interval === {{{#!python # No command arguments, no response payload my_node.send_user_command(CMDID_USER_MYCMD, args=None) }}} === Example: Scanning for Networks === {{{#!python # No command arguments, no response payload my_node.send_user_command(CMDID_USER_MYCMD, args=None) args=[ARG0 ARG1]) }}}