Ping and Traceroute: How to Really Read the Results
ICMP Echo Request and Echo Reply, RTT and loss, TTL and Time Exceeded, tracert with ICMP and traceroute with UDP, asterisks and single-hop delays, three pings to isolate a fault, ICMP and firewalls.
A website is slow, or it will not open at all. We run ping and tracert and get “Request timed out”, rows of asterisks and one hop at 48 ms in the middle of 14 ms values. Is that where the fault is? Almost never. Ping and traceroute are invaluable tools, but only if you know how their results are produced: let's look at ICMP, the TTL, how traceroute works on Windows and Linux, how to read times, loss and asterisks, and how to isolate a fault in a few steps.
Ping: Echo Request and Echo Reply
ping uses ICMP, the IP control protocol defined by RFC 792 for IPv4 and by RFC 4443 for IPv6. The computer sends an Echo Request message (type 8 in IPv4, type 128 in ICMPv6) and the destination answers with an Echo Reply (type 0, or 129). ICMP has no ports: it travels directly inside IP, like TCP and UDP.
An example on Windows, with addresses reserved for documentation and illustrative values:
C:\> ping 192.0.2.80
Pinging 192.0.2.80 with 32 bytes of data:
Reply from 192.0.2.80: bytes=32 time=14ms TTL=58
Reply from 192.0.2.80: bytes=32 time=13ms TTL=58
Reply from 192.0.2.80: bytes=32 time=16ms TTL=58
Reply from 192.0.2.80: bytes=32 time=14ms TTL=58
Ping statistics for 192.0.2.80:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 13ms, Maximum = 16ms, Average = 14ms
On Linux and macOS ping keeps going until you stop it with Ctrl+C, or sends the number of packets given with -c:
$ ping -c 4 192.0.2.80
PING 192.0.2.80 (192.0.2.80) 56(84) bytes of data.
64 bytes from 192.0.2.80: icmp_seq=1 ttl=58 time=14.2 ms
64 bytes from 192.0.2.80: icmp_seq=2 ttl=58 time=13.6 ms
64 bytes from 192.0.2.80: icmp_seq=3 ttl=58 time=15.9 ms
64 bytes from 192.0.2.80: icmp_seq=4 ttl=58 time=14.0 ms
--- 192.0.2.80 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 13.6/14.4/15.9/0.9 ms
Reading RTT, loss and TTL
Each ping line carries three useful pieces of information.
- The time is the RTT, the round-trip time, not the one-way time. It depends on distance, on the access technology and on load. In optical fibre light travels at about 200,000 km per second: every 100 km of distance adds roughly 1 ms of RTT, before counting any equipment.
- Loss is the percentage of requests left unanswered within the timeout. Four packets are not many: an intermittent problem only shows up in a long test, for example
ping -n 100on Windows orping -c 100on Linux. - The TTL of the reply is the value left in the packet on arrival. Systems usually start from 64 (Linux, macOS), 128 (Windows) or 255 (many network devices): a TTL of 58 suggests a server that starts from 64 and a reply that crossed 6 routers. It is an estimate, because the initial value is not guaranteed and the return path may differ from the outbound one.
Rough figures, to be taken as orders of magnitude: on a wired LAN the RTT is below 1 ms; over Wi-Fi it ranges from 1 to a few tens of ms and varies a lot; the ISP's first router on a fibre line answers in a few ms; a server in the same country often in 10–30 ms. The variation from one packet to the next is called jitter, and for voice and video calls it matters more than the average.
Two warnings. Ping does not measure the speed of the connection: a saturated link can show high RTTs with plenty of bandwidth still available, and vice versa. And “Request timed out” does not necessarily mean the host is down: many devices, and often Windows with its default settings, do not answer Echo Requests coming from the network.
The TTL and the Time Exceeded message
Every IPv4 packet contains the TTL field (time to live, RFC 791), a number from 0 to 255. Every router that forwards the packet lowers it by 1 (RFC 1812). When the value reaches 0, the router drops the packet and sends the sender an ICMP Time Exceeded message (type 11, code 0), with its own address as the source. In IPv6 the same field is called Hop Limit and the message is ICMPv6 Time Exceeded (type 3).
The TTL exists to stop a packet from circling forever in a routing loop. Switches work at layer 2, with Ethernet frames, and leave the TTL untouched: that is why a switch never appears in traceroute results.
How traceroute works
Traceroute exploits exactly this. It sends packets with TTL 1, then 2, then 3 and so on: the first router replies Time Exceeded, then the second, then the third. Each reply reveals the address of one hop and its RTT. Each hop usually gets three probes, so you see three times; the default limit is 30 hops. The trace ends when the destination answers.
The type of packet depends on the system:
| Tool | Packets sent | How it knows it has arrived | Useful options |
|---|---|---|---|
tracert (Windows) | ICMP Echo Request | The destination answers Echo Reply | -d no names, -h maximum hops, -w timeout |
traceroute (Linux, macOS) | UDP to high ports, normally from 33434 upwards | The destination answers ICMP Port Unreachable (type 3, code 3) | -n no names, -I with ICMP, -T with TCP SYN (needs administrator privileges) |
pathping (Windows), mtr (Linux, macOS) | Repeated probes towards every hop | As above | Loss and RTT statistics per hop over a long interval |
The difference matters: a firewall that lets ping through but blocks UDP to high ports makes Linux traceroute stop with a row of asterisks, while Windows tracert reaches the destination. In that case try again with traceroute -I or traceroute -T -p 443. An example of tracert, with illustrative values:
C:\> tracert -d www.example.com
Tracing route to www.example.com [192.0.2.80]
over a maximum of 30 hops:
1 <1 ms <1 ms <1 ms 192.168.1.1
2 1 ms 1 ms 2 ms 192.168.100.1
3 5 ms 4 ms 5 ms 198.51.100.1
4 * * * Request timed out.
5 48 ms 51 ms 47 ms 198.51.100.65
6 14 ms 13 ms 14 ms 203.0.113.9
7 14 ms 14 ms 13 ms 192.0.2.80
Trace complete.
Hop 1 is the firewall acting as gateway, hop 2 is the ISP's router, and from hop 3 onwards we are inside the provider's network. The -d option skips reverse name lookups, which slow the trace down. The exact wording depends on the system's language and version.
Asterisks: what they really mean
An asterisk only means that that probe received no answer within the timeout. The most common causes:
- the router does not generate Time Exceeded messages, by the operator's choice;
- the router generates them but limits their rate (rate limiting): some probes go unanswered;
- a firewall along the path filters ICMP messages or UDP probes;
- the destination does not answer the probes: with tracert the last lines stay full of asterisks up to 30, even though the website works.
The practical rule is simple: if the later hops answer, the packets went through the hop with the asterisks too. In the example, hop 4 does not answer but hops 5, 6 and 7 do: there is no fault. It is a different story when nothing answers after a certain hop and the destination is unreachable with other tools as well: there the path really breaks, or a filter blocks the traffic.
If the server does not answer ping but the website seems to work, test the real service, for example port 443: in PowerShell Test-NetConnection www.example.com -Port 443, on Linux curl -I https://www.example.com.
Delays on a single hop: the control plane
In the example hop 5 shows 48 ms, while hops 6 and 7, further away, answer in 14 ms. It is not a paradox. A router forwards transit packets with dedicated circuitry, the data plane, very quickly. But the Time Exceeded message, or the answer to a ping aimed at the router itself, is prepared by its processor, the control plane, which handles it at low priority and often with a rate limit, to protect itself from overload. The router's answer is slow; the traffic passing through it is not.
A delay or loss on an intermediate hop matters only if it persists all the way to the destination. If from hop 3 onwards all times rise from 5 to 60–70 ms, and the destination shows the same increase, there really is congestion or a slow link from that point on. Remember too that every time includes the return trip, which may follow a different path.
Isolating the fault with three pings
Before blaming the Internet, check your own network one stretch at a time, from near to far. With ipconfig /all on Windows, or ip addr and ip route on Linux, read the address, gateway and DNS server; then run three tests.
- Ping the gateway, for example
ping 192.168.1.1. If it does not answer, the problem is in the local network: cable, Wi-Fi, VLAN, a wrong address or a firewall rule on the LAN interface. The role of the default gateway is explained in a dedicated article. - Ping a public address that is well known and reliable. If the gateway answers and the public address does not, the fault is beyond the LAN: on the WAN link, on the ISP router or in the provider's network. A
tracert -dshows how far the packets get. - Ping a name, for example
ping www.example.com. If the public address answers and the name does not (a resolution error), the problem lies in DNS: check the server received from DHCP and trynslookup.
| Gateway | Public IP | Name | Where to look |
|---|---|---|---|
| no | no | no | Local network: cable, Wi-Fi, IP address, VLAN, LAN rules |
| yes | no | no | Firewall towards the Internet, WAN link, ISP |
| yes | yes | no | DNS: configured server, rules on port 53 |
| yes | yes | yes | The network works: test the service (port 443) and the path with traceroute |
If a website is just slow, compare the times to the gateway over cable and over Wi-Fi: if they are already high there, the problem is at home or in the office, not at the ISP. The complete step-by-step procedure is in the article The Internet isn't working: step-by-step troubleshooting.
Firewalls and ICMP: filter, don't block it all
Blocking all ICMP looks prudent, but it breaks important functions. The most delicate is Path MTU Discovery (PMTUD). A computer sends large packets, up to 1500 bytes on Ethernet, with the DF bit (don't fragment) set. If a link along the path has a smaller MTU, for example 1492 bytes on PPPoE or less inside a VPN tunnel, the router drops the packet and replies with ICMP Fragmentation Needed (type 3, code 4, RFC 1191), stating the size allowed. In IPv6 routers never fragment and the message is Packet Too Big (ICMPv6 type 2, RFC 8201).
If a firewall blocks these messages, the sender never learns the limit: connections open, small pages load, large transfers hang. It is the classic PMTUD black hole. With IPv6 the damage is greater, because neighbour discovery and automatic configuration also rely on ICMPv6: RFC 4890 recommends not filtering the essential error messages (Destination Unreachable, Packet Too Big, Time Exceeded, Parameter Problem) and letting neighbour discovery messages through on the local link.
In practice, on a firewall such as OPNsense:
- from the LAN, allow ping to the firewall and to the Internet: it is the everyday diagnostic tool;
- on the WAN there is no need to answer pings from the Internet, but ICMP error messages related to open connections must get through; a stateful firewall generally recognises them and associates them with the connection;
- for IPv6, follow the guidance of RFC 4890, without rules that drop all ICMPv6.
Rules are managed per interface in the firewall rules menu; menus and options may vary with the version. How to write and order rules is explained in the article on firewall rules. To check the MTU of a path you can send a large ping with DF set: ping -f -l 1472 192.0.2.80 on Windows, ping -M do -s 1472 192.0.2.80 on Linux (1472 bytes of data plus 28 bytes of headers make 1500).
Common mistakes
- “It doesn't answer ping, so it's off.” Many hosts and firewalls ignore Echo Requests: test the real service, for example port 443.
- Panicking over asterisks or a spike on an intermediate hop. If the later hops and the destination are normal, there is no fault.
- Using ping or traceroute to measure speed. They measure times and reachability, not bandwidth.
- Running a single four-packet test. Intermittent loss only shows up in long tests, with
pathpingormtr. - Blaming the ISP without testing the gateway. A disturbed Wi-Fi produces delays and loss already at the first hop.
- Blocking all ICMP on the firewall. You lose diagnostics and break PMTUD, especially with IPv6.
- Forgetting the return trip. Every time is a round trip, and the way back may follow another route.
In practice
- Read the device's address, gateway and DNS, then ping the gateway, a public address and a name.
- For an intermittent problem use long tests:
ping -n 100,pathpingormtr. - Read traceroute from top to bottom and look at the destination: asterisks and isolated spikes are not faults.
- Look for the hop where delay or loss begins and never goes away: that is where the stretch to report starts.
- If Linux traceroute stops, try again with ICMP (
-I) or TCP (-T). - On the firewall, filter ICMP with care: never block Fragmentation Needed, Packet Too Big and Time Exceeded.
Ping and traceroute don't lie, but they tell the story from the routers' point of view, and routers answer when they can. Read with these rules, a few minutes are enough to tell whether the fault is in the local network, on the link to the Internet, in DNS or far away, in somebody else's network.
The video
Further reading
- Book: LOCAL AREA NETWORKS (LAN) — Volume 2: IP Addressing and Network Services (English edition)
- Book: LOCAL AREA NETWORKS (LAN) — Volume 4: Routing, NAT, and Internet Access (English edition)
- Book: LOCAL AREA NETWORKS (LAN) — Volume 5: LAN Security and Integration (English edition)
- Video course: Reti LAN in Pratica — Volume 1 (video course in Italian)
- Video course: Capire i Firewall con OPNsense (video course in Italian)
- Related article: DNS: How a Name Becomes an IP Address
- Related article: How a Firewall Rule Works
- Related article: The Internet Isn't Working: Step-by-Step Troubleshooting, from Cable to DNS
- Related article: Default Gateway: How a Device Gets Out of Its Own Network
- Specialization: LAN Networks
Technical sources
- RFC 792 e RFC 4443 — Internet Control Message Protocol (ICMP e ICMPv6) — Echo Request and Echo Reply messages (types 8 and 0; 128 and 129 in ICMPv6), Time Exceeded (type 11; type 3 in ICMPv6), Destination Unreachable and Port Unreachable (type 3, code 3).
- RFC 791 e RFC 1812 — Internet Protocol; Requirements for IP Version 4 Routers — The TTL field of the IPv4 header, decremented by 1 at every router, packet discarded at 0 and a Time Exceeded message sent; generation of ICMP messages by routers.
- RFC 1191 e RFC 8201 — Path MTU Discovery per IPv4 e IPv6 — Path MTU discovery with the DF bit and the Fragmentation Needed (IPv4, type 3 code 4) and Packet Too Big (ICMPv6 type 2) messages; effects of blocking these messages.
- RFC 4890 — Recommendations for Filtering ICMPv6 Messages in Firewalls — ICMPv6 messages that must not be filtered (Destination Unreachable, Packet Too Big, Time Exceeded, Parameter Problem) and neighbour discovery messages needed on the local link.
- Documentazione Microsoft dei comandi ping, tracert e pathping; pagine di manuale di ping e traceroute (Linux) — Command options (-n, -l, -f, -d, -h, -w; -c, -n, -I, -T, -M), three probes per hop and a default limit of 30 hops; Linux traceroute uses UDP to ports from 33434 by default. The output text varies with language and version.
- RFC 1918, RFC 5737 e RFC 2606 — Addresses and names used in the examples: private networks 192.168.1.0/24 and 192.168.100.0/24, documentation addresses 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24, the example.com domain.
Standards and official documentation available from the respective organisations.