41 NDN_THROW(std::invalid_argument(
42 "MulticastStrategy does not support version " + to_string(*parsed.
version)));
50 NDN_LOG_DEBUG(*m_retxSuppression);
56 static const auto strategyName = Name(
"/localhost/nfd/strategy/multicast").appendVersion(4);
62 const shared_ptr<pit::Entry>& pitEntry)
67 for (
const auto& nexthop : nexthops) {
68 Face& outFace = nexthop.getFace();
73 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" to=" << outFace.
getId() <<
" suppressed");
82 auto* sentOutRecord = this->
sendInterest(interest, outFace, pitEntry);
84 m_retxSuppression->incrementIntervalForOutRecord(*sentOutRecord);
91 const shared_ptr<pit::Entry>& pitEntry)
96 auto& interest = pitEntry->getInterest();
99 for (
const auto& r : pitEntry->getInRecords()) {
100 auto& inFace = r.getFace();
103 NFD_LOG_DEBUG(interest <<
" from=" << inFace.getId() <<
" pitEntry-to=" << nextHopFaceId);
This file contains common algorithms used by forwarding strategies.
Represents a face-endpoint pair in the forwarder.
Main class of NFD's forwarding engine.
Generalization of a network interface.
FaceId getId() const noexcept
Returns the face ID.
Represents an entry in the FIB.
const NextHopList & getNextHops() const
Represents a nexthop record in a FIB entry.
A forwarding strategy that forwards Interests to all FIB nexthops.
MulticastStrategy(Forwarder &forwarder, const Name &name=getStrategyName())
void afterNewNextHop(const fib::NextHop &nextHop, const shared_ptr< pit::Entry > &pitEntry) override
Trigger after a new nexthop is added.
static const Name & getStrategyName()
void afterReceiveInterest(const Interest &interest, const FaceEndpoint &ingress, const shared_ptr< pit::Entry > &pitEntry) override
Trigger after an Interest is received.
static std::unique_ptr< RetxSuppressionExponential > construct(const StrategyParameters ¶ms)
Base class of all forwarding strategies.
const fib::Entry & lookupFib(const pit::Entry &pitEntry) const
Performs a FIB lookup, considering Link object if present.
pit::OutRecord * sendInterest(const Interest &interest, Face &egress, const shared_ptr< pit::Entry > &pitEntry)
Send an Interest packet.
static ParsedInstanceName parseInstanceName(const Name &input)
Parse a strategy instance name.
void setInstanceName(const Name &name) noexcept
Set strategy instance name.
static StrategyParameters parseParameters(const PartialName ¶ms)
Parse strategy parameters encoded in a strategy instance name.
static Name makeInstanceName(const Name &input, const Name &strategyName)
Construct a strategy instance name.
#define NFD_LOG_INIT(name)
std::vector< NextHop > NextHopList
@ SUPPRESS
Interest is retransmission and should be suppressed.
@ FORWARD
Interest is retransmission and should be forwarded.
bool isNextHopEligible(const Face &inFace, const Interest &interest, const fib::NextHop &nexthop, const shared_ptr< pit::Entry > &pitEntry, bool wantUnused, time::steady_clock::time_point now)
Determines whether a NextHop is eligible, i.e., not the same inFace.
NFD_REGISTER_STRATEGY(SelfLearningStrategy)
std::optional< uint64_t > version
The strategy version number, if present.
PartialName parameters
Parameter components, may be empty.