WiFi: Android Band Preference / Roaming

126 views
Skip to first unread message

tim....@devoteam.com

unread,
Jan 14, 2016, 11:30:51 AM1/14/16
to android-platform
Hey all

Can anyone tell me how exactly Android chooses which BSSID to connect to upon initially turning on the WiFi / or when roaming (all BSSIDs share the same SSID)?
I know that a 5 GHz BSSID RSSI value is compared with the 2.4GHz BSSID RSSI value, and 5GHz is favored in some conditions.

It is explained here in the source code:

/* Set G-SCAN roam parameters */

 

/**

 * Firmware roaming is implemented with two modes:

 *   1- "Alert" mode roaming, (Note: alert roaming is the pre-L roaming, whereas firmware is

 *      "urgently" hunting for another BSSID because the RSSI is low, or because many successive

 *      beacons have been lost or other bad link conditions).

 *   2- "Lazy" mode, where firmware is hunting for a better BSSID or white listed SSID even though

 *      the RSSI of the link is good.

 *      Lazy mode is configured thru G-scan, that is, the results of G-scans are compared to the

 *      current RSSI and fed thru the roaming engine.

 *      Lazy scan will be enabled (and or throttled down by reducing the number of G-scans) by

 *      framework only in certain conditions, such as:

 *          - no real time (VO/VI) traffic at the interface

 *          - low packet rate for BE/BK packets a the interface

 *          - system conditions (screen lit/dark) etc...

 *

 * For consistency, the roam parameters will always be configured by framework such that:

 *

 * condition 1- A_band_boost_threshold >= (alert_roam_rssi_trigger + 10)

 * This condition ensures that Lazy roam doesn't cause the device to roam to a 5GHz BSSID whose RSSI

 * is lower than the alert threshold, which would consequently trigger a roam to a low RSSI BSSID,

 * hence triggering alert mode roaming.

 * In other words, in alert mode, the A_band parameters may safely be ignored by WiFi chipset.

 *

 * condition 2- A_band_boost_threshold > A_band_penalty_factor

 *

 */


/**

 * Example:

 * A_band_boost_threshold = -65

 * A_band_penalty_threshold = -75

 * A_band_boost_factor = 4

 * A_band_penalty_factor = 2

 * A_band_max_boost = 50

 *

 * a 5GHz RSSI value is transformed as below:

 * -20 -> -20+ 50 = 30

 * -60 -> -60 + 4 * (-60 - A_band_boost_threshold) = -60 + 16 = -44

 * -70 -> -70

 * -80 -> -80 - 2 * (A_band_penalty_threshold - (-80)) = -80 - 10 = -90


 */


I've tested this with a few devices and it just doesn't seem to be consistent, sometimes 2.4GHz is chosen when it should have been 5GHz if I follow the above rules. 

So my question is, do the manufacturers change how this selection process works, or is this how it works in every Android device?

Reply all
Reply to author
Forward
0 new messages