NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.0: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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:


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< 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 time::nanoseconds MEASUREMENTS_LIFETIME = time::seconds(16)

Additional Inherited Members

- Protected Attributes inherited from nfd::fw::Strategy
signal::Signal< FaceTable,
shared_ptr< Face > > & 
signal::Signal< FaceTable,
shared_ptr< Face > > & 

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 35 of file ncc-strategy.cpp.

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

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

Member Function Documentation

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

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

void nfd::fw::NccStrategy::beforeSatisfyInterest ( shared_ptr< pit::Entry pitEntry,
const Face inFace,
const Data &  data 

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.

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

void nfd::fw::NccStrategy::doPropagate ( weak_ptr< pit::Entry pitEntryWeak,
weak_ptr< fib::Entry fibEntryWeak 

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

shared_ptr< NccStrategy::MeasurementsEntryInfo > nfd::fw::NccStrategy::getMeasurementsEntryInfo ( shared_ptr< measurements::Entry entry)
shared_ptr< NccStrategy::MeasurementsEntryInfo > nfd::fw::NccStrategy::getMeasurementsEntryInfo ( shared_ptr< pit::Entry entry)
void nfd::fw::NccStrategy::timeoutOnBestFace ( weak_ptr< pit::Entry pitEntryWeak)

Member Data Documentation

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

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

Referenced by afterReceiveInterest().

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

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

Referenced by afterReceiveInterest().

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

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

Referenced by beforeSatisfyInterest(), and timeoutOnBestFace().

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

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

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

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

Referenced by beforeSatisfyInterest(), and timeoutOnBestFace().

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