[wpa-supplicant] How to control association timeout?

Marc Haber mh+hostap
Tue Dec 5 04:53:13 PST 2006


On Tue, Oct 31, 2006 at 09:11:43PM -0800, Jouni Malinen wrote:
> On Mon, Oct 30, 2006 at 04:40:45PM +0100, Marc Haber wrote:
> > I am using wpa_supplicant on Debian sid (version 0.5.5-2) with current
> > kernel and an ipw2200 interface. I am frequenly moving between my own
> > wireless LAN (WPA-PSK) and the wireless LAN at my girlfriend's place
> > (WEP-128 with hidden ssid). Here my wpa_supplicant.conf:
> 
> > ap_scan=2
> 
> > network={
> >         ssid="<mine>"
> > }
> 
> > network={
> >         ssid="<hers>"
> >         scan_ssid=1
> > }
> 
> > At her place, my notebook first tries to associate to my home wireless
> > LAN for 60 seconds before moving on to her wireless LAN, where the
> > association succeeds immediately.
> > 
> > How can I shorten that time to, say, 5 seconds?
> 
> One way of doing this would be to use ap_scan=1 with a driver that
> supports scan_ssid=1, but since ipw2200 is not such a driver, that
> answer is probably not very helpful..

Yes, and I am not in a position to exchange the ipw2200 card for
something else.

> There is no configuration option for this in wpa_supplicant at the
> moment. If you are willing to change source code and rebuild
> wpa_supplicant, you can change this by modifying
> wpa_supplicant_associate() function in wpa_supplicant.c.

Can I ask for this to be changeable at run time in a future version?

> That 60 there is the timeout for ap_scan=2 case.

I am currently solving this issue by manually issueing select commands
for the network in question.

> I don't know whether I would really like to make this configuration,
> though. I would rather consider ap_scan=2 mode with multiple enabled
> network blocks as a special case that request scanning of multiple SSIDs
> before trying to associate with the first network.

In my limited understanding of wpa_supplicant, ap_scan=2 mode is
needed for an ipw2200 card once even one of the networks in question
has its SSID hidden.

One is not always in a position to influence the configuration of the
wireless LAN in question, and, frankly, I am getting tired about
trying to educate people who think that they know everything better in
the first place.

>  One problem with this is, though, that most drivers do not have such
>  functionality and wpa_supplicant would need to try to associate with
>  each network first with minimal timeout (just couple of seconds) in
>  order to get them included in the scan results.

Yes, that's what wpa_supplicant currently does, with 60 seconds
timeout, which is way too long for the majority of _my_ cases.

>  After each association attempt, scan results would be collected and
>  merged together. Only after this, the best AP (based on security
>  policy and/or priority configuration) would be selected and
>  wpa_supplicant would try to associate with it using a longer timeout.

I'd be happy if wpa_supplicant would take the first network it finds,
they are sufficiently far apart to make absolutely sure that there is
always only one of them in range.

> It should also be possible to optimize this by assuming that each
> network without scan_ssid=1 is sending out its SSID (i.e., does not need
> a specific per-SSID scan). In that case, the scan process would start
> with one scan for all SSIDs and the try-quick-association loop would
> only go through the network blocks with scan_ssid=1. This would likely
> be the fastest solution that is likely to work with most drivers.

That sounds like a good idea to me.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Mannheim, Germany  |  lose things."    Winona Ryder | Fon: *49 621 72739834
Nordisch by Nature |  How to make an American Quilt | Fax: *49 621 72739835




More information about the Hostap mailing list