Thursday, December 31, 2020

Re: Getting wifi bitrate

Stefan Sperling writes:

> On Thu, Dec 31, 2020 at 02:28:35PM +0000, Björn Gohla wrote:
>> Hi all,
[...]
>> So how do I get the it? Am I looking in the wrong place, or does the
>> driver just not expose this information?
>
> Rate/MCS + channel width + some other parameters map to a Tx bitrate:
> https://en.wikipedia.org/wiki/IEEE_802.11n-2009#Data_rates
>
> This Tx bitrate will vary on a per-frame basis, though. And actual user data
> throughput is always below this, due to protocol overhead, re-transmissions,
> interference, other traffic on the same channel, and so on.

Right, so by using the values in that table one could extract a nominal
Tx rate, but not the actual one (much less the Rx); correct?

>> The interface is a "Realtek Wireless N Nano USB Adapter" in case that is
>> relevant.
>
> OpenBSD realtek wifi drivers only support 11g mode at present.
> So on such hardware the kernel and ifconfig never report "MCS23".
> MCS are only reported for 11n/ac modes.

I did notice that it says so in the caveats in urtwn(4), strange.

> In 11g mode the per-frame Tx rate is displayed by ifconfig in Mbit/s.
> However, some realtek devices (like the 8192CU) perform Tx rate-adjustment
> in firmware and do not even expose the chosen Tx data rate to the driver.
> In that case ifconfig always displays 54M which is usually incorrect.

ifconfig says this:
urtwn0: flags=808843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,AUTOCONF4> mtu 1500
lladdr 54:2a:a2:4c:0e:b5
index 8 priority 4 llprio 3
groups: wlan egress
media: IEEE802.11 autoselect (OFDM54 mode 11g)
status: active
ieee80211: join "451UnavailableForLegalReasons " chan 11 bssid b0:bb:e5:13:7b:d4 -72dBm wpakey wpaprotos wpa2 wpaakms psk wpaciphers ccmp wpagroupcipher tkip
inet 192.168.1.182 netmask 0xffffff00 broadcast 192.168.1.255

I suppose the "media" line is what you're referring to here, right?

dmesg says:
urtwn0 at uhub0 port 2 configuration 1 interface 0 "Realtek Wireless N Nano USB Adapter" rev 2.10/2.00 addr 2
urtwn0: MAC/BB RTL8192EU, RF 6052 2T2R, address 54:2a:a2:4c:0e:b5

the device looks similar to the one you mentioned, so maybe that's
what's going on here.

> What problem are you trying to solve?

I just want to show the network activity in my desktop status line.

--
Cheers,
Björn

No comments:

Post a Comment