36 const double RttStats::ALPHA = 0.125;
39 : m_srtt(RTT_NO_MEASUREMENT)
40 , m_rtt(RTT_NO_MEASUREMENT)
51 m_srtt = computeSrtt(m_srtt, m_rtt);
55 RttStats::computeSrtt(Rtt previousSrtt, Rtt currentRtt)
61 return Rtt(ALPHA * currentRtt + (1 - ALPHA) * previousSrtt);
68 : m_isTimeoutScheduled(false)
69 , m_nSilentTimeouts(0)
82 if (!m_isTimeoutScheduled) {
83 m_timeoutEventId = id;
84 m_isTimeoutScheduled =
true;
85 m_lastInterestName = interestName;
88 BOOST_THROW_EXCEPTION(
FaceInfo::Error(
"Tried to schedule a timeout for a face that already has a timeout scheduled."));
93 FaceInfo::cancelTimeoutEvent()
96 m_isTimeoutScheduled =
false;
100 FaceInfo::cancelTimeoutEvent(
const Name& prefix)
108 FaceInfo::doesNameMatchLastInterest(
const Name&
name)
117 pit::OutRecordCollection::const_iterator outRecord = pitEntry->getOutRecord(inFace);
119 if (outRecord == pitEntry->out_end()) {
120 NFD_LOG_TRACE(pitEntry->getInterest() <<
" dataFrom inFace=" << inFace.
getId() <<
" no-out-record");
130 <<
" RTT: " << m_rttStats.
getRtt()
131 <<
" SRTT: " << m_rttStats.
getSrtt());
145 : m_isProbingDue(false)
146 , m_hasFirstProbeBeenScheduled(false)
155 if (it != m_fit.end()) {
170 if (it == m_fit.end()) {
171 const auto& pair = m_fit.insert(std::make_pair(faceId,
FaceInfo()));
172 info = &pair.first->second;
208 : m_measurements(measurements)
239 BOOST_ASSERT(info !=
nullptr);
251 me ==
nullptr && prefixLen <= interest.
getName().
size(); ++prefixLen) {
256 BOOST_ASSERT(me !=
nullptr);
262 BOOST_ASSERT(info !=
nullptr);
time::microseconds Duration
PartialName getPrefix(ssize_t nComponents) const
Extract a prefix of the name.
const Name & getPrefix() const
FaceInfo & getOrCreateFaceInfo(const fib::Entry &fibEntry, FaceId faceId)
void recordRtt(const shared_ptr< pit::Entry > &pitEntry, const Face &inFace)
void setMeasurementExpirationEventId(const scheduler::EventId &id)
generalization of a network interface
void cancel(const EventId &eventId)
cancel a scheduled event
void addRttMeasurement(RttEstimator::Duration &durationRtt)
static time_point now() noexcept
bool isPrefixOf(const Name &other) const
Check if this name is a prefix of another name.
void extendFaceInfoLifetime(FaceInfo &info, FaceId faceId)
FaceInfo & getOrCreateFaceInfo(const fib::Entry &fibEntry, const Interest &interest, FaceId faceId)
const scheduler::EventId & getMeasurementExpirationEventId()
AsfMeasurements(MeasurementsAccessor &measurements)
represents an Interest packet
stores stategy information about each face in this namespace
void extendLifetime(Entry &entry, const time::nanoseconds &lifetime)
extend lifetime of an entry
Entry * findLongestPrefixMatch(const Name &name, const EntryPredicate &pred=AnyEntry()) const
perform a longest prefix match for name
static const Rtt RTT_TIMEOUT
void cancelTimeoutEvent(const Name &prefix)
represents a Measurements entry
Table::const_iterator iterator
std::shared_ptr< ns3::EventId > EventId
#define NFD_LOG_TRACE(expression)
void expireFaceInfo(FaceId faceId)
void addMeasurement(Duration measure)
Copyright (c) 2011-2015 Regents of the University of California.
NamespaceInfo & getOrCreateNamespaceInfo(const fib::Entry &fibEntry, const Interest &interest)
static const Rtt RTT_NO_MEASUREMENT
static constexpr time::microseconds MEASUREMENTS_LIFETIME
Represents an absolute name.
void setTimeoutEvent(const scheduler::EventId &id, const Name &interestName)
std::pair< T *, bool > insertStrategyInfo(A &&... args)
insert a StrategyInfo item
Strategy information for each face in a namespace.
size_t size() const
Get number of components.
allows Strategy to access portion of Measurements table under its namespace
NamespaceInfo * getNamespaceInfo(const Name &prefix)
EventId schedule(time::nanoseconds after, const EventCallback &event)
schedule an event
Entry * get(const Name &name)
find or insert a Measurements entry for name
FaceInfo * getFaceInfo(const fib::Entry &fibEntry, FaceId faceId)
void recordTimeout(const Name &interestName)
FaceInfo * getFaceInfo(const fib::Entry &fibEntry, const Interest &interest, FaceId faceId)
uint64_t FaceId
identifies a face
#define NFD_LOG_INIT(name)
bool isTimeoutScheduled() const
time::duration< double, boost::micro > Rtt
const Name & getName() const