NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
nfd::fw::NccStrategy Class Reference

a forwarding strategy similar to CCNx 0.7.2 More...

#include <ncc-strategy.hpp>

Inheritance diagram for nfd::fw::NccStrategy:
Collaboration diagram for nfd::fw::NccStrategy:

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 NamegetName () 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< MeasurementsEntryInfogetMeasurementsEntryInfo (shared_ptr< measurements::Entry > entry)
 
shared_ptr< MeasurementsEntryInfogetMeasurementsEntryInfo (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...
 
MeasurementsAccessorgetMeasurements ()
 
shared_ptr< FacegetFace (FaceId id)
 
const FaceTablegetFaceTable ()
 

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
 

Detailed Description

a forwarding strategy similar to CCNx 0.7.2

Definition at line 36 of file ncc-strategy.hpp.

Constructor & Destructor Documentation

nfd::fw::NccStrategy::NccStrategy ( Forwarder forwarder,
const Name name = STRATEGY_NAME 
)

Definition at line 36 of file ncc-strategy.cpp.

nfd::fw::NccStrategy::~NccStrategy ( )
virtual

Member Function Documentation

void nfd::fw::NccStrategy::afterReceiveInterest ( const Face inFace,
const Interest interest,
shared_ptr< fib::Entry fibEntry,
shared_ptr< pit::Entry pitEntry 
)
virtual

trigger after Interest is received

The Interest:

  • does not violate Scope
  • is not looped
  • cannot be satisfied by ContentStore
  • is under a namespace managed by this strategy

The strategy should decide whether and where to forward this Interest.

  • If the strategy decides to forward this Interest, invoke this->sendInterest one or more times, either now or shortly after
  • If strategy concludes that this Interest cannot be forwarded, invoke this->rejectPendingInterest so that PIT entry will be deleted shortly
Note
The strategy is permitted to store a weak reference to fibEntry. Do not store a shared reference, because PIT entry may be deleted at any moment. fibEntry is passed by value to allow obtaining a weak reference from it.
The strategy is permitted to store a shared reference to pitEntry. pitEntry is passed by value to reflect this fact.

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().

void nfd::fw::NccStrategy::beforeSatisfyInterest ( shared_ptr< pit::Entry pitEntry,
const Face inFace,
const Data data 
)
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.

Note
The strategy is permitted to store a shared reference to pitEntry. pitEntry is passed by value to reflect this fact.

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.

shared_ptr< NccStrategy::MeasurementsEntryInfo > nfd::fw::NccStrategy::getMeasurementsEntryInfo ( shared_ptr< pit::Entry entry)
protected
void nfd::fw::NccStrategy::doPropagate ( weak_ptr< pit::Entry pitEntryWeak,
weak_ptr< fib::Entry fibEntryWeak 
)
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().

void nfd::fw::NccStrategy::timeoutOnBestFace ( weak_ptr< pit::Entry pitEntryWeak)
protected

Member Data Documentation

const Name nfd::fw::NccStrategy::STRATEGY_NAME
static

Definition at line 136 of file ncc-strategy.hpp.

const time::microseconds nfd::fw::NccStrategy::DEFER_FIRST_WITHOUT_BEST_FACE = time::microseconds(4000)
staticprotected

Definition at line 139 of file ncc-strategy.hpp.

Referenced by afterReceiveInterest(), and ~NccStrategy().

const time::microseconds nfd::fw::NccStrategy::DEFER_RANGE_WITHOUT_BEST_FACE = time::microseconds(75000)
staticprotected

Definition at line 140 of file ncc-strategy.hpp.

Referenced by afterReceiveInterest(), and ~NccStrategy().

const int nfd::fw::NccStrategy::UPDATE_MEASUREMENTS_N_LEVELS = 2
staticprotected

Definition at line 141 of file ncc-strategy.hpp.

Referenced by beforeSatisfyInterest(), and timeoutOnBestFace().

const time::nanoseconds nfd::fw::NccStrategy::MEASUREMENTS_LIFETIME = time::seconds(16)
staticprotected

Definition at line 142 of file ncc-strategy.hpp.

Referenced by beforeSatisfyInterest(), timeoutOnBestFace(), and ~NccStrategy().


The documentation for this class was generated from the following files: