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... | |
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... | |
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 35 of file ncc-strategy.cpp.
|
virtual |
Definition at line 40 of file ncc-strategy.cpp.
|
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 49 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 185 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 |
propagate to another upstream
Definition at line 114 of file ncc-strategy.cpp.
References nfd::getGlobalRng(), getMeasurementsEntryInfo(), nfd::scheduler::schedule(), and nfd::fw::Strategy::sendInterest().
Referenced by afterReceiveInterest().
|
protected |
Definition at line 224 of file ncc-strategy.cpp.
References nfd::fw::Strategy::getMeasurements(), and nfd::MeasurementsAccessor::getParent().
Referenced by afterReceiveInterest(), beforeSatisfyInterest(), doPropagate(), getMeasurementsEntryInfo(), and timeoutOnBestFace().
|
protected |
Definition at line 217 of file ncc-strategy.cpp.
References nfd::MeasurementsAccessor::get(), nfd::fw::Strategy::getMeasurements(), and getMeasurementsEntryInfo().
|
protected |
best face did not reply within prediction
Definition at line 161 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().
|
staticprotected |
Definition at line 139 of file ncc-strategy.hpp.
Referenced by afterReceiveInterest().
|
staticprotected |
Definition at line 140 of file ncc-strategy.hpp.
Referenced by afterReceiveInterest().
|
staticprotected |
Definition at line 142 of file ncc-strategy.hpp.
Referenced by beforeSatisfyInterest(), and timeoutOnBestFace().
|
static |
Definition at line 136 of file ncc-strategy.hpp.
|
staticprotected |
Definition at line 141 of file ncc-strategy.hpp.
Referenced by beforeSatisfyInterest(), and timeoutOnBestFace().