About route tracking Directives traceroute Introduction

Source: Internet
Author: User
Tags emit traceroute command

We have used the ping command to check if the host is connected to the destination address, the communication packet communication rate of the host and destination address, the so-called communication packet, which is what TCP/IP,UDP packet.

about route tracking:
The route trace directive is traceroute for Linux, and in Windows it is tracert, which is mostly traceroute.
Traceroute is a tool used to detect the number of gateways that are passed between the host and the target host that emit the packet. The principle of traceroute is to attempt to emit a probe packet with a minimum TTL (Time-to-live) to track the gateway that the packet reaches the target host, and then listen for a response from the gateway ICMP. The size of the sending packet defaults to 38 bytes.

Traceroute program Complete process: First it sends a TTL field of 1 IP packets to the destination host, the first router processing the packet to reduce the TTL value of 1, and then discard the datagram, and send an ICMP message to the source host ("Timeout" information, This message contains the IP address of the router, which gives the address of the first router, and then traceroute sends a TTL of 2 datagram to get the IP address of the second router, continuing this process until the data is reported to the destination host.

1. Command format:

traceroute [parameters] [host]

2. Command function:
The traceroute command allows you to track the routing path of a network packet, with a preset packet size of 40Bytes, which can be set separately by the user.

* * Specific parameter format: **traceroute [-dflnrvx][-f< survival value >][-g< gateway; [-i< network interface;] [-m< survival value;] [-p< communication port;] [-s< source Address;] [-t< service type;] [-w< timeout number of seconds;] [Host name or IP address] [Packet size]

3. Command parameter:-D uses the socket-level troubleshooting function.
-F Sets the size of the live value TTL for the first instrumented packet.
-F set do not leave the break.
-G Sets the source routing gateway, which can be set to a maximum of 8.
-I sends out the packet using the specified network interface.
-I replaces UDP data information with an ICMP response.
-M sets the size of the maximum surviving value TTL for the detection packet.
-N uses the IP address directly instead of the host name.
-P Sets the communication port for the UDP transport protocol.
-R ignores the normal routing Table and sends the packet directly to the remote host.
-S sets the IP address of the local host to send the packet.
-T sets the value of the TOS for the detection packet.
-V shows the execution of the instruction in detail.
-W Sets the time to wait for the remote host to return.
-X turns the correctness of the packet on or off.

**4 instances:
Example 4.1**: Traceroute www.baidu.com

Description
Record by serial number starting from 1, each record is a hop, each hop represents a gateway, we see each line has three times, the unit is MS, is actually the default parameter-Q. The time the gateway responds after a probe packet sends three packets to each gateway, and if you use Traceroute-q 4 www.baidu.com, 4 packets are sent to each gateway. See figure below:

Sometimes when we traceroute a host, we see that some of the rows are represented by asterisks. In this case, it is possible that the firewall has blocked the return information of ICMP, so we have not got any related packet return data.

Sometimes we have a long delay at a certain gateway, it is possible that a gateway is more blocked, or the physical device itself. Of course, if a DNS problem, can not resolve host name, domain name, there will be a long delay phenomenon; You can add the-n parameter to avoid DNS resolution and output data in IP format.
If there are different network segments in the LAN, we can use Traceroute to troubleshoot the problem, whether it is the host problem or the gateway problem. If we encounter a problem through remote access to a server, we use the gateway that the Traceroute tracking packet, submitted to the IDC service provider, but also help to solve the problem, but at present, it seems difficult to solve such problems at home, that is, we found the problem, IDC service providers will not be able to help us solve.

Example 4.2: Hop count setting
Command: Traceroute-m www.baidu.com
Results:

Note: The Live value = 10 can be seen through the result, and the host cancels the packet when the surviving value = 0 o'clock

Example 3: Probe packet uses the basic UDP port settings 6888 (not quite understand here)
Command: Traceroute-p 6888 www.baidu.com
Results:

Example 4: Setting the waiting response time for the external probe packet to 3 seconds
Command: Traceroute-w 3 www.baidu.com
Results:

This article references:
http://blog.csdn.net/sinat_33442459/article/details/75126149
In addition, detailed commands under the installation, the steps of each step and the meaning of each jump, please refer to:
http://blog.csdn.net/yongh701/article/details/45599001

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.