31 : m_maxMultiplier(maxMultiplier)
32 , m_minRto(minRto.count())
44 double m =
static_cast<double>(measure.count());
46 double err = m - m_rtt;
47 double gErr = err * m_gain;
49 double difference = std::abs(err) - m_variance;
50 m_variance += difference * m_gain;
63 m_multiplier = std::min(static_cast<uint16_t>(m_multiplier + 1), m_maxMultiplier);
69 m_multiplier = std::min(static_cast<uint16_t>(m_multiplier * 2), m_maxMultiplier);
75 double rto = std::max(m_minRto, m_rtt + 4 * m_variance);
77 return Duration(static_cast<Duration::rep>(rto));
time::microseconds Duration
implements the Mean-Deviation RTT estimator
RttEstimator(uint16_t maxMultiplier=16, Duration minRto=time::milliseconds(1), double gain=0.1)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
void incrementMultiplier()
Duration computeRto() const
void addMeasurement(Duration measure)