·11 min read

What is Ping? How ICMP Ping Works and Why Latency Matters

Ping is the most fundamental network diagnostic tool. With a single command, it tells you whether a host is reachable, how fast data travels to it, and whether packets are being lost along the way. It's often the first thing you run when something on the network isn't working.

What is Ping?

Ping is a network utility that tests whether a specific host (server, website, IP address) is reachable across a network. It measures the round-trip time (RTT) — how long it takes for a small packet of data to travel from your computer to the destination and back.

The name "ping" comes from sonar — the sound a submarine makes when it sends out a pulse and listens for the echo bouncing off objects. Network ping works the same way: send a signal, measure how long until the echo returns.

Ping was written by Mike Muussin December 1983 at the U.S. Army's Ballistic Research Laboratory. It's one of the oldest and most universally available network tools — built into every operating system: Windows, macOS, Linux, and even mobile devices.

Ping uses the ICMP(Internet Control Message Protocol) to send and receive messages. It doesn't use TCP or UDP — it operates at a lower level in the network stack, making it lightweight and fast.

How Ping Works — ICMP Under the Hood

When you ping a host, here's exactly what happens:

You run: ping google.com

Step 1: DNS Resolution
  → Your computer resolves google.com → 142.250.80.46

Step 2: Send ICMP Echo Request
  ┌──────────────────────────────────────────┐
  │ ICMP Echo Request (Type 8, Code 0)       │
  │ Source:      Your IP (73.42.115.200)     │
  │ Destination: 142.250.80.46              │
  │ Sequence:    1                           │
  │ Identifier:  12345                       │
  │ Payload:     56 bytes of data            │
  │ Timestamp:   [sent at T₀]               │
  └──────────────────────────────────────────┘
       │
       │  Travels through routers (hops)
       ▼
  Google's server at 142.250.80.46

Step 3: Receive ICMP Echo Reply
  ┌──────────────────────────────────────────┐
  │ ICMP Echo Reply (Type 0, Code 0)         │
  │ Source:      142.250.80.46               │
  │ Destination: Your IP (73.42.115.200)     │
  │ Sequence:    1                           │
  │ Identifier:  12345                       │
  │ Payload:     56 bytes (same data)        │
  └──────────────────────────────────────────┘

Step 4: Calculate RTT
  → RTT = T₁ (received) - T₀ (sent) = 12ms

Step 5: Repeat
  → Send next Echo Request with Sequence: 2
  → Default: every 1 second

ICMP Message Types

ICMP is not just for ping — it's a control protocol used for many network diagnostic purposes:

TypeNameUsed By
Type 0Echo ReplyPing (response)
Type 3Destination UnreachableNetwork errors, firewall blocks
Type 8Echo RequestPing (request)
Type 11Time ExceededTraceroute (TTL expired)
Type 5RedirectRouter optimization

Understanding Latency (Round-Trip Time)

Latency is the time delay between sending a request and receiving a response. In ping, it's measured as RTT (Round-Trip Time) in milliseconds (ms). Latency has several components:

Total Latency = Propagation + Transmission + Processing + Queuing

Components:
  Propagation delay   → Time for signal to physically travel the distance
                        (speed of light in fiber ≈ 200,000 km/s)
                        NYC → London (5,500 km) ≈ 28ms one-way

  Transmission delay  → Time to push all bits onto the wire
                        (depends on bandwidth and packet size)

  Processing delay    → Time for each router to examine and forward
                        (typically < 1ms per hop)

  Queuing delay       → Time spent waiting in router buffers
                        (varies — worst during congestion)

Example breakdown for a 45ms ping:
  ┌─────────────┬──────────┐
  │ Propagation  │  30ms    │  (physical distance)
  │ Processing   │   8ms    │  (12 router hops × ~0.7ms)
  │ Queuing      │   5ms    │  (buffer wait times)
  │ Transmission │   2ms    │  (putting bits on wire)
  ├─────────────┼──────────┤
  │ Total RTT    │  45ms    │
  └─────────────┴──────────┘

The Speed of Light Limit

There's a physical minimum latency that no technology can beat. Light in fiber travels at about 200,000 km/s, so the absolute minimum round-trip time from New York to Tokyo (10,800 km) is ~108ms. In practice, the actual path is longer than a straight line, so real-world latency is always higher.

Packet Loss — What It Means

Packet lossoccurs when one or more ping packets fail to reach the destination or the reply fails to return. It's expressed as a percentage:

Packet Loss = (Packets Sent - Packets Received) / Packets Sent × 100%

Example: Sent 100 packets, received 97
  → Loss = (100 - 97) / 100 × 100% = 3% packet loss
Packet LossQualityImpact
0%PerfectNo issues — ideal connection
1–2%AcceptableMinor glitches in VoIP/video; browsing unaffected
3–5%DegradedNoticeable quality issues in calls, gaming lag spikes
5–10%PoorVideo freezes, audio drops, significant retransmissions
10%+UnusableConnection is effectively broken for real-time applications

Common causes of packet loss include network congestion, faulty hardware (bad cables, failing switches), wireless interference, ISP issues, and overloaded servers. TCP-based applications (web browsing, file downloads) handle packet loss by retransmitting, but real-time applications (VoIP, gaming, video) suffer significantly.

Jitter — Why Consistency Matters

Jitter is the variation in latency between consecutive packets. Even if your average ping is low, high jitter means the connection is inconsistent — some packets arrive fast, others arrive late.

Low jitter (good):
  Ping 1: 25ms
  Ping 2: 27ms
  Ping 3: 24ms
  Ping 4: 26ms
  → Average: 25.5ms, Jitter: ~1.5ms ✓

High jitter (bad):
  Ping 1: 15ms
  Ping 2: 85ms
  Ping 3: 22ms
  Ping 4: 150ms
  → Average: 68ms, Jitter: ~55ms ✗

Jitter formula (average deviation):
  Jitter = avg(|RTT[i] - RTT[i-1]|) for all consecutive pairs

High jitter is especially harmful for VoIP calls (causes choppy audio), video conferencing (stuttering/buffering), and online gaming (rubber-banding, teleporting characters). For these applications, consistent 50ms latency is better than average 30ms with high jitter.

Using the Ping Command

Ping is available on every operating system. Here are common usage patterns:

Basic Ping

# Ping a domain
ping google.com

# Ping an IP address
ping 8.8.8.8

# Ping localhost (test your own network stack)
ping 127.0.0.1
ping localhost

Common Options

# Windows: sends 4 pings by default, then stops
ping google.com

# Linux/macOS: pings forever until Ctrl+C
ping google.com

# Specify number of pings
ping -c 10 google.com         # Linux/macOS: 10 pings
ping -n 10 google.com         # Windows: 10 pings

# Set interval between pings
ping -i 0.5 google.com        # Linux/macOS: every 0.5 seconds

# Set packet size (default: 56 bytes on Linux, 32 on Windows)
ping -s 1000 google.com       # Linux/macOS: 1000-byte payload
ping -l 1000 google.com       # Windows: 1000-byte payload

# Set TTL (Time To Live — max hops)
ping -t 64 google.com         # Linux/macOS: max 64 hops
ping -i 64 google.com         # Windows: max 64 hops

# Ping continuously on Windows
ping -t google.com             # Press Ctrl+C to stop

# Force IPv4 or IPv6
ping -4 google.com             # IPv4 only
ping -6 google.com             # IPv6 only

Reading Ping Results

Here's how to read a typical ping output:

$ ping -c 5 google.com

PING google.com (142.250.80.46): 56 data bytes
64 bytes from 142.250.80.46: icmp_seq=0 ttl=117 time=12.4 ms
64 bytes from 142.250.80.46: icmp_seq=1 ttl=117 time=11.8 ms
64 bytes from 142.250.80.46: icmp_seq=2 ttl=117 time=13.1 ms
64 bytes from 142.250.80.46: icmp_seq=3 ttl=117 time=12.0 ms
64 bytes from 142.250.80.46: icmp_seq=4 ttl=117 time=14.2 ms

--- google.com ping statistics ---
5 packets transmitted, 5 packets received, 0.0% packet loss
round-trip min/avg/max/stddev = 11.8/12.7/14.2/0.8 ms

Breaking it down:
  ┌─────────────┬─────────────────────────────────────────┐
  │ 64 bytes     │ Size of the reply packet                │
  │ from ...46   │ IP address that responded               │
  │ icmp_seq=0   │ Sequence number (0, 1, 2, 3, 4...)     │
  │ ttl=117      │ Time To Live — remaining hops           │
  │              │ (started at 128, so 128-117 = 11 hops)  │
  │ time=12.4 ms │ Round-trip time for this packet         │
  ├─────────────┼─────────────────────────────────────────┤
  │ Summary:     │                                         │
  │ min=11.8     │ Fastest response                        │
  │ avg=12.7     │ Average response time                   │
  │ max=14.2     │ Slowest response                        │
  │ stddev=0.8   │ Standard deviation (jitter measure)     │
  │ 0% loss      │ All packets returned successfully       │
  └─────────────┴─────────────────────────────────────────┘

Common Error Responses

ResponseMeaningCommon Cause
Request timed outNo reply received within timeoutHost down, firewall blocking ICMP, network issue
Destination host unreachableA router can't find a path to the hostWrong IP, routing problem, host offline
TTL expired in transitPacket ran out of hops before arrivingRouting loop or too many hops
General failureNetwork interface error (Windows)No network adapter, driver issue, IPv6 misconfiguration
Unknown hostDNS resolution failedTypo in domain, DNS server down

What Affects Ping Times?

FactorImpactDetails
Physical distanceMajorSame city: 1–10ms. Cross-continent: 60–150ms. Intercontinental: 100–300ms
Connection typeMajorFiber: 1–10ms. Cable: 10–30ms. DSL: 20–50ms. 4G: 30–80ms. Satellite: 500–700ms
Number of hopsModerateEach router adds ~0.5–2ms. Typical path: 10–20 hops
Network congestionVariableRouter queues fill up during peak usage → increased latency
Wi-Fi vs EthernetModerateWi-Fi adds 1–5ms plus variability from interference
VPNModerateAdds 10–50ms due to encryption overhead and detour routing
Server loadMinorOverloaded servers may respond slower to ICMP

What is a Good Ping?

What counts as "good" depends entirely on what you're doing:

Ping (ms)RatingSuitable For
< 20msExcellentCompetitive gaming, real-time trading, live production
20–50msGreatOnline gaming, VoIP calls, video conferencing
50–100msGoodGeneral browsing, streaming, casual gaming
100–200msAcceptableWeb browsing, email, downloads — noticeable delay in real-time apps
> 200msPoorUnusable for gaming/VoIP; noticeable lag in browsing

Gaming Ping Guide

For competitive FPS games (Valorant, CS2, Overwatch), sub-20ms ping is ideal. For MMOs and strategy games, up to 100ms is playable. For turn-based games, ping barely matters. Game servers are typically located in specific regions — connecting to one farther away means higher ping.

Troubleshooting with Ping

Ping is the first stepin diagnosing network problems. Here's a systematic troubleshooting approach:

Step 1: Ping localhost (test your network stack)
  $ ping 127.0.0.1
  ✓ Works → Your network stack is OK
  ✗ Fails → Network adapter/driver issue

Step 2: Ping your default gateway (test LAN)
  $ ping 192.168.1.1
  ✓ Works → Your local network is OK
  ✗ Fails → Check cable/Wi-Fi, router might be down

Step 3: Ping a public IP (test internet connectivity)
  $ ping 8.8.8.8
  ✓ Works → Internet connection is working
  ✗ Fails → ISP issue or firewall blocking outbound ICMP

Step 4: Ping a domain name (test DNS)
  $ ping google.com
  ✓ Works → DNS and internet both working
  ✗ Fails (but step 3 works) → DNS resolution problem
    → Try: ping 1.1.1.1 to confirm, then fix DNS settings

Step 5: Ping the target host
  $ ping example.com
  ✓ Works → Target is reachable
  ✗ Fails → Target might block ICMP, be down, or have routing issues

Common Scenarios

SymptomLikely CauseFix
100% packet loss to everythingNo network connectionCheck cable/Wi-Fi, restart adapter, restart router
Can ping IPs but not domainsDNS failureChange DNS to 8.8.8.8 or 1.1.1.1; flush DNS cache
High ping to one site onlyRemote server issue or routing problemUse traceroute to find where the bottleneck is
Intermittent packet lossFlaky connection, congestionTry Ethernet instead of Wi-Fi; contact ISP if persistent
Ping works but website doesn't loadApplication-level issueServer is up but web service is down; check HTTP status codes

ICMP Blocking

Many servers and firewalls block ICMPfor security reasons. A host that doesn't respond to ping might still be perfectly reachable on HTTP (port 80/443). Amazon AWS, for example, blocks ICMP on many services by default. If ping fails but the website loads, ICMP is simply blocked — the server is fine.

Beyond Ping — Related Tools

Ping is just one tool in the network diagnostic toolkit. Here are related tools that complement it:

ToolPurposeWhen to Use
traceroute / tracertShows every router hop between you and the destinationWhen you need to find where the latency or loss is happening
mtrCombines ping + traceroute in a live updating viewContinuous monitoring to identify intermittent routing issues
nslookup / digQuery DNS records for a domainWhen ping fails with "unknown host" — test DNS separately
curl / wgetTest HTTP/HTTPS connectivityWhen ping works but a website doesn't load
pathping (Windows)Combines ping + traceroute with statistics over timeDetailed analysis of packet loss per hop on Windows

Ping Any Host from Your Browser

Use our free Ping Checker tool to test latency and reachability to any domain or IP address — no command line needed. Get instant results with detailed statistics.

Try Ping Checker →

References

  1. Postel, J. (1981). RFC 792 — Internet Control Message Protocol. https://datatracker.ietf.org/doc/html/rfc792
  2. Conta, A., Deering, S. & Gupta, M. (2006). RFC 4443 — ICMPv6. https://datatracker.ietf.org/doc/html/rfc4443
  3. Muuss, M. (1983). The Story of the Ping Program. https://ftp.arl.army.mil/~mike/ping.html
  4. ITU-T. G.114 — One-way Transmission Time (Latency Recommendations). https://www.itu.int/rec/T-REC-G.114