The Story of the PING Program
ping for UNIX.
Ping is a little thousand-line hack that I wrote in an evening which
practically everyone seems to know about. 🙂
I named it after the sound that a
sonar makes, inspired by the whole principle of echo-location.
In college I’d done a lot of modeling of sonar and radar systems,
so the “Cyberspace” analogy seemed very apt.
It’s exactly the same paradigm applied to a new problem domain:
ping uses timed IP/ICMP ECHO_REQUEST and ECHO_REPLY packets
to probe the “distance” to the target machine.
My original impetus for writing PING for 4.2a BSD UNIX came from
an offhand remark in July 1983 by Dr. Dave Mills while we were attending
a DARPA meeting in Norway, in which he described some work that he
had done on his “Fuzzball” LSI-11 systems to measure path latency
using timed ICMP Echo packets.
In December of 1983 I encountered some odd behavior of
the IP network at BRL.
Recalling Dr. Mills’ comments, I quickly coded up the PING
program, which revolved around opening an ICMP style SOCK_RAW AF_INET
Berkeley-style socket(). The code compiled just fine, but it didn’t work —
there was no kernel support for raw ICMP sockets!
Incensed, I coded up the kernel support and had
everything working well before sunrise. Not surprisingly, Chuck Kennedy
(aka “Kermit”) had found and fixed the network hardware before I was
able to launch my very first “ping” packet. But I’ve used it a few
times since then. *grin* 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.