35 class RetxSuppressionExponential::PitInfo :
public StrategyInfo
45 PitInfo(
const Duration& initialInterval)
46 : suppressionInterval(initialInterval)
60 : m_initialInterval(initialInterval)
61 , m_multiplier(multiplier)
62 , m_maxInterval(maxInterval)
64 BOOST_ASSERT(initialInterval > 0_us);
65 BOOST_ASSERT(multiplier >= 1.0f);
66 BOOST_ASSERT(maxInterval >= initialInterval);
78 auto now = time::steady_clock::now();
79 auto sinceLastOutgoing = now - lastOutgoing;
82 bool shouldSuppress = sinceLastOutgoing < pi->suppressionInterval;
88 pi->suppressionInterval = std::min(m_maxInterval,
89 time::duration_cast<Duration>(pi->suppressionInterval * m_multiplier));
99 if (outRecord == pitEntry.
out_end()) {
103 auto lastOutgoing = outRecord->getLastRenewed();
104 auto now = time::steady_clock::now();
105 auto sinceLastOutgoing = now - lastOutgoing;
108 PitInfo* pi = outRecord->insertStrategyInfo<PitInfo>(m_initialInterval).first;
109 bool shouldSuppress = sinceLastOutgoing < pi->suppressionInterval;
111 if (shouldSuppress) {
122 pi->suppressionInterval = std::min(m_maxInterval,
123 time::duration_cast<Duration>(pi->suppressionInterval * m_multiplier));
Interest is retransmission and should be forwarded.
static const float DEFAULT_MULTIPLIER
OutRecordCollection::iterator getOutRecord(const Face &face)
get the out-record for face
void incrementIntervalForOutRecord(pit::OutRecord &outRecord)
Increment the suppression interval for out record.
std::pair< T *, bool > insertStrategyInfo(A &&... args)
Insert a StrategyInfo item.
Contains information about an Interest toward an outgoing face.
Interest is retransmission and should be suppressed.
RetxSuppressionResult decidePerUpstream(pit::Entry &pitEntry, Face &outFace)
determines whether Interest is a retransmission per upstream and if so, whether it shall be forwarded...
static const Duration DEFAULT_INITIAL_INTERVAL
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
Interest is new (not a retransmission)
RetxSuppressionExponential(const Duration &initialInterval=DEFAULT_INITIAL_INTERVAL, float multiplier=DEFAULT_MULTIPLIER, const Duration &maxInterval=DEFAULT_MAX_INTERVAL)
generalization of a network interface
bool hasPendingOutRecords(const pit::Entry &pitEntry)
determine whether pitEntry has any pending out-records
time::steady_clock::TimePoint getLastOutgoing(const pit::Entry &pitEntry)
static const Duration DEFAULT_MAX_INTERVAL
RetxSuppressionResult decidePerPitEntry(pit::Entry &pitEntry)
determines whether Interest is a retransmission per pit entry and if so, whether it shall be forwarde...
OutRecordCollection::iterator out_end()
time::microseconds Duration
time granularity