The Traceroute tool is used to track the transmission path of datagrams: When a datagram travels from one computer to another, it passes through multiple gateways, and the traceroute command can find all the routers on the datagram transmission path. The transmission path traced through the Traceroute tool is just one of the many pathways between the two computers, so it is not certain that the fire assumes that the datagram will always go this way.
Traceroute process
1. Set the TTL value of the ICMP Echo Request message delivered to the destination IP address to 1, which passes the first router with a TTL value minus 1, at which time the new TTL value is 0.
2. Because the TTL value is set to 0, the router determines that it should not attempt to continue forwarding datagrams at this time, but instead discards the datagram directly. Because the datagram's lifetime (TTL value) has expired, the router sends an ICMP time-out, that is, the TTL value expiration information returned to the client computer.
3. At this point, the client computer that issued the traceroute command displays the name of the router and can then send an ICMP Echo message and set the TTL value to 2.
4. The first router still decrements the TTL value by 1, and then forwards the datagram to the next hop on the transport path, if possible. When the datagram arrives at the second router, the TTL value is subtracted by 1 and becomes 0.
5. The second router, like the first route, discards the datagram and returns an ICMP timeout message as if it were the first router.
6. The process continues, and the traceroute command continuously increments the TTL value, while the router on the transmission path decrements the value until the datagram eventually arrives at the intended destination.
7. When the destination computer receives the ICMP echo Request message, an ICMP echo Reply message is returned.
Command format
traceroute [Options] [host]
Command parameters
-4
Use IPV4.
-6
Use IPV6.
-I.
Use the ICMP ECHO probe.
-T
Use TCP SYN probing.
-U
Using UDP datagram probing, this is the default probing method.
-D
Enable the Socket-level debug feature (if supported by the Linux kernel).
-F
Set the Don ' t Fragment bit and do not allow IP packet fragmentation.
-F First_ttl
Sets the size of the live value TTL for the first instrumented packet, with a default value of 1.
--help
Printing Help information
-M Max_ttl
Specifies the maximum number of hops at the time of the probe, which is the maximum TTL value, and the default value is 30.
-N
The information is displayed without attempting to map the IP address to the host name.
-P Port
Set the destination port number. For ICMP tracing, the sequence value that specifies ICMP.
-Q nqueries
Sets the number of probe packets per hop, the default value is 3.
-R
Bypass the normal routing table and send directly to the network direct-attached host.
-T TOS
When IPV4 is used, the Type of Service value is set, and when IPV6 is used, the traffic Control value is set.
-V
Print version Information
-W waittime
Sets the number of seconds to wait for a test response, with a default value of 5.0.
Instance
A) displays the transmission path of the native to 10.6.0.30 datagram.
traceroute example.comtraceroute to example.com (93.184.216.34), hops max, byte packets 1 10.1.228.254 (10.1.228.254) 1.545 Ms 1.470 Ms 1.381 MS 2 192.168.100.2 (192.168.100.2) 0.818 Ms 0.691 Ms 0.601 MS 3 * * * 4 * * * 5 * * * ... * * * * * * *29 * * *30 * * * *
The record sequence number starts at 1, each row record represents a hop, and each hop represents a gateway. In addition to the host name and its IP address, there is a 3 time per row of records, which is the default-Q value. These time values represent the round-trip time that datagrams arrive at the router. The record is indicated by * * * Because the ICMP response was not received within 5 seconds of the default wait time. This may be because the firewall filters out the ICMP return information.
Linux command-traceroute: Datagram Transmission path tracking