fw: increase initial suppression interval in BestRouteStrategy2

refs #3230

Change-Id: I27217a01c066e90f65b5000a29991c938042a810
This commit is contained in:
Junxiao Shi committed 2015-11-11 06:06:58 -07:00
1 parent 077df8fbb6
commit 52e8540a86
3 files changed
+12 -4

No files matched your search

+6
View File
@@ -34,8 +34,14 @@ NFD_LOG_INIT("BestRouteStrategy2");
const Name BestRouteStrategy2::STRATEGY_NAME("ndn:/localhost/nfd/strategy/best-route/%FD%04");
NFD_REGISTER_STRATEGY(BestRouteStrategy2);
const time::milliseconds BestRouteStrategy2::RETX_SUPPRESSION_INITIAL(10);
const time::milliseconds BestRouteStrategy2::RETX_SUPPRESSION_MAX(250);
BestRouteStrategy2::BestRouteStrategy2(Forwarder& forwarder, const Name& name)
: Strategy(forwarder, name)
, m_retxSuppression(RETX_SUPPRESSION_INITIAL,
RetxSuppressionExponential::DEFAULT_MULTIPLIER,
RETX_SUPPRESSION_MAX)
{
}
+3 -1
View File
@@ -67,7 +67,9 @@ public:
public:
static const Name STRATEGY_NAME;
private:
PUBLIC_WITH_TESTS_ELSE_PRIVATE:
static const time::milliseconds RETX_SUPPRESSION_INITIAL;
static const time::milliseconds RETX_SUPPRESSION_MAX;
RetxSuppressionExponential m_retxSuppression;
};
+3 -3
View File
@@ -84,7 +84,7 @@ BOOST_AUTO_TEST_CASE(Forward)
shared_ptr<pit::Entry> pitEntry = pit.insert(*interest).first;
const time::nanoseconds TICK = time::duration_cast<time::nanoseconds>(
fw::RetxSuppressionExponential::DEFAULT_INITIAL_INTERVAL * 0.1);
BestRouteStrategy2::RETX_SUPPRESSION_INITIAL * 0.1);
// first Interest goes to nexthop with lowest FIB cost,
// however face1 is downstream so it cannot be used
@@ -115,7 +115,7 @@ BOOST_AUTO_TEST_CASE(Forward)
retxFrom4Evt = scheduler::schedule(TICK * 5, periodicalRetxFrom4);
};
periodicalRetxFrom4();
this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 16);
this->advanceClocks(TICK, BestRouteStrategy2::RETX_SUPPRESSION_MAX * 16);
scheduler::cancel(retxFrom4Evt);
// nexthops for accepted retransmissions: follow FIB cost,
@@ -131,7 +131,7 @@ BOOST_AUTO_TEST_CASE(Forward)
strategy.sendInterestHistory.clear();
for (int i = 0; i < 3; ++i) {
this->advanceClocks(TICK, fw::RetxSuppressionExponential::DEFAULT_MAX_INTERVAL * 2);
this->advanceClocks(TICK, BestRouteStrategy2::RETX_SUPPRESSION_MAX * 2);
pitEntry->insertOrUpdateInRecord(face5, *interest);
strategy.afterReceiveInterest(*face5, *interest, fibEntry, pitEntry);
}