41 NDN_THROW(std::invalid_argument(
"MulticastStrategy does not support version " +
42 std::to_string(*parsed.
version)));
50 NDN_LOG_DEBUG(*m_retxSuppression);
56 static const auto strategyName = Name(
"/localhost/nfd/strategy/multicast").appendVersion(5);
62 const shared_ptr<pit::Entry>& pitEntry)
67 for (
const auto& nexthop : nexthops) {
68 Face& outFace = nexthop.getFace();
70 auto suppressResult = m_retxSuppression->decidePerUpstream(*pitEntry, outFace);
81 auto* sentOutRecord = this->
sendInterest(interest, outFace, pitEntry);
83 m_retxSuppression->incrementIntervalForOutRecord(*sentOutRecord);
90 const shared_ptr<pit::Entry>& pitEntry)
95 const auto& interest = pitEntry->getInterest();
98 for (
const auto& r : pitEntry->getInRecords()) {
99 auto& inFace = r.getFace();
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 noexcept
Represents a nexthop record in a FIB entry.
Face & getFace() const noexcept
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
A collection of nexthops in a FIB entry.
@ SUPPRESS
Interest is a retransmission and should be suppressed.
@ FORWARD
Interest is a 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)
#define NFD_LOG_INTEREST_FROM(interest, ingress, msg)
Logs the reception of interest on ingress, followed by msg, at DEBUG level.
std::optional< uint64_t > version
The strategy version number, if present.
PartialName parameters
Parameter components, may be empty.