Current location - Quotes Website - Collection of slogans - What protocol are traceroute and tracert based on?
What protocol are traceroute and tracert based on?
Is based on ICMP.

TCP/IP Protocol Details Volume 1 Section 8.2 mentioned that when routing tracing, UDP datagram is sent to the destination host, and the set port value is very high, generally greater than 30,000, to avoid the port number being used. The original text is as follows:

"Traceroute sent a UDP datagram to the destination host, but it chose an impossible value as the UDP port.

Number (greater than 30,000), which makes it impossible for any application of the target host to use this port. Because, when the datagram

Upon arrival, the UDP module of the destination host will generate an ICMP message with an "unreachable port" error (see section 6). 5).

In this way, what Traceroute program needs to do is to distinguish whether the received ICMP message is timeout or port unreachable, so as to make a judgment.

When will it end? "

The router in the middle returns the timeout message of ICMP type 1 1 and code 0 after TTL=0.

After the destination IP arrives, unpack and analyze the UDP content, and find that the port is unreachable, and return to ICMP type 3 and code 3 (destination port unreachable).

Tracert and TCP/IP detailed descriptions in windws host are slightly different. Tracert of windows host is directly realized by ping, but the TTL value of this ping is increased by 1 after three packets, and an asterisk is returned after it cannot be reached or times out, and the next TTL packet continues to be sent until it reaches the default setting of 30 hops. Generally, traceroute on routers and switches is UDP, and the number of packets sent by each TTL, the maximum number of hops and the UDP starting port can be adjusted.