Hi,
Sample fast connect application works well, a connection is established for about 500msec.
I am trying to make sense and understand how exactly fast connect works and basically how it speeds things up.
Background:
it stores the below in flash:
struct wlan_fast_reconnect {
unsigned char psk_essid[NDIS_802_11_LENGTH_SSID + 4];
unsigned char psk_passphrase[IW_PASSPHRASE_MAX_SIZE + 1];
unsigned char wpa_global_PSK[A_SHA_DIGEST_LEN * 2];
uint32_t channel;
uint32_t security_type;
#if defined(CONFIG_FAST_DHCP) && CONFIG_FAST_DHCP
uint32_t offer_ip;
#endif
#if ATCMD_VER == ATVER_2
uint32_t enable;
#endif
};
I am using security type: RTW_SECURITY_WPA2_AES_PSK
in this case, only psk_essid, psk_passphrase, and channel are used.
key_id is stored in channel higher bit, but key_id is only used for RTW_SECURITY_WEP_PSK which does not apply in my case (RTW_SECURITY_WPA2_AES_PSK)
NOTE: (unless i am missing something wpa_global_PSK is not used when security type = WPA2_AES_PSK, so in my case it should not be used either)
I do see fast connect code sets:
pscan_config = PSCAN_ENABLE | PSCAN_FAST_SURVEY;
//set partial scan for entering to listen beacon quickly
ret = wifi_set_pscan_chan((uint8_t *)&channel, &pscan_config, 1);
and then calls:
ret = wifi_connect((char*)wifi.ssid.val, wifi.security_type, (char*)wifi.password, wifi.ssid.len, wifi.password_len, wifi.key_id, NULL);
Observations:
-
Fast connect takes about 500 msec to get connected
-
If fast connect is cleared from flash, connection to the same AP takes 4+secs (why? - can someone explain this? what exactly is saved/cached?)
Questions:
- what exact steps are saved or cached during fast connect (in terms of actual wifi 802 packets and chip to/from AP packet round trips) in order to make subsequent connections fast?
- Fast connect data stores channels, credentials, ssid and password and it connects within 0.5 secs.
- How is this different than when clearing fast connect (not using fast connect), and then passing exact same parameters - in this case connection to same AP takes 4 secs - why?
- Is fast connect bound to an AP? Or, will it help in speeding up the connection to another AP on the same channel?
- Above, brings the question about the channel, as fast connect is clearly setting the channel, so if AP is on another channel fast connect probably won’t help.
- Is fast connect ONLY useful when channel is the same?
- If we know the set of channels for our environment, does it make sense to pass ALL of the possible channels from our APs instead of only the channel of the last AP?
- I am trying to sense if fast connect can be helpful when device is moving from one AP to another. Seems without any conceptual and code changes, fast connect “sticks” to an AP for as long it is able to connect, and only fast connect fails, it will then see stronger APs - this is what am trying to fine-tune and need to understand how exactly fast connect works
Thanks for any feedback, answers, and suggestions
Ivan S.