[pkg-wpa-devel] Maybe wpasupplicant just shouldn't roam at all..

Reinhard Tartler siretart at tauware.de
Sun Apr 2 20:12:11 UTC 2006


On Sun, Apr 02, 2006 at 09:51:02PM +0200, Joachim Breitner wrote:
> while thinking about the roaming issue, I came to a different
> conclusion: wpasupplicant should not roam at all, strictly following the
> unix paradigm of small tools doing their stuff good. The work on mode1
> enables that. But let's start at the beginning.
> 
> Let's have a look at the wired world first.
> 
> Setup 1) ifupdown
> The simple static setup. There is "auto eth0" in /e/n/i, and exactly one
> network defined for eth0. Works fine since the beginning of dawn
> (ifupdown's dawn at least)
> 
> Setup 2) ifupdown + ifplugd
> We switch to a laptop, that get's unplugged and plugged again. We want,
> I hope you agree, the interface only up when the cable is plugged in,
> and we need to ifup on plugging in anyways, as we might need a new IP
> via. dhcp. So we add ifplugd and remove "auto eth0". With zero more
> configuration, we get what we want, and everything is fine.
> 
> Setup 3) ifupdown + ifplugd + guessnet
> No we suddently have differnet networks that need different
> configuration in /e/n/i. No problem, thanks to guess net. Putting
> several virtual interfaces with a test (e.g. against the ethernet MAC of
> some router) and a simple mapping line solves this problem, and we can
> continue to not worry about network after that -- it just works.
> 
> IIRC, wpasupplicant is also important for 802.1X. So if some network
> needs that, we use wpasupplicant in mode1. This is orthogonal to these
> Setups, and wpasupplicant can stick to it's main task.

I agree with your analysis. I don't think that Setup 3) is the only way
to a decent roaming configuration, but it is surely a decent roaming 
solution.

> Let's transfer this to the wireless world:
> 
> Setup 1) ifupdown
> If we are always in the range of the wireless, we can just make that
> auto. Unlikely, but it is the basic case.
> 
> Setup 2) ifupdown + wifiroamd
> Usually, you walk in and out of the range of your (currently only)
> network. So we need something that detects the reaching and leaving of
> the AP's range. Currently, I'm using wpasupplicant for that, I used to
> use waproamd, but both are actually overkill - we just need the "is
> there an AP with an essid that appears in /e/n/i, then ifup wifi0"
> functionality and the "oh, signal level is zero, or low enough to
> warrant a re-scan, so run ifdown wifi0 and start scanning again". Maybe
> that part of the code can be put in a separate daemon, here dubbed
> "wifiroamd"

Such a daemon shouldn't be that hard to write. In principle, you would
only need to scan periodically (iwlist $IFACE scan). There is a corner
case with hidden ssids, the daemon would have to scan for them actively.
But I like the idea for such an scanning daemon. Heck, it wouldn't even
need to be a daemon, rather a wifidetector: for use with an mapping
script it would perhaps be easier if you could just have the command
returning a string which identifies the detected location.

> Setup 3) ifupdown + wifiroamd + guessnet
> You can guess what happens: We need different configuration, so we use
> virtual devices and guessnet to select them (this time probably based on
> the essid)
> 
> Where does wpasupplicant come it? Again just for the main task: Handling
> the encryption. If one of these configured networks, virtual or not,
> needs WAP or WPA, you add the appropriate stancas to /e/n/i, run
> wpasupplicant in mode1. wpasupplicant will be started when the network
> is brought up, i.e. when the ap is in range, might even fail (like a
> failed dhcp client) when something goes wrong instead of starting to
> scan by itself, and will be ended when the interface is brought down.
> 
> 
> IMHO, this is a very clean implementation, very analogous to the wired
> setup, allows great flexibility and sufficient reliability and "only"
> needs the split of the "roam and associate" and the "encryption" code in
> wpasupplicant into two separate daemons.
> 
> Thanks for your attention, if really read it all :-)

Thank you very much for your post. I think the solution you presented
here does integrate very well into ifupdown. Is there perhaps such a
wifi detector already written?

Gruesse,
	Reinhard
 



More information about the Pkg-wpa-devel mailing list