Ping is a computer network administration software utility used to test the reachability of a host on an Internet Protocol network. It is available for virtually all operating systems that have networking capability, including most embedded network administration software.
Function: Send ICMP ECHO_REQUEST to network hostsSyntax: ping [-aAbBdDfhLnOqrRUvV6] [-c count] [-F flowlabel] [-i interval] [-I interface] [-l preload] [-m mark] [-M pmtudisc_option] [-N nodeinfo_option] [-w deadline] [-W timeout] [-p pattern] [-Q tos] [-s packetsize] [-S sndbuf] [-t ttl] [-T timestamp option] [hop …] destination.
A ping network test transmits data packets to a specific IP address and either confirms or denies there is connectivity between IP-networked devices.
In the case of confirmation, you will discover the “latency” (i.e., the length of the response time) by performing a ping test. A lower latency provides a better experience, as even milliseconds can matter in situations, like online gaming, where a fast response is essential.
If the ping fails, this can point to the need for further investigation to locate the root cause. So, how does pinging a network work?
What is ping exactly?
Users can send a ping command through a Windows, Mac, or Linux computer. It’s a helpful utility that’s been around since the early 80’s. The term comes from sonar technology, which sends out a sound wave and then listens for a ping (or echoes) in return. The longer the interval, the farther away an object must be.
The same principle applies to networks as data requests route around the globe. Pinging can also call out network congestion or other latency problems, such as a server being down. Running a ping test is fairly straightforward.
How to run a ping network test
The steps to executing a ping network test depend upon the operating system you’re using.
For Windows 10, go to Search in the taskbar and:
- Type “cmd” to bring up the Command Prompt.
- Open the Command Prompt.
- Type “ping” in the black box and hit the space bar.
- Type the IP address you’d like to ping (e.g., 192.XXX.X.X).
- Review the ping results displayed.
For Macs, follow the same cadence by opening Network Utility and inputting the hostname or IP address you’d like to ping.
For Linux, open Terminal. You can also use the traceroute command to review the different IP addresses your request routes through. To do this, simply:
- Open Terminal.
- Type “traceroute” followed by the IP address or URL you wish to trace.
- Hit Enter and review the results.
What are some common addresses to ping?
When performing your ping tests, you might do so by simply checking your own internet connectivity. To accomplish this, you want to ensure that the IP address you’re pinging is indeed up and functioning.
While every address could experience downtime at some point, some dependable choices for you to ping include:
- 220.127.116.11 and 18.104.22.168 (OpenDNS)
- 22.214.171.124 and 126.96.36.199 (Cloudflare)
- 188.8.131.52 and 184.108.40.206 (Google DNS)
If you don’t receive a response when running a ping test for connectivity for these IP addresses, this likely means there is a problem on your end.
HOW TO USE PING COMMAND TO TEST YOUR NETWORK
The ping command sends packets of data to a specific IP address on a network, and then lets you know how long it took to transmit that data and get a response. It’s a handy tool that you can use to quickly test various points of your network. Here’s how to use it.
How Does Ping Work?
Ping comes from a term used in sonar technology that sends out pulses of sound, and then listens for the echo to return. On a computer network, a ping tool is built into most operating systems that works in much the same way. You issue the ping command along with a specific URL or IP address. Your computer sends several packets of information out to that device, and then waits for a response. When it gets the response, the ping tool shows you how long each packet took to make the round trip—or tells you there was no reply.
It sounds simple, and it is. But you can use it to good effect. You can test whether your computer can reach another device—like your router—on your local network, or whether it can reach a device on the Internet. This can help you determine if a network problem is somewhere on your local network, or somewhere beyond. The time it takes packets to return to you can help you identify a slow connection, or if you’re experiencing packet loss.
And it pretty much doesn’t matter what operating system you’re using. Pull up a terminal or Command Prompt window, and you can use ping on macOS, Linux, or any version of Windows.
How to Use Ping
We’re going to use the Windows Command Prompt in our example here. But you can also use the ping command in Windows PowerShell, or in the Terminal app on macOS or any Linux distro. Once you get to using the actual command, it works the same everywhere.
In Windows, hit Windows+R. In the Run window, type “cmd” into the search box, and then hit Enter.
At the prompt, type “ping” along with the URL or IP address you want to ping, and then hit Enter. In the image below, we’re pinging www.howtogeek.com and getting a normal response.
That response shows the URL you’re pinging, the IP address associated with that URL, and the size of the packets being sent on the first line. The next four lines show the replies from each individual packet, including the time (in milliseconds) it took for the response and the time-to-live (TTL) of the packet, which is the amount of time that must pass before the packet is discarded.
At the bottom, you’ll see a summary that shows how many packets were sent and received, as well as the minimum, maximum, and average response time.
And in the next image, we’re pinging the router on our local network using its IP address. We’re also getting a normal response from it.
When the ping tool does not get a response from whatever devices you’re pinging, it lets you know that, too.
And that’s how to use ping at its most basic. Of course, like most commands, there are some advanced switches you can use to make it behave a bit differently. For example, you can have it keep pinging a destination until you stop the command, specify the number of times you want it to ping, set how often it should ping, and more. But unless you’re doing some very specific types of troubleshooting, you won’t need to worry much about those advanced switches.
If you’re curious about them, though, just type “ping /?” at the Command Prompt to see a list.
So, What Can You Do With Ping?
Now that you know how to use the command, here are some interesting things you can do with it:
- Ping a URL (like www.howtogeek.com) or IP address to see if you can reach an internet destination. If you get a successful response, you know that all the networking devices between you and that destination are working, including the network adapter in your computer, your router, and whatever devices exist on the internet between your router and the destination. And if you’re interested in exploring those routes further, you can use another networking tool named tracert to do just that.
- Ping a URL to resolve its IP address. If you want know the IP address for a particular URL, you can ping the URL. The ping tool shows you right at the top the IP address it’s working with.
- Ping your router to see if you can reach it. If you can’t successfully ping an internet location, you can then try pinging your router. A successful response lets you know that your local network is working okay, and that the problem reaching the internet location is somewhere out of your control.
- Ping your loopback address (127.0.0.1). If you can’t successfully ping your router, but your router appears to be turned on and working, you can try pinging what’s known as a loopback address. That address is always 127.0.0.1, and pinging it successfully lets you know that the network adapter on your computer (and the networking software in your OS) is working properly.
Note: You may not get a ping response from other computers on your local network because the built-in firewalls on those devices prevent them from responding to ping requests. If you want to be able to ping those devices, you’ll need to turn off that setting to allow pings through firewall
The list above uses a kind of outside-in approach, where you ping the furthest destination first, and then work your way in to the more local devices. Some people like to work inside-out by pinging the loopback address first, then their router (or another local device), and then an internet address.
And of course, what we’re talking about in this article is mostly about using ping to perform troubleshooting on a home or small business network. On larger networks, there’s a lot more complexity to worry about. Plus, if you’re tasked with troubleshooting larger networks, you probably already know how to use ping and many other networking tools.
What are other uses for ping?
Aside from performing the occasional ping test, you can also run ping continuously to maintain a constant influx of information. In Linux, the ping application runs until the user chooses to stop the process. To do this, hit CTRL and C simultaneously. The command is the same in Windows. And to keep ping going endlessly in that OS, type “ping -t” in the Command Prompt. Anything else…? Yes, there is.
If you’re looking for more complete pinging capabilities than are natively found in most operating systems, many third-party tools exist to chart and visualize your ping results. These can be helpful for creating quarterly reports for stakeholders.
Want more functionality? PagerDuty works hand in hand with many popular ping monitoring tool integrations. You can centralize these tools into a single point of ingestion, while gaining full visibility into your network health across your environment.
Drop your comment