I've been trying to diagnose some latency issues with my internet connection.

I've been lagging out of online video games and such, which of course could be their server's fault. So, I've been running ping some. It doesn't indicate anything unusual, but it does act a bit strange.

I can start it with something like ping internethost -i 0.1 so that it will send a ton of packets, and every 10-20 seconds it will appear to just freeze for 2 or 3 seconds. The packets are still being received in the right order though, and there is no packet loss. The weirdest thing is that after the little freeze up, it will usually just report a ping time that is about 10-30ms higher than the average.

How does this happen? Is ping still being accurate?

I'm using Arch Linux. The host I'm pinging is my website, which shouldn't be doing any kind of ping slowing or filtering.

  • Do you have wired or wireless Internet connection?
    – haimg
    Sep 3 '12 at 2:58
  • @haimg wired. My router is OpenBSD and modem is bridged to the router, so I can inspect everything on my end
    – Earlz
    Sep 3 '12 at 3:07

I usually run mtr with an interval of several seconds to a minute to see where the problem is. Not all routers will give echo requests high priority so timings may be a little strange. However, they should be increasing as the number of hops increase.

Other than the fact your ping is not detecting any drops, I would suspect packet drops. Have you tried running it with a count limit to get the summary at the end of the run.

Flood pinging can cause problems, so I usually try to avoid it.

It might also be that your system is freezing while it swaps some stuff periodically. Running sar can be used to look for high swap activity and a lot of other factors which can cause problems. top is also useful for a general overview of the system's performance.

For testing a web site, there are also tools available that do ping and trace route over the HTTP protocol.

EDIT: There have been reports of problems like this with large windows and large buffers on routers. The solution I have implemented is to shape traffic to a little less than my bandwidth.

  • With my ping application at least, doing ctrl-c causes it to print the statistics before it exists. But, regardless, no packet drop is indicated, and the min/avg/max statistics are not showing the random high ping either
    – Earlz
    Sep 3 '12 at 4:11
  • I would say it's my computer, but then why am I randomly lagging out of online game's servers when my friends on the same game aren't having any problems. Could there be anything wrong with my (relatively complex) router setup that could cause this kind of issue
    – Earlz
    Sep 3 '12 at 4:12
  • That's what mtr should find. Try testing it with the game server's address. It could be a BufferBloat issue as noted in my edit.
    – BillThor
    Sep 3 '12 at 4:26
  • Neat. I've never heard of mtr before, but it looks like a powerful diagnostic tool
    – Earlz
    Sep 3 '12 at 14:24

It could be bufferbloat, congestion in general, or latency along the network stack on each or any hop.

The increased latency after "freeze up" sounds normal… if you're freezing. It's likely a sign of congestion upstream however, which if it is normal is not optimal of course.

If practical (i.e., the edge router or you support it and nobody else, if any, behind your router would mind) throttling down your uplink to just a bit above your throughput needs. You may also want to set up other forms of QoS and prioritize your video games' packets. Try tcpdumping on the router or the endpoint to see what port is used.

For throttling, see if OpenBSD has something like token bucket filter, or hierarchical token bucket.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.