Developer & Network Tools

Ping: What It Tests and What It Misses

Learn how ping works, how to read its output, and why a failed ping doesn't always mean down.

Key takeaways

  • Ping uses ICMP echo requests and replies to test reachability and round-trip time.
  • A successful ping says nothing about whether a particular port or application works.
  • No reply can mean the host is down, or just that a firewall drops ICMP.
  • Pinging your gateway, a public address and a name in turn narrows down where a fault lies.
  • Run enough samples to see loss and variation, not only a single time.

Ping sends a small message to another host and waits for it to come back. A reply proves that packets can travel to that address and return, and it tells you how long the trip took. It doesn't prove that a website, mail server or any other service on that host is working.

That gap explains most confusion about ping. It's an excellent first test, as long as you know which question it answers.

How ping works

Ping relies on ICMP, the Internet Control Message Protocol, which carries error and diagnostic messages alongside IP. Your computer sends an echo request. A host that receives it and is willing to answer sends back an echo reply carrying the same data. IPv6 uses the equivalent messages in ICMPv6.

ICMP has no port numbers. It isn't TCP or UDP, so "ping port 443" isn't a thing that ordinary ping can do. To test a port, you need other methods, described in testing a port from the command line.

One ping to an example host
Your computer Router 192.0.2.10 ICMP echo request 1 A timer starts Forwarded hop by hop 2 Each router lowers the time to live ICMP echo reply 3 Same payload sent back Reply arrives 4 Elapsed time is the round trip Your computer Router 192.0.2.10 ICMP echo request 1 A timer starts Forwarded hop by hop 2 Each router lowers the time to live ICMP echo reply 3 Same payload sent back Reply arrives 4 Elapsed time is the round trip

Basic commands

On Windows, ping sends four requests and stops:

ping example.com
ping -n 20 example.com
ping -t example.com
ping -4 example.com
ping -6 example.com

The -n option sets the count, -t runs until you press Ctrl+C, and -4 or -6 forces the IP version.

On Linux and macOS, ping normally runs until you stop it:

ping -c 20 example.com
ping -i 2 -c 10 example.com

Here -c sets the count and -i sets the interval in seconds. On Linux, -4 and -6 choose the IP version; macOS has traditionally offered a separate ping6 command, though newer releases may differ.

Reading the output

A typical reply line from Linux looks like this:

64 bytes from 192.0.2.10: icmp_seq=3 ttl=54 time=23.4 ms
  • icmp_seq numbers the requests. A gap means a reply is missing, and numbers out of order mean replies were reordered.
  • ttl is the time to live left on the reply when it reached you. Hosts start it at a set value and each router subtracts one, so it hints at distance. TTL and hop limits explains the mechanism.
  • time is the round-trip time in milliseconds.

The summary at the end shows packets sent and received, the loss percentage, and the minimum, average and maximum times. Linux and macOS also show a measure of how much the times spread out.

Low, steady times are what you want. A wide gap between minimum and maximum suggests variation, often called jitter. Ping, jitter and packet loss covers how each affects calls and games.

Distance sets a floor. A reply from another continent can't be as quick as one from your own city, however fast your plan is, because signals take time to travel.

Error messages

The wording varies by system, but the main cases are these:

Name not found (such as "could not find host" or "Name or service not known"). The name never turned into an address. Nothing was pinged. Look at DNS.

Request timed out or simply silence. The request or reply was lost, or something chose not to answer.

Destination host unreachable. Your machine or a router along the way reports that it can't deliver the packet. If the message comes from your own address, the local network lookup probably failed. If it comes from another router, that device lacks a way forward.

Network is unreachable. Your system has no route for the destination, often because there's no default gateway or no connectivity for that IP version.

TTL expired in transit or "time to live exceeded". The packet ran out of hops, which can indicate a routing loop.

A short troubleshooting ladder

Ping becomes useful when you test progressively farther targets.

Where does the connection break?
Does a ping to 127.0.0.1 fail? YES The network software on this computer has a problem. 1 NO Does a ping to your default gateway fail? YES Check Wi-Fi or cable, your IP address and the router. 2 NO Does a ping to a known public IP address fail? YES Suspect the modem, the ISP link or upstream routing. 3 NO Does a ping by name fail while the address works? YES Look at DNS settings or the resolver. 4 NO Basic path is fine Test the actual service: port, protocol and application. Does a ping to 127.0.0.1 fail? 1 IF YES The network software on this computer has a problem. NO Does a ping to your default gateway fail? 2 IF YES Check Wi-Fi or cable, your IP address and the router. NO Does a ping to a known public IP address fail? 3 IF YES Suspect the modem, the ISP link or upstream routing. NO Does a ping by name fail while the address works? 4 IF YES Look at DNS settings or the resolver. NO Basic path is fine Test the actual service: port, protocol and application.

Your default gateway is usually your router's address, which you can find with the commands in reading your network setup. Pinging 127.0.0.1, the loopback address, never leaves your machine. For a public address, a well-known public DNS resolver that answers ping is a common choice.

What a failed ping does not prove

Many firewalls and cloud services drop incoming echo requests by default. A web server can be serving pages perfectly while ignoring ping. Windows computers also commonly block inbound echo requests depending on the network profile.

So before declaring something down, try the service itself: load the page, or run curl -I https://example.com. If the service works and ping doesn't, nothing is broken.

Routers also treat packets addressed to themselves as low priority. A router may forward your traffic quickly while answering pings slowly or only occasionally. Loss when pinging a router is weaker evidence than loss when pinging something beyond it.

What a successful ping does not prove

A reply shows that some device at that address answered. It doesn't show that the web server process is running, that the certificate is valid, that the database is reachable, or that large packets get through.

It may not even show you're reaching the machine you think. A name can resolve to an unexpected address, and with anycast, the same address is answered from many locations, so your reply may come from a nearby copy.

Ping also tells you little about throughput. A connection can have excellent ping times and poor download speed, or the reverse. And a ping on an idle line hides delay that appears only under load, the problem described in bufferbloat. To see it, ping continuously while a large upload runs.

What a ping result can and cannot tell you
It can show A name resolved to an address Packets reach it and return Round-trip time and variation Loss across the samples you sent It cannot show That a port or app is working Download or upload speed Which hop caused a delay That silence means the host is down VS It can show A name resolved to an address Packets reach it and return Round-trip time and variation Loss across the samples you sent It cannot show That a port or app is working Download or upload speed Which hop caused a delay That silence means the host is down

Testing packet size

Some faults only affect large packets, often because of a mismatched maximum transmission unit, or MTU. You can ask ping to send a given payload size without allowing fragmentation.

Windows:  ping -f -l 1472 example.com
Linux:    ping -M do -s 1472 example.com
macOS:    ping -D -s 1472 example.com

Some users have reported that on certain macOS releases -D doesn't set the don't-fragment flag, so if every size succeeds there, confirm the result from another system.

A payload of 1472 bytes plus 28 bytes of IPv4 and ICMP headers makes 1500 bytes, the usual Ethernet MTU. If that fails but smaller values work, the path has a lower limit, which is common with some tunnels and VPNs. MTU, MSS and fragmentation explains what to do about it.

Interpreting patterns over time

A single run is a snapshot. Longer runs show shapes that point toward causes, though none of them is proof on its own.

Steady times with no loss mean the path is healthy for small packets. Occasional large spikes on Wi-Fi, absent on a cable, usually involve radio interference, weak signal or a device scanning for networks. Times that climb whenever someone streams or backs up photos suggest a full queue in your router or modem. Loss that comes in bursts, with long clean stretches between, can indicate a faulty cable or connector, or a provider-side fault worth reporting. Complete silence that begins at one moment and doesn't recover is a plain outage somewhere along the path.

When you report a problem to a provider, send the evidence in a form they can use: the time and time zone, the target, whether you were wired, the packet counts and the summary lines. Two sets of results, one to your router and one to a distant host, show that you've already ruled out the home network.

Ping in monitoring

Many monitoring tools ping devices on a schedule and raise an alert when replies stop. It's a cheap way to watch routers, switches and printers. For websites and applications it's too shallow, so pair it with a check that requests a real page and looks at the response. Website uptime monitoring explains how those checks differ.

Alert on several missed replies in a row, not on one. A lone dropped packet is ordinary, and alerts that fire for it soon get ignored.

Good habits

Send at least 20 to 50 samples when investigating intermittent trouble. Compare wired and wireless results to separate a Wi-Fi problem from an internet one. Note the time of day, since congestion often follows a pattern. Save the output before rebooting anything.

When you need to know where along the path delay or loss begins, move on to traceroute or MTR, which build on the same ideas one hop at a time.

Be considerate with other people's systems. A few pings are normal; rapid, continuous pinging of a host you don't run is unwelcome and may get your address blocked.

Common questions

What is a good ping time?

It depends on how far away the target is and what you're doing. Compare against your own normal results for the same target. Interactive uses such as calls and games feel better with low and steady times, while file downloads hardly notice.

Should my computer answer pings?

Answering on a trusted home or office network helps troubleshooting. Blocking echo requests on public networks is a reasonable default. Avoid blocking all ICMP, especially in IPv6, because other ICMP messages are needed for networking to work properly.

Written for 4Internet with AI writing tools and not reviewed line by line by a person. Check anything you rely on with the maker, provider or standard concerned. Report an error.

Keep reading

All 45 articles in Developer & Network Tools →

Latest news on this topic