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.
- What OS? What shell? '3 centiseconds' is, I think, 30ms.Martin James– Martin James2012-04-22 18:30:20 +00:00Commented 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 ;-)Joey– Joey2012-04-22 18:42:51 +00:00Commented 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.Sampo Sarrala– Sampo Sarrala2012-04-22 19:13:15 +00:00Commented Apr 22, 2012 at 19:13
3 Answers
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.
1 Comment
4 Comments
-w only changes timeout which is time how long ping will wait for reply. Timeout and time between sends are very different thins.pathping can do it with -p n and it is shipped with ms products.-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/publicdataIt's ping 192.168.1.1 /n 10 /w 30