57

What does mdev mean in ping output (last row below)?

me@callisto ~ % ping -c 1 example.org   
PING example.org (192.0.43.10) 56(84) bytes of data.
64 bytes from 43-10.any.icann.org (192.0.43.10): icmp_seq=1 ttl=245 time=119 ms

--- example.org ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 119.242/119.242/119.242/0.000 ms
Zaz
  • 783
  • 1
  • 6
  • 17
Daniel
  • 2,877
  • 5
  • 20
  • 24
  • The latest [manual](https://www.mankier.com/8/ping) for iputils calls it a *Population Standard Deviation* – Jon Oct 06 '20 at 19:15

4 Answers4

55

It's the standard deviation, essentially an average of how far each ping RTT is from the mean RTT. The higher mdev is, the more variable the RTT is (over time).

With a high RTT variability, you will have speed issues with bulk transfers (they will take longer than is strictly speaking necessary, as the variability will eventually cause the sender to wait for ACKs) and you will have middling to poor VoIP quality.

Vatine
  • 5,390
  • 23
  • 24
  • 1
    Otherwise known as jitter. – dmourati Jul 29 '13 at 19:32
  • 5
    @dmourati Actually, no, the jitter is the difference between the lowest and highest RTT (or, equally, the difference from min to mean and teh difference from mean to max, depending on if you see it as "I ms" or "-A / +B ms". – Vatine Jul 30 '13 at 09:20
  • 1
    RTT - is the amount of time it takes for a signal to be sent plus the amount of time it takes for an acknowledgement of that signal to be received (https://en.wikipedia.org/wiki/Round-trip_delay) – Talespin_Kit Feb 04 '21 at 08:56
33

From the source code [1]:

            tsum += triptime;
            tsum2 += (long long)triptime * (long long)triptime

and,

            tsum /= nreceived + nrepeats;
            tsum2 /= nreceived + nrepeats;
            tmdev = llsqrt(tsum2 - tsum * tsum);

we can conclude that:

mdev = SQRT(SUM(RTT*RTT) / N – (SUM(RTT)/N)^2)

which is another formula for calculating the standard deviation (see [2]). This matches Vatine's answer above.

  1. http://www.skbuff.net/iputils
  2. http://www.brainkart.com/article/Calculation-of-Standard-Deviation_39437/ under Calculation of Standard Deviation for ungrouped data -> Direct Method
ndemou
  • 1,215
  • 2
  • 16
  • 27
Cong Wang
  • 431
  • 3
  • 4
3

It's the standard deviation - not sure why the label mdev has been used for it.

TomH
  • 1,290
  • 7
  • 9
  • 5
    Google said that it could be `m`ean (or `m`edian) `dev`viation. – quanta Nov 21 '11 at 09:26
  • Okay. The ping(8) man pages does not tell me anything about deviations. What is it exactly or how should I interpret this particular value? – Daniel Nov 21 '11 at 09:37
  • 2
    @Daniel: standard deviation is a statistics concept, it tells you how the samples were distributed from the average. See http://en.wikipedia.org/wiki/Standard_deviation – Matteo Nov 21 '11 at 13:40
  • @quanta jfyi mean & median are not the same concept, mean is a synonym of average, while median is the value from which 50% of values are greater and 50% lesser. `mdev` stands for **mean** deviation. – Nearoo Jan 17 '20 at 09:15
-1

mdev is like jitter in telecom terminology, for example in VoIP it doesn't by greater 30 ms between endpoints https://www.ciscopress.com/articles/article.asp?p=357102

aldro dav
  • 11
  • 3