From owner-freebsd-wireless@FreeBSD.ORG Tue Jul 30 09:33:19 2013 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 6E9A3ABD; Tue, 30 Jul 2013 09:33:19 +0000 (UTC) (envelope-from cg@cgross.info) Received: from alpha.kreiz-it.fr (alpha.kreiz-it.fr [IPv6:2001:41d0:8:dda6::1]) by mx1.freebsd.org (Postfix) with ESMTP id EA03620EC; Tue, 30 Jul 2013 09:33:18 +0000 (UTC) Received: from DirTech (lnr56-1-82-246-51-185.fbx.proxad.net [82.246.51.185]) by alpha.kreiz-it.fr (Postfix) with ESMTPSA id EBF53916; Tue, 30 Jul 2013 11:33:16 +0200 (CEST) From: "Cedric GROSS" To: References: <00b101ce8c8b$3db5f200$b921d600$@info> In-Reply-To: Subject: RE: Wifi rates Date: Tue, 30 Jul 2013 11:33:12 +0200 Message-ID: <000c01ce8d07$d10a6550$731f2ff0$@info> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac6Mjvog19mySsMYQzutQzryQZdlswAdQbrA Content-Language: fr X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 30 Jul 2013 09:33:19 -0000 > 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 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 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 RATES DSPARMS<5> ERP<0x4> XRATES<48,72,96,108> RSN HTCAP HTINFO WME [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