Is scanning mandatory when doing a SelectNetwork?

Adrien Bustany adrien
Mon Jan 2 05:02:45 PST 2012


Le 2012-01-02 13:57, Jouni Malinen a ?crit?:
> On Mon, Jan 02, 2012 at 12:33:57PM +0200, Adrien Bustany wrote:
>> while analyzing why associating to a wifi network (in open mode, no
>> encryption) would take around 2 seconds on my device, I saw that
>> (apparently) wpa_supplicant will run a scan (scanning for the 
>> specific
>> SSID of the network) before initiating the actual association. I was
>> wondering if wpa_supplicant could somehow cache the previous scan
>> results to avoid this scan operation when associating. Reading the 
>> code
>> I stumbled on the wpa_bss_add function in bss.c, which looks like it
>> could maintain a cache of scan results, however this function does 
>> not
>> seem to be used anywhere in the code.
>
> It is used and the results are indeed cached.
>

Indeed, my grep skills failed me :-/

>> Do you know if such a caching would be "legal"? wlancond, the daemon
>> used on Nokia devices, seems to maintain such a cache, and 
>> association
>> +
>> DHCP then takes around 400ms on the same network.
>
> I would not skip the new scan completely since it can cause problems
> with some drivers (i.e., anything using cfg80211). However, it would 
> be
> possible to limit the new scan to only a single channel if the target
> BSS is known. This would speed up the connection quite a bit 
> especially
> on dualband cards. This is done in some cases already (e.g., when 
> using
> WPS, the channel for the second connection is very likely the same as
> for the first connection). select_network case could be extended to 
> do
> the same if a matching network is found in the current BSS table.

OK, that's interesting, I could try to implement that and see how big
the savings would be.

Thanks for the quick answer!

Adrien



More information about the Hostap mailing list