0

How do I ping 192.168.1.1 10 times with a break of 3 centiseconds after each ping! In command prompt. The ping command is really confusing.

3
  • What OS? What shell? '3 centiseconds' is, I think, 30ms. Commented Apr 22, 2012 at 18:30
  • Martin, I applaud your grasp of SI prefixes, but in the civilised world that should be common knowledge, I guess ;-) Commented Apr 22, 2012 at 18:42
  • You should check answers as accepted one clearly does not do it with 30ms interval. AFAIK ping provided with windows cannot do that with interval less than one second <- Someone please correct if I am wrong. Commented Apr 22, 2012 at 19:13

3 Answers 3

3

You should propably get fping and use that:

fping -c 10 -p 30ms 192.168.1.1 

This will send 10 packets to 192.168.1.1, interval between each packet is 30ms

fping because it allows flooding if required, 30ms interval between sends without waiting reply is propably considered flooding anyway...

With -t msecs you can add timeout for individual packets, this timeout is non blocking so interval between packets is always same, in this case -p 30 it is 30ms.

Packet loss with fping

Because of this, fping -p 30ms -t 10000 -s example.com may first show some packet loss but after waiting before summary is printed it should have enough time (10sec) to receive all packets that is not received in 30ms frame and final summmary shows that there is no real loss at all.

Example of packet exceeding interval but arriving within timeout:

Cmd:

fping -c 10 -p 30ms -s -t 10000 -e somehost.com 

Output:

somehost.com : [0], 84 bytes, 299 ms (299 avg, 90% loss) somehost.com : [1], 84 bytes, 269 ms (284 avg, 80% loss) somehost.com : [2], 84 bytes, 239 ms (269 avg, 70% loss) somehost.com : [3], 84 bytes, 209 ms (254 avg, 60% loss) somehost.com : [4], 84 bytes, 179 ms (239 avg, 50% loss) somehost.com : [5], 84 bytes, 158 ms (225 avg, 40% loss) somehost.com : [6], 84 bytes, 128 ms (212 avg, 30% loss) somehost.com : [7], 84 bytes, 137 ms (202 avg, 20% loss) somehost.com : [8], 84 bytes, 137 ms (195 avg, 10% loss) somehost.com : [9], 84 bytes, 127 ms (188 avg, 0% loss) somehost.com : xmt/rcv/%loss = 10/10/0%, min/avg/max = 127/188/299 1 targets 1 alive 0 unreachable 0 unknown addresses 0 timeouts (waiting for response) 10 ICMP Echos sent 10 ICMP Echo Replies received 0 other ICMP received 127 ms (min round trip time) 188 ms (avg round trip time) 299 ms (max round trip time) 0.410 sec (elapsed real time) 

As you can see, finally there is no loss at all 0 timeouts and 10 ICMP Echo Replies received out of 10 ICMP Echos sent.

Here you can find fping for linux.

And here fping for windows.

Sign up to request clarification or add additional context in comments.

1 Comment

I've just released ping-xray which is based on "fping" and makes output more human-friendly, plus it creates CSV logs with exact millisecond resolution for all targets: dimon.ca/ping-xray
0

Assuming you are in a Windows Command Line:

ping 192.168.1.1 -n 10 -w 10 

Here is a help page: link

4 Comments

You are right, units is in milliseconds. However that does not change anything as interval between packets is still one second and -w only changes timeout which is time how long ping will wait for reply. Timeout and time between sends are very different thins.
However, seems like pathping can do it with -p n and it is shipped with ms products.
Well, I believe the ping interval also depends on the speed of your network and the other host's response speed... if you have found the solution, then I am glad you did ;) , if not, can you provide me with more detail what you want to do... so I can do my best to help you.
Yes it depends, but not a lot. I ran fping with -p 20ms interval and -t 150ms timeout and it took 1.646 sec (elapsed real time) to send/receive -c 50 packets to/from google.com. As I am now behind HSDPA typical RTT for me is 130-180ms so there is approx 7-8 ICMP packets sent before first reply. With typical ADSL2+ RTT 10-50ms there is not much effect on 30ms delay between parallel sends, in fact because sending is done parallel there is only 20ms delay in theory. Here you can look for some real data google.com/publicdata
0

It's ping 192.168.1.1 /n 10 /w 30

1 Comment

Same here, interval is one second, timeot 30 second, 10 packets. Worst case it takes 5 minutes to complete as it will not do it parallel.