What is the Tracert or Traceroute command and what is it for?

Many times users can find that we cannot access a computer on our network, a website, a resource on the network, etc. That is why, so one of the most useful tools we have to diagnose connection problems is the so-called ” tracert ” or ” traceroute ” that allows us to know which route we pass until we reach the destination host. In this article we will explain what it is for, how it can be used and what options this command has available on all operating systems.




What is Tracert or Traceroute

The Tracert command is executed in the command prompt console on Windows operating systems. Thanks to this command, we can keep track of packages that come from a host. When we execute the “Tracert” command, we obtain a statistic of the network latency of these packets, which is an estimate of the distance at which the communication ends are. This command is not exclusive to Windows operating systems, on UNIX, Linux and OSX this command is called “Traceroute” and does the same as in Windows operating systems.

How the Tracert or Traceroute command works

The Tracert diagnostic command determines the route to a destination entered by sending “ICMP echo” packets, using the Internet control message protocol known as “ICMP” to the host destination. These packets that are sent use the default lifetime values (TTL), or that we indicate using the Tracert command options.

When we send a packet of data, the routers decrease this TTL of the packet by one unit before forwarding the packet to the next point in the path. Therefore, thanks to the TTL we can know the amount of “jumps” that the package has given from an origin to a destination. However, when the TTL of a packet reaches zero, without reaching its final destination, the router returns an ICMP “Timeout” message to the source device.

The Tracert command works by first sending an “ICMP echo” packet with a TTL of 1 and increases the TTL by 1 on each subsequent transmission, until it reaches the final destination or until the maximum TTL is reached. Thanks to the intermediate routers that return the ICMP “Timeout” message, we can know the route the data packet sent from our computer to the destination host is following. However, it may happen that some routers send TTL “Timeout” packets without warning and these packets are invisible to the Tracert command.

Once we know this, we can understand that the Tracert command works by displaying, on the screen, an ordered list of intermediate routers that return the ICMP “time-out” message. Let’s look at an example by entering the Tracert command www.redeszone.net in the command prompt console:

In the image above of the Tracert command to our website www.redeszone.net, we can see that to get to the destination web server you have to make eight jumps. In addition, in each jump it shows us the minimum, average and maximum time of each jump of the data packet. In this specific case we can see how some of this data does not provide them, and that is why it shows an asterisk.

How can we use the TRACERT command to detect problems

The Tracert command can be very useful to find out if there is a problem on the way to a computer on the internal, external network or website. Imagine that you want to enter our website www.redeszone.net, and the web does not load. Apart from carrying out, for example, a PING towards our website, we can also execute the Tracert command to find out if communication to the destination host is lost or interrupted at some point along the way. Thanks to these results, we can find out at what point the problem occurs and even notify them to solve the problem on said router, or if it is at the internal network level to be able to solve it.

We have to keep in mind that the tracert command is very useful in very large local networks, where a packet can choose different paths to reach its destination host. Thanks to this, we can know which equipment the data packet is going through, and thus improve the performance of the local network. Now we will see an example of what happens when the Tracert command sends a data packet that cannot reach its destination:

As we can see the package is jumping from router to router, looking for the destination host. Some routers show the “timeout” error message, this is because they are likely to have limited tracert on their computers since it is part of the operator’s internal network.

Tracert command options

When we use the Tracert command, in addition to writing the Tracert command and the IP address or server name in the system symbol console, we can write a series of options to modify or obtain extra data, for this we must enter the command “Tracert ”A space, and followed one of the options that we indicate below. An example would be: Tracert -d 192.168.1.1

Let’s see what options we have:

  • -d: This option causes the Tracert command not to perform a DNS lookup on all IP addresses. That is, instead of showing the router’s name, it will only show us its IP address.
  • -h: This option allows us to specify the number of maximum jumps that the Tracert command can perform. To do this we must enter the command as follows. Tracert -h «number of hops» «ip address or host name» .
  • -j: This option is to indicate to the tracert command what will be the non-strict origin of the request to the host. To do this, we must enter the -j option, a space, followed by the source host we want. It only works with IPv4 IP addresses.
  • -w: This option is used to indicate the maximum waiting time in milliseconds in each response before giving connection failure. To do this we must enter the -w option, a space, and the time in milliseconds we want.
  • -R: This option is used to follow the return route. It only works with IPv6 IP addresses.
  • -S: This option serves to indicate to the tracert command which source address we want to use. To do this we must enter the -s option, a space, followed by the source IP address.
  • -4: This option serves to force the use of IPv4 IP addresses.
  • -6: This option helps us to force the use of IPv6 IP addresses.

As we have seen, the Tracert command not only helps us to know which route the sending of a data packet takes to its final host destination. But it also helps us to diagnose the performance of the network, if there is a fault in any internal router of our local network, or if there is a problem in some external router to another server. Without a doubt, the tracert command can clarify many doubts and questions about a network problem that we have. If you have any questions, leave it to us in the comments.