fbpx

How the Traceroute command works

Facebook
Twitter
LinkedIn
WhatsApp
Telegram

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:

  1. The Traceroute command sends a data packet with an initial TTL value of 1 to the final destination.
  2. 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.
  3. The origin will receive the “time exceeded” response and record the IP address of the first node.
  4. The Traceroute command will send another data packet with a TTL value of 2 to the final destination.
  5. 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.
  6. The origin will receive the “time exceeded” response and record the IP address of the second node.
  7. 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.
  8. 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:

  1. Access the Mikrotik router interface and open the command console.

  2. 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
				
			
  1. 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.

  2. 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:

  1. 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”.

  2. 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.

  3. 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.

  4. 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.

Do you want to suggest a topic?

Every week we post new content. Do you want us to talk about something specific?
Topic for the next blog

Leave a comment

Your email address will not be published. Required fields are marked with *

DISCOUNT CODE

AN24-LIB

applies to MikroTik books and book packs

Days
Hours
Minutes
Seconds

Introduction to
OSPF - BGP - MPLS

Sign up for this Free course

MAE-RAV-ROS-240118
Days
Hours
Minutes
Seconds

Sign up for this Free course

MAS-ROS-240111

Promo for Three Kings Day!

KINGS24

15%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the Three Kings Day discount code!

* promotion valid until Sunday January 7, 2024
** the code (KINGS24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

New Year's Eve Promo!

NY24

20%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the New Year's Eve discount code!

* promotion valid until Monday, January 1, 2024
** the code (NY24) applies to shopping cart
*** buy your course now and take it until March 31, 2024

Christmas discounts!

XMAS23

30%

all the products

MikroTik courses
Academy courses
MikroTik books

Take advantage of the discount code for Christmas!!!

**codes are applied in the shopping cart
Promo valid until Monday December 25, 2023

CYBER WEEK DISCOUNTS

CW23-MK

17%

all MikroTik OnLine courses

CW23-AX

30%

all Academy courses

CW23-LIB

25%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Cyber ​​Week!!!

**codes are applied in the shopping cart
Promo valid until Sunday December 3, 2023

BLACK FRIDAY DISCOUNTS

BF23-MX

22%

all MikroTik OnLine courses

BF23-AX

35%

all Academy courses

BF23-LIB

30%

all MikroTik Books and Book Packs

Take advantage of the discount codes for Black Friday!!!

**Codes are applied in the shopping cart

codes are applied in the shopping cart
valid until Sunday November 26, 2023

Days
Hours
Minutes
Seconds

Sign up for this Free course

MAE-VPN-SET-231115

Halloween promo

Take advantage of discount codes for Halloween.

Codes are applied in the shopping cart

HW23-MK

11% discount on all MikroTik OnLine courses

11%

HW23-AX

30% discount on all Academy courses

30%

HW23-LIB

25% discount on all MikroTik Books and Book Packs

25%

Register and participate in the free course Introduction to Advanced Routing with MikroTik (MAE-RAV-ROS)

Today (Wednesday) October 11, 2023
7pm to 11pm (Colombia, Ecuador, Peru)

MAE-RAV-ROS-231011