37 const time::milliseconds MulticastStrategy::RETX_SUPPRESSION_INITIAL(10);
38 const time::milliseconds MulticastStrategy::RETX_SUPPRESSION_MAX(250);
43 , m_retxSuppression(RETX_SUPPRESSION_INITIAL,
49 BOOST_THROW_EXCEPTION(std::invalid_argument(
"MulticastStrategy does not accept parameters"));
52 BOOST_THROW_EXCEPTION(std::invalid_argument(
53 "MulticastStrategy does not support version " +
to_string(*parsed.
version)));
61 static Name strategyName(
"/localhost/nfd/strategy/multicast/%FD%03");
67 const shared_ptr<pit::Entry>& pitEntry)
72 int nEligibleNextHops = 0;
74 bool isSuppressed =
false;
76 for (
const auto& nexthop : nexthops) {
77 Face& outFace = nexthop.getFace();
83 <<
"to=" << outFace.
getId() <<
" suppressed");
95 <<
" pitEntry-to=" << outFace.
getId());
103 if (nEligibleNextHops == 0 && !isSuppressed) {
107 nackHeader.
setReason(lp::NackReason::NO_ROUTE);
108 this->
sendNack(pitEntry, inFace, nackHeader);
116 const shared_ptr<pit::Entry>& pitEntry)
void afterReceiveInterest(const Face &inFace, const Interest &interest, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Interest is received
Interest is retransmission and should be forwarded.
static ParsedInstanceName parseInstanceName(const Name &input)
parse a strategy instance name
MulticastStrategy(Forwarder &forwarder, const Name &name=getStrategyName())
generalization of a network interface
PartialName parameters
parameter components
void sendNack(const shared_ptr< pit::Entry > &pitEntry, const Face &outFace, const lp::NackHeader &header)
send Nack to outFace
RetxSuppressionResult decidePerUpstream(pit::Entry &pitEntry, Face &outFace)
determines whether Interest is a retransmission per upstream and if so, whether it shall be forwarded...
Interest is retransmission and should be suppressed.
void setInstanceName(const Name &name)
set strategy instance name
represents an Interest packet
#define NFD_LOG_DEBUG(expression)
void processNack(const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry)
static const Name & getStrategyName()
ndn::optional< uint64_t > version
whether strategyName contains a version component
represents a Network Nack
void afterReceiveNack(const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Nack is received
ndn::nfd::LinkType getLinkType() const
Copyright (c) 2011-2015 Regents of the University of California.
void incrementIntervalForOutRecord(pit::OutRecord &outRecord)
Increment the suppression interval for out record.
NFD_REGISTER_STRATEGY(AccessStrategy)
std::vector< fib::NextHop > NextHopList
void rejectPendingInterest(const shared_ptr< pit::Entry > &pitEntry)
decide that a pending Interest cannot be forwarded
Represents an absolute name.
represents a forwarding strategy
This file contains common algorithms used by forwarding strategies.
const fib::Entry & lookupFib(const pit::Entry &pitEntry) const
performs a FIB lookup, considering Link object if present
static Name makeInstanceName(const Name &input, const Name &strategyName)
construct a strategy instance name
std::string to_string(const V &v)
const NextHopList & getNextHops() const
#define NFD_LOG_INIT(name)
a retransmission suppression decision algorithm that suppresses retransmissions using exponential bac...
void sendInterest(const shared_ptr< pit::Entry > &pitEntry, Face &outFace, const Interest &interest)
send Interest to outFace
bool wouldViolateScope(const Face &inFace, const Interest &interest, const Face &outFace)
determine whether forwarding the Interest in pitEntry to outFace would violate scope ...