How to Use Ping and Traceroute to Diagnose Your Connection

"The internet is slow" can mean a dozen different things: weak Wi-Fi, a congested ISP, a broken DNS server or a problem far away on the route to a game server. Two small command-line tools, ping and traceroute, let you tell these apart in a minute — no special software needed. This guide shows how to run them, how to read the output, and a simple order of tests that finds where a connection breaks.

What ping does

ping sends a small test packet (an ICMP "echo request") to an address and waits for the reply. It reports how long the round trip took in milliseconds — the latency or "ping time" — and whether any packets were lost. It is the quickest way to learn: is that machine reachable, and how far away is it in network terms?

How to run it

  • Windows: open Command Prompt and type ping 8.8.8.8. It sends 4 packets by default; use ping -t 8.8.8.8 to keep going until you press Ctrl+C.
  • macOS / Linux: open Terminal and type ping 8.8.8.8. It runs until you press Ctrl+C; use ping -c 4 8.8.8.8 to send exactly four.

You can ping an IP address or a domain name (ping example.com). Pinging a name also tests DNS, because the name has to be resolved first.

Reading the output

Pinging 8.8.8.8 with 32 bytes of data:
Reply from 8.8.8.8: bytes=32 time=18ms TTL=117
Reply from 8.8.8.8: bytes=32 time=17ms TTL=117
Reply from 8.8.8.8: bytes=32 time=21ms TTL=117
Reply from 8.8.8.8: bytes=32 time=18ms TTL=117

Ping statistics for 8.8.8.8:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 17ms, Maximum = 21ms, Average = 18ms
  • time — round-trip latency. Lower is better.
  • TTL — "time to live", the number of hops a packet may still make. It also hints at the remote operating system.
  • Lost / % loss — packets that never came back. On a healthy link this is 0%.
  • Min / Max / Average — a large gap between them means jitter (unstable latency), which hurts calls and games even when the average looks fine.

What counts as a good ping?

Distance matters — signals cannot beat the speed of light in fibre — so judge against where the server is:

  • Under 20–30 ms: excellent, typical for a nearby server on a wired connection.
  • 30–80 ms: good for browsing, video calls and most games.
  • 80–150 ms: noticeable in fast-paced games.
  • Over 150 ms, or any steady packet loss: something is wrong, or the server is very far away.

For gaming specifics, see how to reduce ping in online games.

A step-by-step test order

Ping things in order, from your own computer outward. The first one that fails shows where the problem is:

  1. ping 127.0.0.1 — your own network stack. If this fails, the problem is on your computer.
  2. ping your router (the default gateway; find it as described in how to log in to your router). Failure or high times here point to your Wi-Fi or cable.
  3. ping 8.8.8.8 — reaches the internet without needing DNS. If this works but step 4 fails, the issue is DNS.
  4. ping example.com — tests name resolution on top.

What traceroute does

Ping tells you whether and how fast; traceroute shows the path. It sends packets with a TTL of 1, then 2, then 3 and so on. Each router along the path subtracts one from the TTL, and the router where it reaches zero replies "time exceeded" — revealing itself. Repeating this gives you a list of every hop between you and the destination.

  • Windows: tracert example.com (and pathping example.com for a slower but more detailed report with loss per hop).
  • macOS / Linux: traceroute example.com. The mtr tool, if installed, combines ping and traceroute live.

Reading a traceroute

 1    1 ms    1 ms    1 ms  192.168.1.1
 2    9 ms    8 ms    9 ms  10.20.0.1
 3   14 ms   15 ms   14 ms  isp-core.example.net [203.0.113.1]
 4   *        *        *     Request timed out.
 5   31 ms   30 ms   32 ms  edge1.transit.example [198.51.100.7]
 6   35 ms   34 ms   35 ms  203.0.113.80
  • Hop 1 is your own router. A slow first hop means a Wi-Fi or local problem.
  • * * * (timed out) does not automatically mean a fault. Many routers simply do not answer these probes while still forwarding your traffic fine — as hop 4 does above, since later hops respond.
  • A latency jump that stays high from one hop onward is where the delay is introduced. If a single hop is slow but the next ones are fine, that router is just low priority for answering probes.
  • Hop names and addresses often reveal the network each hop belongs to — paste an address into a WHOIS or IP-lookup service to see who owns it, and read what an ASN is to make sense of the company name you get back.

Limits of these tools

  • Some servers and firewalls block ICMP, so a failed ping does not always mean the server is down.
  • Ping measures latency, not speed. A connection can have low ping and low bandwidth, or the reverse.
  • Test against the server you actually use (for example a game's regional server), not just a public DNS address.

Key takeaways

  • ping measures round-trip time and packet loss; tracert/traceroute shows every hop on the path.
  • Test in order — localhost, router, 8.8.8.8, then a domain — to find where the failure is.
  • Look at packet loss and the min/max gap (jitter), not only the average.
  • Timeouts in the middle of a traceroute are often harmless; a delay that continues to the end is not.
Show-IP.ir
Find your public IP address along with your country, city, ISP, time zone and location on a map. Includes VPN/proxy/Tor detection and a free subnet calculator.
Try it
Back to articles