# [solved] Wifi transmit ridiculously slow on kernel 3.10.50+

## haarp

Hello,

I've got a Thinkpad W520 running Gentoo which uses an Intel Ultimate-N 6300 card. My access point is an Asus AC66U (dual-band) running Tomato. The laptop is 3 meters away from the AP and has direct line-of-sight and thus perfect signal quality. I'm connecting through network-manager. I've noticed this on kernel 3.12 and 3.14.

When connecting via the 5GHz band, my Thinkpad only manages around 3.5-4MB/s when uploading data via Wifi (to a machine on the LOCAL NETWORK which is ATTACHED VIA ETHERNET). Downstream however is about 8-10MB/s! the 2.5GHz band is even slower, barely getting beyond 2.5MB/s. These values are ridiculously bad for a 3x3 antenna setup with perfect signal strength.

Another laptop, a Thinkpad X61t with an Ultimate-N 5300 card running Linux Mint manages 12MB/s upstream and 17MB/s downstream on the same AP. Curiously, I booted a Mint live-system on the W520 itself and discovered Wifi to be MUCH faster. Something is wrong on my Gentoo that makes Wifi disgustingly slow.

So far I have two theories:

a) Gentoo is only using one TX antenna out of 3. The reason is beyond me. I've not set any module parameters for iwlwifi.

b) Some regulatory problem. But I'm using the modern nl80211 and I've set the country code correctly:

```
# iw reg get

country DE: DFS-UNSET

   (2400 - 2483 @ 40), (N/A, 20)

   (5150 - 5250 @ 80), (N/A, 20), NO-OUTDOOR

   (5250 - 5350 @ 80), (N/A, 20), NO-OUTDOOR, DFS

   (5470 - 5725 @ 80), (N/A, 26), DFS

   (57240 - 65880 @ 2160), (N/A, 40), NO-OUTDOOR
```

The only thing suspicious here is DFS-UNSET. Apparently I can't get it to use DFS properly, but that doesn't explain why 2.5GHz is also so slow, as only 5GHz needs DFS. So I think theory a) is more likely.

Any ideas?Last edited by haarp on Sat Aug 02, 2014 9:38 am; edited 2 times in total

----------

## szatox

My old wifi b/g saturates at 22Mbps (this seems to be hard cap for data transfer speed over wifi G - 54Mb - due to high protocol overhead). Using 1 anthena out of 3 is a poor theory becauce it does not explain speed drop and I honestly doubt gentoo has anything to do with anthenas' roles - that looks more like a task for chipset alone.

First guess on that bandwidth behaviour was "check router's config for bandwidth spliting/sharing/limiting functions", but then that doesn't explain difference between 5G and 2,4G.

Maybe it workes in b mode when it's set to 2,4G? Stupit as it is, that would be closer match for those funny speeds.

Can you check connection speed reported by device? Iwconfig used to show that, you can also try

'cat /sys/class/net/<WIFI NAME>/speed'

edit: yep, typo fixedLast edited by szatox on Sat Aug 02, 2014 9:02 am; edited 1 time in total

----------

## haarp

Ah, you probably mean 802.11g, not b. g is the 54Mbit/s one, which in practice is usually less than half that, so your speed is pretty reasonable.

It's definitely not a router issue. It does support 802.11n. If I boot Mint on this same laptop I get speeds of up to 25MB/s (that's megabytes!). Only Gentoo limits it severely.

The gross speed negotiated fluctuates somewhat, but for 5GHz, it never exceeds 150Mbit/s (which is the maximum speed for 802.11n on one antenna)

Here's a table for reference, both on the same machine, in megabyte/s:

Gentoo:

5GHz down: 9MB/s

5GHz up: 3.5MB/s

2.5GHz down: 7MB/s

2.5GHz up: 2.5MB/s

Linux Mint:

5GHz down: 25MB/s

5GHz up: 11MB/s

2.5GHz down: 22MB/s

2.5GHz up: 18MB/s

----------

## haarp

Ok, I just booted kernel 3.10 on my Gentoo and behold, I get much higher speeds. Interesting.

----------

## haarp

Sweet! I tracked the problem down to this commit: https://github.com/torvalds/linux/commit/205e2210daa975d92ace485a65a31ccc4077fe1a

It was introduced some time along the 3.10 release. All kernels using it have slow Wifi for me.

The commit indicates that the iwlwifi module option 11n_disable accepts the value 8 now. modinfo shows:

```
parm:           11n_disable:disable 11n functionality, bitmap: 1: full, 2: disable agg TX, 4: disable agg RX, 8 enable agg TX (uint)
```

Hmmmm. That looks suspicious. Lack of antenna aggregation is exactly what I suspected. So I loaded the module with 11n_disable=8. Lo and behold, I get much faster speeds now!

Yay!

----------

## swimmer

*wow* thank you very much!!!

I was wondering as well why the networking speeds on the Ubuntu Live cd I used for checking out the hardware of my new laptop were *that* much higher than under Gentoo but I didn't find this solution. 

After implementing your option I get full speed connection as well! 

Marvelous - thanks again B-)

----------

## haarp

Apparently, the change is important for stability:

https://bugzilla.kernel.org/show_bug.cgi?id=81571

While I agree that stability is the most important aspect, throwing people back to 2003 (802.11g) speeds even on modern hardware does not paint a good picture of Linux wireless.

----------

## khayyam

 *haarp wrote:*   

> While I agree that stability is the most important aspect, throwing people back to 2003 (802.11g) speeds even on modern hardware does not paint a good picture of Linux wireless.

 

haarp ... note that firmware is involved, and linux developers have no control over this (and as Emmanuel Grumbach points out it can't easily be debugged).

While "modern hardware" sounds innocuous there is something of a catch there, the industry is driven by the requirement to sell new/improved units (and being able to provide some rational for it ... ie, "x faster") that looks good on paper (or more accurately "on the box") but the solution of spatial streams is such that "[e]ach additional spatial stream increases the RF complexity and likelihood of errors, requiring greater SNR [signal-to-noise ratio] and signal diversity at the receiver for reliable use" and so is bumping up against the law of diminishing returns (after all its *radio* which is inherently subject to interference/noise). The fact that "stability" is opted for in preference to speed is not entirely the result of the driver but also reflects the nature of the medium and implementation of the standard.

best ... khay

----------

## haarp

Khay,

I know that. And I agree that stability>throughput. But as I said, it doesn't paint a good light on Linux when users get 1/10 of the performance they get on Windows. I'm not pointing fingers, just stating a fact.

----------

## khayyam

 *haarp wrote:*   

> I know that. And I agree that stability>throughput. But as I said, it doesn't paint a good light on Linux when users get 1/10 of the performance they get on Windows. I'm not pointing fingers, just stating a fact.

 

haarp ... ok, but what are the facts here, "1/10 of the performance they get on Windows" sounds anecdotal to me. If presented with such a fact I'd ask for the data set and experimental setting from which this "1/10" was derived. I'd also ask that the experiment be repeated in a real world setting, say two years from now when the spectrum currently providing such increased speeds is as thoroughly awash with interference as 802.11g.

I see what your saying, but I would challenge the idea that there is something inherently wrong with linux ITR ... the issue is really at the technical level and the economics driving the products involved (note the Wi-Fi Alliance is a trade association, and given their other technical specifications, such as WPS, economic considerations trump technical ones).

best ... khay

----------

## i92guboj

Today I got some free time to diagnose why the hell all linux laptops at home were so insanely slow when connecting via wifi. I can confirm this is still an issue in 2020, and I also can confirm that 11n_disable=8 "solves" it.

As much as I appreciate stability, I have no option but to use this hack. Otherwise most web pages won't even load nowadays when using this driver, and having wires all around my flat doesn't feel like a viable option.

Thanks everyone for the insight. It's been quite valuable.

----------

