News for hackers. Stuff that matters.
Re:The Story of the Ping Program by lkrubner on Wednesday January 09, 2013 @02:48AM (#5030644)
This story was my favorite part:

: : : : :

The best ping story I've ever heard was told to me at a USENIX conference, where a network administrator with an intermittent Ethernet had linked the ping program to his vocoder program, in essence writing:

ping goodhost | sed -e 's/.*/ping/' | vocoder

He wired the vocoder's output into his office stereo and turned up the volume as loud as he could stand. The computer sat there shouting "Ping, ping, ping..." once a second, and he wandered through the building wiggling Ethernet connectors until the sound stopped. And that's how he found the intermittent failure.

Re:The Story of the Ping Program by cs02rm0 on Wednesday January 09, 2013 @04:11AM (#5030800)
:::::

^ I thought you were starting the story with an ipv6 address to ping...!

Re:The Story of the Ping Program by mixmastamyk on Wednesday January 09, 2013 @02:24PM (#5032928)
Reminds me of setting up a dish for DirecTV. Receiver (thru stereo) beeps loudly, frequency changing via signal strength, while someone points it on the roof.
Re:The Story of the Ping Program by l0c0b0x on Wednesday January 09, 2013 @01:18PM (#5032536)
I burst in laughter in the office.
Re:The Story of the Ping Program by jameswyse on Wednesday January 09, 2013 @03:37AM (#5030730)
Interesting story, I loved the vocoder idea!

Sadly Mike passed away in 2000:

    Sadly, Mike Muuss was killed in an automobile accident on November 20, 2000.
    His work lives on in testament to his intellect and indomitable spirit
    -- Lee A. Butler
Re:The Story of the Ping Program by js2 on Wednesday January 09, 2013 @10:15AM (#5031875)
It's interesting that ICMP ECHO_REQUEST and ECHO_REPLY predate the ping program. But indeed they are defined by http://tools.ietf.org/html/rfc792 from Sep 1981. I guess that Unix hosts were already replying to ECHO_REQUESTs even though this isn't prescribed till http://tools.ietf.org/html/rfc1122#page-42 from 1989. But I wonder what was sending ECHO_REQUEST before ping? The only other standard use of these packets I know of today is DHCP servers before handing out a lease to ensure a host isn't already using a given IP.

Phil Dykstra added ICMP Record Route support to PING, but in those early days few routers processed them

It must have been a narrow window in time when routers respected this option. My Internet career goes back to 1995 and I've never known a router to do so.

I was insanely jealous when Van Jacobson of LBL used my kernel ICMP support to write TRACEROUTE, by realizing that he could get ICMP Time-to-Live Exceeded messages when pinging by modulating the IP time to life (TTL) field. I wish I had thought of that! :-)

Asking a candidate to figure out how traceroute works is one of my interview questions, but if the author of ping didn't think of it, maybe I should drop the question. :)

The real traceroute uses UDP datagrams because routers aren't supposed to generate ICMP error messages for ICMP messages.

The Windows version I believe uses ICMP by default, and the Unix version, these days, can be asked to. I had always heard that routers do reply to ICMP, but at a lower priority.

Re:The Story of the Ping Program by zbowling on Wednesday January 09, 2013 @03:42AM (#5030746)
A shell script like the vocoder one in the article, this works:

  ping google.com | while read line; do 
     echo $line | sed -n 's/^.*time=\(.*$\).*$/\1/p' | xargs say
  done
Says the ping time to google out loud on a Mac.
Re:The Story of the Ping Program by robinhouston on Wednesday January 09, 2013 @04:20AM (#5030814)
I know Perl is no longer fashionable, but it’s still the simplest way to do this sort of ad hoc processing I think.

  ping google.com | perl -ne '/time=(.*)/ && system("say", $1)'
Of course it’s only a little more awkward in Ruby:

  ping google.com | ruby -ne '$_ =~ /time=(.*)/ && system("say", $1)'
(No criticism is intended of your perfectly fine code. I enjoy comparing different ways to do things like this, and perhaps others do too.)
Re:The Story of the Ping Program by gvalkov on Wednesday January 09, 2013 @05:45AM (#5030973)
For the sake of comparison, here's the corresponding Python one-liner:

   ping google.com | python -c 'import os,re,sys; [os.system("say %s" % j[0]) for j in  (re.findall("time=(.*)", i) for i in sys.stdin) if j]'
I'm sure someone can come up with a shorter one-liner, but in general I think Python is simply too verbose for this kind of stuff.
Re:The Story of the Ping Program by kator on Wednesday January 09, 2013 @06:16AM (#5031046)
Add a delay so say can keep up:

ping -i 5 8.8.8.8 | perl -ne '/time=(.*)/ && system("say", $1)'

Re:The Story of the Ping Program by fgribreau on Monday January 14, 2013 @04:45PM (#5056858)
In NodeJS (tested on Mac 10.7)

   ping g.cn | node -e "process.stdin.on('data',function(l){require('child_process').exec('say '+/time=([0-9]*)/g.exec(l+'')[1])}).resume()"
Re:The Story of the Ping Program by gautamc on Wednesday January 09, 2013 @02:51PM (#5033108)
On linux I used espeak. ping google.com | ruby -ne '$_ =~ /time=(.*)/ && system("espeak", "-s 120", $1);'
Re:The Story of the Ping Program by laumars on Wednesday January 09, 2013 @06:13AM (#5031043)
Nice code, but I think a more robust method would be using the return codes from ping:

    while (true) do ping -c1 -w3 google.com && say "ping" && sleep 3; done
Re:The Story of the Ping Program by kator on Wednesday January 09, 2013 @06:12AM (#5031040)
Best part is the source is in a SHAR..

Wow that brought back memories.

I doubt most people here even know what a SHAR is.

The other day in a group of engineers at my work I made a joke about SHAR and NOBODY even knew what a SHAR was.

It's like making a joke at a party that "Dates you".. :)

Re:The Story of the Ping Program by simonh on Wednesday January 09, 2013 @06:58AM (#5031135)
I had that happen a few years ago. Nobody had heard of uucp either. Someone once asked me what the first browser I ever used was and when I said Lynx, they thought it was fork of Firefox.
Re:The Story of the Ping Program by CodeMage on Wednesday January 09, 2013 @08:27AM (#5031343)
lynx, gopher, irc... Now I feel old, despite being only 34...
Re:The Story of the Ping Program by johncoltrane on Wednesday January 09, 2013 @03:39AM (#5030739)
I know HN is not reddit (and the link is relatively old), but check this alternative take on the history of Ping:

http://www.amazon.com/Story-about-Reading-Railroad-Books/dp/...

BTW, someone has to write a long form article or a thesis on the Amazon Customer Reviews scene…

Re:The Story of the Ping Program by zschallz on Wednesday January 09, 2013 @02:44AM (#5030634)
Interesting read. Was sad to click through to his homepage and find out that he had already passed away in 2000 due to an automobile accident.
Re:The Story of the Ping Program by dexcs on Wednesday January 09, 2013 @02:37AM (#5030619)
I would like to know how they could maintain this webserver all the years... Rock solid :-) "This Web server was one of the first 50 Web servers on the InterNet"
Re:The Story of the Ping Program by code0 on Wednesday January 09, 2013 @04:58AM (#5030887)
This is pretty hilarious from the amazon review quoted in the article:

But even with these problems, The Story About Ping has earned a place on my bookshelf, right between Stevens' Advanced Programming in the Unix Environment, and my dog-eared copy of Dante's seminal work on MS Windows, Inferno. Who can read that passage on the Windows API ("Obscure, profound it was, and nebulous, So that by fixing on its depths my sight -- Nothing whatever I discerned therein."), without shaking their head with deep understanding. But I digress.

Re:The Story of the Ping Program by csense on Wednesday January 09, 2013 @06:14PM (#5034174)
On the latest release of Linux Mint, I did the following (it should also work for Debian, Ubuntu and other Debian-like systems):

  sudo apt-get install espeak
  HOST=127.0.0.1
  ping $HOST | sed -u -e 's/.*/ping/' | espeak -v en
The -u (unbuffered) option to sed was required to get it to work. Apparently, the problem is that Mint's version of sed (GNU sed version 4.2.1) will buffer too aggressively for this usage when the output is not a terminal. It was a little confusing to troubleshoot since the output looked OK without the last pipe, the espeak command seemed to work when you just run it and type stuff in directly, but putting them together yielded silence without the -u switch.
Re:The Story of the Ping Program by hayksaakian on Wednesday January 09, 2013 @02:30AM (#5030604)
A great snippet posted by the author in the OP.

"The book describes networking in terms even a child could understand, choosing to anthropomorphize the underlying packet structure. The ping packet is described as a duck, who, with other packets (more ducks), spends a certain period of time on the host machine (the wise-eyed boat). At the same time each day (I suspect this is scheduled under cron), the little packets (ducks) exit the host (boat) by way of a bridge (a bridge). From the bridge, the packets travel onto the internet (here embodied by the Yangtze River)."

Re:The Story of the Ping Program by pjungwir on Wednesday January 09, 2013 @01:07PM (#5032481)
This seems like a lovely wry way of expressing YAGNI/MVP/shipping:

    If I'd known then that it would be my most famous accomplishment in life, I might have worked on it another day or two and added some more options.
Re:The Story of the Ping Program by hmart on Wednesday January 09, 2013 @10:31AM (#5031942)
From the home page of the late Michael John Muuss : "Unlike every other document on the Web, this page is in final form and completely finished. grin"
Re:The Story of the Ping Program by neilmiddleton on Wednesday January 09, 2013 @06:08AM (#5031027)
Not entirely sure what the last comment is talking about…
Re:The Story of the Ping Program by n0nick on Wednesday January 09, 2013 @08:26AM (#5031340)
It's a quote from the server's homepage http://ftp.arl.army.mil/
Re:The Story of the Ping Program by Xbin on Wednesday January 09, 2013 @02:58AM (#5030666)
I agree,That is a great story of using ping!
Re:The Story of the Ping Program by timc3 on Wednesday January 09, 2013 @09:12AM (#5031524)
Wonderful. The vocoder idea is fantastic