General concepts
The Traceroute command, also known as tracert in Windows, is a network diagnostic tool used to trace the path a data packet takes from a source to its final destination on the Internet. This tool is very useful for identifying possible network problems, such as high latency or lost packets.
In the process of tracing the route, the Traceroute command sends a series of data packets across the network, and each packet includes a TTL (Time To Live) number starting with a value of 1. Each time a packet arrives at a node on the network, the node decrements the TTL value by 1 before forwarding the packet. When the TTL value reaches 0, the packet is discarded and the node sends a “time exceeded” message to the source, indicating that the packet could not reach its destination and that the allowed time has been exceeded.
The Traceroute command repeats this process for each node on the route until the packet reaches its final destination. At the end of the process, the Traceroute command displays a list of the nodes on the route, along with the IP address of each node and the response time it took for the packet to reach that node.
Detailed package sequence
The detailed operation of the Traceroute command can be expressed as follows:
- The Traceroute command sends a data packet with an initial TTL value of 1 to the final destination.
- The first node on the packet path will receive the packet, decrement the TTL value by 1, and send a “TTL expired” response to the source.
- The origin will receive the “time exceeded” response and record the IP address of the first node.
- The Traceroute command will send another data packet with a TTL value of 2 to the final destination.
- The second node on the packet path will receive the packet, decrement the TTL value by 1, and send a “time exceeded” response to the source.
- The origin will receive the “time exceeded” response and record the IP address of the second node.
- This process will be repeated for each node in the packet's path, increasing the TTL value at each iteration until the packet reaches the final destination.
- Once the packet reaches the final destination, the Traceroute command displays the full path of the packet, including the IP address and response time of each node on the route.
What is the command in MikroTik RouterOS
For an example of how to use the Traceroute command on a Mikrotik RouterOS, the following steps can be followed:
Access the Mikrotik router interface and open the command console.
Enter the Traceroute command followed by the IP address or domain name of the destination to which you want to trace the route. For example, to trace the path to the Google website, you could use the following command:
[admin@MikroTik] > tool traceroute google.com
Wait for the route tracing process to complete. Depending on the number of nodes on the path and the latency of the network, this process may take a few seconds or several minutes.
Review the results of the Traceroute command. The output of the command will display a list of all nodes on the path to the destination, along with the IP address of each node and the response time it took to reach that node. For example:
ADDRESS STATUS
1 192.168.1.1 1ms 1ms 1ms
2 10.0.0.1 5ms 5ms 5ms
3 200.10.0.1 10ms 10ms 10ms
4 200.10.1.1 15ms 15ms 15ms
5 200.10.2.1 20ms 20ms 20ms
6 200.10.3.1 25ms 25ms 25ms
7 8.8.8.8 30ms 30ms 30ms
[admin@MikroTik] >
In this example, you can see that the data packet passed through six different nodes before reaching the final destination (8.8.8.8).
Difference between Linux Traceroute and Windows Tracert
There are some key differences between the two commands:
Command syntax: The syntax of the Linux Traceroute command and the Windows Tracert command is slightly different. On Linux, the command is written as “traceroute”, while on Windows it is written as “tracert”.
Command options: The Linux Traceroute command and the Windows Tracert command have different command options. For example, on Linux, the Traceroute command supports options such as -I to specify the use of ICMP instead of UDP, while on Windows, the Tracert command supports options such as -h to specify the maximum number of hops.
Output format: The output format of Linux Traceroute command and Windows Tracert command is also different. On Linux, the Traceroute command displays the IP address and response time of each node on the route, while on Windows, the Tracert command displays the name of each node and the response time.
advanced functionality: The Linux Traceroute command is capable of performing more advanced route traces, such as reverse route traces and multipath traces. Additionally, the Linux Traceroute command is more customizable than the Windows Tracert command, allowing the user to specify the port and packet size.
In summary, although both commands are similar in their basic functionality, there are some significant differences in command syntax, command options, output format, and advanced functionality.
Example of the command in Linux
traceroute google.com
1 192.168.1.1 (192.168.1.1) 1.107 ms 1.237 ms 1.353 ms
2 10.255.255.1 (10.255.255.1) 14.527 ms 14.622 ms 14.719 ms
3 172.16.1.1 (172.16.1.1) 25.817 ms 25.912 ms 26.005 ms
4 172.16.2.1 (172.16.2.1) 38.320 ms 38.414 ms 38.505 ms
5 203.208.222.125 (203.208.222.125) 38.601 ms 37.301 ms 37.392 ms
6 72.14.195.12 (72.14.195.12) 60.225 ms 60.318 ms 60.415 ms
7 108.170.247.65 (108.170.247.65) 61.424 ms 61.511 ms 61.605 ms
8 108.170.235.225 (108.170.235.225) 62.719 ms 62.814 ms 62.908 ms
9 108.170.232.193 (108.170.232.193) 63.016 ms 63.103 ms 63.197 ms
10 74.125.244.16 (74.125.244.16) 63.300 ms 63.386 ms 63.480 ms
11 172.253.50.138 (172.253.50.138) 64.685 ms 64.781 ms 64.877 ms
12 172.253.66.7 (172.253.66.7) 65.122 ms 65.217 ms 65.314 ms
13 172.253.50.246 (172.253.50.246) 66.493 ms 66.587 ms 66.680 ms
14 74.125.252.128 (74.125.252.128) 66.879 ms 66.965 ms 67.058 ms
15 216.58.214.142 (216.58.214.142) 67.252 ms 67.365 ms 67.454 ms
Example of the command in Windows
tracert google.com
Tracing route to google.com [172.217.12.142]
over a maximum of 30 hops:
1 1 ms 1 ms 1 ms 192.168.1.1
2 17 ms 17 ms 18 ms 10.255.255.1
3 27 ms 27 ms 27 ms 172.16.1.1
4 40 ms 40 ms 40 ms 172.16.2.1
5 38 ms 37 ms 37 ms 203.208.222.125
6 59 ms 59 ms 59 ms 108.170.247.65
7 61 ms 61 ms 61 ms 108.170.235.225
8 63 ms 63 ms 63 ms 108.170.232.193
9 64 ms 64 ms 64 ms 74.125.244.16
10 67 ms 67 ms 67 ms 172.253.50.138
11 67 ms 67 ms 67 ms 172.253.66.7
12 69 ms 69 ms 69 ms 172.253.50.246
13 66 ms 66 ms 66 ms 74.125.252.128
14 66 ms 66 ms 66 ms 216.58.214.142
Trace complete.
Which is better?
In general, both commands (traceroute
y tracert
) are useful for tracking down network problems and diagnosing connectivity issues. Choosing which one to use will depend on operating systems and personal preferences.
Regarding the specific characteristics, traceroute
on Linux offers more options and advanced features than tracert
on Windows, such as support for UDP and TCP protocols, and the ability to customize the timeout and hop count. However, tracert
on Windows it is easier to use and can provide clearer, more readable information in some cases.
In summary, both tools have their strengths and weaknesses, and choosing one or the other will depend on the specific use and personal preferences.