RTT/RTO estimator. More...
#include <rtt-estimator.hpp>
Classes | |
struct | Options |
Public Member Functions | |
RttEstimator (shared_ptr< const Options > options=nullptr) | |
Constructor. More... | |
void | addMeasurement (time::nanoseconds rtt, size_t nExpectedSamples=1) |
Records a new RTT measurement. More... | |
bool | hasSamples () const |
time::nanoseconds | getEstimatedRto () const |
Returns the estimated RTO value. More... | |
time::nanoseconds | getSmoothedRtt () const |
Returns the smoothed RTT value (SRTT). More... | |
time::nanoseconds | getRttVariation () const |
Returns the RTT variation (RTTVAR). More... | |
void | backoffRto () |
Backoff RTO by a factor of Options::rtoBackoffMultiplier. More... | |
Protected Attributes | |
shared_ptr< const Options > | m_options |
RTT/RTO estimator.
This class implements the "Mean-Deviation" RTT estimator, as discussed in RFC 6298, with the modifications to RTO calculation described in RFC 7323 Appendix G.
Definition at line 41 of file rtt-estimator.hpp.
|
explicit |
Constructor.
options | options for the estimator; if nullptr, a default set of options is used |
Definition at line 32 of file rtt-estimator.cpp.
References m_options.
void ndn::util::RttEstimator::addMeasurement | ( | time::nanoseconds | rtt, |
size_t | nExpectedSamples = 1 |
||
) |
Records a new RTT measurement.
rtt | the sampled RTT |
nExpectedSamples | number 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. |
Definition at line 46 of file rtt-estimator.cpp.
References ndn::time::abs(), ns3::alpha, ndn::clamp(), hasSamples(), and m_options.
Referenced by ndn::util::RttEstimatorWithStats::addMeasurement(), nfd::face::LpReliability::processIncomingPacket(), and nfd::fw::asf::FaceInfo::recordRtt().
|
inline |
Definition at line 74 of file rtt-estimator.hpp.
Referenced by addMeasurement().
|
inline |
Returns the estimated RTO value.
Definition at line 83 of file rtt-estimator.hpp.
Referenced by nfd::face::LpReliability::handleOutgoing(), nfd::face::LpReliability::onLpPacketLost(), nfd::face::LpReliability::processIncomingPacket(), and nfd::fw::asf::FaceInfo::scheduleTimeout().
|
inline |
Returns the smoothed RTT value (SRTT).
hasSamples() == true
Definition at line 93 of file rtt-estimator.hpp.
Referenced by nfd::fw::asf::FaceInfo::getSrtt().
|
inline |
Returns the RTT variation (RTTVAR).
hasSamples() == true
Definition at line 103 of file rtt-estimator.hpp.
References backoffRto().
void ndn::util::RttEstimator::backoffRto | ( | ) |
Backoff RTO by a factor of Options::rtoBackoffMultiplier.
Definition at line 67 of file rtt-estimator.cpp.
References ndn::clamp(), and m_options.
Referenced by getRttVariation().
|
protected |
Definition at line 115 of file rtt-estimator.hpp.
Referenced by addMeasurement(), backoffRto(), and RttEstimator().