How can I diagnose a network connectivity issue?
I am seeing latency and packet loss when trying to connect to my Linode. How can I determine what is causing that?
We primarily use the MTR command to diagnose networking issues that our customers are seeing. Essentially, MTR combines both the
ping commands into a single command to provide greater clarity of the traffic that your Linode is seeing.
Debian and Ubuntu
apt-get update apt-get upgrade apt-get install mtr-tiny
CentOS and Fedora
yum update yum install mtr
pacman -Syu pacman -S mtr
For Windows, you can use an application called WinMTR.
Mac OS X
brew install mtr
Running the MTR command
The following syntax will provide you with a great deal of information regarding the traffic that you are seeing. Since this runs a count of 100, it will take some time to complete.
mtr -rwzbc100 < IP address >
Reading an MTR
~$ mtr -rwzbc100 google.com Start: Wed May 9 08:50:17 2018 HOST: fremont Loss% Snt Last Avg Best Wrst StDev 1. AS63949 2600:3c01::8678:acff:fe0d:79c1 0.0% 100 0.9 1.0 0.8 2.6 0.1 2. AS63949 2600:3c01:3:4::1 0.0% 100 0.4 1.7 0.4 49.6 6.8 3. AS63949 2600:3c01:3333:5::1 0.0% 100 0.6 0.9 0.5 17.1 1.8 4. AS??? as15169.sfmix.org (2001:504:30::ba01:5169:1) 0.0% 100 3.8 4.7 3.7 52.7 5.2 5. AS15169 2001:4860:0:1007::1 3.0% 100 5.4 5.5 5.2 8.0 0.3 6. AS15169 2001:4860:0:1::967 4.0% 100 5.2 5.4 5.0 11.4 0.6 7. AS15169 sfo03s18-in-x0e.1e100.net (2607:f8b0:4005:80b::200e) 0.0% 100 4.3 4.3 4.2 4.8 0.0
Each column in the MTR output pertains to a specific data point.
Loss% - The percentage of packet loss at each hop.
Snt - The number of packets sent.
Last - The latency of the last packet sent.
Avg - The average latency of all packets.
Best & Wrst - The best(shortest) and worst(longest) round trip time for a packet.
StDev - The standard deviation, which is how far the data is from the mean.
Analyzing and MTR
There are two major pieces of the MTR that you will want to focus on; Loss% and Latency.
When you are looking at loss%, you will want to focus on loss that occurs consistently over multiple hops. When you see loss for a single hop that then drops back down to 0%, this is typically indicative of rate limiting, not actual loss.
If there is loss across multiple hops, you should focus on the loss% value in the later hops as rate limiting can also alter the loss% across a number of hops.
There are many factors to consider when looking at the latency output of an MTR. There are real world factors, such as hardware and distance or the speed allowed by an ISP, that will come into play when determining how big of an impact latency will have.
As expected, you will want to see the lowest latency possible. Also, as with Loss%, if you see a spike in latency that then drops off for subsequent hops, you will want to focus on the latency that continues through multiple hops.
Linode's Guides & Tutorials page has a great, in-depth, guide that offers additional details and use cases for the MTR command. You can find that at the following link.
The Official MTR Website is also a great resource that we would recommend looking into.