What does mdev mean in ping(8)?
Solution 1:
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.
Solution 2:
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.
- http://www.skbuff.net/iputils
- http://www.brainkart.com/article/Calculation-of-Standard-Deviation_39437/ under Calculation of Standard Deviation for ungrouped data -> Direct Method