# ath5k + hostapd too slow

## hermes_jr

Hello.

I've been using this configuration for a couple of months and everything works almost fine, and there are no link/auth failures. But recently I noticed that the speed isn't good enough and I don't get why. Could you please give me an advice guys?

Hardware: access point is Gentoo router with D-Link DWA-520 and D-Link ANT24-0700 antenna

lspci: 01:09.0 Ethernet controller: Atheros Communications Inc. Atheros AR5001X+ Wireless Network Adapter (rev 01)

client is - MacBookPro7,1 with AirPort Extreme Broadcom BCM43xx 1.0 (5.10.131.36.1) onboard.

Laptop and antenna are on the line of sight and close to each other.

Router configs:

```

#Linux hoop 2.6.37-gentoo #3 Wed Feb 16 15:18:06 MSK 2011 i686 Intel(R) Celeron(R) CPU 2.26GHz GenuineIntel GNU/Linux

# just stripped out interesting options

CONFIG_ATH_COMMON=m

CONFIG_ATH5K=m

CONFIG_ATH9K_HW=m

CONFIG_ATH9K_COMMON=m

CONFIG_ATH9K=m

CONFIG_ATH9K_RATE_CONTROL=y

CONFIG_WIRELESS=y

CONFIG_WIRELESS_EXT=y

CONFIG_CRYPTO_HMAC=y

CONFIG_CRYPTO_AES=y

CONFIG_VLAN_8021Q=m

CONFIG_VLAN_8021Q_GVRP=y

CONFIG_CFG80211=m

CONFIG_CFG80211_DEFAULT_PS=y

CONFIG_LIB80211=y

CONFIG_LIB80211_CRYPT_WEP=y

CONFIG_LIB80211_CRYPT_CCMP=y

CONFIG_LIB80211_CRYPT_TKIP=y

CONFIG_MAC80211=m

CONFIG_MAC80211_HAS_RC=y

CONFIG_MAC80211_RC_MINSTREL=y

CONFIG_MAC80211_RC_MINSTREL_HT=y

CONFIG_MAC80211_RC_DEFAULT_MINSTREL=y

CONFIG_MAC80211_RC_DEFAULT="minstrel_ht"

CONFIG_MAC80211_LEDS=y

```

```

modules="iproute2 !iwconfig !wpa_supplicant"

metric_wlan0="100"

config_wlan0="10.13.14.1/24 brd 10.13.14.255"

routes_wlan0="10.13.14.0/24 dev wlan0 src 10.13.14.1 table intwifi"

mode_wlan0="master"

```

```

interface=wlan0

driver=nl80211

logger_syslog=-1

logger_syslog_level=4

logger_stdout=-1

logger_stdout_level=2

dump_file=/tmp/hostapd.dump

ctrl_interface=/var/run/hostapd

ctrl_interface_group=0

ssid=myssid

country_code=RU

ieee80211d=1

hw_mode=g

channel=3

beacon_int=100

dtim_period=2

max_num_sta=255

rts_threshold=2347

fragm_threshold=2346

# I've tried to uncomment the following lines, but there's no difference

#supported_rates=180 480 540

#basic_rates=240 540

macaddr_acl=1

accept_mac_file=/etc/hostapd/hostapd.accept

deny_mac_file=/etc/hostapd/hostapd.deny

auth_algs=1

ignore_broadcast_ssid=1

#Turned off the following parameter, but no difference either

wmm_enabled=1

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

eapol_key_index_workaround=0

eap_server=0

own_ip_addr=127.0.0.1

wpa=3

wpa_passphrase=MasK3DPa$$phras3

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

```

Everything works stable with minor packet loss while flooding, but throughput is very poor:

```

 $ sudo ping -s 1400 -f 10.13.14.1

PING 10.13.14.1 (10.13.14.1): 1400 data bytes

..Request timeout for icmp_seq 3594

..Request timeout for icmp_seq 3600

..Request timeout for icmp_seq 3619

.Request timeout for icmp_seq 3620

..Request timeout for icmp_seq 10887

.^C

--- 10.13.14.1 ping statistics ---

11406 packets transmitted, 11400 packets received, 0.1% packet loss

round-trip min/avg/max/stddev = 0.710/4.523/38.124/2.845 ms

```

```

iperf -i 5 -t 40 -c 10.13.14.10 -d 

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

Server listening on TCP port 5001

TCP window size: 85.3 KByte (default)

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

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

Client connecting to 10.13.14.10, TCP port 5001

TCP window size: 22.6 KByte (default)

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

[  3] local 10.13.14.1 port 53491 connected with 10.13.14.10 port 5001

[  5] local 10.13.14.1 port 5001 connected with 10.13.14.10 port 49440

[ ID] Interval       Transfer     Bandwidth

[  5]  0.0- 5.0 sec  4.71 MBytes  7.91 Mbits/sec

[  3]  0.0- 5.0 sec  3.12 MBytes  5.24 Mbits/sec

[  5]  5.0-10.0 sec  3.75 MBytes  6.30 Mbits/sec

[  3]  5.0-10.0 sec  3.75 MBytes  6.29 Mbits/sec

[  5] 10.0-15.0 sec  3.79 MBytes  6.36 Mbits/sec

[  3] 10.0-15.0 sec  3.75 MBytes  6.29 Mbits/sec

[  5] 15.0-20.0 sec  3.84 MBytes  6.43 Mbits/sec

[  3] 15.0-20.0 sec  3.88 MBytes  6.50 Mbits/sec

[  5] 20.0-25.0 sec  3.83 MBytes  6.42 Mbits/sec

[  3] 20.0-25.0 sec  3.88 MBytes  6.50 Mbits/sec

[  5] 25.0-30.0 sec  4.47 MBytes  7.50 Mbits/sec

[  3] 25.0-30.0 sec  4.50 MBytes  7.55 Mbits/sec

[  3] 30.0-35.0 sec  3.38 MBytes  5.66 Mbits/sec

[  5] 30.0-35.0 sec  3.42 MBytes  5.74 Mbits/sec

[  5] 35.0-40.0 sec  3.99 MBytes  6.70 Mbits/sec

[  5]  0.0-40.0 sec  31.8 MBytes  6.67 Mbits/sec

[  3] 35.0-40.0 sec  4.12 MBytes  6.92 Mbits/sec

[  3]  0.0-40.1 sec  30.5 MBytes  6.37 Mbits/sec

```

Bandwidth is always under 10-15 Mbits while it should be around 54 Mbits (G mode)!

There are some wireless networks nearby, but it seems like they're not interfere much with mine (also changing channel to 3 or 11 doesn't make any progress)

Chart 1

Chart 2 (the grey filled one is mine)

What should I check to solve this speed issue?

----------

## gerdesj

Are you able to get any insight as to a possible maximum throghput?

For example you might want to try a Windows/OSX/ based system to see if you can get a better or worse figure to compare with.

In the end you have a sample size of one to play with - you need to expand that sample size.  You need contrast.  It would be rude of us to ask for you to replace your AP but I think a contrast of clients is reasonable.

Cheers

Jon

----------

## celticsoul

I have the same problem but my hardware configuration is different.

I have an rt73usb with hostapd 0.7.3, vanilla kernel 3.2.6 x86_64

interface=wlan0

driver=nl80211

bridge=br0

country_code=SG

ieee80211d=1

ssid=xxxxxx

hw_mode=g

channel=11

wme_enabled=1

macaddr_acl=0

auth_algs=1

ignore_broadcast_ssid=0

wpa=2

wpa_passphrase=xxxxxxx

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

I have tried to connect from my Android phone as well as my MacBook but the max speed that I can get is less than 300KBps for LAN file transfer

There is no channel overlap.

Any help woull be appreciated.

Thanks

----------

