NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::util::RttEstimator Class Reference

RTT/RTO estimator. More...

#include <rtt-estimator.hpp>

Inheritance diagram for ndn::util::RttEstimator:
Collaboration diagram for ndn::util::RttEstimator:


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 Optionsm_options

Detailed Description

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.

Constructor & Destructor Documentation

◆ RttEstimator()

ndn::util::RttEstimator::RttEstimator ( shared_ptr< const Options options = nullptr)


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

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

References m_options.

Member Function Documentation

◆ addMeasurement()

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

Records a new RTT measurement.

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.
Do not call this function with RTT samples from retransmitted Interests (per Karn's algorithm).

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().

◆ hasSamples()

bool ndn::util::RttEstimator::hasSamples ( ) const

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

Referenced by addMeasurement().

◆ getEstimatedRto()

time::nanoseconds ndn::util::RttEstimator::getEstimatedRto ( ) const

◆ getSmoothedRtt()

time::nanoseconds ndn::util::RttEstimator::getSmoothedRtt ( ) const

Returns the smoothed RTT value (SRTT).

hasSamples() == true

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

Referenced by nfd::fw::asf::FaceInfo::getSrtt().

◆ getRttVariation()

time::nanoseconds ndn::util::RttEstimator::getRttVariation ( ) const

Returns the RTT variation (RTTVAR).

hasSamples() == true

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

References backoffRto().

◆ 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().

Member Data Documentation

◆ m_options

shared_ptr<const Options> ndn::util::RttEstimator::m_options

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

Referenced by addMeasurement(), backoffRto(), and RttEstimator().

The documentation for this class was generated from the following files: