Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 30 Jul 2013 11:33:12 +0200
From:      "Cedric GROSS" <cg@cgross.info>
To:        <freebsd-wireless@freebsd.org>
Subject:   RE: Wifi rates
Message-ID:  <000c01ce8d07$d10a6550$731f2ff0$@info>
In-Reply-To: <CAJ-Vmo=y609_w2dMyLkgOpd24poRJKqn=LPW%2BQGi7z346xTZrQ@mail.gmail.com>
References:  <00b101ce8c8b$3db5f200$b921d600$@info> <CAJ-Vmo=y609_w2dMyLkgOpd24poRJKqn=LPW%2BQGi7z346xTZrQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
> De=A0: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] De la =
part
> de Adrian Chadd
> Envoy=E9=A0: lundi 29 juillet 2013 21:08
> =C0=A0: Cedric GROSS
> Cc=A0: freebsd-wireless@freebsd.org
> Objet=A0: Re: Wifi rates
>=20
> Hi,
>=20
> So the trick here is that iwn uses the net80211 rate control API for
> doing things.
>=20
> Look at if_iwn.c for "ratectl". There's a spot in the TX path where it
> calls it to look up the rate.
>=20
> It then converts that rate to the iwn PLCP format for the given
> transmission rate. You can google "PLCP". Intel has a few extra bits =
in
> that field for controlling the NIC behaviour. THat bit is straight
> forward.
>=20
> Anyway - the trick here is that the net80211 rate control (amrr by
> default) is going to be selecting transmission rates. You can see the
> current rate by doing 'ifconfig wlan0 list sta'. Now, if you're =
running
> -HEAD net80211 / iwn then AMRR knows about 11n and if_iwn will happily
> use it. In the past it was hackier - AMRR didn't know about 11n rates
> and so iwn "faked" things by pretending it was doing non-11n, and then
> translating these to 11n rates. Hopefully you're running -HEAD and =
this
> is no longer a problem.
>=20
> So - do an "ifconfig -v wlan0 list sta" to list the station
> negotiation. It looks like it's doing 11ng but its downgraded to 11n.

Right :
[root@Test]/root#ifconfig -v wlan0
wlan0: flags=3D8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu =
1500
        ether 60:36:dd:93:34:56
        inet 192.168.1.20 netmask 0xffffff00 broadcast 192.168.1.255
        nd6 options=3D29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
        status: associated
        ssid WLenine channel 5 (2432 MHz 11g ht/20) bssid =
00:24:d4:97:80:20
        regdomain 0 country US anywhere -ecm authmode WPA2/802.11i -wps =
-tsn
        privacy ON deftxkey UNDEF
        AES-CCM 2:128-bit powersavemode OFF powersavesleep 100 txpower =
15
        txpowmax 50.0 -dotd rtsthreshold 2346 fragthreshold 2346 bmiss =
10
        11a     ucast NONE    mgmt  6 Mb/s mcast  6 Mb/s maxretry 6
        11b     ucast NONE    mgmt  1 Mb/s mcast  1 Mb/s maxretry 6
        11g     ucast NONE    mgmt  1 Mb/s mcast  1 Mb/s maxretry 6
        turboA  ucast NONE    mgmt  6 Mb/s mcast  6 Mb/s maxretry 6
        turboG  ucast NONE    mgmt  1 Mb/s mcast  1 Mb/s maxretry 6
        sturbo  ucast NONE    mgmt  6 Mb/s mcast  6 Mb/s maxretry 6
        11na    ucast NONE    mgmt 12 MCS  mcast 12 MCS  maxretry 6
        11ng    ucast NONE    mgmt  2 MCS  mcast  2 MCS  maxretry 6
        half    ucast NONE    mgmt  3 Mb/s mcast  3 Mb/s maxretry 6
        quarter ucast NONE    mgmt  1 Mb/s mcast  1 Mb/s maxretry 6
        scanvalid 450 bgscan bgscanintvl 300 bgscanidle 250
        roam:11a     rssi    7dBm rate 12 Mb/s
        roam:11b     rssi    7dBm rate  1 Mb/s
        roam:11g     rssi    7dBm rate  5 Mb/s
        roam:turboA  rssi    7dBm rate 12 Mb/s
        roam:turboG  rssi    7dBm rate 12 Mb/s
        roam:sturbo  rssi    7dBm rate 12 Mb/s
        roam:11na    rssi    7dBm  MCS  1
        roam:11ng    rssi    7dBm  MCS  1
        roam:half    rssi    7dBm rate  6 Mb/s
        roam:quarter rssi    7dBm rate  3 Mb/s
        -pureg protmode CTS ht htcompat ampdu ampdulimit 64k =
ampdudensity NA
        -amsdutx amsdurx shortgi htprotmode RTSCTS -puren -smps -rifs =
wme
        -burst -dwds roaming MANUAL bintval 96
        AC_BE cwmin  4 cwmax 10 aifs  3 txopLimit   0 -acm ack
              cwmin  4 cwmax 10 aifs  3 txopLimit   0 -acm
        AC_BK cwmin  4 cwmax 10 aifs  7 txopLimit   0 -acm ack
              cwmin  4 cwmax 10 aifs  7 txopLimit   0 -acm
        AC_VI cwmin  3 cwmax  4 aifs  2 txopLimit  94 -acm ack
              cwmin  3 cwmax  4 aifs  2 txopLimit  94 -acm
        AC_VO cwmin  2 cwmax  3 aifs  2 txopLimit  47 -acm ack
              cwmin  2 cwmax  3 aifs  2 txopLimit  47 -acm
        groups: wlan

[root@Test]/root#ifconfig -v wlan0 list sta
ADDR               AID CHAN RATE RSSI IDLE  TXSEQ  RXSEQ CAPS FLAG
00:24:d4:97:80:20    2    5   6M 18.5    0   1162  58480 EP   AQEHTRS
SSID<WLenine> RATES<B2,B4,B11,
B22,12,18,24,36> DSPARMS<5> ERP<0x4> XRATES<48,72,96,108> RSN<v1 =
mc:AES-CCMP
uc:AES-CCMP km:8021X-PS
K> HTCAP<cap 0x6c param 0x3 mcsset[0-23,32] extcap 0x0 txbf 0x0 antenna =
0x0>
HTINFO<ctl 5, 0,7,0,0 b
asicmcs[]> WME<qosinfo 0x0 BE[aifsn 3 cwmin 4 cwmax 10 txop 0] BK[aifsn =
7
cwmin 4 cwmax 10 txop 0] V
O[aifsn 2 cwmin 3 cwmax 4 txop 94] VI[aifsn 2 cwmin 2 cwmax 3 txop 47]>

[root@Test]/root#ifconfig -v wlan0 list chan
Channel   5 : 2432      MHz 11b
Channel   5 : 2432      MHz 11g
Channel   5 : 2432      MHz 11g ht/20
Channel   5 : 2432      MHz 11g ht/40+
Channel   5 : 2432      MHz 11g ht/40-

And the amrr output :
Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: non-11n node
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=3D0, initial rate 0
Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: 11n node
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=3D16, initial rate =
128
Test kernel: wlan0: [00:24:d4:97:80:20] recv auth frame with algorithm 0 =
seq
2
Test kernel: wlan0: [00:24:d4:97:80:20] amrr_node_init: 11n node
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: nrates=3D16, initial rate =
128
Test kernel: wlan0: link state changed to UP
Test dhclient: New IP Address (wlan0): 192.168.1.20
Test dhclient: New Subnet Mask (wlan0): 255.255.255.0
Test dhclient: New Broadcast Address (wlan0): 192.168.1.255
Test dhclient: New Routers (wlan0): 192.168.1.254
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 15, =
txcnt=3D12,
retrycnt=3D144
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 14 =
(txcnt=3D12
retrycnt=3D144)
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 14, =
txcnt=3D12,
retrycnt=3D192
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 13 =
(txcnt=3D12
retrycnt=3D192)
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 13, =
txcnt=3D11,
retrycnt=3D176
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR decreasing rate 12 =
(txcnt=3D11
retrycnt=3D176)
...
And so on until
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 0, =
txcnt=3D11,
retrycnt=3D176
Test last message repeated 2 times
Test kernel: wlan0: [00:24:d4:97:80:20] AMRR: current rate 0, =
txcnt=3D12,
retrycnt=3D192

What is 'nrates' and 'rate' in start of output ? Is nrates an index in =
rate
table ?

After the dhclient, I started a ftp file transfer. As you can see rate
decrease to 0 very quickly.
Is the 'current rate' same as initial nrates value ?

I've found this for MCS :
http://www.digitalairwireless.com/wireless-blog/recent/demystifying-modul=
ati
on-and-coding-scheme-index-values.html





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?000c01ce8d07$d10a6550$731f2ff0$>