From: Cedric Sodhi <ManDay@openmail.cc>
To: James Prestwood <prestwoj@gmail.com>
Cc: Denis Kenzior <denkenz@gmail.com>, iwd@lists.linux.dev
Subject: Re: Initial choice of network should consider RSSI?
Date: Mon, 10 Apr 2023 09:04:35 +0300 [thread overview]
Message-ID: <ZDOm8xHuEXQ7l1EZ@air> (raw)
In-Reply-To: <CAPv5Ue6KEZVxT2Mb15bBH_8n53abvJbu_+aCTHJgP9ODU3AT5Q@mail.gmail.com>
Hello and thank you for the responses.
Denis, perhaps I misunderstood something, my description wasn't clear or/and (most likely, after I looked at iwd -d), my diagnosis was wrong in the first place, but I thought that the problem was that iwd will connect to a network as soon as a network can be connected to and it will not _revise_ that decision (connect to a better network afterwards). That would become a problem if a "bad" network becomes known moments before the "good" network becomes known.
Looking at iwd -d, however, I get the following list, before it attempt to connect to BAD_NETWORK
src/station.c:station_add_seen_bss() Processing BSS '24:5a:4c:25:f4:71' with SSID: BAD_NETWORK, freq: 5220, rank: 736, strength: -7200, data_rate: 90.0
src/station.c:station_add_seen_bss() Added new Network "BAD_NETWORK" security psk
src/station.c:station_add_seen_bss() Processing BSS '68:72:51:48:72:c2' with SSID: GOOD_NETWORK, freq: 2412, rank: 492, strength: -5400, data_rate: 72.2
src/station.c:station_add_seen_bss() Added new Network "GOOD_NETWORK" security psk
src/station.c:station_add_seen_bss() Processing BSS '24:5a:4c:24:f4:71' with SSID: BAD_NETWORK, freq: 2462, rank: 472, strength: -7300, data_rate: 57.8
src/station.c:station_add_seen_bss() Processing BSS 'cc:2d:21:5d:dd:95' with SSID: BAD_NETWORK3, freq: 5240, rank: 443, strength: -7600, data_rate: 65.0
src/station.c:station_add_seen_bss() Added new Network "BAD_NETWORK3" security psk
src/station.c:station_add_seen_bss() Processing BSS 'cc:2d:21:5d:dd:91' with SSID: BAD_NETWORK2, freq: 2417, rank: 197, strength: -7400, data_rate: 28.9
src/station.c:station_add_seen_bss() Added new Network "BAD_NETWORK2" security psk
src/station.c:station_add_seen_bss() Processing BSS '24:5a:4c:24:f4:73' with SSID: BAD_NETWORK, freq: 2462, rank: 90, strength: -8300, data_rate: 11.0
src/station.c:station_add_seen_bss() Processing BSS 'd8:32:14:ee:a3:d1' with SSID: BAD_NETWORK2, freq: 2422, rank: 37, strength: -8500, data_rate: 5.5
so from what you write James, I think the problem lies in the estimated data rate, given how it appears high on the network with bad RSSI.
I suspect the recommended course of action at this point is just blacklist the station which seems to yield a "misleading high" data rate!
Unless my assumption about how iwd doesn't "revise" network choices during an initial scan period is somehow valid or related to my probelem, I suppose this is an issue with the particular station then and has nothing to do with iwd's behaviour, so thanks for the help!
Cedric
On Sun, Apr 09, 2023 at 10:07:34AM -0700, James Prestwood wrote:
> Hi Cedric,
>
> On Sun, Apr 9, 2023, 9:58 AM Denis Kenzior <[1]denkenz@gmail.com> wrote:
>
> Hi Cedric,
>
> On 4/9/23 06:33, Cedric Sodhi wrote:
> > Hello,
> >
> > I have a permanent problem with IWD when multiple known networks
> (different SSIDs) are in range: With a large probably (although it is
> most likely just random, depending on when the beacons fire) IWD manages
> to connect to a network with an unusable low RSSI while better networks
> are available.
> >
> > I suspect there is currently no logic in place which would somehow
> work in favor of making a "good" choice? RoamThreshold, for example,
> doesn't seem to apply and InitialPeriodicScanInterval seems to have no
> effect either, given that the (initial) connection to the (bad) network
> happens immediately before InitialPeriodicScanInterval passed, and that
> choice does not seem to be revised even if the better network becomes
> visible within InitialPeriodicScanInterval.
>
> Periodic scans are attempted every N seconds, with exponentially
> increasing N if
> no connectable network was found. InitialPeriodicScanInterval simply
> sets the
> initial timeout N. It isn't that iwd scans constantly during that
> period.
>
> Once a periodic scan completes, and there's something to connect to, iwd
> attempts to do so. If there are multiple somethings to connect to, then
> iwd
> prioritizes networks based on estimated throughput (this is where the
> RSSI is
> taken into account) and which network was most recently used. There are
> some
> other factors.
>
> >
> > Would it possible to either extend the meaning of
> InitialPeriodicScanInterval or introduce another option which would
> allow IWD to connect to a better, different SSID (thus not covered by
> roaming) within an initial period?
> If you have a more concrete proposal please share it. And patches are
> always
> welcome :)
>
> It would also be helpful to see the debug logs too see why IWD chose the
> network it did. This would answer questions I have like:
> Did the scan only see one network?
> What was the estimated data rate of both networks?
> How good/bad was the RSSI between the two networks in question?
> Thanks,
> James
>
> Regards,
> -Denis
>
> References
>
> Visible links
> 1. mailto:denkenz@gmail.com
next prev parent reply other threads:[~2023-04-10 6:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-09 11:33 Initial choice of network should consider RSSI? Cedric Sodhi
2023-04-09 16:47 ` Denis Kenzior
[not found] ` <CAPv5Ue6KEZVxT2Mb15bBH_8n53abvJbu_+aCTHJgP9ODU3AT5Q@mail.gmail.com>
2023-04-10 6:04 ` Cedric Sodhi [this message]
2023-04-10 14:59 ` James Prestwood
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZDOm8xHuEXQ7l1EZ@air \
--to=manday@openmail.cc \
--cc=denkenz@gmail.com \
--cc=iwd@lists.linux.dev \
--cc=prestwoj@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox