experchange > linux.networking

William Unruh (08-20-18, 09:34 PM)
Networking on Linux seems to be a bit of a mess.

wpa_supplicant just randomly connects with an access point, ignoring all
suggestions as to what it should connect to. Thus, if you have (like me)
a /etc/wpa_supplicant.conf file, it will just randomly choose one of
them to connect to, if it is available.

It will also just connect to the a given SSID in random order, rather
than connecting to say the BSSID with the strongest signal available (
as would be sensible) Thus it will connect to a flakey 30% signal
strength BSSID rather than a 90% signal strength BSSID with the same
SSID.

iwlist craps out if there are too many BSSID available. When I am at
airports, it is impossible to use the Network Center on Mageia, since it
uses iwlist, and airports often have "too many" access points for iwlist
(iw will list them, but it has a totally lunatic output format, and
gives huge warnings that you should not screen scrape it-- and it has,
as far as I can see, no other output.) Also iw seems not to work at all
half the time, or if you happen to be connected to an access point, it
will only give that one AP, when there another 50 available that it does
not list.
wpa_cli MUST have wpa_supplicant running when it tries to do anything.

And all of them have woefully inadequate documentation, and ancient
documentation. ( for example, wpa_supplicant documentation does not mention
nl80211 driver, when that is now the strongly approved driver, all
others being deprecated. )
Jorgen Grahn (08-20-18, 10:12 PM)
On Mon, 2018-08-20, William Unruh wrote:
> Networking on Linux seems to be a bit of a mess.


At this point I prepared to disagree violently ...

> wpa_supplicant just randomly [...]


Oh, /wireless/ networking. That does indeed seem like a terrible
mess.

/Jorgen
William Unruh (08-20-18, 10:59 PM)
On 2018-08-20, Jorgen Grahn <grahn+nntp> wrote:
> On Mon, 2018-08-20, William Unruh wrote:
>> Networking on Linux seems to be a bit of a mess.

> At this point I prepared to disagree violently ...
>> wpa_supplicant just randomly [...]

> Oh, /wireless/ networking. That does indeed seem like a terrible
> mess.


Yes, I meant wireless. Sorry to not have been clearer. I do agree that
wired networking seems to be fine.
tom (08-28-18, 06:19 AM)
On 20 Aug 2018 20:12:58 GMT
Jorgen Grahn <grahn+nntp> wrote:

> On Mon, 2018-08-20, William Unruh wrote:
> At this point I prepared to disagree violently ...
> Oh, /wireless/ networking. That does indeed seem like a terrible
> mess.
> /Jorgen


Just to be clear are we talking about eating dogs for breakfast or
what dogs eat for breakfast?
Dan Purgert (08-28-18, 01:29 PM)
tom wrote:
> On 20 Aug 2018 20:12:58 GMT
> Jorgen Grahn <grahn+nntp> wrote:
> Just to be clear are we talking about eating dogs for breakfast or
> what dogs eat for breakfast?


Hopefully the former. Neighbor's dog eats its own shit for breakfast...
Allodoxaphobia (08-28-18, 03:31 PM)
On Mon, 27 Aug 2018 21:19:38 -0700, tom wrote:
> On 20 Aug 2018 20:12:58 GMT
> Jorgen Grahn <grahn+nntp> wrote:
> Just to be clear are we talking about eating dogs for breakfast or
> what dogs eat for breakfast?


Probably what the dog _had_ for breakfast -- post-processing...
Jerry Peters (08-28-18, 10:10 PM)
William Unruh <unruh> wrote:
[..]
> documentation. ( for example, wpa_supplicant documentation does not mention
> nl80211 driver, when that is now the strongly approved driver, all
> others being deprecated. )


Use networkmanager it will control wpa-supplicant & internally it uses
the nl80211 interface. Wicd on the other hand, calls iwlist internally
so in your case it'd be problematic.

You also will need nm-applet to convienently set up each network.
William Unruh (08-28-18, 10:49 PM)
On 2018-08-28, Jerry Peters <jerry> wrote:
> William Unruh <unruh> wrote:
> Use networkmanager it will control wpa-supplicant & internally it uses
> the nl80211 interface. Wicd on the other hand, calls iwlist internally
> so in your case it'd be problematic.
> You also will need nm-applet to convienently set up each network.


I did try the network manager about 3 years ago for a while, and found
it frustrating. When it worked it was fine. When it did not it was very
hard to debug or to figure out how to fix it. network center (on Mageia)
is much more configurable, but the person who wrote it is long gone, and
the others seem to be leary/uncomforable at tackling it. It is not a
well documented code at all (in perl), and is somewhat obscure. I think
it eventually uses the ifup scripts to do the actual connecting. One
problem is that wpa_supplicant itself is weird. For example it does not
connect to the strongest signal for an SSID, but goes through trying the
first one that reported, then if that does not work, the next, etc. Thus
with one AP having strength 95% and another with 44%, it is as likely as
not to connect to the weaker one, making the connection very flakey.
Jerry Peters (08-29-18, 10:21 PM)
William Unruh <unruh> wrote:
[..]
> first one that reported, then if that does not work, the next, etc. Thus
> with one AP having strength 95% and another with 44%, it is as likely as
> not to connect to the weaker one, making the connection very flakey.


You might experiment with NM again, it's under continual development
and there are significant changes between versions. One problem that I
have with NM is that it's typical GNOME -- it assumes that its way of
doing things is what everyone wants. I want dnsmasq to be a caching
nameserver, and don't care about "split dns for vpn", so I use a
wrapper script to ignore most of the args NM passes to dnsmasq so I
can use it the way I want.

Wicd is simpler, but again uses iwlist internally and doesn't seem to
have a large developer base. NM also connects faster than wicd,
probably related to using nl80211 directly rather than parsing iwlist
output.
William Unruh (08-30-18, 01:29 AM)
On 2018-08-29, Jerry Peters <jerry> wrote:
[..]
> have a large developer base. NM also connects faster than wicd,
> probably related to using nl80211 directly rather than parsing iwlist
> output.


If they use iw to read the APs then it is far more difficult to parse
than is iwlist. (iwlist unfortuantely has a max buffer size too small
for man locations). However, NM might use wpa_cli to read from
wpa_supplicant the APs that are available. Not sure how to run
wpa_supplicant so that it does not try to connect to anything but does
actually scan all the APs, so wpa_cli can read them and then tell
wpa_supplicant to connect to a certain one.

Also, if you have many BSSIDs which have the same SSID name, does NM
connect to the strongest one, or does it also randomly choose (well in
order of actually receiving the scan, which is random with respect to
the strength)?
Jerry Peters (08-30-18, 10:19 PM)
William Unruh <unruh> wrote:
> On 2018-08-29, Jerry Peters <jerry> wrote:
> If they use iw to read the APs then it is far more difficult to parse
> than is iwlist. (iwlist unfortuantely has a max buffer size too small
> for man locations). However, NM might use wpa_cli to read from
> wpa_supplicant the APs that are available. Not sure how to run
> wpa_supplicant so that it does not try to connect to anything but does
> actually scan all the APs, so wpa_cli can read them and then tell
> wpa_supplicant to connect to a certain one.


AFAIK NM uses nl80211 directly via netlink, not an external program
like iw.
There's also an option in wicd to use another python module instead of
iwlist, but I have no idea what interface that module uses.

> Also, if you have many BSSIDs which have the same SSID name, does NM
> connect to the strongest one, or does it also randomly choose (well in
> order of actually receiving the scan, which is random with respect to
> the strength)?


Sorry, don't know, you'd have to experiment to find out, unless it's
in the NM documentation.

I just switched from wicd about 2 months ago when a kernel upgade
broke iwlist for ath5k (now fixed, btw). Once I got used to NM I find
that I like it better than wicd. A big reason is that it automatically
reconnects after resume from hibernate or sleep, something wicd would
do sporadically.
tom (11-26-18, 04:43 AM)
On Tue, 28 Aug 2018 11:29:17 -0000 (UTC)
Dan Purgert <dan> wrote:

> tom wrote:
> Hopefully the former. Neighbor's dog eats its own shit for
> breakfast...


Oh man, that's probably very not healthy.
Similar Threads