As more and more IT Pros start their career as specialists, fewer and fewer come from a “in the trenches” IT background. I’ve found many that don’t know how to use or, in some cases, have never even heard of many of the basic diagnostic tools built into modern operating systems (e.g. ping & tracert). Case in point, this is a conversation I recently had with an Senior ASPX Web Developer:
Dev: “Hi Mike. I cannot get my development server. Can you check it for me?”
Me: “Lemme check…looks like it’s up and running. It’s responding to pings. What happens when you ping it?”
Dev: “It’s not working when I try to ping it.”
Me: “Okay. What error are you getting?”
Dev: “It just says the page cannot be found.”
Me: “Got that part. What do you get when you ping the server?”
Dev: “Um…Isn’t that what I’m doing?”
I’ll spare you the rest of the conversation, but you can probably guess where it went from there. In short, the highly-skilled web developer had such a laser beam skill set that she had never used (or even heard of) of this mysterious diagnostic tool named “ping”. It may seem impossible for someone to get to that level in their career having zero knowledge of such a fundamental tool but, I am sad to say, it happens more often than many want to admit.
But never let it be said that I am unwilling to do my part to fix the problem! Here is a quick primer on what is arguably the single most common (and basic) tool for network diagnostics: PING. If you already know about it, go you! If not, just read the rest of this post. I promise I won’t tell anyone 🙂
A Brief History of PING
Way back in 1983, a man named Mike Muuss came up with a nifty utility for leveraging the existing Internet Control Message Protocol (ICMP) as a means of diagnosing IP networks. Since the general mechanism of sending a signal, waiting for it to bounce back, and measuring the result was similar to how sonar technology works, he named his brainchild “PING”.
When to Use PING
There are any number of reasons why one would use the ping tool. Here are a couple of common ones:
- Scoping a Problem:
Ohnoes! The website www.example.com is giving a 404 error! Is the server down or just my web service?
- Monitoring Connectivity:
It seems like my workstation is having intermittent network disconnects. How many packets are being dropped?
How to Use PING
PING with a Target
It’s a snap. Just open a command line (Windows) or terminal (Linux) and type “ping” and the IP address or DNS name for the target. In its most basic form, that is the only required parameter! The resulting process will send the default number of pings (Windows is generally five but Linux can vary). When it’s done, a report is delivered with a calculation of the total “packet loss” (i.e. pings that failed to return).
ping [URL or IP address]
PING without a Target
PING with Advanced Parameters (and a Target)
Send more (or less) than the default number of pings:
ping -n [number of pings to send] [URL or IP]
Save the results to a file (to show your network guy):
ping [URL or IP] > [path]\ping-test.txt
NOTE: When sending output to a file, nothing is generally shown on the screen. But everything will be saved to the file and, since the file is named with the date, it will help you remember when you ran the test! If you want to stop the process before the define number of pings has finished, just use Ctrl + C to cancel (the pings already complete will still be in the file). Also, when using Linux the file path will be formatted differently.
Run a quick DNS query to get the URL (if any):
ping -a [URL or IP]
NOTE: This parameter is only available in Windows. To perform a similar action in Linux use NSLOOKUP (which we will discuss in a future post).
You can also combine parameters!
The below command will perform 100 pings against www.example.com, force the results to IPv4, and save the output to a text file in Windows:
ping -n 100 -4 www.example.com > C:\MyFile\ping-test.txt
So there you have it! You are now a certified ping engineer and are ready to wow all your sysadmin friends with your mad skillz. If they laugh at you, just tell yourself it’s because they are jealous.
Until next time!