How to 'ping' politely

24

3

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?

Ziggy

Posted 2012-12-02T00:36:52.047

Reputation: 826

27There was a childrens book on pinging? – cutrightjm – 2012-12-02T00:47:26.027

Sounds like the kind of thing that should be made readily available. – WindowsEscapist – 2012-12-02T00:54:22.587

ping -f? -f! I am not sure which client you use, but on many operating systems that is flood ping. And flood ping is never acceptable. – Hennes – 2012-12-02T00:58:15.433

1@Hennes In Windows, -f is the parameter for "Set Don't Fragment flag in packet (IPv4-only)". – That Brazilian Guy – 2012-12-02T01:10:31.987

@Hennes never? Never ever? Not ever? Why? (I guess I should have specified that I was wondering about more than just the rules of politesse but also their justification). – Ziggy – 2012-12-02T01:13:10.660

1I doubt that pinging more than once a second is useful as the ping time is unlikely to change so fast that wouldn't notice it at least over the internet while ping flooding does have some use on local networks where it can be used to measure delay in cables where the variance is magnitudes smaller. – Dan D. – 2012-12-02T01:27:07.980

I checked a Linux, FreeBSD and win 7. I somehow missed the option when checking the windows help. Linux and FreeBSD still have -f as flood ping. Aka 'bring the network down' mode. Modern hardware seems more resilient to this, but flood ping to someone server not on your own local LAN quite conflicted with 'politely'. – Hennes – 2012-12-02T01:30:49.703

One ping per minute can hardly be considered flooding by any sane metric. The -f flag probably does something else as commented above. – Thomas – 2012-12-02T07:51:20.520

13

@ekaj - A Story About Ping - Read the first Customer Review

– Ex Umbris – 2012-12-02T07:51:21.300

3@ExUmbris you get the bonus points! – Ziggy – 2012-12-02T18:17:58.073

Answers

20

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.

Synetech

Posted 2012-12-02T00:36:52.047

Reputation: 63 242

4I set -f because it produces pretty output: a '.' when the ping is dropped, and a '<backspace>' when there is a response. If I were to write the full script I wouldn't set the flood flag, that was just for inspecting. – Ziggy – 2012-12-02T01:31:19.803

great minds think alike. – peelman – 2012-12-02T01:32:39.283

@Ziggy, ah, then yes, you should be fine with such a low output. – Synetech – 2012-12-02T01:39:56.857

Oh man you guys are tied! I can't decide! – Ziggy – 2012-12-02T18:19:27.387

18

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.

Ярослав Рахматуллин

Posted 2012-12-02T00:36:52.047

Reputation: 9 076

9

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.

peelman

Posted 2012-12-02T00:36:52.047

Reputation: 4 580

Indeed. ☺ I just got distracted with another question. (If I can peel myself away, I would get back to the movie I’m in the middle of. :-D) – Synetech – 2012-12-02T01:39:16.513

Oh man you guys are tied! I can't decide! – Ziggy – 2012-12-02T18:19:53.003