2

I have custom-built router, based on Intel D510MO motherboard with Slackware 13.37 on it. I'm using hostapd-2.0 and iptables to make it act as a router. Client is a laptop with Windows 7 on it. Both router and laptop have Atheros AR5BXB72 mini pci-e wlan cards.

When it's configured as 802.11g, there are basically no problems - it is stable and works at full speed, something around 2.7 MB/s (= ~21 Mbps), which seems to be OK for 802.11g.

When it's configured as 802.11n, funny things start happening:

  • web pages in my country seem to open at full speed <-- OK
  • speedtest.net reports speeds between 75-95 Mbps for local servers (100Mbps Internet connection) <-- OK
  • speedtest.net reports speeds up to 3-4 Mbps download, 7-9 Mbps upload for foreign servers <-- why?!
  • everything else (e.g., downloading huge files) outside my country works at 300-400 KB/s <-- why?!

What I've tried:

  • googled a lot…
  • various drivers on client (Windows)
  • update driver on router (Linux)
  • update hostapd to force operating in 40MHz even when BSSes overlap

Drivers on Windows - tried both default Windows drivers (from Win7 installation, from Windows Update) and drivers from atheros.cz (9.0.0.173, 9.1.0.314, 10.0.0.45, 10.0.0.221) - no changes, besides blinking orange WLAN status LED.

Drivers on Linux - used compat-drivers package to update ath9k driver. 802.11n used to be unusable, because it was very unstable, e.g., usually only half of web page loaded, or most of images did not load. I also tried pinging some foreign hosts - response times mostly were more than 1-2 secs, with lots of timeouts. After updating driver everything works stable, e.g., pages are fully loaded, bigger files are being dowloaded just fine, but the speeds are low - 300-400 KB/s for foreign resources.

Also, I noticed that hostapd often disables 20/40 MHz operation because of overlapping BSSes. Patched it to skip this check. With 20 MHz, Windows reports 130 Mbps connection speed, with 40 MHz - 300 Mbps. Internet works the same in both cases, but local network - 16-17 MB/s in 20 MHz mode and 20-21 MB/s in 40 MHz mode. Channels are chosen carefully, so my neighbours should not be affected by this.

Any ideas what else I could try? I really don't like the fact that I can use foreign resources with max 2-3 MB/s (with 802.11g), when I should have speeds up to 10-12 MB/s…

binaryLV
  • 121
  • 1
  • 5

3 Answers3

1

If in-country connectivity is good, then the bottleneck is most likely your ISP. It's definitely not related to your AP. It's either the connectivity between your country and others, or your ISP may just not have good connectivity to foreign sites. You may be able to narrow it down by doing some traceroute tests to foreign sites to see if there's an obvious bottleneck.

As to the 40MHz, if you are in the 2.4GHz range, there are only 3 (or maybe 4 where you are) non-overlapping channels and your use of 2 of those channels may still be causing issues for your neighbors and possibly you, as well. But as I said before, that has nothing to do with the problem you're trying to solve, so long as you can get good bandwidth to local servers.

scottm32768
  • 449
  • 3
  • 7
  • Well, if it was ISP, then both 802.11n and 802.11g would be slow. The funny thing is that while 802.11n works with 300-400 KB/s, 802.11g - with 2.7 MB/s (probably about the maximum what can be achieved in 802.11g). It shouldn't matter for ISP what type of network I use locally. – binaryLV Mar 19 '13 at 02:03
  • If you use a 20MHz channel, does throughput on large files improve? – scottm32768 Mar 19 '13 at 02:06
  • As for the neighbors, there's one on ch11 (802.11g), I'm on ch3 and ch7 - no overlapping here. Other networks are so weak that I rarely see them (signal strength is around -90, -100 dBm for those). – binaryLV Mar 19 '13 at 02:06
  • scottm32768, no, it didn't seem so. To be honest, I even thought that switching to 20MHz (automatic disabling 40MHz) might cause the problems, therefore I disabled the check that switches to 20MHz. – binaryLV Mar 19 '13 at 02:07
  • 1
    ch7 overlaps with channel 11 (not a lot, but it does). You should use ch1 if your neighbors are on ch11 and you're using a 40MHz wide channel. – scottm32768 Mar 19 '13 at 02:08
  • I somehow missed that I can use channels below 3. Switching to ch1 made the network unusable. Switching to ch2 gives same slow speeds. Though, I just noticed that speedtest.net shows 8Mbps upload, when download is just 3Mbps. – binaryLV Mar 19 '13 at 02:17
  • Unfortunately, troubleshooting the RF part of wireless is hard without specialized tools. Is 5GHz an option? – scottm32768 Mar 19 '13 at 02:27
  • I doubt so, I don't think my phone supports 5GHz. Also, if it was the RF part, wouldn't local network be affected as well? I'm easily getting >160Mbps speeds (real throughput) between client and router. – binaryLV Mar 19 '13 at 02:39
  • Then I will return to what I said earlier. If you are getting good performance, then the wireless isn't the problem... – scottm32768 Mar 19 '13 at 02:58
  • If it's not wireless, then why does 802.11g give much better speeds? – binaryLV Mar 19 '13 at 03:04
  • That's an excellent question, but if it is wireless, why do local servers work fine? If it was the wireless, I would expect local servers to have problems, too. The only thing I can guess is something about the faster wireless connection, is causing some strange buffering or tcp window issue. What might be an interesting test is to disable 11n in the new AP and see if you get the same performance as with the old 11g AP. – scottm32768 Mar 19 '13 at 03:54
  • There's no such thing as "the old 11g AP" - both 802.11g and 802.11n are tested with the same machine. Switching between g and n is performed by enabling/disabling `ieee80211n` and `wmm_enabled` configuration parameters in `hostapd.conf` file. – binaryLV Mar 19 '13 at 06:41
  • Got it. You might try with WMM disabled, but other than that, I'm out of ideas. – scottm32768 Mar 19 '13 at 14:14
  • Now I'm confused. I thought that WMM is disabled by default, so I tried ommiting it, but not setting to 0. If I set it to 0, `wmm_enabled=0`, I get ~30 Mbps down and ~22 Mbps up for both local and foreign internet - much better for foreign internet, but ~3x worse for local. Also, WLAN (between laptop and router) is somewhere aroud 6-7 MB/s - 3x slower than with WMM enabled. Will take a closer look at those WMM settings. – binaryLV Mar 19 '13 at 14:52
  • As for 5GHz you mentioned in one of previous comments - I might try to switch to it, but I have to find out how to do it (google, google, google, ...). Currently hostapd just says that my hardware does not support it - might be because of country codes here and there. `iw list` lists 5GHz channels with "passive scanning, no IBSS", some with additional "radar detection" notes. But that's unrelated to the current problem. – binaryLV Mar 19 '13 at 15:00
  • Switching to 5GHz did not help - foreign internet is still slow. – binaryLV Mar 20 '13 at 09:55
0

This part of the default hostapd.conf is very misleading:

# ieee80211n: Whether IEEE 802.11n (HT) is enabled
# 0 = disabled (default)
# 1 = enabled
# Note: You will also need to enable WMM for full HT functionality.
ieee80211n=1

If you're like me, you probably read that and enabled WMM:

wmm_enable=1

That's what's killing the throughput. WMM is a QoS service designed to leave bandwidth available for high-priority packets. Comment-out that wmm_enable=1 line, restart hostapd, and you should find your n speeds up where they should be -- faster than g!

Raptor007
  • 151
  • 1
  • 4
  • I tried to enable/disable wmm_enable and it did not give desired results (I believe it was even worse without WMM). As for speeds being just "faster than g" - local network was up to 20-21 MB/s which is MUCH faster than g. The problem was that accessing foreign resources was awfully bad. It had basically nothing to do with my ISP, tested that. Anyway, it doesn't matter anymore as I've moved since then, changed ISP from 100Mbps fiber optics (which is even faster now, ISP upgraded speeds to 250Mbps) to 10-12 Mbps 3G connection and replaced custom-built router with Mikrotik's router. – binaryLV Feb 05 '14 at 11:30
-1

"The speed of light sucks." - John Carmack

Danack
  • 1,186
  • 1
  • 14
  • 27
  • I'm slightly tired now, at 5am, but while giving a quick look to that article, I noticed that it suggests to enable TCP window scaling to solve that issue. Another article states that on Linux it's enabled by default since 2.6.8. Neither disabling it, nor re-enabling did not change anything. – binaryLV Mar 19 '13 at 02:47
  • The TCP Window has to be changed on both ends of the connection, as well as all 'buffering' connections between the two end-points. – Danack Mar 19 '13 at 02:58