Ping and traceroute: reading latency, loss and every hop
Ping measures round-trip latency and packet loss; traceroute shows the networks in between. How both work, how to read the results, and when hop loss matters.
6 min readPart 11 of 16
On this page
A site loads slowly, a game lags, a video keeps buffering. Where is the problem? The two most basic tools for finding out are ping and traceroute. Ping measures how long a round trip to the target takes and whether packets get lost. Traceroute shows which networks the traffic passes through and how long each hop takes.
What ping measures
Ping sends a small packet to the target, the target sends one back, and the time in between is the round-trip time (RTT), in milliseconds. Send a few packets and you get the minimum, average and maximum latency, plus how many packets never came back: the packet loss.
Ping uses ICMP by default. Many servers and firewalls don't answer ICMP, so a failed ping doesn't mean the site is down. In that case you can use TCP instead: open a connection to a port the target has open, such as 443 for websites, and time how long the connection takes.
Latency is mostly a matter of distance. Light covers about 200 km per millisecond in fiber, and Shanghai to Los Angeles is roughly 10,000 km in a straight line, so the round trip can't be much under 100 ms; detours, equipment and queuing add more. That's why a connection within the same city takes a few milliseconds, and one between continents a hundred or two.
Beyond the average, two things matter:
- Jitter: the further apart the minimum and maximum are, the less stable the connection. Web pages barely notice, but games and video calls stutter.
- Packet loss: lost packets have to be resent, so downloads slow down and calls and games stutter or drop. Even a few percent is very noticeable.
Why ping from around the world
A ping from your own computer only measures the path from you to the target. CKIP's global ping measures from more than 40 locations at once: China Mobile in Beijing, China Telecom in Shanghai and Guangzhou, and major cities across Asia, Europe, North America, South America, Oceania and Africa. Each location sends 3 packets, and results are colored by latency: up to 100 ms, up to 250 ms, up to 500 ms, and slower or timed out.
That answers questions a single ping can't:
- Which regions are slow or unreachable. If only some regions time out, it's usually a routing or policy issue. If every region times out, the target most likely doesn't answer ping.
- Where the server really is. The closer a probe is, the faster it gets a reply. From the fastest probe, CKIP works out roughly how far away the target can be and compares that with the IP's listed location (see How IP geolocation works).
- Whether it's anycast. If two probes far apart both get fast replies, no single server can be close to both, so the address is anycast and each region reaches a different node.
- How a server performs from China. Before renting a server abroad, check the latency from China Telecom, China Unicom and China Mobile.
Here's a real measurement: the same 9 probes ping a fixed address in Frankfurt, then 1.1.1.1:
Ping from 9 cities
- A fixed address in Frankfurt
- Light-speed minimum
- 1.1.1.1 (anycast)
- Frankfurt
- London
- New York
- Los Angeles
- Singapore
- Johannesburg
- São Paulo
- Sydney
- Tokyo
Latency to the fixed address grows with distance and always sits above the light-speed minimum: London is about three times the minimum and so is Tokyo, a sign of detours. 1.1.1.1 answers in about a millisecond in all 9 cities. No single server can be that close to all of them, so it's anycast.
With the protocol set to Auto, probes in the US, Germany and Singapore first check whether the target answers ICMP. If it doesn't, the test switches to TCP port 443. If neither works, you're asked to choose a port the target actually has open.
How traceroute works
Every IP packet carries a TTL (time to live) number, which each router decreases by one. When it hits zero, the router drops the packet and sends a "time exceeded" message back to the sender. TTL exists so packets can't loop around the network forever, and traceroute puts it to clever use: it sends packets with a TTL of 1, 2, 3 and so on, and the router at each hop answers the packet that expires there. That reveals the address and latency of every router along the way, one hop at a time, until the target itself replies.
CKIP's traceroute sends 3 packets to each hop, so every hop shows packet loss, average latency and best and worst latency. The summary above the hops lists the networks on the path, the number of hops, whether the trace reached the target, and the final latency and loss.
Reading the hops
Here's a real trace from a cloud server in Tokyo to Los Angeles, with 5 packets per hop.
Look at the last hop, not the middle. Many routers rate-limit "time exceeded" replies, because generating them is extra work, so a hop in the middle often shows loss or high latency while the traffic it forwards is perfectly fine. Hop 4 above lost 60% of its packets while every hop after it lost none; that's this case. To judge the route, look at the last hop, the target: if the target has no loss, loss in the middle can be ignored.
Loss that carries through to the end is real. If loss starts at one hop and every hop after it, including the target, keeps losing packets, the problem is in that stretch.
Compare latency jumps with distance. A jump of over 100 ms between two hops is normal if it's the hop from Asia to North America, because that's an ocean crossing; above, from hop 4 to hop 5 the router names change from Tokyo (tokyjp) to Los Angeles (lsanca) and latency rises by 98 ms. If both hops are in the same region and the latency still jumps, it may be congestion or a detour.
Hops with no answer can be ignored. Some routers never answer trace packets and show as No answer. As long as later hops respond, they don't matter.
You only see the way there. Traceroute shows the path packets take to the target, not the path back. The return trip can take a completely different route (How BGP routing works explains why), and each hop's latency includes its own return trip.
Traces from mainland China often stop early. Carrier gateways and international links in mainland China generally don't answer trace packets, so traces stop around the border. That doesn't mean the target is unreachable; check the ping from the same location instead.
The networks on the path
The networks on the path are listed in order by ASN; the trace above goes through AS31898 (Oracle Cloud), AS2914 (NTT) and AS20473 (Vultr). From China, whether traffic leaves through China Telecom's AS4134 or AS4809 tells you whether it's on the 163 backbone or CN2 (see What is an ASN?). Besides the listed locations, you can type a city, country or ASN, such as AS4809, to trace from there.
Testing from your own computer
Testing from your own computer measures the path from where you are, which complements global ping.
Windows:
ping ckip.nettracert ckip.netmacOS and Linux:
ping -c 4 ckip.nettraceroute ckip.netHere's the raw output of ping -c 4 ckip.net on a Globalping probe in Hong Kong (Linux; macOS writes stddev in the last line):
PING ckip.net (104.21.74.32) 56(84) bytes of data.64 bytes from ckip.net (104.21.74.32): icmp_seq=1 ttl=58 time=1.09 ms64 bytes from ckip.net (104.21.74.32): icmp_seq=2 ttl=58 time=1.09 ms64 bytes from ckip.net (104.21.74.32): icmp_seq=3 ttl=58 time=1.00 ms64 bytes from ckip.net (104.21.74.32): icmp_seq=4 ttl=58 time=0.944 ms --- ckip.net ping statistics ---4 packets transmitted, 4 received, 0% packet loss, time 1504msrtt min/avg/max/mdev = 0.944/1.031/1.093/0.061 msThe last two lines matter most: how many packets were lost, and the minimum, average and maximum latency plus the jitter (mdev). ckip.net is on Cloudflare, which has a node in Hong Kong, so it takes about a millisecond.
mtr keeps tracing and shows live loss and latency for every hop, which makes problems much easier to spot. On macOS you can install it with Homebrew and usually need to run it with sudo; on Linux it's usually an mtr package.
mtr ckip.netGlobal ping runs on a public probe network's free quota: 250 tests per hour, counted by your current public IP. Each location that takes part counts as one test, and the Auto protocol's pre-check and traceroutes count too. When the quota runs out, the page tells you when it resets.