|
NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
|
API Documentation
|
Go to the documentation of this file.
36 const time::milliseconds BestRouteStrategy2::RETX_SUPPRESSION_INITIAL(10);
37 const time::milliseconds BestRouteStrategy2::RETX_SUPPRESSION_MAX(250);
42 , m_retxSuppression(RETX_SUPPRESSION_INITIAL,
48 NDN_THROW(std::invalid_argument(
"BestRouteStrategy2 does not accept parameters"));
52 "BestRouteStrategy2 does not support version " +
to_string(*parsed.
version)));
60 static Name strategyName(
"/localhost/nfd/strategy/best-route/%FD%05");
66 const shared_ptr<pit::Entry>& pitEntry)
70 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" suppressed");
76 auto it = nexthops.end();
80 it = std::find_if(nexthops.begin(), nexthops.end(), [&] (
const auto& nexthop) {
81 return isNextHopEligible(ingress.face, interest, nexthop, pitEntry);
84 if (it == nexthops.end()) {
85 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" noNextHop");
88 nackHeader.
setReason(lp::NackReason::NO_ROUTE);
89 this->
sendNack(pitEntry, ingress, nackHeader);
96 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" newPitEntry-to=" << egress);
102 it = std::find_if(nexthops.begin(), nexthops.end(), [&] (
const auto& nexthop) {
103 return isNextHopEligible(ingress.face, interest, nexthop, pitEntry, true, time::steady_clock::now());
106 if (it != nexthops.end()) {
109 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" retransmit-unused-to=" << egress);
115 if (it == nexthops.end()) {
116 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" retransmitNoNextHop");
121 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" retransmit-retry-to=" << egress);
127 const shared_ptr<pit::Entry>& pitEntry)
static const Name & getStrategyName()
void sendInterest(const shared_ptr< pit::Entry > &pitEntry, const FaceEndpoint &egress, const Interest &interest)
send Interest to egress
NFD_REGISTER_STRATEGY(AccessStrategy)
a retransmission suppression decision algorithm that suppresses retransmissions using exponential bac...
Represents an absolute name.
Copyright (c) 2011-2015 Regents of the University of California.
RetxSuppressionResult decidePerPitEntry(pit::Entry &pitEntry)
determines whether Interest is a retransmission per pit entry and if so, whether it shall be forwarde...
void setInstanceName(const Name &name)
set strategy instance name
void sendNack(const shared_ptr< pit::Entry > &pitEntry, const FaceEndpoint &egress, const lp::NackHeader &header)
send Nack to egress
const NextHopList & getNextHops() const
Represents a face-endpoint pair in the forwarder.
BestRouteStrategy2(Forwarder &forwarder, const Name &name=getStrategyName())
const fib::Entry & lookupFib(const pit::Entry &pitEntry) const
performs a FIB lookup, considering Link object if present
Represents an Interest packet.
static ParsedInstanceName parseInstanceName(const Name &input)
parse a strategy instance name
void rejectPendingInterest(const shared_ptr< pit::Entry > &pitEntry)
schedule the PIT entry for immediate deletion
std::vector< NextHop > NextHopList
represents a forwarding strategy
Main class of NFD's forwarding engine.
fib::NextHopList::const_iterator findEligibleNextHopWithEarliestOutRecord(const Face &inFace, const Interest &interest, const fib::NextHopList &nexthops, const shared_ptr< pit::Entry > &pitEntry)
pick an eligible NextHop with earliest out-record
void processNack(const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry)
represents a Network Nack
void afterReceiveNack(const FaceEndpoint &ingress, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Nack is received
std::string to_string(const T &val)
static Name makeInstanceName(const Name &input, const Name &strategyName)
construct a strategy instance name
optional< uint64_t > version
whether strategyName contains a version component
PartialName parameters
parameter components
@ SUPPRESS
Interest is retransmission and should be suppressed.
Best Route strategy version 4.
#define NFD_LOG_INIT(name)
void afterReceiveInterest(const FaceEndpoint &ingress, const Interest &interest, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Interest is received
@ NEW
Interest is new (not a retransmission)