How to check your Internet connection with Ping
Mac Tip #382, 29 April 2009
Use Ping to check an Internet connection.
The other day my Internet connection suddenly stopped working — I knew because Gmail showed an endless
Connecting … message, until it came up with
Failed to load ….
I tried some of the usual steps: restarting the modem and wireless devices. It didn’t seem to help.
That’s when I broke out Ping, a very handy free tool for checking Internet connections.
Ping is like sonar
Ping works rather like radar or sonar: it sends out little ‘blips’ into the network, and then listens to what comes back. If the ‘blips’ don’t return, then there’s nothing out there.
If the blips do return then you can learn some interesting information from how long they took.
Network Utility contains PingTo use Ping on your Mac open Applications > Utilities > Network Utility. The Network Utility window opens to display half a dozen tabs. Click on the Ping tab to call up the Ping interface.
Enter an address and start pinging
In the text box near the top of the window enter an Internet address, such as
Note: test this while you know for sure your Internet connection is working correctly. Some sites disable ping because it can be misused. Try various sites until you find one that does work, such as Google. Then, if you suspect at a later date that your Internet connection is not functioning, you’ll know which sites to ping.
Click the radio button to send only 10 pings, then click the Ping button.
What the Ping results mean
The results area in the lower part of the window now shows you what’s happening to those pings.
When you ping a network address your machine sends out a tiny packet of data (64 bytes). The site you ping sends back an ‘echo’ of the same data. That all takes a little time, measured in milliseconds. 1 millisecond (ms) = 1/1000th of a second.
I sent 4 pings. The results were:
Ping has started ... PING google.com (18.104.22.168): 56 data bytes 64 bytes from 22.214.171.124: icmp_seq=0 ttl=242 time=204.604 ms 64 bytes from 126.96.36.199: icmp_seq=1 ttl=242 time=201.161 ms 64 bytes from 188.8.131.52: icmp_seq=2 ttl=242 time=202.834 ms 64 bytes from 184.108.40.206: icmp_seq=3 ttl=242 time=201.866 ms --- google.com ping statistics --- 4 packets transmitted, 4 packets received, 0% packet loss round-trip min/avg/max/stddev = 201.161/202.616/204.604/1.292 ms
In the first few lines the important stuff is at the end:
time=204.604 ms. That tells me that the round trip for that ping took almost 205 milliseconds.
The first summary line tells me that my computer sent 4 packets, all 4 were received and 0% were lost.
The final summary line tells me the minimum, average, maximum trip times and the standard deviation.
Time and speed
The 200 or so milliseconds round trip to Google.com is a bit slow, probably because the Google.com machine I pinged is quite far away. For comparison I pinged my cable modem, located only a couple of metres from my Mac. This time the result was:
time=0.761 ms. Less than 1 millisecond, compared to 200.
When the network isn’t working
To simulate an Internet connection that wasn’t working, I started 10 pings to
google.com and then turned off my wireless connection. Here are the results, showing 90% packet loss:
Ping has started ... PING google.com (220.127.116.11): 56 data bytes 64 bytes from 18.104.22.168: icmp_seq=0 ttl=242 time=200.773 ms --- google.com ping statistics --- 10 packets transmitted, 1 packets received, 90% packet loss round-trip min/avg/max/stddev = 200.773/200.773/200.773/0.000 ms
These results show that only 1 ping got away before I broke the connection.
Test Ping before you need it
Ping can be a very handy tool if you suspect your Internet connection is giving you problems. It can prove an overall slow-down, or a failure to ‘talk’ with the outside world.
Some sites disable ping, because it has been misused in the past, so test it out before you need it, and figure out which sites do let you ping them.
Coming up soon: how to use Traceroute.