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 NDN_THROW(std::invalid_argument(
"MulticastStrategy does not accept parameters"));
52 NDN_THROW(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();
82 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" to=" << outFace.
getId() <<
" suppressed");
101 if (nEligibleNextHops == 0 && !isSuppressed) {
102 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" noNextHop");
104 lp::NackHeader nackHeader;
105 nackHeader.setReason(lp::NackReason::NO_ROUTE);
106 this->
sendNack(pitEntry, ingress, nackHeader);
114 const shared_ptr<pit::Entry>& pitEntry)
Main class of NFD's forwarding engine.
Interest is retransmission and should be forwarded.
void setInstanceName(const Name &name)
set strategy instance name
void incrementIntervalForOutRecord(pit::OutRecord &outRecord)
Increment the suppression interval for out record.
void sendNack(const shared_ptr< pit::Entry > &pitEntry, const FaceEndpoint &egress, const lp::NackHeader &header)
send Nack to egress
Interest is retransmission and should be suppressed.
static Name makeInstanceName(const Name &input, const Name &strategyName)
construct a strategy instance name
RetxSuppressionResult decidePerUpstream(pit::Entry &pitEntry, Face &outFace)
determines whether Interest is a retransmission per upstream and if so, whether it shall be forwarded...
ndn::nfd::LinkType getLinkType() const
static const Name & getStrategyName()
const fib::Entry & lookupFib(const pit::Entry &pitEntry) const
performs a FIB lookup, considering Link object if present
void sendInterest(const shared_ptr< pit::Entry > &pitEntry, const FaceEndpoint &egress, const Interest &interest)
send Interest to egress
Represents a face-endpoint pair in the forwarder.
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents...
a retransmission suppression decision algorithm that suppresses retransmissions using exponential bac...
MulticastStrategy(Forwarder &forwarder, const Name &name=getStrategyName())
void afterReceiveInterest(const FaceEndpoint &ingress, const Interest &interest, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Interest is received
generalization of a network interface
Represents a collection of nexthops.
PartialName parameters
parameter components
represents a forwarding strategy
This file contains common algorithms used by forwarding strategies.
const NextHopList & getNextHops() const
#define NFD_LOG_INIT(name)
static ParsedInstanceName parseInstanceName(const Name &input)
parse a strategy instance name
void afterReceiveNack(const FaceEndpoint &ingress, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry) override
trigger after Nack is received
void processNack(const Face &inFace, const lp::Nack &nack, const shared_ptr< pit::Entry > &pitEntry)
NFD_REGISTER_STRATEGY(SelfLearningStrategy)
bool wouldViolateScope(const Face &inFace, const Interest &interest, const Face &outFace)
determine whether forwarding the Interest in pitEntry to outFace would violate scope ...
void rejectPendingInterest(const shared_ptr< pit::Entry > &pitEntry)
schedule the PIT entry for immediate deletion
optional< uint64_t > version
whether strategyName contains a version component