Trace route command tracert
Release date:
2019-09-17

Viewed:

0

The tracert program allows users to track routes from one host to any other host in the world.

Tracert is implemented using ICMP messages. To determine the name and IP address of all routers between the source and destination, the tracert in the source host sends a batch of ordinary IP datagrams to the destination host. Each of these datagrams carries a UDP segment with an unreachable UDP port number. The first datagram has a TTL=1; the second datagram has a TTL=2; the third datagram has a TTL=3, and so on. The source host also starts a timer for each datagram. When the nth datagram arrives at the nth router, the nth router just observes the TTL termination of the datagram. According to the IP protocol, the router will discard the IP datagram and send a warning message to the source host. (Type: 11, code: 0). The warning message contains the name and IP address of the router. When the ICMP packet reaches the source host, the source host obtains a round-trip delay from the timer, and obtains the name and IP address of the nth router from the ICMP packet.

How does the tracert source host know when to stop sending UDP packets?

Because the source host +1s the TTL value of each datagram it sends, one of these datagrams will eventually reach the destination host along this path. The destination host does not drop the message because it has reached its final destination. How do ICMP packets be sent back to the source host?

Because the datagram contains an unreachable port number, the destination host sends an ICMP packet with the destination port unreachable (type 3, code 3) to the source host. The source host receives the special ICMP packet. At that time, it knows that it does not need to send another probe packet.

Note: The tracert client must be able to instruct the operating system to generate a UDP datagram with a specific TTL value, and must be able to be notified by its operating system of the time the ICMP message was reached.

Master the ability to use the trace route command tracert to measure routing conditions, that is, to display the path that the packet passes through to the destination host.

The basic usage of the traceroute command is to type at the command prompt.

'tracert host_name'

Or 'tracert ip_address',

Among them, tracert is the name of traceroute on the Windows operating system.

C:\Users\yangbo>tracert www.yangbo.pro


Track by up to 30 hops

To the route of www.yangbo.pro [101.132.67.215]:


 1 3 ms 3 ms 3 ms 222.20.119.254

 2 2 ms 17 ms 3 ms 192.168.243.29

 3 5 ms 5 ms 2 ms 192.168.243.129

 4 5 ms 5 ms 2 ms 202.114.1.186

 5 6 ms 6 ms 5 ms 202.112.53.81

 6 * 2 ms 5 ms 101.4.114.229

 7 24 ms 21 ms 29 ms 101.4.112.62

 8 * * 57 ms 101.4.117.26

 9 * 20 ms 20 ms 101.4.112.42

10 * * 23 ms 101.4.115.173

11 21 ms 21 ms 21 ms 101.4.135.202

12 22 ms 22 ms 20 ms 101.4.135.214

13 22 ms 23 ms 23 ms 219.224.103.226

14 23 ms 22 ms 21 ms 140.205.50.230

15 20 ms 21 ms 21 ms 106.11.75.2

16 * * * Request timed out.

17 31 ms 24 ms 31 ms 11.218.122.61

18 22 ms 19 ms 19 ms 101.132.67.215