31 #include "ns3/simulator.h"
32 #include "ns3/double.h"
33 #include "ns3/integer.h"
34 #include "ns3/uinteger.h"
49 .AddAttribute (
"MaxMultiplier",
50 "Maximum RTO Multiplier",
53 MakeUintegerChecker<uint16_t> ())
54 .AddAttribute (
"InitialEstimation",
55 "Initial RTT estimation",
59 .AddAttribute (
"MinRTO",
60 "Minimum retransmit timeout value",
95 : seq (s), count (c), time (t), retx (false)
101 : seq (h.seq), count (h.count), time (h.time), retx (h.retx)
109 : m_next (1), m_history (),
124 :
Object (c), m_next (c.m_next), m_history (c.m_history),
125 m_maxMultiplier (c.m_maxMultiplier),
126 m_initialEstimatedRtt (c.m_initialEstimatedRtt),
127 m_currentEstimatedRtt (c.m_currentEstimatedRtt), m_minRto (c.m_minRto),
128 m_nSamples (c.m_nSamples), m_multiplier (c.m_multiplier)
178 Time m = Seconds (0.0);
243 .AddConstructor<RttMeanDeviation> ()
244 .AddAttribute (
"Gain",
245 "Gain used in estimating the RTT, must be 0 < Gain < 1",
248 MakeDoubleChecker<double> ())
260 :
RttEstimator (c), m_gain (c.m_gain), m_variance (c.m_variance)
312 return CopyObject<RttMeanDeviation> (
this);
325 NS_ASSERT_MSG( (g > 0) && (g < 1),
"RttMeanDeviation: Gain must be less than 1 and greater than 0" );
Time m_currentEstimatedRtt
Current estimate.
Time m_variance
Current variance.
keep track of time values and allow control of global simulation resolution
smart pointer class similar to boost::intrusive_ptr
#define NS_LOG_FUNCTION(parameters)
int64x64_t Abs(const int64x64_t &value)
NS_LOG_COMPONENT_DEFINE("RttEstimator")
double ToDouble(enum Unit timeUnit) const
static TypeId GetTypeId(void)
Get the type ID.
RttHistory_t m_history
List of sent packet.
double m_gain
Filter gain.
int64_t ToInteger(enum Unit timeUnit) const
The "Mean--Deviation" RTT estimator, as discussed by Van Jacobson.
NS_OBJECT_ENSURE_REGISTERED(NullMessageSimulatorImpl)
bool retx
True if this has been retransmitted.
uint32_t count
Number of bytes sent.
static TypeId GetTypeId(void)
Get the type ID.
Time m_initialEstimatedRtt
Initial RTT estimation.
virtual TypeId GetInstanceTypeId(void) const
static Time FromDouble(double value, enum Unit timeUnit)
SequenceNumber< uint32_t, int32_t > SequenceNumber32
uint16_t m_multiplier
RTO Multiplier.
double GetSeconds(void) const
uint16_t m_maxMultiplier
Maximum RTO Multiplier.
Time time
Time this one was sent.
virtual void ResetMultiplier()
Resets the estimation multiplier to 1.
hold objects of type ns3::Time
Time GetCurrentEstimate(void) const
gets the current RTT estimate.
Hold an unsigned integer type.
Base class for all RTT Estimators.
RttHistory(SequenceNumber32 s, uint32_t c, Time t)
Constructor - builds an RttHistory with the given parameters.
virtual void Measurement(Time t)=0
Add a new measurement to the estimator.
virtual void SentSeq(SequenceNumber32 seq, uint32_t size)
Note that a particular sequence has been sent.
void ConstructSelf(const AttributeConstructionList &attributes)
Time GetMinRto(void) const
Get the Minimum RTO.
uint32_t m_nSamples
Number of samples.
Time RetransmitTimeout()
Returns the estimated RTO.
void SetMinRto(Time minRto)
Sets the Minimum RTO.
Time m_minRto
minimum value of the timeout
virtual void Reset()
Resets the estimation to its initial state.
static Time Now(void)
Return the "current simulation time".
void Reset()
Resets the estimator.
virtual void IncreaseMultiplier()
Increase the estimation multiplier up to MaxMultiplier.
#define NS_ASSERT_MSG(condition, message)
Ptr< RttEstimator > Copy() const
Copy object.
static Time FromInteger(uint64_t value, enum Unit timeUnit)
void Measurement(Time measure)
Add a new measurement to the estimator.
virtual TypeId GetInstanceTypeId(void) const
SequenceNumber32 m_next
Next expected sequence to be sent.
Helper class to store RTT measurements.
SequenceNumber32 seq
First sequence number in packet sent.
void SetCurrentEstimate(Time estimate)
Sets the current RTT estimate (forcefully).
#define NS_LOG_DEBUG(msg)
virtual void ClearSent()
Clear all history entries.
void Gain(double g)
Sets the estimator Gain.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
a base class which provides memory management and object aggregation
Hold a floating point type.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
virtual Time AckSeq(SequenceNumber32 ackSeq)
Note that a particular ack sequence has been received.