37 const time::milliseconds MulticastStrategy::RETX_SUPPRESSION_INITIAL(10);
38 const time::milliseconds MulticastStrategy::RETX_SUPPRESSION_MAX(250);
42 , m_retxSuppression(RETX_SUPPRESSION_INITIAL,
48 NDN_THROW(std::invalid_argument(
"MulticastStrategy does not accept parameters"));
51 NDN_THROW(std::invalid_argument(
52 "MulticastStrategy does not support version " + to_string(*parsed.
version)));
60 static const auto strategyName = Name(
"/localhost/nfd/strategy/multicast").appendVersion(4);
66 const shared_ptr<pit::Entry>& pitEntry)
71 for (
const auto& nexthop : nexthops) {
72 Face& outFace = nexthop.getFace();
77 NFD_LOG_DEBUG(interest <<
" from=" << ingress <<
" to=" << outFace.
getId() <<
" suppressed");
86 auto* sentOutRecord = this->
sendInterest(interest, outFace, pitEntry);
95 const shared_ptr<pit::Entry>& pitEntry)
100 auto& interest = pitEntry->getInterest();
103 for (
const auto& r : pitEntry->getInRecords()) {
104 auto& inFace = r.getFace();
107 NFD_LOG_DEBUG(interest <<
" from=" << inFace.getId() <<
" pitEntry-to=" << nextHopFaceId);
Represents a face-endpoint pair in the forwarder.
Main class of NFD's forwarding engine.
generalization of a network interface
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.
a retransmission suppression decision algorithm that suppresses retransmissions using exponential bac...
void incrementIntervalForOutRecord(pit::OutRecord &outRecord)
Increment the suppression interval for out record.
RetxSuppressionResult decidePerUpstream(pit::Entry &pitEntry, Face &outFace)
determines whether Interest is a retransmission per upstream and if so, whether it shall be forwarded...
Represents a forwarding strategy.
void setInstanceName(const Name &name)
Set strategy instance name.
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.
static Name makeInstanceName(const Name &input, const Name &strategyName)
Construct a strategy instance name.
This file contains common algorithms used by forwarding strategies.
#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.
NFD_REGISTER_STRATEGY(SelfLearningStrategy)
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)
Copyright (c) 2014-2015, Regents of the University of California, Arizona Board of Regents,...
optional< uint64_t > version
whether strategyName contains a version component
PartialName parameters
parameter components