All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: Sven-Hendrik Haase <mailinglists@svenstaro.org>, iwd@lists.linux.dev
Subject: Re: iwd picking worse network despite better one available
Date: Thu, 28 Mar 2024 09:45:33 -0700	[thread overview]
Message-ID: <e26370df-6a03-4b23-b71f-049b530841d7@gmail.com> (raw)
In-Reply-To: <aa2a5e2a-77f0-4b79-80d0-6dbf877c5b6e@app.fastmail.com>

Hi Sven,

On 3/28/24 9:21 AM, Sven-Hendrik Haase wrote:
> On Thu, Mar 28, 2024, at 14:48, James Prestwood wrote:
>> Hi Sven,
>>
>> On 3/27/24 12:21 PM, Sven-Hendrik Haase wrote:
>>> On Wed, Mar 27, 2024, at 19:54, James Prestwood wrote:
>>>> Hi,
>>>>
>>>> On 3/27/24 11:36 AM, Sven-Hendrik Haase wrote:
>>>>> Hello,
>>>>>
>>>>> I've spent a good chunk of my evening looking into why iwd doesn't select the network I want it to select. I have a network "Home" with two APs. iwd seems to strongly prefer the AP that is further away and that has worse strength as measured by iwd.
>>>>>
>>>>>    From some testing, I believe it has to do with the AP rather than the wifi adapter. I tested a wifi adapter using mt7921e and one using iwlwifi and the result is the same in both cases. The APs are both pretty modern: The one iwd doesn't like is a FRITZ!Box 7590 AX while the one it likes is a FRITZ!Repeater 6000. From the log it seems that iwd is unable to perform a proper data rate estimation and then falls back to some default. At any rate, the rank would indicate that the estimated data rate plays an important role. If I use the developer mode to force roaming to the AP I want (named "better" in the log) then I'm able to use it perfectly well with a good data rate.
>>>>>
>>>>> As such I think this is a bug _somewhere_ but I'm not exactly sure where. I searched the configuration options but it seems it's not possible to turn off the data rate estimations for the ranking. I'd be perfectly happy to just go by signal strength. However, I suppose it would be better to actually fix the core problem in iwd.
>>>> IWD bases the ranking of BSS's heavily off the estimated data rate. If
>>>> that fails then as you see the rank is very low as it defaults back to
>>>> 802.11b rates. There are several IEs the AP sends which IWD parses, any
>>>> one of them could be either not included at all, or not be formatted
>>>> correctly, or an actual bug in the parsing code. Could you get an iwmon
>>>> capture of IWD scanning your APs so I could take a look and see exactly
>>>> why its failing? Then we can go from there.
>>>>
>>>> Thanks,
>>>>
>>>> James
>>>>
>>> Hi James,
>>>
>>> You should have received a pcap file of an iwd restart in a separate email. I hope there's some usable data in there for you.
>>>
>>> Cheers,
>>> Sven
>> The issue is that the AP in question is not setting a bit correctly in
>> the HE capabilities element. As part of the HE PHY capabilities there is
>> a "Supported Channel Width Set" (Table 9-322b):
>>
>> — B2 indicates support for a 160 MHz channel width.
>> — B3 indicates support for a 160/80+80 MHz channel
>> width.
>>
>> And it then goes to say:
>>
>> B3 is set to 1 if supported. If B3 is 1, then B2 is set to 1.
>>
>> In your case B3=1 and B2=0. This is checked by IWD and fails. So this is
>> something the AP should fix. But at the same time this check actually
>> bypasses the VHT/HT/basic rates calculations which is why your only
>> getting 2mbps as the estimation. I just sent patches to the list fixing
>> this, so this should certainly help in your case, although the HE
>> capabilities will still fail to parse which means IWD will estimate
>> based on VHT instead.
>>
>> Thanks,
>>
>> James
>>
> Hey James,
>
> I just tested the patches and can confirm that they perform perfectly for me and I'm now getting the right AP selected along with incredible speeds so I'm happy. Looking forward to the next release of iwd!
>
> I also reported the problem in detail to AVM. Let's see whether they will actually get an engineer onboard to fix the fundamental problem.
Glad to hear it. The unfortunate thing is these bits come directly from 
the driver/hardware so the AP is probably just passing those as-is, 
which is what IWD does as well. They'll have to push on the hardware 
vendor to fix the bits. But in any case, glad the behavior is at least 
improved now.
>
> Cheers,
> Sven

      reply	other threads:[~2024-03-28 16:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-27 18:36 iwd picking worse network despite better one available Sven-Hendrik Haase
2024-03-27 18:54 ` James Prestwood
2024-03-27 19:21   ` Sven-Hendrik Haase
2024-03-28 13:48     ` James Prestwood
2024-03-28 16:21       ` Sven-Hendrik Haase
2024-03-28 16:45         ` James Prestwood [this message]

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=e26370df-6a03-4b23-b71f-049b530841d7@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    --cc=mailinglists@svenstaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.