fw: increase initial suppression interval in BestRouteStrategy2
refs #3230
Change-Id: I27217a01c066e90f65b5000a29991c938042a810
diff --git a/daemon/fw/best-route-strategy2.cpp b/daemon/fw/best-route-strategy2.cpp
index f582358..477b0a3 100644
--- a/daemon/fw/best-route-strategy2.cpp
+++ b/daemon/fw/best-route-strategy2.cpp
@@ -34,8 +34,14 @@
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)
{
}
diff --git a/daemon/fw/best-route-strategy2.hpp b/daemon/fw/best-route-strategy2.hpp
index 8c19dc0..8985586 100644
--- a/daemon/fw/best-route-strategy2.hpp
+++ b/daemon/fw/best-route-strategy2.hpp
@@ -67,7 +67,9 @@
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;
};
diff --git a/tests/daemon/fw/best-route-strategy2.t.cpp b/tests/daemon/fw/best-route-strategy2.t.cpp
index 4ee43e9..9cecd15 100644
--- a/tests/daemon/fw/best-route-strategy2.t.cpp
+++ b/tests/daemon/fw/best-route-strategy2.t.cpp
@@ -84,7 +84,7 @@
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 @@
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 @@
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);
}