Stefan Sperling <[email protected]> wrote:
> On Sun, Jan 01, 2023 at 09:00:30PM +0000, Ali Farzanrad wrote:
> > Hi Stefan,
> >
> > Stefan Sperling <[email protected]> wrote:
> > > On Sun, Jan 01, 2023 at 05:00:35PM +0000, Ali Farzanrad wrote:
> > > > Hi tech@,
> > > >
> > > > Happy new year!
> > > > I have some weird problems with my athn interface which drives me crazy.
> > > >
> > > > 1. Whenever I configure my athn as `media auto' for the first time it
> > > > correctly detects correct media subclass, but as soon as I select exact
> > > > same media subclass manually, it diverts to DS1 media subclass and after
> > > > that auto will not work again (I need to reboot system or my WiFi
> > > > provider aka my Android phone).
> > >
> > > You are not supposed to force a specific Tx rate, unless you are
> > > debugging a Tx-specific problem in the code. The driver will
> > > adjust the Tx rate on demand, based on packet loss statistics.
> > > If you force a specific Tx rate then associated devices will either see
> > > a lot of packet loss (if the rate is too high and the device is too far
> > > away) or very low speed (if the Tx rate is forced to a low rate).
> >
> > OK, but the point is DS1 is not a correst config for my Android WiFi.
> > Normally it should be HT-MCS0 or HT-MCS7 in 11n mode.
>
> Given your android phone is the AP which athn(4) connects to, indeed,
> the driver should use HT-MCS0 up to HT-MCS7 while connected in 11n mode
> (retried frames will use legacy rates if HT-MCS0 doesn't work, but this
> won't be displayed by ifconfig; you would have to capture frames from
> the air with a separate wifi device in monitor mode to see this).
>
> Because there is no support for Tx aggregation and 40Mhz channels in
> our athn driver yet, running athn in 11n mode does not provide a
> significant performance advantage over 11a/11g modes. The driver does
> support Rx aggregation though, so at least traffic sent from the AP to
> the athn client may be a bit faster than in 11a/11g modes.
>
> > > On 2Ghz channels the driver will start out in DS1 and adjust upwards,
> > > and adjust the rate upwards if packet loss remains low while doing so.
> >
> > So it might be my Android phone problem which caused my system think DS1
> > is the correct config, right?
>
> I don't know why ifconfig would show DS1 if 11n mode is active.
> I believe it is possible for DS1 to show up somewhere in ifconfig output
> If you forced it to use DS1 earlier and produced a non-default media
> config as a result. In such cases the media info shown by ifconfig might
> be incorrect and confusing. No polish has gone into that part of the
> user-facing display because it is not really intended for users. AFAIK the
> commands which force a particular Tx rate aren't even documented anymore.
> We removed the docs at some point because regular users should not need
> to fiddle with wifi Tx rate selection.
>
> You might simply not be switching back into auto-selection mode with
> the commands you are running. Try rebooting with a hostnname.athn0
> that does not contain any 'media' and 'mode' commands and it should
> be reset to defaults (that is the foolproof way to reset things; there
> are other ways but I'd rather avoid talking about those without a solid
> understanding of what you were doing).
OK, I started in a working state where I was connected to my Android
phone:
# cat /etc/hostname.athn0
nwid [..name..] wpakey [..pass..]
inet autoconf
# ifconfig athn0
athn0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
lladdr [..lladdr..]
index 1 priority 4 llprio 3
groups: wlan egress
media: IEEE802.11 autoselect (HT-MCS7 mode 11n)
status: active
ieee80211: nwid [..name..] chan 9 bssid [..bssid..] -45dBm wpakey
wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher ccmp
inet 192.168.131.83 netmask 0xffffff00 broadcast 192.168.131.255
then I simply re-run netstart:
# sh /etc/netstart athn0
# ifconfig athn0
athn0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
lladdr [..lladdr..]
index 1 priority 4 llprio 3
groups: wlan egress
media: IEEE802.11 autoselect (DS1 mode 11b)
status: no network
ieee80211: nwid [..name..] wpakey wpaprotos wpa2 wpaakms psk wpaciphers
ccmp wpagroupcipher ccmp
inet 192.168.131.83 netmask 0xffffff00 broadcast 192.168.131.255
[..after some time..]
# ifconfig athn0
athn0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
lladdr [..lladdr..]
index 1 priority 4 llprio 3
groups: wlan egress
media: IEEE802.11 autoselect (DS1 mode 11g)
status: no network
ieee80211: nwid [..name..] chan 9 bssid [..bssid..] -100dBm wpakey
wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher ccmp
inet 192.168.131.83 netmask 0xffffff00 broadcast 192.168.131.255
[..after some time..]
# ifconfig athn0
athn0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
lladdr [..lladdr..]
index 1 priority 4 llprio 3
groups: wlan egress
media: IEEE802.11 autoselect (DS1)
status: no network
ieee80211: nwid [..name..] wpakey wpaprotos wpa2 wpaakms psk wpaciphers
ccmp wpagroupcipher ccmp
inet 192.168.131.83 netmask 0xffffff00 broadcast 192.168.131.255
and it repeats showing different modes but always in DS1 media type.
2 days ago I waited for hours, but it didn't find correct media type.
This time even after reboot it didn't find correct media type, so I
forced to turn my phone's Internet sharing off and on.
I wanted to find the problem by myself but unfortunately I don't know
how :(