Ping, Traceroute, and MTR

Ping, traceroute, and MTR are the three fundamental tools for diagnosing network path problems. Ping tests reachability and measures round-trip latency. Traceroute shows the path packets take through the network. MTR combines both into a real-time display that reveals intermittent packet loss at specific hops. Together, they help you determine whether a problem is on your network, at your ISP, or at the destination.

ping: more than just connectivity

# Basic ping
ping google.com
ping -c 5 8.8.8.8    # Send 5 packets then stop

# Useful options
ping -c 10 -i 0.2 8.8.8.8  # 10 packets, 0.2s interval (flood test)
ping -c 100 -q 8.8.8.8     # 100 packets, quiet mode (only shows summary)
ping -s 1400 8.8.8.8        # Large packet size (test MTU path)

ping output explained

PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=118 time=12.3 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=118 time=11.8 ms
^C
--- 8.8.8.8 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss
rtt min/avg/max/mdev = 11.3/12.1/12.9/0.5 ms
#                              ↑       ↑
#                           average   max (spike detection)
# mdev (mean deviation) high? → inconsistent latency (jitter)

traceroute: following the path

# Install if not present
sudo apt install -y traceroute

# Trace the path to a destination
traceroute google.com
traceroute -n google.com    # -n: no DNS lookups (faster)

# Use ICMP instead of UDP (sometimes ICMP gets through when UDP is blocked)
sudo traceroute -I 8.8.8.8

# tracepath: no root required, uses UDP
tracepath google.com

traceroute output

traceroute to google.com (142.250.80.78), 30 hops max
 1  192.168.1.1   1.2 ms   1.1 ms   1.0 ms    ← your router
 2  10.10.0.1     8.5 ms   8.2 ms   8.4 ms    ← ISP first hop
 3  * * *                                      ← hop dropped ICMP (normal)
 4  74.125.243.1  12.1 ms  11.9 ms  12.0 ms
 5  142.250.80.78 12.5 ms  12.3 ms  12.4 ms   ← destination

MTR: combining ping and traceroute

# Install MTR
sudo apt install -y mtr

# Run MTR (press q to quit, cursor mode)
mtr google.com
mtr --no-dns google.com     # Skip DNS lookups
mtr -c 100 --report google.com  # Run 100 cycles and report (non-interactive)

MTR output (report mode)

HOST: server                     Loss%   Snt   Last   Avg  Best  Wrst StDev
  1.|-- 192.168.1.1               0.0%   100    1.2   1.3   1.1   2.1   0.2
  2.|-- 10.10.0.1                 0.0%   100    8.5   8.7   8.2   9.8   0.4
  3.|-- 203.0.113.1               0.5%   100   11.2  11.8  10.9  45.2   3.1  ← minor loss
  4.|-- 142.250.80.78             0.0%   100   12.3  12.1  11.8  13.0   0.3

Interpreting packet loss at hops

💡 TIP: Packet loss at an intermediate hop in MTR does NOT necessarily indicate a problem. Many routers deprioritize ICMP (the protocol used by traceroute/MTR) when under load — they process regular traffic normally but drop ICMP probes. The key indicator is loss at the FINAL destination hop. If the last hop shows 0% loss but an intermediate hop shows 20%, that intermediate router is rate-limiting ICMP — not dropping your actual traffic.

When ICMP is blocked

# Some networks block ICMP entirely — ping and traceroute appear to fail
# Alternative: TCP port test
nc -zv host 80        # Test TCP port 80 reachability
nc -zv host 443       # Test HTTPS

# curl as a network test (tests TCP + TLS + HTTP)
curl -v --max-time 5 https://example.com 2>&1 | head -20

# Use hping3 for advanced probing
sudo apt install -y hping3
sudo hping3 -S -p 80 -c 5 google.com    # TCP SYN ping on port 80

Conclusion

Use ping for basic reachability and latency measurement. Use traceroute or MTR to identify where in the network path the problem occurs. MTR is more valuable than traceroute because it shows sustained statistics over many packets, making intermittent packet loss visible. Remember: ICMP packet loss at intermediate hops is usually rate-limiting, not actual packet loss. Loss at the final destination hop is the definitive indicator of a real connectivity problem.

FAQ

Is Ping, Traceroute, and MTR important for Ubuntu administrators?+

Yes. It supports practical Ubuntu administration because it connects directly to server reliability, security, troubleshooting, or daily operations.

Should I practice this on a live server?+

Use a lab VM first. After you understand the command output and rollback path, apply the workflow carefully on real systems.

What should I do after reading this article?+

Run the practice commands, write down what each one shows, and continue to the next article in the Ubuntu roadmap.

Need help with Ubuntu administration?

Work directly with Muhammad Irfan Aslam for Ubuntu Server, Linux, cloud, Docker, DevOps, CI/CD, or infrastructure troubleshooting support.

Hire Me for Support