Marcio Cunha

How to diagnose packet loss and high latency with mtr

Learn how to isolate network failures and routing bottlenecks in Linux servers using the real-time mtr diagnostic tool.

Marcio Cunha•6 min
Also available in:PortuguêsEspañol
Summary
  • The mtr command combines ping and traceroute capabilities into a single real-time updated interface.
  • Pinpointing the exact hop where packet loss occurs prevents false assumptions about upstream providers.
  • High jitter values indicate severe route instability, which damages sensitive real-time applications.
  • Slow response times on intermediate routers do not always mean actual traffic failure or packet drops.
  • Routine checks on production servers help anticipate network bottlenecks before they impact users.

Why mtr is essential for diagnosing network issues

When a production application suffers from intermittent slowness or sudden connection drops, the application code is rarely to blame. Most of the time, the root cause lies within the network infrastructure, where data packets get lost somewhere along the path between origin and destination. Traditional utilities like ping — a simple utility that sends small packets to test host reachability — only show whether the final destination responds, leaving you blind to what happens in the middle. Traditional traceroute maps the entire route, but only captures a static, momentary snapshot, completely ignoring performance fluctuations that change every second.

This is precisely where mtr (My Traceroute) comes in as an indispensable tool, combining the best of both worlds by running continuous diagnostics. In practice, it continuously sends packets to each router — known as hops — through which your traffic travels until it reaches the final destination. As you watch the screen, it calculates live statistics updated second by second, revealing with surgical precision exactly where traffic is bottlenecking or disappearing. Before diving into route analysis, keep in mind that physical bench issues also affect general stability, as discussed when dealing with power supplies and electrical stability.

How to install and run mtr on Linux

Using mtr in Linux environments is straightforward, as the tool is included in the official repositories of most modern distributions. To install it on Debian or Ubuntu-based servers, simply open your terminal and run the package manager with administrative privileges. In infrastructure-oriented operating systems, command-line usage offers superior flexibility, allowing you to export data or run diagnostics without relying on heavy graphical interfaces. If your environment suffers from intermittent performance hiccups that feel like physical hardware glitches, it is worth cross-referencing diagnostic data with hardware checks to find damaged SMD components and rule out local motherboard instability.

To run the command in its basic, interactive form, simply type the tool name followed by the target IP address or domain you want to test. The terminal will immediately display a dynamic table that starts accumulating statistical data every second. See the basic execution command below:

mtr 8.8.8.8

As packets circulate, crucial columns populate the screen with vital metrics. The Loss% column reveals the exact percentage of dropped packets at each hop, while Last, Avg, and Best show current, average, and minimum latencies in milliseconds. To stop execution and return to the normal prompt, simply press Ctrl + C at any time.

Interpreting packet loss and intermediate hops

One of the most common mistakes when analyzing mtr output is panicking upon noticing that an intermediate router exhibits high packet loss or elevated latency. In practice, many carrier and transit routers are factory-configured to prioritize fast packet forwarding for actual customer traffic while giving minimal priority to processing ICMP responses directed at diagnostic tools. This means a middle hop can display 100% loss without affecting the final connection at all. The golden rule is simple: if an intermediate hop shows packet loss, but subsequent hops and the final destination record 0% loss, the router is simply ignoring probe packets rather than dropping real traffic.

On the other hand, when packet loss begins at a specific hop and persists across all subsequent hops up to the final destination, you have mathematical confirmation of a real bottleneck. This kind of evidence is your best passport for opening a well-founded technical ticket with your internet service provider or transit carrier. Instead of sending vague messages claiming the internet is slow, you deliver a detailed report proving exactly which autonomous system router started dropping your traffic. Furthermore, failures in other layers of the local network create similar symptoms, making it useful to understand how to diagnose packet loss and jitter in depth across different infrastructure scenarios.

Identifying jitter and fluctuating latency issues

Beyond direct packet loss, data delivery instability — technically known as jitter, which represents variation in packet delay times — is a major villain in modern production environments. Applications requiring real-time communication, such as VoIP voice calls, high-quality video streaming, or synchronous financial transactions, suffer severely when jitter is high. In mtr, you can observe this variation by comparing the minimum (Best), average (Avg), and maximum (Wrst) latency columns. If the gap between the lowest and highest latency is too wide, your network suffers from chronic instability even if the average looks acceptable at first glance.

To further investigate performance issues that seem tied to the broader infrastructure ecosystem, it is worth combining route analysis with other operational diagnostic fronts. In complex local networks, for instance, routing issues often overlap with name resolution failures, making it essential to know how to test DNS latency on Linux using the dig command to isolate whether delays stem from address translation or raw IP packet traffic.

Running advanced tests with batch reports

While the interactive interface is fantastic for everyday quick checks, we often need to collect data over a long period to prove an intermittent issue that only occurs during peak hours. For these scenarios, mtr provides a batch report mode, allowing you to fire a predetermined number of cycles and save clean results to a text file for later auditing. This automated feature is excellent for feeding internal monitoring scripts or attaching undeniable evidence to enterprise-level support tickets. Here is how to execute a structured collection of 100 cycles and save the output:

mtr --report --report-cycles 100 8.8.8.8 > mtr_report.txt

Another important technical detail is choosing the transport protocol used in tests. By default, mtr uses ICMP packets, but some corporate firewalls and edge routers block or throttle these packets for security reasons. To bypass this restriction and test the exact path your application's actual traffic (such as HTTP or HTTPS ports) takes, you can instruct the tool to use TCP or UDP packets by adding specific command-line parameters, ensuring a diagnosis much truer to the real production scenario.

Final considerations on route diagnostics

Mastering mtr completely transforms how engineers and system administrators approach connectivity problems in critical environments. Instead of guessing where the network is failing or accepting unwarranted blame, you gain the ability to isolate bottlenecks, measure real losses, and confront carriers with precise, irrefutable data. Integrating this testing routine into your daily troubleshooting arsenal guarantees fast diagnostics, drastically reduces service downtime, and raises the overall reliability of your company's tech infrastructure.

Understanding network hop behavior, properly interpreting loss and jitter metrics, and knowing how to extract automated reports are fundamental skills for anyone dealing with distributed systems. Constant practice and critical analysis of results will ensure that any routing anomaly stops being a complex mystery and becomes just another simple, fast problem to solve.