Return-path: Received: from mail-fx0-f158.google.com ([209.85.220.158]:38394 "EHLO mail-fx0-f158.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753813AbZCXKPk convert rfc822-to-8bit (ORCPT ); Tue, 24 Mar 2009 06:15:40 -0400 Received: by fxm2 with SMTP id 2so2187628fxm.37 for ; Tue, 24 Mar 2009 03:15:37 -0700 (PDT) From: Helmut Schaa To: Holger Schurig Subject: Re: Google Summer of Code 2009 -- Linux wireless roaming project Date: Tue, 24 Mar 2009 11:15:28 +0100 Cc: "Luis R. Rodriguez" , linux-wireless@vger.kernel.org, Jouni Malinen , Mircea Gherzan References: <20090320215705.GE8120@tesla> <200903211243.25380.helmut.schaa@gmail.com> <200903241006.43512.hs4233@mail.mn-solutions.de> In-Reply-To: <200903241006.43512.hs4233@mail.mn-solutions.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Message-Id: <200903241115.29868.helmut.schaa@gmail.com> (sfid-20090324_111544_397516_E04BE16A) Sender: linux-wireless-owner@vger.kernel.org List-ID: Am Dienstag, 24. M=C3=A4rz 2009 schrieb Holger Schurig: > > Basically roaming can be divided into 3 steps: > > 1) detect if it is time to roam > > 2) scan for better APs > > 3) associate with the new AP > > > > Step 1 is the most difficult one here, 2 only needs some > > tweaking and 3 should work as it is currently. >=20 > For one the disadvantage you mentioned I have some ideas: >=20 > > - The signal strength values on different cards are not > > comparable. So the threshold value has to be different for all > > cards. >=20 > First thing is to make the drivers report similar values in=20 > similar situations. What would be helful for user-space as well,=20 > so I think this should eventually be tackled independend of=20 > roaming anyway. Yep, that would help a lot (if it is achievable). > But consider for now the case where two different cards provide=20 > values that are (absolutely) quite different. If we look at=20 > signal differences, this wouldn't harm us that much. Consider=20 > this bss entries: >=20 > bss 1: 45 > bss 2: 42 <- also the current one > bss 3: 10 >=20 > In this case the difference from our BSS to the best matching one=20 > is only 3. If we have some heuristic that says "Only roam if you=20 > find an AP which is 6 points betters" we wouldn't roam. If=20 > another card would report for the same situation >=20 > bss 1: 54 > bss 2: 50 <- also the current one > bss 3: 12 >=20 > (that's the same as above, but multiplied by 1.2) the outcome=20 > would be the same. Got your point. My concern was not about the AP selection ;). More that= if the values are hardly comparable (like card A returns a value of 40 whi= le card B returns a value of 50 for the same AP) it is difficult to find a= good threshold value when to trigger a scan. > > - Ping-pong effect if you sit between two APs both are in > > range but with a signal strength around the threshold. >=20 > It's my understanding that a good threshold would also prevent=20 > ping-pongs ?!? Hmm, quick example: AP1 - STA - AP2 We cannot consider the signal strength as constant as it varies over ti= me even when neither the STA nor the AP are moving. Assume a threshold val= ue of t=3D40. Furthermore, the signal strength of AP1 and AP2 might alter = between 35-50 which means we have an average signal strength of 42,5 > t. Never= theless that would result in ping-pongs between AP1 and AP2 because the signal = might drop below t on both APs, while it would be better to stick to one AP a= s the signal is already quite bad (but still good enough to do some communica= tion). > > - Unnecessary scanning if the signal strength is below the > > threshold but no better AP is in range will further reduce the > > connection quality and increase power consumption. >=20 > Either you know that your device is moving, than you want this=20 > scanning, because soon the scanning is no longer unnecessary.=20 > Even if at the current position (corner of the=20 > street/warehouse/whatever) you "scan" in vein, some minutes=20 > later the situation has changed. >=20 > Or you know that you're in hot-spot mode and then you attach to=20 > an AP and stay with it. Then you don't need the whole roaming=20 > sermon at all --- this is BTW the reason why mac80211 is,=20 > despite it's awful roaming, such a success so for. >=20 > What I meant is that this is a policy decision (or trade-off=20 > decision), that the user should be able to influence. =46ully agreed. It would really make sense to turn on roaming on a per network base (maybe in wpa_supplicant's network blocks for example). > For one of my devices, I made lots of local changes: >=20 > - I provide a list of channels for the driver to scan. In most > warehouses only channels 1, 6, 11 are used. Then there's no > reason for the driver to scan at channel 2,3,4 etc. If user- > space didn't provide such a list, the driver has to scan on > all frequencies, so this is merely an optimization. But an > important one, helps tremenduously. >=20 > - I let the driver scan one frequency every n time units, e.g. > every second one channel. This makes the driver visit all > three channels during 3 seconds. >=20 > - If I would get all beacons of the current channel, AND if the > ESSID is not hidden, I would only scan for the channels I'm > not on. Because for my current channels I have the signal > strengths of all channels anyway and know also ESSID an IEs > to decide if I can roam or not, should the need arise. >=20 >=20 >=20 > > b) Number of consecutivley missed beacons below threshold >=20 > This tends to roam only when it is too late, e.g. when the=20 > connection is nearly breaking. But you wrote this by=20 > yourself :-) >=20 > In my case, I'm doing a full scan if this happens, to protect=20 > about bad channel list provisioning. >=20 >=20 >=20 >=20 > > c) Only scan for new APs if the environment changes (e.g. we > > are moving or the AP is moving etc.) >=20 > You very seldom know about this, e.g. GPS is mostly useless=20 > inside big buildings. >=20 > You can however record "Okay, when I associated to the AP my=20 > signal strength was 56. If it drops below 50, I'll look if I=20 > find something better". >=20 > > I already did some research on c) and it looks very promising > > but the topic is quite complex and needs more theoretical > > research first. >=20 > If you're serious about that then mac80211 should only get the=20 > infrastructure necessary so that we can write different roaming=20 > implementations, like we now have different rate selection=20 > implementations. Yes, that's a good idea. There are some more scenarios where different roaming algorithms might make sense. However, I'm still not sure where the roaming decision should be made (and thus where the algorithm shoul= d be implemented). In user space (wpa_supplicant) or in mac80211. Having it in user space would allow non-mac80211-drivers to benefit too but th= e driver would have to provide the necessary information. > > Scanning for new APs should not be started from within the > > driver or mac80211. Instead wpa_supplicant should care about > > that. Why? Just because the supplicant might have more > > information (maybe provided by NM) about the used network. For > > example a typical multi-AP network won't use all channels from > > within the bg-band due to signal interferences. Instead, all > > APs will be located on non-overlapping channels. Let's say 1,6 > > and 11. Hence, if the supplicant tiggers a scan it will just > > leave all channels !=3D 1,6,11 out of the scan request and the > > scan will take a shorter amount of time, which in turn speeds > > up the handoff delay. >=20 > That's similar to my local, debugfs-based channel list hack, but=20 > better :-) >=20 > But please make this be able to run from wpa_supplicant alone,=20 > don't force NM into the picture. Many embedded developers will=20 > say "thank you" for this. :-) Also agreed. The solution should be usable without NM too but I thought more about the degree of automatism here. If plain wpa_supplicant is us= ed the wpa_supplicant config should simply contain the channel list static= ally configured while in the NM case the channel list could be created by NM based on historical data. > > extend wpa_supplicant's network blocks to allow the > > specification of preferred channels ("channels=3D1,6,11"). This > > value could be provided by NM which gathered that information > > either from the user or through monitoring. >=20 > Or the value should simply be recorded in wpa_supplicant's config=20 > file. No need no stinkin' NM ! :-) Adding a network block through dbus or through the config file is prett= y much the same. So, yes, this should of course also work with a plain=20 supplicant config. Helmut -- To unsubscribe from this list: send the line "unsubscribe linux-wireles= s" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html