Lesson 5 of 720 minutesHands-on

Measure your connection: ping and traceroute

“My internet is slow” can mean three very different things: not enough capacity, too much delay, or messages getting lost on the way. Speed tests only measure the first. In this lesson you’ll use two tools that have been built into every computer for decades to measure the other two, and to see every network your data passes through on its way to a website.

In this lesson

  • Use ping to time a round trip and spot lost messages
  • Use traceroute to see each stop between you and a website
  • Tell latency, jitter, packet loss and bandwidth apart

You’ll need: a computer with Windows, macOS or Linux. On a phone? Our ping test measures latency and jitter from your browser, and you can read along for the rest.

Four words for “slow”

TermWhat it meansWhat it feels like when it’s bad
BandwidthHow much data can flow per second, in megabits per second (Mbps)Downloads crawl, video drops to low quality
LatencyHow long one message takes to get there and back, in milliseconds (ms)A delay before every page starts loading; game actions lag
JitterHow much the latency varies from one message to the nextVideo calls stutter and voices go robotic
Packet lossThe share of messages that never arrive and have to be sent againFreezes, sudden drops, calls cutting out

A connection can have plenty of bandwidth and still feel terrible because of latency, jitter or loss. That’s why a great speed test result doesn’t always mean your video calls will be smooth. Bandwidth vs Internet Speed goes deeper on the difference.

What ping does

Ping sends a tiny message to another computer whose only job is to come straight back, and times how long the round trip takes. It repeats this a few times and then tells you how many came back and how long they took. It’s the internet’s equivalent of shouting into a canyon and timing the echo.

Try it yourself ยท part 1

Ping a website

๐ŸชŸ Windows

Open the Command Prompt (press Windows, type cmd, press Enter) and run:

ping examineip.com

Windows sends 4 messages and stops by itself.

๐ŸŽ Mac and ๐Ÿง Linux

Open Terminal and run:

ping -c 4 examineip.com

The -c 4 tells it to send 4 messages. Without it, ping keeps going until you press Ctrl + C.

On Windows you’ll see something like this. The numbers on your screen will be different:

Pinging examineip.com [198.51.100.87] with 32 bytes of data:
Reply from 198.51.100.87: bytes=32 time=44ms TTL=46
Reply from 198.51.100.87: bytes=32 time=44ms TTL=46
Reply from 198.51.100.87: bytes=32 time=45ms TTL=46
Reply from 198.51.100.87: bytes=32 time=44ms TTL=46

Ping statistics for 198.51.100.87:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 44ms, Maximum = 45ms, Average = 44ms
  • The address in brackets is the DNS lookup from Lesson 4 happening first: ping needs a number before it can send anything.
  • time= is the round trip for each message: your latency to that server.
  • The gap between Minimum and Maximum is a rough measure of jitter. Here it’s 1 millisecond: very steady.
  • Lost is your packet loss. Anything above 0% on a wired connection is worth investigating.

Try it yourself ยท part 2

Ping your router, then the internet

Remember the router address from Lesson 2? Ping it, using your own router’s address:

ping 192.168.1.1

Then ping a server on the internet by its number, Cloudflare’s DNS at 1.1.1.1:

ping 1.1.1.1

Compare the two. Your router is in the same room, so on a cable it usually answers in under a millisecond, and over Wi-Fi in a few. The internet server takes noticeably longer. This simple comparison is one of the most useful tricks in the whole course:

  • The router is slow or loses messages: the problem is inside your home, usually Wi-Fi.
  • The router is fine but the internet server isn’t: the problem is beyond your router, with your provider or further away.

If you’re on Wi-Fi, try the router ping again standing next to the router, then from the far end of the house, and watch the time and loss change.

What traceroute does

Your data doesn’t travel to a website in one jump. It’s passed from router to router: your home router, your provider’s equipment, then a chain of networks that hand it along until it reaches the destination. Traceroute shows you that chain, one stop (one hop) per line, with the time to reach each one.

It works with a clever trick. Every message carries a counter that each router reduces by one; when it hits zero, the router throws the message away and sends back a note saying so. Traceroute sends messages with the counter set to 1, then 2, then 3, so each router along the way, in turn, reveals itself. That counter is the TTL you saw in the ping output.

Try it yourself ยท part 3

Trace the route to a website

๐ŸชŸ Windows

In the Command Prompt it’s spelled tracert. The -d skips looking up a name for every hop, which makes it much faster:

tracert -d examineip.com
๐ŸŽ Mac
traceroute -n examineip.com
๐Ÿง Linux

Many distributions don’t include traceroute. On Ubuntu or Debian, install it first:

sudo apt install traceroute
traceroute -n examineip.com

It takes a little longer than ping. On Windows the result looks like this:

Tracing route to 198.51.100.87 over a maximum of 30 hops

  1    <1 ms    <1 ms    <1 ms  192.168.1.1
  2     8 ms     7 ms     8 ms  10.20.0.1
  3     9 ms     9 ms    10 ms  203.0.113.14
  4     *        *        *     Request timed out.
  5    21 ms    20 ms    21 ms  203.0.113.90
  6    44 ms    44 ms    45 ms  198.51.100.87

Trace complete.
  • Hop 1 is your own router, answering in under a millisecond.
  • Hop 2 is usually your provider’s first piece of equipment. Notice the private address: providers use them inside their own networks too.
  • Each line has three times because traceroute tries every hop three times.
  • The last line is the website’s server. Its time should be close to what ping showed.

Reading the stars

A line of * * * with “Request timed out” looks alarming but usually isn’t. Many routers are set up to pass traffic along without answering traceroute’s question. If the hops after the stars reply normally, the stars mean nothing.

What does matter:

  • Times that jump and stay high from one hop onward: the delay is being added at that point. A jump when the route crosses an ocean is normal (light in fibre still needs time), so a server on another continent will always show one.
  • Stars on every line from some hop to the end: the trail stops there. Traffic may be failing at that point, or the destination may simply not answer traceroute, so check whether the website itself loads before you conclude anything.
  • One slow hop in the middle, with normal times after it: that router is just slow to answer traceroute’s question, while still passing your real traffic quickly. Ignore it.
Ping says “Request timed out” for everything? Some networks and servers are set to ignore ping completely, especially at work or in public places. If websites load fine, ping being blocked isn’t a fault. Try pinging your router: if that answers, your own connection is fine.

Your browser can measure too

Browsers can’t send real ping messages, but they can time a complete web request again and again. Our ping test does exactly that, showing your best, average and worst times, jitter and failed requests, and it works on a phone. Its numbers are a few milliseconds higher than a real ping, so compare its results with each other (Wi-Fi against cable, now against tonight) rather than with the command line. For bandwidth, run the speed test.

Key takeaways

  • Bandwidth is capacity; latency is delay; jitter is how much the delay varies; packet loss is messages that never arrive.
  • ping times round trips and counts lost messages. The minimum-to-maximum gap is a quick look at jitter.
  • Pinging your router, then 1.1.1.1, tells you whether a problem is inside your home or beyond it.
  • traceroute (tracert on Windows) shows every hop to a destination, with the time to reach each one.
  • Stars in a traceroute are usually routers that don’t answer, not a fault.

Check yourself

Three questions. Pick one answer each and you’ll see why.

1. Your speed test shows 300 Mbps, but video calls keep freezing. Which measurement is most likely the problem?

2. Pinging your router shows 2 ms and 0% loss, but pinging 1.1.1.1 shows 15% loss. Where is the problem?

3. In a traceroute, hop 4 shows * * *, but hops 5 to 9 answer normally and the site loads. What does that mean?

Want the background in more depth? Read Network Latency and Ping Explained and What Is Traceroute?, the explainers this lesson builds on.

This lesson is part of the free course How the Internet Works, licensed under CC BY-NC-SA 4.0: you may share and adapt it for non-commercial use, with credit to ExamineIP and a link to the original.

Scroll to Top