当前位置:网站首页>[network packet loss and network delay? This artifact can help you deal with everything!]
[network packet loss and network delay? This artifact can help you deal with everything!]
2022-07-01 01:18:00 【GLAB-Mary】
frequently-used ping,tracert,nslookup It is generally used to judge the network connectivity of the host , Actually Linux There is a better tool for judging network connectivity , It can combine ping nslookup traceroute To judge the relevant characteristics of the network , The order is mtr.
mtr Full name my traceroute, It's a handful ping and traceroute A network diagnostic tool incorporated into a program .
traceroute By default UDP Packet detection , and mtr By default ICMP Message detection ,ICMP In some routing nodes, the priority is lower than other packets , So the test data may be lower than the actual situation .
Installation method
Windows The system can be directly in https://cdn.ipip.net/17mon/besttrace.exe download BestTrace Tools and install . It can also be in https://github.com/oott123/WinMTR/releases GitHub Upload and download MTR Special tools , The tool is installation free , After downloading, you can use it directly .
Linux You can run the command directly to install .
Debian/Ubuntu System
sudo apt install mtr
RedHat/CentOS System
sudo yum install mtrApple The client can be in App store Search for Best NetTools Download and install
Android client : Can be in Google Play Upload and download TracePing, But because of the domestic Google Play cannot access , I download it by myself , You can directly access https://dwz.cn/KCdNPH4c download TracePing.
Use
MTR Very simple to use , View this machine to qq.com Run the following command directly :
mtr qq.com
MTR qq.com Test interface
The specific output parameters mean :
The first column is IP Address
Packet loss rate :Loss
Number of packets sent :Snt
The delay of the last packet :Last
Average delay :Avg
Minimum delay :Best
Worst case delay :Wrst
variance ( stability ):StDev
Parameter description
-r or – report
Use mtr -r qq.com To print the report , If not used -r or – report Parameters mtr It's going to keep moving . Use report Options , mtr Will send to qq.com Host send 10 individual ICMP package , And then output the result directly . Usually mtr It takes a few seconds to output the report .mtr The report consists of a series of hops , Each hop means that packets reach the destination host through nodes or routers .
In general mtr The first few jumps were local ISP, The last few hops belong to the service provider , such as Tencent data center , Intermediate hops are intermediate nodes , If the first few jumps are abnormal , Need to contact local ISP In terms of service provision , On the contrary, if something goes wrong with the last few jumps , You need to contact your service provider , There's something wrong with the middle jump , You need to contact the operator for handling .
By default -r Parameters to generate reports , Just send 10 A packet , If you want to customize the number of packets , have access to -c Parameters .
-s or – packetsize
Use -s To specify the ping Packet size
mtr -s 100 qq.com
100 bytes Packets will be used to send , test , If it is set to a negative number , The size of each packet sent will be a random number .
-c
Specify the number to send
mtr -c 100 qq.com
-n
No host interpretation
Use -n Options to make mtr Only the output IP, Instead of the host host name Explain
mtr -n qq.com
MTR Result analysis
When we analyze MTR At the time of the report , It's best to find any problems with each jump . In addition to being able to see the path between two servers ,MTR It provides a lot of valuable statistical reports in its seven columns of data .Loss% Column shows the packet loss rate per hop .Snt How many packets of column records are sent out . Use –report Parameters will be sent by default 10 A packet . If you use –report-cycles=[number-of-packets] Options ,MTR Will follow [number-of-packets] Send out in a specified quantity ICMP Data packets .
Last, Avg, Best and Wrst Columns all identify the round trip time of the packet , Using milliseconds ( ms ) Unit means .Last Represents the time taken by the last packet , Avg It means evaluation time , Best and Wrst Represents the minimum and maximum time . in the majority of cases , average time ( Avg) We need to pay special attention to .
The last column StDev Provides the standard deviation of data packets in each host . If the higher the standard deviation , The more different the delay of this node is . The standard deviation will let you know whether the average delay is the center point of the true delay time , Or the measurement data is disturbed by some problems .
for example , If the standard deviation is large , The delay of data packet is uncertain . Some packets have little latency ( for example :25ms), Other packets have a lot of latency ( for example :350ms). When 10 After all packets are sent , The average delay obtained may be normal , But the average delay does not reflect the actual situation very well . If the standard deviation is very high , Using the best and worst latencies to determine the average latency is a good solution .
in the majority of cases , You can put MTR The output is divided into three blocks . According to the configuration , The second or third jump is usually your local ISP, The last two or three hops are usually for your destination host ISP. The middle node is the router through which the packets pass .
When analyzing MTR Output of , You need to pay attention to two points :loss and latency.
Network packet loss
If you see loss Percent of , This shows that there may be something wrong with this jump . Of course , Many service providers are limiting ICMP The rate of transmission , This can also lead to this problem . So how to specify artificial restrictions ICMP The transmission still has packet loss ? At this point, you need to see the next hop . If there is no packet loss in the next hop , It shows that the last one is artificially limited . The following example :
Man made restrictions MTR Packet loss
In this case , The first 4 Packet loss occurred in the hop , But there was no packet loss in the next few , It shows that the packet loss of the second hop is artificially limited . If there is a packet loss in the next few items , Then maybe there is something wrong with the second jump . please remember ,ICMP Packet rate limiting and packet loss may occur simultaneously .
MTR Screenshot of packet loss
From the picture above , You can see from page 13 Jump and step 17 It's all about dancing 10% The packet loss rate , From the next few hops, there is packet loss , But in the end 15、16 It's all about 100% The packet loss rate , We can guess 100% In addition to the bad network, the packet loss rate is also artificially limited ICMP. therefore , When we see different packet loss rates , Usually, the last few jumps should prevail .
There are also many times when the problem occurs on the way back to the packet . Packets can reach the destination host successfully , But I encountered “ difficult ” 了 . therefore , When the problem happens , We usually need to collect things in the opposite direction MTR The report .
Besides , Maintenance of Internet facilities or short-term network congestion may lead to short-term packet loss rate , When there is a brief 10% When the packet loss rate , Don't worry about , The application layer program will make up for this loss .
Network delay
Except through MTR Report the packet loss rate , We can also see the delay from local to destination . Because it's a different position , The delay usually increases with the number of bars . therefore , The delay usually depends on the physical distance between nodes and the quality of the line .
MTR View network latency
From the above MTR In the screenshot of the report , We can see from page 11 Jump to the 12 The delay of the jump soared , It directly leads to a great delay later , It may be 11 Jump to the 12 Jump belongs to different regions , Physical distance leads to a sharp increase in delay , It could also be the first 12 The router is not configured properly , Or the line is congested . Specific analysis of specific problems is needed .
However , High latency does not necessarily mean there is a problem with the current router . The reason for the high delay may also be caused during the return process . You can't see the path back from the screenshot of this report , The return path can be a completely different route , So it's usually two-way MTR test .
notes :ICMP Rate limits can also increase latency , But you can usually check the time delay of the last item to determine whether it is the above situation .
according to MTR The result is to solve the network problem
MTR Most of the routing problems shown in the report are temporary . A lot of problems are 24 It was solved within hours . Most of the time , If you find routing problems ,ISP The provider has monitored and is working on it . When you experience network problems , You can choose to remind you of ISP provider . When contacting your provider , It needs to be sent MTR Reports and related data . There's no useful data , The provider has no way to solve the problem .
But most of the time , Routing problem is relatively rare . More common is because the physical distance is too long , Or Internet peak , It makes the network slow . Especially across the Atlantic and Pacific , Sometimes the Internet can be slow . In this case , It is recommended to access the customer's node nearby .
1
end
source :https://cloud.tencent.com/developer/article/1491610
边栏推荐
猜你喜欢
随机推荐
关于Unity一般的输入操作方式
双位置继电器DLS-5/2 DC220V
Hoo research | coinwave production - nym: building the next generation privacy infrastructure
染色法判断二分图
[learning notes] double + two points
Two position relay st2-2l/ac220v
High quality pump SolidWorks model material recommended, not to be missed
C # Generate PPK files in Putty format (passthrough support)
Detailed analysis of operators i++ and ++i in JS, i++ and ++i
Double linked list: initialize insert delete traversal
【原创】 PLSQL 索引排序优化
(学习力+思考力) x 行动力,技术人成长的飞轮效应总结
A letter to 5000 fans!
How to do the performance pressure test of "Health Code"
闭锁继电器YDB-100、100V
The longest selling mobile phone in China has been selling well since its launch, crushing iphone12
CSDN common complex formula template record
Cmu15445 (fall 2019) project 1 - buffer pool details
Two-stage RO: part 1
Experiment 8 T-SQL, stored procedure








