How to 'ping' politely
Today minecraft was down at exactly the moment when I wanted to take a break from studying for my finals. A harrowing experience! So I thought I would procrastinate a bit by writing a script that would ping minecraft.net every minute, and launch minecraft for me as soon as things were back to normal. As a proof of concept I ran ping -i 60 -f www.minecraft.net
for a while and observed the output. That command sends a ping every 60 seconds (-f is the 'flood ping' option on my system).
Then it occurred to me: is this OK? I grepped about the man pages, and googled around the interweb, but aside from one illustrated book for children I could find no good advice for how to ping politely.
So I put it to you, gentle super users: what are some general guidelines for using ping politely? Is there a permissible interval for using ping -f
?
Solution 1:
Sending a ping once every 60 seconds is hardly a DoS. In fact, the traffic that you generate to the servers of an online game simply by playing far outweigh a simple ping once per minute. Even if everybody who wants to connect to play were to do that, it would still be less than if they all were actively playing.
Why did you choose to use the flood mode? If you remove that, then you are perfectly fine sending a ping once per minute (or even per 30 seconds since it is only a single packet once in a while).
Just make sure that you code your script so that the pinging stops once you have connected.
Solution 2:
The permissible interval for a ping is the default of one second. Increasing that to an interval of two seconds would make the user twice as nice. At a ten second interval, you'd be five-hundred-and-twelve times more polite than the average ping user, which is probably as high a tidemark of etiquette as any of us can hope to reach.
I figure that if the once a second interval was acceptable some 30 years ago when the program became popular, it certainly is acceptable today because the capacity of the network has increased.
Solution 3:
In the grand scheme of things, no; there is no etiquette. You can blast out ICMP to your heart's content and no ill should come of it. Certainly sending one ping every minute would be perfectly acceptable, especially when you consider the amount of traffic typically going to that particular address.
ICMP is pretty paltry in terms of usage, both bandwidth and resources necessary for a response, so as long as you're not systematically organizing hundreds of thousands of machines to all ping the same box(es) at the same time, you aren't violating any unwritten rules of the interwebs.