What is Traceroute (tracert)?

The windows tool tracert and its Linux counterpart, traceroute, offer a simple solution for taking a closer look at the routes of data packages. Based on the results, users can find out which particular stations dispatched data packages pass through on their way to their recipients and where exactly they run into trouble. Complicated detours or downed routers are able to be identified this way, thus bringing you one step closer to solving the problem.

Traceroute is a command line tool that can be started with a prompt and delivers the user information on the paths of data packages within a given network. To this end, the program identifies via which routers and internet nodes sent packages follow before ending up with their host. On top of this, the user also receives information on the number of stations passed as well as the respective response time; this clarifies as to where exactly bottlenecks are occurring on the data route. Traceroute also informs users in cases where certain routers have not been successfully reached. Linux, Unix, and Mac OS users can start the analysis tool by using the command line and entering traceroute; on Windows PCs the application is called tracert.

How does traceroute work?

Traceroute, or tracert, sends small data packages with limited time to live (TTL) to the target host. Contrary to what its name may imply, TTL does not actually deal with any sort of time units. Instead, it focuses on the maximum number of stations, or hops, that a given online data package is allowed to cover. Every passed router automatically reduces the TTL’s value by 1. In order to request an answer from the accessed router, tracert sends automatic pings (ICMP), while traceroute, as programmed by default, sends UDP packages. The router that is reached first on the way to the target host receives a package with a TTL of 1. Following this, the router devalues the TTL to 0.

As a result, the data package is no longer forwarded, and the router instead sends the answer ‘Time to live exceeded in transit’ along with its IP address back to the original exit server. Tracert records this information along with the transfer duration and then repeats the process with a TTL raised by the value of 1. This process is repeated until either the target host or the defined maximum number of hops, i.e. the defined TTL, is reached. The located host then sends the message ‘Port unreachable’ and terminates registering the IP trace route. Following its default settings, a total of three packages is sent to each host, which is why traceroute displays three response time statements, all of which are issued to the millisecond.

Detecting traceroute online

Those wishing to forego the task of dealing with the command line are able to utilize traceroute online. Many websites offer the option of tracking the route to the targeted IP address and, to a certain extent, even work with visual traceroute tools that clearly display gathered information. In most cases, the sender address is the web server on which the used website is hosted (not the address of the respective user). Here is a list of sites that enable trace route tracking:

Traceroute – how to get things done using the command tool

In order for the data package to get analyzed using this method, the command line has to be opened. This functions in different ways depending on the operating system in use. Entering the command line can only be carried out by using the keyboard. Commands need to be manually entered and are executed with the ‘Enter’ button.

The following is an introduction on how to use tracert and traceroute.

Execute tracert on Windows operating systems

Users of Windows systems first need to enter the tracert command in cmd.exe, which is also known as the Windows command prompt. cmd.exe opens a window with the command line and input prompt and displays an extended version of the command line interpreter from MS-DOS. The easiest way to start cmd.exe is with the keyboard shortcut ‘Window logo key’ + ‘R’. After entering ‘cmd’ into the opened text box and pushing the ‘Enter’ button, the Windows input prompt opens and the tracert command is now ready to be put in. Tracking the route to the target host is started with the following command:

tracert www.address-of-the-target-host.com

If known, the IP address of the target can be given instead of the domain. Tracking can be further configured with the following entries:

  1. Intermediate addresses will not be resolved to host names.
tracert -d www.address-of-the-target-host.com
  1. Determine the maximum number of hops (stations)
tracert -h NUMBER www.address-of-the-target-host.com
  1. Loose Source Route’ according to the host list (only IPv4)
tracert -j www.address-of-the-target-host.com
  1. Time limit for an answer in milliseconds
tracert -w NUMBER www.address-of-the-target-host.com
  1. Trace round-trip path (only IPv6)
tracert -R  www.address-of-the-target-host.com
  1. For using source addresses (only IPv6)
tracert -S  www.address-of-the-target-host.com
  1. Force use of IPv4
tracert -4  www.address-of-the-target-host.com
  1. Force use of IPv6
tracert -6  www.address-of-the-target-host.com

In place of the word ‘NUMBER’ enter the desired value as a number. Entering a combination of the commands can be achieved by separating them with spaces in front of the target address. 

Starting traceroute on UNIX operating systems

Linux operating systems and Mac OS X are based on Unix and both contain command lines that allow the user to control the system via input prompt. Newer versions of OS X have important command line diagnostic tools, such as traceroute, integrated in the Network Utility application; these can be chosen through a graphical user interface. The easiest way to access this network service is via the search function Spotlight, which is carried out by selecting the very first hit located after the entry ‘Network Utility’. Traceroute is started through the following command:

traceroute www.address-of-the-target-host.com

Those working directly in the terminal while using Linux operating systems are able to configure the Traceroute:

  1. Addresses will not be terminated in host names
traceroute -n www.addresses-of-the-target-host.com
  1. Determine the maximum number of hops (stations)
traceroute -m NUMBER www.address-of-the-target-host.com
  1. Define the number of probe packages per hop
traceroute -q NUMBER www.address-of-the-target-host.com
  1. Time limit for an answer in seconds
traceroute -w NUMBER www.address-of-the-target-host.com
  1. Specify the TTL with which to start
traceroute -f NUMBER www.address-of-the-target-host.com
  1. Use ICMP Echo for probes
traceroute -I www.address-of-the-target-host.com
  1. Force use of IPv4
traceroute -4 www.address-of-the-target-host.com
  1. Force use of IPv6
traceroute -6 www.address-of-the-target-host.com

As is the case with Windows, these options can also be combined with one another. Linux or Unix systems offer many further settings that can be found on the site computerhope.com.

Using traceroute for a first check for network problems

Traceroute for Linux/Mac and tracert for Windows can be of significant help when solving network-related issues. The command line tool provides insight on whether or not sent packages have taken the appropriate routes on the way to their respective goals. Cumbersome data paths or packages that failed to arrive are often indicative of router issues. Using tracert also allows users to determine the location of a slowed-down station. Due to faulty routing diagrams, a routing loop may occur. The traceroute protocol can discover such mishaps in cases where the same router appears multiple times.

External factors, such as firewalls and re-routing during periods of high traffic, can influence the result of data package tracking; this can lead to incorrect results being displayed.

Was this article helpful?
Page top