32 #include "ns3/simulator.h"
33 #include "ns3/double.h"
34 #include "ns3/integer.h"
35 #include "ns3/uinteger.h"
38 NS_LOG_COMPONENT_DEFINE(
"ndn.RttEstimator");
50 TypeId(
"ns3::ndn::RttEstimator")
52 .AddAttribute(
"MaxMultiplier",
"Maximum RTO Multiplier", UintegerValue(64),
53 MakeUintegerAccessor(&RttEstimator::m_maxMultiplier),
54 MakeUintegerChecker<uint16_t>())
55 .AddAttribute(
"InitialEstimation",
"Initial RTT estimation", TimeValue(Seconds(1.0)),
56 MakeTimeAccessor(&RttEstimator::m_initialEstimatedRtt), MakeTimeChecker())
57 .AddAttribute(
"MinRTO",
"Minimum retransmit timeout value",
63 .AddAttribute(
"MaxRTO",
"Maximum retransmit timeout value", TimeValue(Seconds(200.0)),
72 NS_LOG_FUNCTION(
this << minRto);
84 NS_LOG_FUNCTION(
this << maxRto);
96 NS_LOG_FUNCTION(
this << estimate);
112 NS_LOG_FUNCTION(
this);
121 NS_LOG_FUNCTION(
this);
132 NS_LOG_FUNCTION(
this);
137 ObjectBase::ConstructSelf(AttributeConstructionList());
146 , m_maxMultiplier(c.m_maxMultiplier)
147 , m_initialEstimatedRtt(c.m_initialEstimatedRtt)
148 , m_currentEstimatedRtt(c.m_currentEstimatedRtt)
149 , m_minRto(c.m_minRto)
150 , m_maxRto(c.m_maxRto)
151 , m_nSamples(c.m_nSamples)
152 , m_multiplier(c.m_multiplier)
153 , m_history(c.m_history)
155 NS_LOG_FUNCTION(
this);
160 NS_LOG_FUNCTION(
this);
172 NS_LOG_FUNCTION(
this << seq << size);
176 m_next = seq + SequenceNumber32(size);
180 if ((seq >= i->seq) && (seq < (i->seq + SequenceNumber32(i->count)))) {
183 if ((seq + SequenceNumber32(size)) > m_next) {
184 m_next = seq + SequenceNumber32(size);
185 i->count = ((seq + SequenceNumber32(size)) - i->seq);
196 NS_LOG_FUNCTION(
this << ackSeq);
200 Time m = Seconds(0.0);
204 if (!h.
retx && ackSeq >= (h.
seq + SequenceNumber32(h.
count))) {
205 m = Simulator::Now() - h.
time;
212 if ((h.
seq + SequenceNumber32(h.
count)) > ackSeq)
222 NS_LOG_FUNCTION(
this);
231 NS_LOG_FUNCTION(
this);
233 NS_LOG_DEBUG(
"Multiplier increased to " <<
m_multiplier);
239 NS_LOG_FUNCTION(
this);
246 NS_LOG_FUNCTION(
this);