2

I'm seeing some weird behavior with the built in ping command that I don't understand. (this is on a windows 2012 r2 box - I haven't verified if this behavior is seen on other windows versions)

If I set the timeout (in ms) to a value like 120, I consistently see intermittent timeouts when pinging a remote host (about 10 hops away)

ping -t -w 120 myhost.domain.local
Reply from (removed): bytes=32 time=21ms TTL=246
Reply from (removed): bytes=32 time=23ms TTL=246
Request timed out.
Reply from (removed): bytes=32 time=25ms TTL=246
Reply from (removed): bytes=32 time=22ms TTL=246

which is fine, EXCEPT, if I leave the ping timeout at its default value (which is I believe 5000ms) I don't see any timeouts, AND never see a time reported greater than 30ms.

In fact, I can run 2 instances of ping at the same time, one with -w 120 and one with default timeout, and the instance with -w 120 will consistently have intermittent timeouts while the other instance will have none, and both instances won't show any responses greater than 30ms.

Does anyone have an explanation why it appears that ping is timing out in a much shorter interval than the one I'm specifying?

EDIT:

I'm beginning to think the -w parameter doesn't work at all, it certainly isn't doing what it says it should do. The description from the ping command is:

-w timeout     Timeout in milliseconds to wait for each reply.

so why the heck doesn't this timeout?

C:\Windows\System32>ping -w 10 google.com

Pinging google.com [66.58.255.29] with 32 bytes of data:
Reply from 66.58.255.29: bytes=32 time=46ms TTL=58

???

bkr
  • 865
  • 1
  • 8
  • 21
  • If you ping each device (you said you had 10 of them) that is between you and your server with the same timeout value, can you narrow it down to one of your routers? I'm not sure if this goes through the internet to get to your server, but 22ms ping seems pretty high for a LAN (I can ping 4.2.2.2 with that kind of response). – Nixphoe Apr 24 '14 at 20:17
  • it's a internal private network but there's a ~900 mile jump so the 22ms doesn't suprise me. what's confusing to me is that I'm getting timeouts but I should only get those if time > 120ms, however when running a control ping in parallel I'm getting timeouts at apparently lesser values. I'll try hitting a couple of the hops individually to see if the behavior only shows up partway along the route. – bkr Apr 24 '14 at 22:07

1 Answers1

1

per MS documentation

"When specifying very small numbers for timeout, the Ping reply can be received even if timeout milliseconds have elapsed."

I can only conclude based on my testing and the above statement that the timeout value in Ping is simply not very accurate and when set to 120ms you will simply get unpredictable results.

bkr
  • 865
  • 1
  • 8
  • 21
  • 1
    I can confirm this. When testing on a server that replies between 70-85ms, and setting timeout to 80, i get the occasional timeout error. – Wouter Dec 08 '16 at 13:28