Understanding latency and packet loss with mtr

If you have call quality issues with VOIP then one of the first things to check is if there is any packet loss or unexpected high latency on the network connections. A great tool for this is called ‘mtr’.

However, I often see some misunderstanding of the reports produced by mtr.

I was going to write a guide to mtr but there is a really good one already that you can find here – https://library.linode.com/linux-tools/mtr

Two of the most important things the post highlights can be summarised like this …

Packet loss

This packet loss is OK …

[email protected]:~# mtr --report www.google.com
HOST: ducklington               Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. 63.247.74.43                  0.0%    10    0.3   0.6   0.3   1.2   0.3
  2. 63.247.64.157                50.0%    10    0.4   1.0   0.4   6.1   1.8
  3. 209.51.130.213                0.0%    10    0.8   2.7   0.8  19.0   5.7
  4. aix.pr1.atl.google.com        0.0%    10    6.7   6.8   6.7   6.9   0.1
  5. 72.14.233.56                  0.0%    10    7.2   8.3   7.1  16.4   2.9
  6. 209.85.254.247                0.0%    10   39.1  39.4  39.1  39.7   0.2
  7. 64.233.174.46                 0.0%    10   39.6  40.4  39.4  46.9   2.3
  8. gw-in-f147.1e100.net          0.0%    10   39.6  40.5  39.5  46.7   2.2

This packet loss is BAD …

[email protected]:~# mtr --report www.google.com
HOST: localhost                   Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. 63.247.74.43                   0.0%    10    0.3   0.6   0.3   1.2   0.3
  2. 63.247.64.157                  0.0%    10    0.4   1.0   0.4   6.1   1.8
  3. 209.51.130.213                60.0%    10    0.8   2.7   0.8  19.0   5.7
  4. aix.pr1.atl.google.com        60.0%    10    6.7   6.8   6.7   6.9   0.1
  5. 72.14.233.56                  50.0%    10    7.2   8.3   7.1  16.4   2.9
  6. 209.85.254.247                40.0%    10   39.1  39.4  39.1  39.7   0.2
  7. 64.233.174.46                 40.0%    10   39.6  40.4  39.4  46.9   2.3
  8. gw-in-f147.1e100.net          40.0%    10   39.6  40.5  39.5  46.7   2.2

Latency

If you’re expecting a ping/latency of around 40ms this is OK (even with a 254ms latency along the route) …

[email protected]:~# mtr --report www.google.com
HOST: localhost                   Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. 63.247.74.43                  0.0%    10    0.3   0.6   0.3   1.2   0.3
  2. 63.247.64.157                 0.0%    10    0.4   1.0   0.4   6.1   1.8
  3. 209.51.130.213                0.0%    10    0.8   2.7   0.8  19.0   5.7
  4. aix.pr1.atl.google.com        0.0%    10    6.7   6.8   6.7   6.9   0.1
  5. 72.14.233.56                  0.0%    10  254.2 250.3 230.1 263.4   2.9
  6. 209.85.254.247                0.0%    10   39.1  39.4  39.1  39.7   0.2
  7. 64.233.174.46                 0.0%    10   39.6  40.4  39.4  46.9   2.3
  8. gw-in-f147.1e100.net          0.0%    10   39.6  40.5  39.5  46.7   2.2

If you’re expecting latency of a lot less than 400ms then this report is BAD …

[email protected]:~# mtr --report www.google.com
HOST: localhost                   Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. 63.247.74.43                  0.0%    10    0.3   0.6   0.3   1.2   0.3
  2. 63.247.64.157                 0.0%    10    0.4   1.0   0.4   6.1   1.8
  3. 209.51.130.213                0.0%    10    0.8   2.7   0.8  19.0   5.7
  4. aix.pr1.atl.google.com        0.0%    10  388.0 360.4 342.1 396.7   0.2
  5. 72.14.233.56                  0.0%    10  390.6 360.4 342.1 396.7   0.2
  6. 209.85.254.247                0.0%    10  391.6 360.4 342.1 396.7   0.4
  7. 64.233.174.46                 0.0%    10  391.8 360.4 342.1 396.7   2.1
  8. gw-in-f147.1e100.net          0.0%    10  392.0 360.4 342.1 396.7   1.2

Go read the guide to find out more and read a description of the traces above – https://library.linode.com/linux-tools/mtr