How ping Works
When you run ping google.com, your operating system sends an ICMP Echo Request packet to the destination. If the host is reachable and not blocking ICMP, it returns an ICMP Echo Reply. Your system records the elapsed time between sending the request and receiving the reply — this is the round-trip time (RTT), reported in milliseconds.
ping repeats this process once per second by default, building a statistical picture of reachability and latency over time. At the end of a session you receive a summary showing the minimum, average, maximum, and (on Linux) standard deviation of RTT, along with the percentage of packets that received no reply (packet loss).
This simplicity makes ping the first tool to reach for in any network investigation. Before examining routes, DNS, or application behaviour, confirming that a host responds to ping rules out the most fundamental problems.
Basic Syntax
The simplest invocation is just the command followed by a hostname or IP address:
ping google.com
ping 8.8.8.8
On Linux and macOS, this runs indefinitely until you press Ctrl+C. On Windows, ping sends exactly four packets and exits. To send a fixed number of packets on Linux and macOS, use the -c flag:
ping -c 4 google.com
To force continuous pinging on Windows, use -t:
ping -t google.com
Key Flags: Windows vs Linux and macOS
The flags differ between platforms. The table below covers the most commonly used options.
| Purpose | Linux / macOS flag | Windows flag |
|---|---|---|
| Limit packet count | -c <count> |
-n <count> |
| Ping continuously | default behaviour | -t |
| Set interval between pings | -i <seconds> |
not directly supported |
| Set packet size (bytes) | -s <size> |
-l <size> |
| Force IPv4 | -4 |
-4 |
| Force IPv6 | -6 |
-6 |
| Set TTL on outgoing packets | -t <ttl> (macOS) / -T <ttl> (Linux) |
-i <TTL> |
| Suppress DNS resolution | -n |
-a resolves; omit to suppress |
Reading the Output
A typical ping session on Linux looks like this:
PING google.com (142.250.80.46) 56(84) bytes of data.
64 bytes from lga34s32-in-f14.1e100.net (142.250.80.46): icmp_seq=1 ttl=117 time=11.4 ms
64 bytes from lga34s32-in-f14.1e100.net (142.250.80.46): icmp_seq=2 ttl=117 time=11.2 ms
64 bytes from lga34s32-in-f14.1e100.net (142.250.80.46): icmp_seq=3 ttl=117 time=11.6 ms
64 bytes from lga34s32-in-f14.1e100.net (142.250.80.46): icmp_seq=4 ttl=117 time=11.3 ms
--- google.com ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3005ms
rtt min/avg/max/mdev = 11.2/11.375/11.6/0.148 ms
Each reply line shows the bytes returned, the resolved hostname and IP, the sequence number (icmp_seq), the TTL value from the reply, and the round-trip time. The summary gives total packets sent and received, the loss percentage, total elapsed time, and RTT statistics.
What TTL Values Tell You
TTL (Time To Live) starts at a value set by the sending OS and decrements by one at each router hop. Common starting values are 64 for Linux and macOS, 128 for Windows, and 255 for many network devices. Because the returned TTL is the starting value minus the number of hops traversed, you can estimate the remote OS. A reply TTL of 117 suggests a Windows host (128 − 11 hops) or a Linux host that started at 128. This is a rough heuristic, not a definitive identification.
High Ping vs Packet Loss
High RTT and packet loss are different problems. Consistently high RTT (say, 200 ms to a server that should be 20 ms) typically points to congestion, a suboptimal route, or a distant server. Packet loss — replies that never arrive — indicates something more serious: a congested or failing link, a router dropping packets under load, or a firewall silently discarding ICMP. Even 1–2% sustained packet loss will significantly degrade real-time applications. Run a speed test alongside ping to correlate bandwidth and latency simultaneously.
When ping Fails to Prove Anything
A failed ping does not prove a host is down. Many servers, firewalls, and cloud load balancers are configured to silently drop ICMP Echo Requests while still serving TCP traffic normally. Conversely, a host that responds to ping may still be unreachable on the TCP port your application needs. If ping fails but you suspect the host is up, try connecting to a specific port with curl or a TCP-based tool before concluding the host is offline.
Frequently Asked Questions
What does ping measure?
ping measures round-trip time (RTT) — the time in milliseconds for a packet to travel from your machine to a target host and back. It also reports packet loss percentage, which indicates how many probes received no reply.
What does TTL mean in ping output?
TTL stands for Time To Live. Each router that forwards a packet decrements the TTL by one; if it reaches zero, the packet is discarded. The TTL value you see in ping replies is the remaining TTL after the packet has traversed all hops. Common starting values are 64 (Linux/macOS), 128 (Windows), and 255 (Cisco/network devices), so the returned TTL gives a rough indication of the remote OS.
What is a good ping response time?
For most internet destinations, under 20 ms is excellent, 20–60 ms is good, 60–150 ms is acceptable for general browsing, and above 150 ms starts to feel sluggish for real-time applications like video calls or online gaming. Latency to local servers should typically be under 5 ms.
Why does ping say "Request timed out"?
"Request timed out" means no ICMP Echo Reply arrived within the wait period. The most common causes are: the target host is unreachable or offline, a firewall between you and the target is silently dropping ICMP packets, or the target OS is configured to not respond to pings. A timed-out ping does not definitively mean the host is down — many servers block ICMP for security reasons.
What is the difference between ping and traceroute?
ping tests reachability and measures RTT to a single destination in aggregate. traceroute reveals the individual hops (routers) along the path and measures latency at each hop, letting you pinpoint where in the network delay or loss is introduced. Use ping for a quick health check; use traceroute when you need to locate the source of a problem.
How do I ping continuously on Windows vs Linux?
On Windows, ping runs for 4 packets by default. To ping continuously use ping -t hostname. Press Ctrl+C to stop and see summary statistics. On Linux and macOS, ping runs continuously by default. To limit to a specific count, use ping -c 10 hostname. To stop a continuous ping, press Ctrl+C.