January 5, 2007
Everyone loves ping. It's simple. It's utilitarian. And it does exactly what the sonar inspired name implies. Ping tells you if a remote computer is responding to network requests.
The ping utility was written by Mike Muuss, a senior scientist at the U.S. Army Research Laboratory. Mike also wrote ttcp, which I'm a big fan of. I've used the PC port of ttcp many times to test network throughput.
Mike was tragically killed in an automobile accident 7 years ago, but his legacy lives on in Ping:
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. 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.
Ping isn't very useful on today's internet because most routers and hosts filter it out. But it's still quite useful on local networks; not a month goes by that I'm not pinging something. Ping is always a solid starting point, but sometimes you'll need to perform deeper network diagnostics, too.
Of course, we can't talk about ping without mentioning one of the most famous Amazon book reviews of all time.
PING! The magic duck!
Using deft allegory, the authors have provided an insightful and intuitive explanation of one of Unix's most venerable networking utilities. Even more stunning is that they were clearly working with a very early beta of the program, as their book first appeared in 1933, years (decades!) before the operating system and network infrastructure were finalized.
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).
The title character -- er, packet, is called Ping. Ping meanders around the river before being received by another host (another boat). He spends a brief time on the other boat, but eventually returns to his original host machine (the wise-eyed boat) somewhat the worse for wear.
If you need a good, high-level overview of the ping utility, this is the book. I can't recommend it for most managers, as the technical aspects may be too overwhelming and the basic concepts too daunting.
As good as it is, The Story About Ping is not without its faults. There is no index, and though the ping(8) man pages cover the command line options well enough, some review of them seems to be in order. Likewise, in a book solely about Ping, I would have expected a more detailed overview of the ICMP packet structure.
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.
It's a timeless geek humor classic. The original was posted in March 1999 by an anonymous reviewer from "Upper Volta, Uzbekistan". It must have been deleted by Amazon, because it was reinstated by another reviewer later in 2000.
You may be familiar with the command line version of Ping, and maybe even the book, but did you ever play the arcade version of Ping?
It's milliseconds of fun for the entire family.
Posted by Jeff Atwood
Yes, it is a very simple, but useful function. I sometimes ping Google to find out if there is some problem with the Internet connection. Another useful, complementary utility is "tracert" (Windows) which gives more details about routing.
ping and the corisponding protocol it is based upon, is blocked on campus.
they use something else to test avalibility.
Mike was brilliant, if a bit idiosyncratic. I had the pleasure and honor of working with him early in my career. I remember watching in awe as he implemented a virtual memory object system, entirely in C, so that we could fit our large CAD models into a PDP-11's address space (64K (not M) bytes of data and 64K bytes of program). It took him maybe a day or two.
We used it to compute this object: http://www.cs.utah.edu/gdc/pics/images/bulkhead1.gif, and I'm pretty sure, this more complex one, too: http://www.cs.utah.edu/gdc/pics/images/blades.gif
Mike was a hacker, in the best sense of the word. He may have written code quickly, but it was never dirty. Our world is poorer without him.
Interesting that you ping www.yahoo.com in your screenshot. For some reason, that's my habit when testing an internet connection. I always ping yahoo. I wonder how much ping traffic they get.
I think it's because ping predates Google.. and Yahoo was around much earlier.
From a linguistic perspective, of course, hardly a day goes by when I don't ping someone to get their insight/opinion/schedule on something, or to remind them about something. I am guessing that a fair percentage of people where I work who say "I'll ping so-and-so" don't know exactly where this comes from.
I always do this to troubleshoot connectivity at a wifi spot, etc:
ping 188.8.131.52 (easy to remember and doesn't need DNS)
ping www.google.com (to test DNS)
telnet www.google.com 80 (to test HTTP outbound and DNS)
It takes 5-10 seconds, and you know that everything *should* be working after that. It's also incremental in nature in terms of the stack, so you'll know what the issue is based on how far you've made it with those three tests.
Here's my tip.
Use "ping -t (host)" to repeatedly ping a server while it's restarting, rebooting, etc.
You'll know it's back up when it is responding to pings..
The arcade classic Pong was called Ping in the UK, as "pong" here is slang for a noxious odour :-)
If 'ping' works on your local Windows network, and you've not enabled file sharing or otherwise opened TCP port 445 (e.g. through Group Policy), it may be a sign that Windows Firewall is not enabled. In its default configuration, Windows Firewall rejects ICMP Echo Request packets.
Ping itself probably isn't harmful - although it gives attackers an indication that a host is alive - but leaving your computers open to attack definitely is. You may think you're secure but if you have any users with laptops that they take home or to customer sites, it's quite possible for them to get infected off-site then infect everyone else when they bring the laptop back to the office (or onto the VPN). Don't trust any other machines - use a software firewall.
I find it sad nobody mentioned the "ping of death". If you flood pinged windows (95?) machines, they would become unresponsive and then either BSOD (blue screen of death) or reboot, I don't remember which.
Actually, the "ping of death" was not a flood of ICMP Echos. It's simply one ICMP Echo with over 65536 bytes in the payload directed at a host. Remember, 64 bytes is the default. The packet would be fragmented in order to be transmitted to the destination due to its size being larger than the MTU. The receiving host would attempt to reconstruct the overly large packet from the fragments and overflow a buffer causing itself to panic/hang/need rebooting/reboot.
Categorical blocking of all ICMP is something that ignorant security paranoid people do. It drops out "ping" too.
At the same time they break TCP Path-MTU, and when IPv6 comes into true use, they break their entire network.
In many web-site cases the published one/two IP addresses for the site are actually handled by a "load-balancer switch", which diverts incoming TCP connection flows to real back-end servers. At the same time they don't (at all) support ICMP redirecting - which may cause surprising effects with TCP Path-MTU.
(All the world can carry full-size ethernet frames of 1500 bytes each? Yeah, right... Consider PPPoE, and realize that present world is by default running with "don't fragment" bit set..)
traceroute can use ICMP too, but original UNIX traceroute used UDP, thus all its UNIX descendants use that by default, while some can use also ICMP.
And you might also find this entertaining (and serious) explanation of how traceroute works useful in explaining it to your less technical colleagues: http://samspade.org/d/traceroute.html
I was wondering, if my kid brother was on the xbox 360 online all day and one day I got tired of it, but he was smart enough to check to see if everythings plugged in, is there a way that I could ping the xbox on the network to make it lag bad or time out or something?