Changes between Version 1 and Version 2 of 802.11/wlan_exp/bss
- Timestamp:
- Mar 28, 2016, 11:02:38 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
802.11/wlan_exp/bss
v1 v2 13 13 || channel || Primary channel || 14 14 || channel_type || Channel Type || 15 || ssid || SSID (32 chars max) || 15 16 || latest_beacon_rx_time || Value of System Time in microseconds of last beacon Rx || 16 || ssid || SSID (32 chars max) ||17 17 || latest_beacon_rx_power || Last observed Rx Power (dBm) || 18 18 || flags || BSS flags || … … 23 23 === Python === 24 24 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: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 requested from the node. The following methods are used to interact with BSS information: 26 26 27 27 * [http://warpproject.org/docs/mango-wlan-exp-dev/node.html#wlan_exp.node.WlanExpNode.get_bss_info get_bss_info()] … … 51 51 '''Arguments:''' 52 52 53 * {{{bssid}}}: depends on node type; {{{None}}} means wipeBSS state; {{{False}}} means no change53 * {{{bssid}}}: depends on node type; {{{None}}} means to remove all BSS state; {{{False}}} means no change 54 54 * '''AP''': must be node's wireless MAC address 55 55 * '''STA''': must be BSSID of BSS with which to associate … … 84 84 === Example: Configuring BSS === 85 85 86 87 86 {{{#!python 88 87 # 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 90 89 >>> n_ap.configure_bss(ssid='My Network', beacon_interval=100, channel=6, ht_capable=True) 91 90 >>> n_ap.get_bss_info() … … 96 95 97 96 >>> n_ap.add_association(n_sta) 98 99 97 >>> n_sta.get_bss_info() 100 98 {'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 100, 'channel': 6, 'ht_capable': True, ...} 99 }}} 101 100 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 102 113 # Update the beacon interval 114 # - Assumes both AP and STA are part of a BSS 103 115 >>> n_ap.configure_bss(beacon_interval=250) 104 116 >>> n_ap.get_bss_info() … … 114 126 {'bssid': AP_WLAN_MAC_ADDR, 'ssid': 'My Network', 'beacon_interval': 250, 'channel': 6, 'ht_capable': True, ...} 115 127 116 # Retune both nodes by adjusting the BSS channel117 for n in [n_ap, n_sta]:118 n.configure_bss(channel=7)119 120 128 # Disable AP beacon Tx 121 129 >>> 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, ...} 122 135 }}} 123 136 124 === Example: Changing Channel === 125 126 137 === Example: Configuring IBSS === 127 138 128 139 {{{#!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 141 bssid = 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) 131 153 }}} 132 154 133 134 === Example: Adjusting Beacon Interval === 155 === Example: Reset === 135 156 136 157 {{{#!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() 169 None 170 171 >>> n_ap.get_station_info() 172 [{'mac_addr': STA2_MAC_ADDR, 'AID': 2, ...}] 139 173 }}} 140 141 174 142 175 === Example: Scanning for Networks === 143 176 144 177 {{{#!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 181 my_bss = n.get_bss_info() # Get current BSS info 182 n.configure_bss(None) # Set BSS info to None 183 n.start_network_scan() # Start network scan 184 time.sleep(5) # Wait for node to scan 185 n.stop_network_scan() # Stop network scan 186 networks = n.get_network_list() # Get networks seen in scan 187 188 # Restore BSS 189 n.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']) 148 191 }}} 149 192 150 151