0

I am still kind of dealing with my other question here and while doing that, I need to be able to measure the quality of the connection. I found the measurement quite unreliable (despite measuring for minutes and taking the average) and then I tried running two ping commands, both directed to my local router, at the same time. One shows delay 2-4 ms, second shows delays 40-60 ms. How can it be possible?

different pings

Update: couple of minutes later, the very same ping commands (I didn't stop them while writing this question) switched their roles.

enter image description here

4
  • You should not have that much latency to a LAN device, most certainly to your router/modem. Are you sure there aren't a buttload of other wifi connections interfering with yours? If yes, i would suggest you switching to the 5Ghz band, it is somewhat more expensive but it doesn't have the interference 2.4Ghz has
    – Maarten
    May 13, 2016 at 10:18
  • Well, there is certainly some interference (which I am dealing with in that another question linked above). But this question focuses on how two equal pings can show such different results.
    – Erlik
    May 13, 2016 at 10:34
  • I assume that you are doing this over Wifi. When I move around with my laptop around the house I get different results. Pings are not a static thing, connections aren't always solid, even while using a cable. So you have to find out what the interfering factor is and shut it out. And from the information you have given me, i assume it is interference wirelessly
    – Maarten
    May 13, 2016 at 10:39
  • WiFi indeed, but these pings are run on the same PC at the same time.
    – Erlik
    May 13, 2016 at 13:36

1 Answer 1

2

The most common cause of significant ping time variation on Wi-Fi is not actually interference (including a busy RF medium), but 802.11 power save mode.

Wireless clients save power by sleeping their radio receivers between packets (or between bursts of packets). Once a client sleeps its receiver, it doesn't wake it again until either it has another packet to send, or until at least the next beacon frame is due to be sent by the AP (sometimes clients will sleep for more than one beacon interval). Most APs default to sending beacons once every 100 Kiµsec (100 Kibi (Kilo-Binary) microseconds = 102400 µsec = 102.4 ms = a little less frequent than 10 beacons per second), so a client that likes to sleep for the rest of the current beacon interval will add 51.2 ms of latency, on average, to any once-per-second ping.

On top of that, a client will usually keep its receiver awake for a brief moment following a packet transmission or reception, in order to see if it's in the middle of a burst that would make it worth keeping the receiver awake for.

I think if we dug into your AP's beacon interval and your client's 802.11 power save strategy, it's possible to explain your ping time variance by how the different once-per-second pings happened to line up with your network's beacon timing. For example, maybe the ping in one window happened to line up such that the ping request went out just a couple ms before the beacon, so the client woke up for the reply just 2-3ms later; whereas the other window's ping request went out right after the beacon, so the client was asleep already when the ping reply reached the AP, so the AP had to queue it up for that client for the next time the client was awake, which may be one or two beacons later.

There are two easy ways to test this theory. Either of these should work:

  • Lower your ping interval to a tenth of a second instead of the default of a full second, so that you have a ping happening every beacon interval. That will keep most receivers awake all the time.

    ping -i 0.1 192.168.0.1

  • Adjust the advanced properties of your 802.11 driver to disable 802.11 power save mode.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .