ndn::util::RttEstimatorWithStats Class Reference

RTT/RTO estimator that also maintains min/max/average RTT statistics. More...

#include <ndn-cxx/util/rtt-estimator.hpp>

+ Inheritance diagram for ndn::util::RttEstimatorWithStats:
+ Collaboration diagram for ndn::util::RttEstimatorWithStats:

Public Member Functions

void addMeasurement (time::nanoseconds rtt, size_t nExpectedSamples=1)
 Records a new RTT measurement. More...
 
void backoffRto ()
 Backoff RTO by a factor of Options::rtoBackoffMultiplier. More...
 
time::nanoseconds getAvgRtt () const
 Returns the average RTT. More...
 
time::nanoseconds getEstimatedRto () const
 Returns the estimated RTO value. More...
 
time::nanoseconds getMaxRtt () const
 Returns the maximum RTT observed. More...
 
time::nanoseconds getMinRtt () const
 Returns the minimum RTT observed. More...
 
time::nanoseconds getRttVariation () const
 Returns the RTT variation (RTTVAR). More...
 
time::nanoseconds getSmoothedRtt () const
 Returns the smoothed RTT value (SRTT). More...
 
bool hasSamples () const
 
 RttEstimator (std::shared_ptr< const Options > options=nullptr)
 Constructor. More...
 

Private Member Functions

time::nanoseconds getEstimatedRto () const
 Returns the estimated RTO value. More...
 
time::nanoseconds getRttVariation () const
 Returns the RTT variation (RTTVAR). More...
 
time::nanoseconds getSmoothedRtt () const
 Returns the smoothed RTT value (SRTT). More...
 
bool hasSamples () const
 

Detailed Description

RTT/RTO estimator that also maintains min/max/average RTT statistics.

Definition at line 127 of file rtt-estimator.hpp.

Member Function Documentation

◆ addMeasurement()

void ndn::util::RttEstimatorWithStats::addMeasurement ( time::nanoseconds  rtt,
size_t  nExpectedSamples = 1 
)

Records a new RTT measurement.

Parameters
rttthe sampled RTT
nExpectedSamplesnumber of expected samples, must be greater than 0. It should be set to the current number of in-flight Interests. Please refer to Appendix G of RFC 7323 for details.
Note
Do not call this function with RTT samples from retransmitted Interests (per Karn's algorithm).

Definition at line 73 of file rtt-estimator.cpp.

◆ backoffRto()

void ndn::util::RttEstimator::backoffRto

Backoff RTO by a factor of Options::rtoBackoffMultiplier.

Definition at line 113 of file rtt-estimator.cpp.

◆ getAvgRtt()

time::nanoseconds ndn::util::RttEstimatorWithStats::getAvgRtt ( ) const
inline

Returns the average RTT.

Definition at line 172 of file rtt-estimator.hpp.

◆ getEstimatedRto()

time::nanoseconds ndn::util::RttEstimator::getEstimatedRto
inline

Returns the estimated RTO value.

Definition at line 84 of file rtt-estimator.hpp.

◆ getMaxRtt()

time::nanoseconds ndn::util::RttEstimatorWithStats::getMaxRtt ( ) const
inline

Returns the maximum RTT observed.

Definition at line 163 of file rtt-estimator.hpp.

◆ getMinRtt()

time::nanoseconds ndn::util::RttEstimatorWithStats::getMinRtt ( ) const
inline

Returns the minimum RTT observed.

Definition at line 154 of file rtt-estimator.hpp.

◆ getRttVariation()

time::nanoseconds ndn::util::RttEstimator::getRttVariation
inline

Returns the RTT variation (RTTVAR).

Precondition
hasSamples() == true

Definition at line 104 of file rtt-estimator.hpp.

◆ getSmoothedRtt()

time::nanoseconds ndn::util::RttEstimator::getSmoothedRtt
inline

Returns the smoothed RTT value (SRTT).

Precondition
hasSamples() == true

Definition at line 94 of file rtt-estimator.hpp.

◆ hasSamples()

bool ndn::util::RttEstimator::hasSamples
inline

Definition at line 75 of file rtt-estimator.hpp.

◆ RttEstimator()

ndn::util::RttEstimator::RttEstimator
explicit

Constructor.

Parameters
optionsoptions for the estimator; if nullptr, a default set of options is used

Definition at line 61 of file rtt-estimator.cpp.