OpenWrt Forum Archive

Topic: x86 ath9k, only get 135mbits with HT40 and 65mbits with HT20

The content of this topic has been archived on 21 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello,

I'm running openwrt trunk r21346 and only get half of the speed.

Here are some commands output:
-----------------------------------------

root@OpenWrt:~# iw list
Wiphy phy0
        Band 1:
                Capabilities: 0x104e
                        HT20/HT40
                        SM Power Save disabled
                        RX HT40 SGI
                        No RX STBC
                        Max AMSDU length: 7935 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 8 usec (0x06)
                HT TX/RX MCS rate indexes supported: 0-15
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)                                                                                             
                        * 2457 MHz [10] (20.0 dBm)                                                                                           
                        * 2462 MHz [11] (20.0 dBm)                                                                                           
                        * 2467 MHz [12] (20.0 dBm)                                                                                           
                        * 2472 MHz [13] (20.0 dBm)                                                                                           
                        * 2484 MHz [14] (disabled)
                Bitrates (non-HT):
                        * 1.0 Mbps
                        * 2.0 Mbps (short preamble supported)
                        * 5.5 Mbps (short preamble supported)
                        * 11.0 Mbps (short preamble supported)
                        * 6.0 Mbps
                        * 9.0 Mbps
                        * 12.0 Mbps
                        * 18.0 Mbps
                        * 24.0 Mbps
                        * 36.0 Mbps
                        * 48.0 Mbps
                        * 54.0 Mbps
        max # scan SSIDs: 4
        Coverage class: 0 (up to 0m)
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * mesh point
        Supported commands:
                 * new_interface
                 * set_interface
                 * new_key
                 * new_beacon
                 * new_station
                 * new_mpath
                 * set_mesh_params
                 * set_bss
                 * authenticate
                 * associate
                 * deauthenticate
                 * disassociate
                 * join_ibss
                 * (null)
                 * (null)
                 * Unknown command (59)
                 * set_wiphy_netns
                 * connect
                 * disconnect

----------------------------------

root@OpenWrt:~# iwconfig
lo        no wireless extensions.

imq0      no wireless extensions.

imq1      no wireless extensions.

eth0      no wireless extensions.

br-lan    no wireless extensions.

eth1      no wireless extensions.

eth2      no wireless extensions.

wlan0     IEEE 802.11bgn  Mode:Master  Frequency:2.412 GHz  Tx-Power=20 dBm   
          RTS thr:off   Fragment thr:off
          Power Management:off
         
mon.wlan0  IEEE 802.11bgn  Mode:Monitor  Frequency:2.412 GHz  Tx-Power=20 dBm   
          RTS thr:off   Fragment thr:off
          Power Management:off
         
-----------------------------------------------------------------------------------------------------------

root@OpenWrt:~# ifconfig
br-lan    Link encap:Ethernet  HWaddr 00:25:86:DF:CC:9A 
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::f079:8fff:fe95:9960/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:46880 errors:0 dropped:0 overruns:0 frame:0
          TX packets:77375 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:8221492 (7.8 MiB)  TX bytes:98070783 (93.5 MiB)

eth0      Link encap:Ethernet  HWaddr 00:50:8B:11:FD:6B 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth1      Link encap:Ethernet  HWaddr 00:50:8B:11:FD:6C 
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

eth2      Link encap:Ethernet  HWaddr 00:50:BA:C9:5C:1D 
          inet addr:74.210.159.93  Bcast:255.255.255.255  Mask:255.255.255.0
          inet6 addr: fe80::250:baff:fec9:5c1d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:159870 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45352 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:104054863 (99.2 MiB)  TX bytes:8722544 (8.3 MiB)
          Interrupt:5 Base address:0xe000

lo        Link encap:Local Loopback 
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:16 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:832 (832.0 B)  TX bytes:832 (832.0 B)

mon.wlan0 Link encap:UNSPEC  HWaddr 00-25-86-DF-CC-9A-20-00-00-00-00-00-00-00-00-00 
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1236 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:158824 (155.1 KiB)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:25:86:DF:CC:9A 
          inet6 addr: fe80::225:86ff:fedf:cc9a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:47034 errors:0 dropped:0 overruns:0 frame:0
          TX packets:78003 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:8889856 (8.4 MiB)  TX bytes:99719208 (95.0 MiB)

-----------------------------------------------------------------------------------------------------

root@OpenWrt:~# iw reg get
country CN:
        (2402 - 2482 @ 40), (N/A, 20)
        (5735 - 5835 @ 40), (N/A, 30)
root@OpenWrt:~#

-----------------------------------------------------------------------------------------------------

root@OpenWrt:~# cat /etc/config/wireless

config 'wifi-device' 'radio0'
        option 'type' 'mac80211'
        option 'macaddr' '00:25:86:df:cc:9a'
        option 'hwmode' '11ng'
        list 'ht_capab' 'SHORT-GI-40'
        list 'ht_capab' 'DSSS_CCK-40'
        option 'disabled' '0'
        option 'channel' '1'
        option 'htmode' 'HT40+'

config 'wifi-iface'
        option 'device' 'radio0'
        option 'network' 'lan'
        option 'mode' 'ap'
        option 'ssid' 'Univers'
        option 'encryption' 'psk-mixed'
        option 'key' <removed>

------------------------------------------------------------------------

root@OpenWrt:~# cat /var/run/hostapd-phy0.conf
ctrl_interface=/var/run/hostapd-phy0
driver=nl80211
wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0
tx_queue_data3_aifs=7
tx_queue_data3_cwmin=15
tx_queue_data3_cwmax=1023
tx_queue_data3_burst=0
tx_queue_data2_aifs=3
tx_queue_data2_cwmin=15
tx_queue_data2_cwmax=63
tx_queue_data2_burst=0
tx_queue_data1_aifs=1
tx_queue_data1_cwmin=7
tx_queue_data1_cwmax=15
tx_queue_data1_burst=3.0
tx_queue_data0_aifs=1
tx_queue_data0_cwmin=3
tx_queue_data0_cwmax=7
tx_queue_data0_burst=1.5
hw_mode=g
channel=1


ieee80211n=1
ht_capab=[HT40+][SHORT-GI-40][DSSS_CCK-40][SHORT-GI-40][DSSS_CCK-40]

interface=wlan0
wpa_passphrase=<removed>
wpa=3
wpa_pairwise=CCMP TKIP
ssid=Univers
bridge=br-lan
wmm_enabled=1
bssid=00:25:86:df:cc:9a
ignore_broadcast_ssid=0


I find it strange that the capabilities are repeated twice.

Any idea?

Thank you.

Pitou!

(Last edited by Pitou on 4 May 2010, 02:41)

Perhaps hostapd did not allow the ht40 mode because there are too many wireless networks in range. I have the same problem in my neighborhood. The "psk-mixed" is also a little bit buggy. wink WPA2-PSK is even better and more stable.

(Last edited by CrazyChris on 4 May 2010, 14:22)

Thanks for the suggestion, I'll try those.

Just want to precise that I'm linking at those speeds (HT20 = 65mb/s and HT40=135mb/s). I didn't test actual transfert speeds yet.

Where can I see hostapd logs? Would it says why it didn't activate HT40?

Pitou!

where do you get your info that you are only connected at 135mbits? from your client?
take a look at the datarate section http://en.wikipedia.org/wiki/IEEE_802.11n-2009

your connection rates are corresponding to MCS index 7 with 20MHz and 40MHz channelwidth, so this means you only have one spartial stream, and not two (which you would need for 300Mbit)
connect your client run

iw wlan0 station dump

on the router, to check which MCS index is used.

does your wifi-cards (router and client) support multiple spartial  streams?

Pitou wrote:

Thanks for the suggestion, I'll try those.

Just want to precise that I'm linking at those speeds (HT20 = 65mb/s and HT40=135mb/s). I didn't test actual transfert speeds yet.

Where can I see hostapd logs? Would it says why it didn't activate HT40?

Pitou!

start hostapd in the console. The warning apears only there and not in the log files. (That cost me a day of my lifetime wink)

(Last edited by CrazyChris on 4 May 2010, 15:05)

eleon216 wrote:

where do you get your info that you are only connected at 135mbits? from your client?
take a look at the datarate section http://en.wikipedia.org/wiki/IEEE_802.11n-2009

your connection rates are corresponding to MCS index 7 with 20MHz and 40MHz channelwidth, so this means you only have one spartial stream, and not two (which you would need for 300Mbit)
connect your client run

iw wlan0 station dump

on the router, to check which MCS index is used.

does your wifi-cards (router and client) support multiple spartial  streams?

Yes I see the speed on my client. It's a usb dongle Belkin F5D8053 v3. I get the same in Windows XP and Ubuntu

In the x86 router, it's PCI card TP-Link TL-WN851N. It seems to use the Atheros 5416 + ar2122

I'll check the MCS index and post back.

Thanks!

Pitou!

I mean this warning:

 
root@router:~# /usr/sbin/hostapd /tmp/run/hostapd-phy0.conf

20/40 MHz operation not permitted on channel pri=7 sec=3 based on overlapping BSSes

PS: Is it possible to force ht40? ;-)

ok we found the problem: its an usb-dongle!

to run 300Mbit you need two spatial streams, and for this you need two antennas, which (like the name suggests) need a spatial distance between them (minimum half of the wavelengh or something like that. this would be a minimum of 6cm for 2.4 Ghz). this can not work with an usb-dongle without external antennas.

"300Mbit/s" sounds good for marketing purposes, and thats the reason why they use a 2x2 chip,  but i really doubt that the antenna-layout of this usb-dongle allow multiple spartial streams. and the antennas on your pci-card are quite near too.

and @CrazyChris: I hope it's not possible to force 40MHz on 2.4GHz, because this mode would use over 80% of the available frequencyband, so it would be irresponsible to allow this if someone else is using this band.

(Last edited by eleon216 on 4 May 2010, 16:40)

I can't imagine, there are so many 300Mbps USB WLAN sticks available.

Here is the output of the command:

root@OpenWrt:/# iw wlan0 station dump
Station 00:22:75:8e:e0:65 (on wlan0)
        inactive time:  10 ms
        rx bytes:       16224
        rx packets:     154
        tx bytes:       5902
        tx packets:     47
        signal:         -70 dBm
        tx bitrate:     135.0 MBit/s MCS 7 40Mhz

Pitou!

(Last edited by Pitou on 4 May 2010, 18:42)

CrazyChris,

It looks happy here.

root@OpenWrt:/# /usr/sbin/hostapd /tmp/run/hostapd-phy0.conf
Configuration file: /tmp/run/hostapd-phy0.conf
Using interface wlan0 with hwaddr 00:25:86:df:cc:9a and ssid 'OpenWrt'


Pitou!

eleon216 wrote:

and @CrazyChris: I hope it's not possible to force 40MHz on 2.4GHz, because this mode would use over 80% of the available frequencyband, so it would be irresponsible to allow this if someone else is using this band.

hmm hmm But the original firmware for my Linksys WRT160NL allow ht40 and i can connect with 300Mbps. And it work stable.

(Last edited by CrazyChris on 4 May 2010, 19:27)

@CrazyChris: it is ok to run 40MHz if you have no neighbors. but if you havea lot of accesspoints around, it would be really egoistic, and probably useless with all the interference. but if you are alone "in the air" it's ok to use HT40.

@eleon216,

So you really think it's my usb dongle and/or my PCI card that is causing the limitation, due to antennas being too close?

What would you suggest as PCI cards? I was thinking about the Dlink DWA-552 or the Linksys WMP600N. I would buy 2 of them, one for my x86 router and one for my client PC.

What do you think?

Thanks.

Pitou!

(Last edited by Pitou on 5 May 2010, 13:26)

Any suggestions for PCI cards or other?

Thanks.

Pitou!

First, i would try to test the wlan stick with another draftn AP or the original firmware.

(Last edited by CrazyChris on 6 May 2010, 08:57)

ok The belkin dongle is the culprit. I opened it and only one "antenna" (there so small) is active. Easy to follow using a ohm meter.

Now, I tried with another card in my client PC and it works fine.

Pitou!

The discussion might have continued from here.