Pathfinders
Understanding the path that data packets take across the Internet is crucial for troubleshooting connectivity issues, identifying bottlenecks, and ensuring optimal performance. Traditional tools such as tracert on Windows and traceroute on Linux have long been used for this purpose, allowing you to trace the routes taken by packets from the originating machine to a destination. However, as networks have grown more complex with the introduction of firewalls, load balancing, and cloud-based infrastructures, these older tools have shown their limitations.
To address these challenges, more advanced alternatives have emerged. On Windows, Test-NetConnection, a modern PowerShell command, provides a versatile and user-friendly way to diagnose network issues, offering not only route tracing but also port testing and latency analysis. On Linux, mtr (my traceroute) has become the gold standard for real-time network monitoring, combining the functionality of ping and traceroute to provide continuous, dynamic insights into network performance.
Both tools go beyond basic path tracing, offering network administrators and IT professionals a more accurate and detailed view of connectivity issues. Whether diagnosing packet loss, latency spikes, or unexpected routing behavior, Test-NetConnection and mtr provide powerful solutions tailored for modern network environments. Understanding how to use these tools effectively can make all the difference in identifying and resolving connectivity problems quickly and efficiently.
Verifying and Installing
To use Test-NetConnection and mtr effectively, the first step is to verify their availability on the system. If they are not installed, they can be easily added by built-in package managers or system features.
On Windows, Test-NetConnection is included by default in modern versions of the operating system, starting from Windows 8.1 and Windows Server 2012 R2. To check whether it is available, you open PowerShell and run the command
Test-NetConnection google.com -TraceRouteIf the command executes and returns a trace of network hops, the tool is working properly. If PowerShell returns an error stating that the command is not recognized, it might indicate that the system is running an outdated version of Windows or that PowerShell is not properly configured. In such cases, ensure that PowerShell 5.0 or later is installed and running. Windows updates generally include this tool, but upgrading to the latest Windows version or entering the command
Get-Command Test-NetConnectionto confirm its availability can help troubleshoot issues.
On Linux, mtr is not always installed by default, but checking its presence is straightforward: open a terminal and run
mtr --versionIf mtr is installed, the command returns its version number. A system response of command not found means the tool needs to be installed, for which Debian-based systems such as Ubuntu would use
sudo apt update && sudo apt install mtr -yOnce installed, mtr can be tested by running
mtr google.comwhich should display a live, continuously updating trace of network hops, confirming that the tool is installed and functioning properly (Figure 1).

Ensuring that the appropriate tool is available on Windows or Linux is essential for network diagnostics. With both tools correctly set up, you can efficiently analyze network performance, troubleshoot connectivity problems, and gain deeper insights into your Internet connections.
The Linux mtr Tool
The powerful and versatile mtr network diagnostic tool combines the functionality of the traditional traceroute and ping utilities into a single dynamic interface. It is widely used in Linux environments to diagnose network connectivity issues, identify latency problems, and pinpoint packet loss across the network path. Unlike its Windows counterpart, Test-NetConnection, which is more focused on basic connectivity testing and port probing, mtr provides a continuous, real-time analysis of the network path.
The mtr command operates by sending a sequence of packets to a destination host, much like traceroute, but it goes a step further by continuously monitoring the path and gathering statistics over time, providing a more comprehensive view of network performance, including metrics such as packet loss, latency, and jitter for each hop along the route. The tool's ability to refresh and update these metrics in real time sets it apart from traditional diagnostic utilities, which often provide only a static snapshot of the network path.
One of the key strengths of mtr is its interactive and user-friendly interface. When run in its default mode, mtr displays a table that lists each hop between the source and destination, along with detailed statistics for each hop. These statistics include percent packet loss, the number of packets sent, the last recorded latency, the average latency, and the best and worst latency measurements. This level of detail allows you to quickly identify problematic nodes in the network, such as routers or switches that might be experiencing high latency or dropping packets.
Another notable feature of mtr is its ability to operate in both Internet Control Message Protocol (ICMP) and Transmission Control Protocol (TCP)/User Datagram Protocol (UDP) modes. By default, mtr uses ICMP packets, which are similar to those used by the ping command. However, you can also configure the tool to use TCP or UDP packets, which can be particularly useful for diagnosing issues in environments where ICMP traffic is restricted or blocked. This flexibility ensures that mtr can adapt to a wide range of network configurations and troubleshooting scenarios.
The mtr tool also includes several advanced options that allow you to customize its behavior. For example, you can specify the number of packets to send per hop, set the interval between packets, or limit the number of hops traced. Additionally, mtr supports both IPv4 and IPv6, making it a future-proof tool for diagnosing connectivity issues in modern networks. The ability to export results to a file or display them in a graphical format further enhances its utility, particularly for generating reports or sharing findings with colleagues.
Despite its many advantages, mtr does have some limitations. For instance, because it relies on sending a continuous stream of packets, it can generate significant network traffic, which might not be desirable in bandwidth-constrained environments. Additionally, some network devices might be configured to deprioritize or drop ICMP traffic, which can lead to inaccurate results. In such cases, switching to TCP or UDP mode might help mitigate these issues, but it is important to be aware of the potential for false positives or misleading data.
In comparison to Test-NetConnection on Windows, mtr offers a more granular and dynamic approach to network diagnostics. Although Test-NetConnection is excellent for quick connectivity checks and port testing, it lacks the continuous monitoring and detailed hop-by-hop analysis provided by mtr, which makes mtr particularly well-suited for diagnosing complex network issues, such as intermittent packet loss or routing problems, where a single snapshot of the network might not be sufficient to identify the root cause.
PowerShell Test-NetConnection
Test-NetConnection is a versatile and user-friendly network diagnostic cmdlet available in Windows PowerShell that's designed to simplify the process of testing network connectivity and troubleshooting common network issues. It serves as a modern replacement for older command-line tools like ping and tracert, offering a more streamlined and feature-rich experience for Windows users. Although it might not have the real-time, continuous monitoring capabilities of the Linux mtr tool, Test-NetConnection excels in providing quick, actionable insights into network connectivity, port availability, and route tracing.
Test-NetConnection is designed to test whether a remote host or service is reachable from the local machine. By default, it performs an ICMP echo request, similar to the traditional ping command, to determine whether the target host is online and responsive. However, what sets Test-NetConnection apart is its ability to perform more advanced tests, such as checking the availability of a specific TCP port on a remote host, which makes it particularly useful for diagnosing issues with network services, such as web servers, databases, or email servers, where simply knowing that a host is reachable might not be sufficient to confirm that the service is functioning correctly.
One of the key strengths of Test-NetConnection is its simplicity and ease of use. Running the cmdlet with just a target hostname or IP address as an argument provides a concise summary of the connection status, including the remote host's IP address, the interface used for the connection, and the round-trip time (latency) of the ICMP request (Figure 2). For more detailed diagnostics, users can leverage additional parameters, such as -Port to test a specific TCP port or -TraceRoute to perform a route trace similar to the tracert command. This flexibility allows Test-NetConnection to adapt to a wide range of troubleshooting scenarios, from basic connectivity checks to more complex service-level diagnostics.

The -TraceRoute parameter is particularly noteworthy because it allows you to trace the path that packets take to reach the destination host. Although it does not provide the continuous, real-time monitoring and detailed statistics offered by mtr, it does offer a clear and concise view of the network path, including the number of hops and the latency to each intermediate node, which can be invaluable for identifying routing issues or network bottlenecks, especially in environments where a Linux-based tool such as mtr is not available.
Another useful feature of Test-NetConnection is its ability to perform detailed diagnostics with the -DiagnoseRouting parameter. This option provides insights into the routing behavior of the local machine, including the source address used for the connection, the next hop, and the route taken to reach the destination. This level of detail can help identify misconfigurations or inconsistencies in the local routing table that could be contributing to connectivity issues.
Test-NetConnection also integrates seamlessly with other PowerShell cmdlets, allowing you to incorporate its functionality into scripts and automated workflows. For example, the results of a Test-NetConnection command can be piped to other cmdlets for further processing, such as filtering, formatting, or exporting to a file. This ability makes it a powerful tool for administrators who need to perform routine network diagnostics across multiple systems or generate reports for audit purposes.
Despite its many advantages, Test-NetConnection does have some limitations. For instance, it does not provide the same level of granularity or real-time monitoring as mtr, which can make it less effective for diagnosing intermittent or complex network issues. Additionally, like mtr, it relies on ICMP by default, which may be restricted or blocked in some environments. Whereas the -Port parameter can help mitigate this limitation by using TCP instead of ICMP, it is important to be aware of the potential for false negatives or incomplete results in such cases. In comparison to mtr, Test-NetConnection is more focused on simplicity and ease of use, making it an excellent choice for quick connectivity checks and basic troubleshooting.
A Real-World Scenario
As a real-world example of how mtr can be used to diagnose and resolve a network issue, imagine you are a network administrator for a medium-sized company, and employees in one of your branch offices are experiencing slow and unreliable connectivity to the company's cloud-based application hosted on a remote server. Users report that the application frequently times out, making it difficult to complete their work. You suspect the issue might be related to network performance, so you decide to use mtr to investigate.
To begin, you open a terminal on a Linux machine in the affected branch office and trace the network path to the cloud server with
mtr -rw <cloudapp>.<company.com>The mtr command sends packets to the destination and displays a real-time table of each hop along the route, including statistics for packet loss, latency, and jitter. After a few moments, you will notice that the output shows a consistent pattern of high packet loss (~20%) and elevated latency (>150ms) at a specific hop. This hop corresponds to a router operated by an Internet service provider (ISP) that handles traffic between your branch office and the cloud server.
To confirm the issue, you let mtr run for several minutes, observing that the packet loss and latency spikes persist at the same hop. These results strongly suggest that the problem lies with the ISP's router or the network segment it manages. You also notice that the latency and packet loss are minimal for hops before and after the problematic one, which further isolates the issue to that specific point in the network path.
Armed with this detailed information, you contact the ISP's technical support team and provide the mtr report. The ISP investigates and discovers that the router in question is experiencing hardware degradation, causing it to drop packets and introduce delays. The ISP replaces the faulty router, and once the repair is complete, you run mtr again to verify the fix:
mtr -rw <cloudapp>.<company.com>This time, the output shows no packet loss and significantly reduced latency across all hops, including the previously problematic one. The connection to the cloud application is now stable, and employees in the branch office report that the application is functioning smoothly.
In this scenario, mtr proved to be an invaluable tool for diagnosing the root cause of the connectivity issue. Its ability to provide continuous, real-time monitoring of the network path allowed you to pinpoint the exact location of the problem, which would have been difficult to identify with traditional tools such as ping or traceroute. By leveraging the detailed statistics of mtr, you were able to provide the ISP with concrete evidence of the issue, leading to a swift resolution.
To troubleshoot a similar network issue on Windows with Test-NetConnection, you would begin by opening PowerShell. In this case, you want to trace the route to the cloud-based application server that the employees are having trouble reaching by using the command
Test-NetConnection -<ComputerName> <cloudapp>.<company.com> -TraceRouteThis command instructs PowerShell to trace the network path to the cloud server. As it runs, you'll see a detailed report of each hop along the route, along with its latency. For instance, if a particular hop has an issue, you might see that it has significantly increased latency or packet loss. For example, high latency at the the fourth hop would indicate a potential problem in the network path, which would be consistent with the network issue your employees are experiencing.
If you see high latency or packet loss at one of the hops, you can reasonably deduce that the problem lies at that specific point in the network, whether it be a router operated by an ISP or another part of the network infrastructure. In this case, because you see consistent packet loss or high latency at the same hop over several runs, it's likely the issue stems from the ISP's network or the hardware in that segment.
To further investigate, you can use Test-NetConnection to verify the basic connectivity to the cloud server,
Test-NetConnection -<ComputerName> <cloudapp>.<company.com>which would be like running a ping test in a typical troubleshooting session. This command will give you a straightforward report on whether the server is reachable and will provide the round-trip time for the connection. A significant delay or no response would confirm that the issue is likely with the network route, which was already suggested with the -TraceRoute parameter. You can then pass this data along to the ISP's support team for further investigation. This approach allows you to isolate the problem quickly to a specific network segment, making it much easier to work with the ISP to resolve the issue.
Conclusion
Test-NetConnection on Windows and mtr on Linux are powerful tools for diagnosing network issues. Whereas mtr provides real-time packet loss and latency analysis, Test-NetConnection integrates multiple diagnostics in a single command. Each tool excels in its environment, helping IT professionals quickly pinpoint and resolve connectivity problems. Mastering these utilities ensures more efficient troubleshooting and better network performance.