PING|TRACEROUTE|MTR tool for network troubleshooting under Linux (ZZ)

Source: Internet
Author: User
Tags network troubleshooting

1.ping

The ping uses an ICMP echo request and a loopback reply message. The packet sent out by the Ping tool does not pass the TCP/UDP protocol, but goes through the IP protocol. The time that the ping command calculates is the total round-trip time of the packet.

The common options for the ping command are as follows:

[Plain]View PlainCopy
    1. -C num--indicates that NUM packets are sent out using a ping
    2. -n--indicates that the output of the ping contains the host information in the IP representation, not the mapping between IP and host name, so that the ping responds faster
    3. -S packetsize--Specifies the size of the packet that the ping sends out, in units B. If you do not configure this option, the default is 56B
    4. -T ttl--set the Time to Live (TTL) life cycle of packets transmitted over the network
    5. -f--Fast Ping,flood Ping, sending receive ICMP Echo messages much faster

Examples are as follows:

[Plain]View PlainCopy
    1. Ping-c 3-s www.baidu.com #表示向www. baidu.com Send 3 512B-size packets for network probing
    2. Ping-f www.baidu.com #快速ping

2.traceroute

Traceroute also uses the ICMP protocol, which uses ICMP for more time than error-Error reporting and ICMP endpoint unreachable messages. For the ICMP protocol, the principle is:

Important options for traceroute are:

[Plain]View PlainCopy
    1. -u--uses the UDP protocol to detect, which is the default detection protocol.
    2. -i--uses the ICMP protocol to detect
    3. -t--uses the TCP protocol to detect

Examples of use are:

[Plain]View PlainCopy
    1. Traceroute www.baidu.com

Note that there are three time values in each line of information returned using traceroute, because the source has three probe requests per node or router.

3.mtr

There is a better network connectivity judgment tool in Linux, which can be combined with ping | nslookup | Tracert to determine the relevant characteristics of the network, this command is the MTR

Use format:

[Plain]View PlainCopy
    1. mtr [Options] hostname

Common options:

[Plain]View PlainCopy
    1. The-r--sets the MTR to reporting mode, tracing the results to report the mode output. If the-R is not present, it will enter the real-time interactive mode of MTR.
    2. -C num--defines the number of traces, each of which is 1s, and-c must be used with-R, by default 10 times.

Examples of Use:

(1) Real-time display mode of MTR

[Plain]View PlainCopy
    1. MTR 202.108.33.94
(2) MTR's reporting model [Plain]View PlainCopy
  1. [Email protected] ~]# mtr-r 202.108.33.94
  2. FOCUS9097 snt:10 loss% last AVG best Wrst StDev
  3. 220.181.61.252 0% 6.8 3.3 1.8 7.4 2.2
  4. 220.181.17.217 0% 0.4 0.5 0.4 0.7 0.1
  5. 220.181.16.17 0% 0.6 0.5 0.5 0.6 0.0
  6. 202.97.53.14 10% 0.7 0.7 0.7 0.8 0.0
  7. 219.158.35.1 0% 0.8 0.8 0.8 0.9 0.0
  8. 219.158.5.81 0% 1.2 1.3 1.2 1.6 0.1
  9. 123.126.0.138 0% 1.2 1.1 1.1 1.3 0.1
  10. 61.148.153.126 0% 1.9 10.5 1.5 89.9 27.9
  11. 61.148.143.22 0% 1.5 1.6 1.5 1.7 0.0
  12. 210.74.178.198 0% 1.6 1.6 1.5 1.9 0.1
  13. 202.108.33.94 0% 1.5 1.5 1.4 1.5 0.0
Output Explanation:

First column: The IP address and the native domain name are displayed, which is like tracert
Second column: Snt:10 set the number of traces, the default value is 10 can be customized by the parameter-C, such as Mtr-r-C 15 202.108.33.94
Third column Loss: is the packet loss rate for each corresponding IP displayed
Fourth column last: The most recent return delay shown
Fifth Column avg: Is average this should be the average delay in sending ping packets
Best of the Sixth column: the shortest delay
Seventh column Wrst: is the worst or the most frequent delay
Eighth Column StDev: is the standard deviation

PING|TRACEROUTE|MTR tool for network troubleshooting under Linux (ZZ)

Related Article

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.