Press "Enter" to skip to content

WiFi works fine but gets significant packet loss

I had been having a packet loss issue with my XPS 13 7390 when connecting to my home 5GHz WiFi. The connection was fine. I could use the internet normally without any problem. But whenever I wanted to ping something, the results always showed a lot of packet loss. Even when I ping the machines in the same LAN, it was the same.

The WiFi card of XPS 13 7390 is Intel Wi-Fi 6 AX200, and my router is NETGEAR Nighthawk AC1750. Turns out these have nothing to do with the packet loss issue.

Not sure why, but I found (by trial-and-error) the power management/saving of the internet interface is the culprit (do not be confused with the WiFi card’s power saving). There are several ways to disable power management.

Option 1: use iw to disable power management of the interface

iw can turn the power management of an interface off. Use this command:

# iw <interface name> set power_save off

We can check if the power management is indeed turned off by

$ iw <interface name> get power_save

It should give you off.

And then do the pinging again to see if turning off the power management works.

The above command only works temporarily. We’ll have to re-run the command again next boot. To do this permanently, we can set a udev rule as described in this Wiki post — create a new file /etc/udev/rules.d/81-wifi-powersave.rules, and add the following line:

ACTION=="add", SUBSYSTEM=="net", KERNEL=="wl*", RUN+="/usr/bin/iw dev $name set power_save on"

And then reboot the machine.

Option 2: use NetworkManager to disable power management for a specific network only

This option can do better control over when power management should be disabled based on the current network. For example, if we have the packet loss issue with a home 5GHz network but not with 2.4GHz. And we don’t have the issue with our office’s WiFi, either. So we may want to only disable the power management when connecting to the home 5GHz network. NetworkManager gives us this flexibility.

To my knowledge, there’s no way to set this parameter through the GUI of NetworkManager. So we have to go through a terminal. First, go to the setting interface of the target network:

$ nmcli connection edit <network connection name>

This should get us into an interactive interface with nmcli> prompt.

Go to the 802-11-wireless setting section:

nmcli> goto 802-11-wireless

The prompt should change to nmcli 802-11-wireless>. We can print out the current configuration in the 802-11-wireless section through print command. We should see a line indicating the current setting of power management:

nmcli 802-11-wireless> print
---------------------------------------------------------
...
...
802-11-wireless.powersave: 0 (default)
...

A value of 0 means, I guess (i.e., I’m not sure), it will follow the global setting of NetworkManager, which may be enable. Anyway, what we’re going to do is to change this setting to 2, meaning disable:

nmcli 802-11-wireless> set powersave 2

If we use print to check the value, we should see

802-11-wireless.powersave: 2 (disable)

We can now save and quit by using

nmcli 802-11-wireless> save

and

nmcli 802-11-wireless> quit

Finally, disconnect and reconnect the WiFi network to see if the issue is resolved.

Be First to Comment

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.