a forwarding strategy similar to CCNx 0.7.2 More...
#include <ncc-strategy.hpp>
Classes | |
class | MeasurementsEntryInfo |
StrategyInfo on measurements::Entry. More... | |
class | PitEntryInfo |
StrategyInfo on pit::Entry. More... | |
Public Member Functions | |
NccStrategy (Forwarder &forwarder, const Name &name=STRATEGY_NAME) | |
virtual | ~NccStrategy () |
virtual void | afterReceiveInterest (const Face &inFace, const Interest &interest, shared_ptr< fib::Entry > fibEntry, shared_ptr< pit::Entry > pitEntry) 1 |
trigger after Interest is received More... | |
virtual void | beforeSatisfyInterest (shared_ptr< pit::Entry > pitEntry, const Face &inFace, const Data &data) 1 |
trigger before PIT entry is satisfied More... | |
Public Member Functions inherited from nfd::fw::Strategy | |
Strategy (Forwarder &forwarder, const Name &name) | |
construct a strategy instance More... | |
virtual | ~Strategy () |
const Name & | getName () const |
a Name that represent the Strategy program More... | |
virtual void | beforeExpirePendingInterest (shared_ptr< pit::Entry > pitEntry) |
trigger before PIT entry expires More... | |
virtual void | afterReceiveNack (const Face &inFace, const lp::Nack &nack, shared_ptr< fib::Entry > fibEntry, shared_ptr< pit::Entry > pitEntry) |
trigger after Nack is received More... | |
Static Public Attributes | |
static const Name | STRATEGY_NAME |
Protected Member Functions | |
shared_ptr< MeasurementsEntryInfo > | getMeasurementsEntryInfo (shared_ptr< measurements::Entry > entry) |
shared_ptr< MeasurementsEntryInfo > | getMeasurementsEntryInfo (shared_ptr< pit::Entry > entry) |
void | doPropagate (weak_ptr< pit::Entry > pitEntryWeak, weak_ptr< fib::Entry > fibEntryWeak) |
propagate to another upstream More... | |
void | timeoutOnBestFace (weak_ptr< pit::Entry > pitEntryWeak) |
best face did not reply within prediction More... | |
Protected Member Functions inherited from nfd::fw::Strategy | |
void | sendInterest (shared_ptr< pit::Entry > pitEntry, shared_ptr< Face > outFace, bool wantNewNonce=false) |
send Interest to outFace More... | |
void | rejectPendingInterest (shared_ptr< pit::Entry > pitEntry) |
decide that a pending Interest cannot be forwarded More... | |
void | sendNack (shared_ptr< pit::Entry > pitEntry, const Face &outFace, const lp::NackHeader &header) |
send Nack to outFace More... | |
void | sendNacks (shared_ptr< pit::Entry > pitEntry, const lp::NackHeader &header, std::initializer_list< const Face *> exceptFaces=std::initializer_list< const Face *>()) |
send Nack to every face that has an in-record, except those in exceptFaces More... | |
MeasurementsAccessor & | getMeasurements () |
shared_ptr< Face > | getFace (FaceId id) |
const FaceTable & | getFaceTable () |
Static Protected Attributes | |
static const time::microseconds | DEFER_FIRST_WITHOUT_BEST_FACE = time::microseconds(4000) |
static const time::microseconds | DEFER_RANGE_WITHOUT_BEST_FACE = time::microseconds(75000) |
static const int | UPDATE_MEASUREMENTS_N_LEVELS = 2 |
static const time::nanoseconds | MEASUREMENTS_LIFETIME = time::seconds(16) |
Additional Inherited Members | |
Protected Attributes inherited from nfd::fw::Strategy | |
signal::Signal< FaceTable, shared_ptr< Face > > & | afterAddFace |
signal::Signal< FaceTable, shared_ptr< Face > > & | beforeRemoveFace |
a forwarding strategy similar to CCNx 0.7.2
Definition at line 36 of file ncc-strategy.hpp.
nfd::fw::NccStrategy::NccStrategy | ( | Forwarder & | forwarder, |
const Name & | name = STRATEGY_NAME |
||
) |
Definition at line 36 of file ncc-strategy.cpp.
|
virtual |
Definition at line 41 of file ncc-strategy.cpp.
References DEFER_FIRST_WITHOUT_BEST_FACE, DEFER_RANGE_WITHOUT_BEST_FACE, and MEASUREMENTS_LIFETIME.
|
virtual |
trigger after Interest is received
The Interest:
The strategy should decide whether and where to forward this Interest.
Implements nfd::fw::Strategy.
Definition at line 50 of file ncc-strategy.cpp.
References DEFER_FIRST_WITHOUT_BEST_FACE, DEFER_RANGE_WITHOUT_BEST_FACE, doPropagate(), getMeasurementsEntryInfo(), nfd::fw::Strategy::rejectPendingInterest(), nfd::scheduler::schedule(), nfd::fw::Strategy::sendInterest(), and timeoutOnBestFace().
|
virtual |
trigger before PIT entry is satisfied
This trigger is invoked when an incoming Data satisfies the PIT entry. It can be invoked even if the PIT entry has already been satisfied.
In this base class this method does nothing.
Reimplemented from nfd::fw::Strategy.
Definition at line 191 of file ncc-strategy.cpp.
References nfd::scheduler::cancel(), nfd::MeasurementsAccessor::extendLifetime(), nfd::MeasurementsAccessor::get(), nfd::fw::Strategy::getMeasurements(), getMeasurementsEntryInfo(), nfd::MeasurementsAccessor::getParent(), MEASUREMENTS_LIFETIME, and UPDATE_MEASUREMENTS_N_LEVELS.
|
protected |
Definition at line 230 of file ncc-strategy.cpp.
References nfd::fw::Strategy::getMeasurements(), nfd::MeasurementsAccessor::getParent(), nfd::fw::NccStrategy::MeasurementsEntryInfo::INITIAL_PREDICTION, nfd::fw::NccStrategy::MeasurementsEntryInfo::MAX_PREDICTION, and nfd::fw::NccStrategy::MeasurementsEntryInfo::MIN_PREDICTION.
Referenced by afterReceiveInterest(), beforeSatisfyInterest(), doPropagate(), getMeasurementsEntryInfo(), and timeoutOnBestFace().
|
protected |
Definition at line 223 of file ncc-strategy.cpp.
References nfd::MeasurementsAccessor::get(), nfd::fw::Strategy::getMeasurements(), and getMeasurementsEntryInfo().
|
protected |
propagate to another upstream
Definition at line 120 of file ncc-strategy.cpp.
References nfd::getGlobalRng(), getMeasurementsEntryInfo(), nfd::scheduler::schedule(), and nfd::fw::Strategy::sendInterest().
Referenced by afterReceiveInterest().
|
protected |
best face did not reply within prediction
Definition at line 167 of file ncc-strategy.cpp.
References nfd::MeasurementsAccessor::extendLifetime(), nfd::MeasurementsAccessor::get(), nfd::fw::Strategy::getMeasurements(), getMeasurementsEntryInfo(), nfd::MeasurementsAccessor::getParent(), MEASUREMENTS_LIFETIME, and UPDATE_MEASUREMENTS_N_LEVELS.
Referenced by afterReceiveInterest().
|
static |
Definition at line 136 of file ncc-strategy.hpp.
|
staticprotected |
Definition at line 139 of file ncc-strategy.hpp.
Referenced by afterReceiveInterest(), and ~NccStrategy().
|
staticprotected |
Definition at line 140 of file ncc-strategy.hpp.
Referenced by afterReceiveInterest(), and ~NccStrategy().
|
staticprotected |
Definition at line 141 of file ncc-strategy.hpp.
Referenced by beforeSatisfyInterest(), and timeoutOnBestFace().
|
staticprotected |
Definition at line 142 of file ncc-strategy.hpp.
Referenced by beforeSatisfyInterest(), timeoutOnBestFace(), and ~NccStrategy().