The problem: choppy and slow wifi with Intel 7260
I recently bought a small 13.3″ notebook, the Lenovo IdeaPad U330p. I formatted the SSD, and installed both Win7 and Lubuntu 15.04 on it (Lubuntu is a light-weight version of the famous Ubuntu, it more or less sacrifices eye-candy for speed). Everything worked perfectly out of the box under Lubuntu it seemed, but when I tried to install new software packages, I noticed that the wifi connection was very slow, it also lost the connection to my router every few minutes and was unusable. The U330p has an Intel 7260 wifi chipset.
My first thought: Damn, it’s like 10 years ago, when I had to fiddle for days with self-compiled kernels and modules which refused to load until I could use the wifi on my laptop under Linux!
Let’s check the device, to make sure we really have Intel 7260:
# lspci | grep -i wire
02:00.0 Network controller: Intel Corporation Wireless 7260 (rev 73)
OK, we do. Short look at my linux kernel:
Linux mdev 3.19.0-15-generic #15-Ubuntu SMP Thu Apr 16 23:32:37 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
You can see the connection errors in /var/log/syslog, mine looked like this:
Jun 8 01:03:05 mdev wpa_supplicant: wlan0: WPA: Group rekeying completed with 24:66:11:73:d9:f1 [GTK=TKIP]
Jun 8 01:03:08 mdev whoopsie: [01:03:08] Cannot reach: https://daisy.ubuntu.com
Jun 8 01:03:11 mdev kernel: [ 558.707680] wlan0: disassociated from 24:66:11:73:d9:f1 (Reason: 2)
Jun 8 01:03:11 mdev wpa_supplicant: message repeated 6 times: [ wlan0: WPA: Group rekeying completed with 24:65:11:72:d9:f1 [GTK=TKIP]]
Jun 8 01:03:11 mdev wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid=24:65:11:72:d9:f1 reason=2
Jun 8 01:03:11 mdev NetworkManager: Connection disconnected (reason 2)
Workaround solution: disable 802.11n on the adapter
So I searched the internet, and found a few topics on this. Some suggested DNS trouble, but the one that did the trick was this great post: http://zeroset.mnim.org/2014/04/22/unstable-wifi-connection-on-ubuntu-14-04-trusty-tahr-ctrl-event-disconnected-reason4-locally_generated1/
It’s for Ubuntu 14.04, but that did not make a difference. The solution suggested in that post is to disable the 802.11n protocol on the adapter. I had already checked the settings on my router, and it does indeed use 802.11n as the default protocol.
So what is 802.11n?
802.11n is a specification/draft for a faster wifi than the older 802.11g standard. If you disable it, your card will use 802.11g to talk to the access point instead, which is limited to 54 mbit/s. This is more than enough, and most likely more than your internet connection behind the wifi provides. And when using 802.11n with the driver/firmware of Lubuntu, my card has more like 1 mbit/s, so I had nothing to lose. I tried it, and it works for me: after disabling n, the connection is stable and way faster.
So how to disable 802.11n for the Intel 7260 driver in (L)Ubuntu?
This is described by simon in his post I mentioned earlier, and all the credit goes to him: http://zeroset.mnim.org/2014/04/22/unstable-wifi-connection-on-ubuntu-14-04-trusty-tahr-ctrl-event-disconnected-reason4-locally_generated1/
The solution is the usual way of passing options to drivers in linux, you edit the config file and add the option you want. The driver for the Intel 7260 is called iwlwifi, and the config file is at /etc/modprobe.d/iwlwifi.conf under debian-based distros.
To disable 11n, append the following line to that file:
options iwlwifi 11n_disable=1
Then reboot your laptop, and you should have way better wifi.
Note: In case it does not improve the situation (or in case they improve the driver in the future and you want to give 11n another try then), you may want to re-enable 11n. To do that, just remove the line and reboot once more.
Hope it helps somebody.