15

I am currently running Ubuntu 16.04 LTS, and I'm running into an extremely annoying problem with my wireless setup. Occasionally (and seemingly, randomly), my ping will begin to skyrocket and get out of hand:

PING 10.0.2.1 (10.0.2.1) 56(84) bytes of data.
64 bytes from 10.0.2.1: icmp_seq=1 ttl=64 time=367 ms
64 bytes from 10.0.2.1: icmp_seq=2 ttl=64 time=8.48 ms
64 bytes from 10.0.2.1: icmp_seq=3 ttl=64 time=971 ms
64 bytes from 10.0.2.1: icmp_seq=4 ttl=64 time=1.11 ms
64 bytes from 10.0.2.1: icmp_seq=5 ttl=64 time=91.6 ms
64 bytes from 10.0.2.1: icmp_seq=6 ttl=64 time=482 ms
64 bytes from 10.0.2.1: icmp_seq=7 ttl=64 time=1.15 ms
64 bytes from 10.0.2.1: icmp_seq=8 ttl=64 time=131 ms
64 bytes from 10.0.2.1: icmp_seq=9 ttl=64 time=92.6 ms
64 bytes from 10.0.2.1: icmp_seq=10 ttl=64 time=2.72 ms

--- 10.0.2.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9005ms
rtt min/avg/max/mdev = 1.116/215.207/971.833/297.328 ms

I've also seen cases where my ping to my router is in the upwards of the 4000ms range:

--- 10.0.2.1 ping statistics ---
10 packets transmitted, 10 received, 0% packet loss, time 9031ms
rtt min/avg/max/mdev = 1425.396/3721.331/5352.349/1087.015 ms, pipe 5

Other pings seem to just drop packets entirely:

--- 10.0.2.1 ping statistics ---
60 packets transmitted, 48 received, 20% packet loss, time 71043ms
rtt min/avg/max/mdev = 0.544/2206.796/7108.406/2372.068 ms, pipe 8

Otherwise, the system functions completely normally. How can I fix or at least reduce this excessive latency?

lshw output is as follows:

*-network
     description: Wireless interface
     product: BCM4352 802.11ac Wireless Network Adapter
     vendor: Broadcom Corporation
     physical id: 0
     bus info: pci@0000:03:00.0
     logical name: wlan0
     version: 03
     serial: [REDACTED]
     width: 64 bits
     clock: 33MHz
     capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
     configuration: broadcast=yes driver=wl0 driverversion=6.30.223.248 (r487574) ip=10.0.2.71 latency=0 multicast=yes wireless=IEEE 802.11abg
     resources: irq:19 memory:f7a00000-f7a07fff memory:f7800000-f79fffff

The Broadcom STA driver is installed and is running. This is happening to no other devices on the network.

uname -a returns:

Linux ArcticWolf 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

I have the latest (known) drivers installed:

Package: bcmwl-kernel-source
Version: 6.30.223.248+bdcom-0ubuntu8
Priority: optional
Section: restricted/admin
Source: bcmwl
Origin: Ubuntu
Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer: Alberto Milone <alberto.milone@canonical.com>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 8,013 kB
Depends: dkms, linux-libc-dev, libc6-dev

iwconfig output at any given time:

wlan0     IEEE 802.11abg  ESSID:"[redacted]"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: [REDACTED]   
          Bit Rate=144 Mb/s   Tx-Power=200 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=51/70  Signal level=-59 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

I can occasionally "jar" the network back to normal by disconnecting and reconnecting the wireless connection, but it always goes back to normal after a few minutes of operating normally.

There are no other wireless routers or devices nearby that may cause interference on my WiFi channel. The router firmware is up-to-date and I have tried rebooting it numerous times now.

The router is on Channel 1 (and is the only device on the channel), and WPA2-AES is being used. Distance makes no difference.

This is not a router or interference issue, as other devices on my network work perfectly and exhibit none of the same symptoms.

This happens (so far) on all networks I've tested with, suggesting that this is actually an issue with my system and not my router. This situation happens in both noisy and quiet radio areas, further suggesting that it has nothing to do with interference.

Kaz Wolfe
  • 33,802
  • 20
  • 111
  • 168
  • What channel are you running on? Are you using WPA2-AES? Are you using a repeater? Do the pings become more consistent if you're closer to the router? – heynnema Dec 08 '16 at 15:58
  • 1
    @heynnema I am the only device running on Channel 11, and I am using WPA2-AES. There is no repeater, and the pings are the same three feet from the router as they are 20 feet away. – Kaz Wolfe Dec 09 '16 at 21:32
  • OK. For testing purposes, please set your router to use channel 1 and reconnect the wifi, and then test again with channel 6 and reconnect the wifi. `sudo iwlist wlan0 freq` (change wlan0 to the correct interface name) will show what channel you are currently connected to. Are there any wireless phones, or microwave ovens, near the router? Report back on the test results. – heynnema Dec 09 '16 at 21:42
  • Channel 1 and 6 have the same issue (I've tried channel-hopping already), as I think it's the system, not the router itself. There are phones and microwaves (hence using Channel 11 instead of Channel 1). Output of the command: http://pastebin.com/GKAq6Kip – Kaz Wolfe Dec 09 '16 at 21:45
  • Good. What happens if you connect to any of the 5ghz channels? Also, type `iwconfig` and note the `Power management` setting. If it's ON, type `sudo iwconfig wlan0 power off`, confirm that `iwconfig` now shows PM=off. Test again. Report back. – heynnema Dec 09 '16 at 21:47
  • 5GHz does not reach back to the room where my device is, sadly. Power management was turned off before, it seems to not be saved with reboot. Turning it back off has appeared to reduce the ping back to sane levels. – Kaz Wolfe Dec 09 '16 at 21:49
  • Move the computer closer to the router, and try a 5ghz channel. I want to eliminate a 2.4ghz problem. Test 5ghz with power management off and on. Report back. You can purchase an inexpensive Netgear dual-band repeater for <$40 on ebay. That would solve your problem in the room where it doesn't reach. – heynnema Dec 09 '16 at 21:52
  • ps: is your router, or your wirelss card, AC capable? If not, look on eBay for a `Netgear WN2500RP`... and they're even cheaper than I thought. Do you have an Android phone/tablet? If so, install `WiFi Analyzer` and look at your channel breakdown of local traffic. See if all channels show high traffic. – heynnema Dec 09 '16 at 22:02
  • Both my router and PC are AC-compatible. Traffic is normal and sane, but only on channel 11 (with my only AP) and Channel 36. It might also be worth mentioning that all other devices are running just fine during my PC spikes. – Kaz Wolfe Dec 09 '16 at 22:35
  • Good, both your wireless and your router are AC. The Netgear WN2500RP is not AC, so it wouldn't be right for your setup. What were the results of the 5ghz test? Did you install WiFi Analyzer? We may have to move to chat soon. So did the power management adjustment help? You can always add `iwconfig wlan0 power off` to `/etc/rc.local`. – heynnema Dec 09 '16 at 23:46
  • Traffic is normal, 5GHz test changes nothing. Power management seems to help temporarily and then it goes back to normal. – Kaz Wolfe Dec 10 '16 at 00:36
  • Last shot. What do the ping times look like to 8.8.8.8? Consistent or varying wildly? After this test, I'm out of ideas. – heynnema Dec 10 '16 at 00:58
  • Pinging out to the world is consistent provided the ping to the router is consistent. – Kaz Wolfe Dec 10 '16 at 01:00
  • Sounds so much like an interference problem, or a router problem. Any way, maybe somebody else can chime in with some ideas. – heynnema Dec 10 '16 at 01:02
  • Your iwconfig stdout is **very** weird. There is no country with such a legal maximum level as 200dBm I don't even understand how this stdout can happen as you are normally locked by your CRDA configuration at 20dBm. And If you try to put it manually at 16dBm? That's normaly the mximu output power for an internal card... – kcdtv Jan 24 '17 at 19:11
  • @kcdtv 200 dBm is half of the sun's power output in watts. Other people report that some Broadcom drivers have a bug that report power in mW instead of dBm, causing iwconfig to have bad output. – Kaz Wolfe Jan 24 '17 at 19:13
  • Yes, it is kind of a lot... isn't it? :D 200mw would be 23dBm which doesn't seems realitic neither for an inetrnal wifi chipset. – kcdtv Jan 24 '17 at 19:18
  • @kcdtv According to the [Wikipedia page for dBm](https://en.wikipedia.org/wiki/DBm), 200mW is a sane value for 5 GHz devices and the new wifi standard. – Kaz Wolfe Jan 24 '17 at 19:22
  • where i live it is limited at 100mw but you are right, it is in the majority of places limited to 200mw. I forgot about that. – kcdtv Jan 24 '17 at 19:26

1 Answers1

11

Since power management seems to be the problem, this command will disable power management and keep it from turning itself back on

sudo sed -i 's/wifi.powersave = 3/wifi.powersave = 2/' /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

The issue was caused by this commit to the network manager git

This comment on the bug report shows us that using the wifi.powersave = 3 enables power management and using 2 will disable it

We could also try a newer version of bcmwl-kernel-source

sudo apt-get install linux-headers-$(uname -r) build-essential dkms
wget http://de.archive.ubuntu.com/ubuntu/pool/multiverse/b/broadcom-sta/broadcom-sta-dkms_6.30.223.271-4_all.deb
sudo dpkg -i broadcom-sta-dkms_6.30.223.271-4_all.deb

As recommended by praseodym here

Jeremy31
  • 12,262
  • 9
  • 57
  • 113
  • Nope, pings are still spiking up to 2 seconds or more, even with this patch in place. – Kaz Wolfe Jan 22 '17 at 20:49
  • Have your rebooted/restarted network manager? – Jeremy31 Jan 22 '17 at 20:56
  • I have, yes. Multiple times now. – Kaz Wolfe Jan 22 '17 at 20:57
  • Will try new drivers when I get back home and report back. – Kaz Wolfe Jan 24 '17 at 19:13
  • Did you try with iwl package instead of sta? – kcdtv Jan 25 '17 at 13:08
  • Broadcom STA packages do not seem to make any difference over my current driver version, unfortunately. Still reporting very high pings. It doesn't seem *as* bad (??) but there's still definitely a problem there. – Kaz Wolfe Jan 26 '17 at 04:25
  • Awarded the bounty because you would have gotten it anyways, and I don't want to see it go to waste. Problem is still there, unfortunately. – Kaz Wolfe Jan 29 '17 at 02:42
  • Thanks. I wonder if you would have better results from an Intel 7265 wifi card as Broadcom hasn't updated bcmwl in over a year, see the [Broadcom](https://www.broadcom.com/support/download-search/?pf=Wireless+LAN+Infrastructure) page. They do have a support email there and may be able to help – Jeremy31 Jan 29 '17 at 17:29
  • This totally solved my issues.. Fresh install of Linux Mint and I had ping response times constantly wavering between 3ms and 600ms. Setting the wifi.powersave=2 and restarting the network stack brought me back to a consistent 5-7ms response. Thanks Jeremy31 – Tim Kane Feb 25 '17 at 20:11