Abstract base class for Ndn forwarding strategies. More...
#include <ndn-forwarding-strategy.h>
Public Member Functions | |
ForwardingStrategy () | |
Default constructor. | |
virtual void | OnInterest (Ptr< Face > face, Ptr< Interest > interest) |
Actual processing of incoming Ndn interests. More... | |
virtual void | OnData (Ptr< Face > face, Ptr< Data > data) |
Actual processing of incoming Ndn content objects. More... | |
virtual void | WillEraseTimedOutPendingInterest (Ptr< pit::Entry > pitEntry) |
Event fired just before PIT entry is removed by timeout. More... | |
virtual void | AddFace (Ptr< Face > face) |
Event fired every time face is added to NDN stack. More... | |
virtual void | RemoveFace (Ptr< Face > face) |
Event fired every time face is removed from NDN stack. More... | |
virtual void | DidAddFibEntry (Ptr< fib::Entry > fibEntry) |
Event fired every time a FIB entry is added to FIB. More... | |
virtual void | WillRemoveFibEntry (Ptr< fib::Entry > fibEntry) |
Fired just before FIB entry will be removed from FIB. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId () |
static std::string | GetLogName () |
Helper function to retrieve logging name for the forwarding strategy. | |
Protected Member Functions | |
virtual void | DidCreatePitEntry (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
An event that is fired every time a new PIT entry is created. More... | |
virtual void | FailedToCreatePitEntry (Ptr< Face > inFace, Ptr< const Interest > interest) |
An event that is fired every time a new PIT entry cannot be created (e.g., PIT container imposes a limit) More... | |
virtual void | DidReceiveDuplicateInterest (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
An event that is fired every time a duplicated Interest is received. More... | |
virtual void | DidSuppressSimilarInterest (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
An event that is fired every time when a similar Interest is received and suppressed (collapsed) More... | |
virtual void | DidForwardSimilarInterest (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
An event that is fired every time when a similar Interest is received and further forwarded (not suppressed/collapsed) More... | |
virtual void | DidExhaustForwardingOptions (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
An even that is fired when Interest cannot be forwarded. More... | |
virtual bool | DetectRetransmittedInterest (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
Method that implements logic to distinguish between new and retransmitted interest. More... | |
virtual void | WillSatisfyPendingInterest (Ptr< Face > inFace, Ptr< pit::Entry > pitEntry) |
Even fired just before Interest will be satisfied. More... | |
virtual void | SatisfyPendingInterest (Ptr< Face > inFace, Ptr< const Data > data, Ptr< pit::Entry > pitEntry) |
Actual procedure to satisfy Interest. More... | |
virtual void | DidSendOutData (Ptr< Face > inFace, Ptr< Face > outFace, Ptr< const Data > data, Ptr< pit::Entry > pitEntry) |
Event which is fired just after data was send out on the face. More... | |
virtual void | DidReceiveSolicitedData (Ptr< Face > inFace, Ptr< const Data > data, bool didCreateCacheEntry) |
Event which is fired every time a requested (solicited) DATA packet (there is an active PIT entry) is received. More... | |
virtual void | DidReceiveUnsolicitedData (Ptr< Face > inFace, Ptr< const Data > data, bool didCreateCacheEntry) |
Event which is fired every time an unsolicited DATA packet (no active PIT entry) is received. More... | |
virtual bool | ShouldSuppressIncomingInterest (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
Method implementing logic to suppress (collapse) similar Interests. More... | |
virtual bool | CanSendOutInterest (Ptr< Face > inFace, Ptr< Face > outFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
Method to check whether Interest can be send out on the particular face or not. More... | |
virtual bool | TrySendOutInterest (Ptr< Face > inFace, Ptr< Face > outFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
Method implementing actual interest forwarding, taking into account CanSendOutInterest decision. More... | |
virtual void | DidSendOutInterest (Ptr< Face > inFace, Ptr< Face > outFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
Event fired just after forwarding the Interest. More... | |
virtual void | PropagateInterest (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry) |
Wrapper method, which performs general tasks and calls DoPropagateInterest method. More... | |
virtual bool | DoPropagateInterest (Ptr< Face > inFace, Ptr< const Interest > interest, Ptr< pit::Entry > pitEntry)=0 |
Virtual method to perform Interest propagation according to the forwarding strategy logic. More... | |
virtual void | NotifyNewAggregate () |
Even when object is aggregated to another Object. | |
virtual void | DoDispose () |
Do cleanup. | |
Protected Attributes | |
Ptr< Pit > | m_pit |
Reference to PIT to which this forwarding strategy is associated. | |
Ptr< Fib > | m_fib |
FIB. | |
Ptr< ContentStore > | m_contentStore |
Content store (for caching purposes only) | |
bool | m_cacheUnsolicitedDataFromApps |
bool | m_cacheUnsolicitedData |
bool | m_detectRetransmissions |
TracedCallback< Ptr< const Interest >, Ptr< const Face > > | m_outInterests |
Transmitted interests trace. | |
TracedCallback< Ptr< const Interest >, Ptr< const Face > > | m_inInterests |
trace of incoming Interests | |
TracedCallback< Ptr< const Interest >, Ptr< const Face > > | m_dropInterests |
trace of dropped Interests | |
TracedCallback< Ptr< const Data >, bool, Ptr< const Face > > | m_outData |
trace of outgoing Data | |
TracedCallback< Ptr< const Data >, Ptr< const Face > > | m_inData |
trace of incoming Data | |
TracedCallback< Ptr< const Data >, Ptr< const Face > > | m_dropData |
trace of dropped Data | |
TracedCallback< Ptr< const pit::Entry > > | m_satisfiedInterests |
TracedCallback< Ptr< const pit::Entry > > | m_timedOutInterests |
Abstract base class for Ndn forwarding strategies.
Doxygen introspection did not find any typical Config paths.
Definition at line 61 of file ndn-forwarding-strategy.h.
|
virtual |
Event fired every time face is added to NDN stack.
face | face to be removed |
Reimplemented in ns3::ndn::fw::PerOutFaceLimits< SmartFlooding >, ns3::ndn::fw::PerOutFaceLimits< BestRoute >, ns3::ndn::fw::PerOutFaceLimits< Flooding >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< SmartFlooding > >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< BestRoute > >, and ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< Flooding > >.
Definition at line 572 of file ndn-forwarding-strategy.cc.
|
protectedvirtual |
Method to check whether Interest can be send out on the particular face or not.
In the base class, this method perfoms two checks:
inFace | incoming face of the Interest |
outFace | proposed outgoing face of the Interest |
interest | Interest packet |
pitEntry | reference to PIT entry (reference to corresponding FIB entry inside) |
Reimplemented in ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< SmartFlooding > >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< BestRoute > >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< Flooding > >, ns3::ndn::fw::PerOutFaceLimits< SmartFlooding >, ns3::ndn::fw::PerOutFaceLimits< BestRoute >, and ns3::ndn::fw::PerOutFaceLimits< Flooding >.
Definition at line 493 of file ndn-forwarding-strategy.cc.
Referenced by TrySendOutInterest().
|
protectedvirtual |
Method that implements logic to distinguish between new and retransmitted interest.
This method is called only when DetectRetransmissions attribute is set true (by default).
Currently, the retransmission detection logic relies on the fact that list of incoming faces already has inFace (i.e., a similar interest is received on the same face more than once).
inFace | incoming face |
interest | Interest header |
pitEntry | an existing PIT entry, corresponding to the duplicated Interest |
Definition at line 338 of file ndn-forwarding-strategy.cc.
Referenced by PropagateInterest(), and ShouldSuppressIncomingInterest().
|
virtual |
Event fired every time a FIB entry is added to FIB.
fibEntry | FIB entry that was added |
Reimplemented in ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< SmartFlooding > >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< BestRoute > >, and ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< Flooding > >.
Definition at line 584 of file ndn-forwarding-strategy.cc.
|
protectedvirtual |
An event that is fired every time a new PIT entry is created.
Note that if NDN node is receiving a similar interest (interest for the same name), then either DidReceiveDuplicateInterest, DidSuppressSimilarInterest, or DidForwardSimilarInterest will be called
Suppression of similar Interests is controlled using ShouldSuppressIncomingInterest virtual method
inFace | incoming face |
header | deserialized Interest header |
pitEntry | created PIT entry (incoming and outgoing face sets are empty) |
Definition at line 273 of file ndn-forwarding-strategy.cc.
Referenced by OnInterest().
|
protectedvirtual |
An even that is fired when Interest cannot be forwarded.
Note that the event will not fire if retransmission detection is enabled (by default) and retransmitted Interest cannot by forwarded. For more details, refer to the implementation.
inFace | incoming face |
interest | Interest header |
pitEntry | an existing PIT entry, corresponding to the duplicated Interest |
Reimplemented in ns3::ndn::fw::Nacks.
Definition at line 315 of file ndn-forwarding-strategy.cc.
References m_dropInterests, and m_pit.
Referenced by ns3::ndn::fw::Nacks::DidExhaustForwardingOptions(), and PropagateInterest().
|
protectedvirtual |
An event that is fired every time when a similar Interest is received and further forwarded (not suppressed/collapsed)
This even is fired just before handling the Interest to PropagateInterest method
inFace | incoming face |
interest | Interest packet |
pitEntry | an existing PIT entry, corresponding to the duplicated Interest |
Definition at line 308 of file ndn-forwarding-strategy.cc.
Referenced by OnInterest().
|
protectedvirtual |
An event that is fired every time a duplicated Interest is received.
This even is the last action that is performed before the Interest processing is halted
inFace | incoming face |
interest | Interest packet |
pitEntry | an existing PIT entry, corresponding to the duplicated Interest |
Reimplemented in ns3::ndn::fw::Nacks.
Definition at line 287 of file ndn-forwarding-strategy.cc.
References m_dropInterests.
Referenced by ns3::ndn::fw::Nacks::DidReceiveDuplicateInterest(), and OnInterest().
|
protectedvirtual |
Event which is fired every time a requested (solicited) DATA packet (there is an active PIT entry) is received.
inFace | incoming face |
data | Data packet |
didCreateCacheEntry | flag indicating whether a cache entry was added for this data packet or not (e.g., packet already exists in cache) |
Definition at line 389 of file ndn-forwarding-strategy.cc.
Referenced by OnData().
|
protectedvirtual |
Event which is fired every time an unsolicited DATA packet (no active PIT entry) is received.
The current implementation allows ignoring unsolicited DATA (by default), or cache it by setting attribute CacheUnsolicitedData true
inFace | incoming face |
data | Data packet |
didCreateCacheEntry | flag indicating whether a cache entry was added for this data packet or not (e.g., packet already exists in cache) |
Definition at line 397 of file ndn-forwarding-strategy.cc.
Referenced by OnData().
|
protectedvirtual |
Event which is fired just after data was send out on the face.
inFace | incoming face of the Data |
outFace | outgoing face |
data | Data packet |
pitEntry | an existing PIT entry, corresponding to the duplicated Interest |
Definition at line 557 of file ndn-forwarding-strategy.cc.
References m_outData.
Referenced by SatisfyPendingInterest().
|
protectedvirtual |
Event fired just after forwarding the Interest.
inFace | incoming face of the Interest |
outFace | outgoing face of the Interest |
interest | Interest packet |
pitEntry | reference to PIT entry (reference to corresponding FIB entry inside) |
Definition at line 548 of file ndn-forwarding-strategy.cc.
References m_outInterests.
Referenced by TrySendOutInterest().
|
protectedvirtual |
An event that is fired every time when a similar Interest is received and suppressed (collapsed)
This even is the last action that is performed before the Interest processing is halted
inFace | incoming face |
interest | Interest packet |
pitEntry | an existing PIT entry, corresponding to the duplicated Interest |
Definition at line 301 of file ndn-forwarding-strategy.cc.
Referenced by OnInterest().
|
protectedpure virtual |
Virtual method to perform Interest propagation according to the forwarding strategy logic.
In most cases, this is the call that needs to be implemented/re-implemented in order to perform forwarding of Interests according to the desired logic.
There is also PropagateInterest method (generally, do not require to be overriden) which performs general tasks (adding face to the list of incoming face, updating PIT entry lifetime, calling DoPropagateInterest, as well as perform retransmissions (enabled by default).
inFace | incoming face |
interest | Interest packet |
pitEntry | reference to PIT entry (reference to corresponding FIB entry inside) |
Implemented in ns3::ndn::fw::Flooding, ns3::ndn::fw::BestRoute, ns3::ndn::fw::SmartFlooding, and ns3::ndn::fw::GreenYellowRed.
Referenced by PropagateInterest().
|
protectedvirtual |
An event that is fired every time a new PIT entry cannot be created (e.g., PIT container imposes a limit)
Note that this call can be called only for non-similar Interest (i.e., there is an attempt to create a new PIT entry). For any non-similar Interests, either FailedToCreatePitEntry or DidCreatePitEntry is called.
inFace | incoming face |
interest | Interest packet |
Definition at line 280 of file ndn-forwarding-strategy.cc.
References m_dropInterests.
Referenced by OnInterest().
Actual processing of incoming Ndn content objects.
Processing Data packets
face | incoming face |
data | Data packet |
Definition at line 224 of file ndn-forwarding-strategy.cc.
References ns3::ndn::Face::APPLICATION, DidReceiveSolicitedData(), DidReceiveUnsolicitedData(), m_contentStore, m_dropData, m_inData, m_pit, SatisfyPendingInterest(), and WillSatisfyPendingInterest().
Referenced by ns3::ndn::L3Protocol::AddFace().
|
virtual |
Actual processing of incoming Ndn interests.
Note, interests do not have payload
Processing Interest packets
face | incoming face |
interest | Interest packet |
Reimplemented in ns3::ndn::fw::Nacks.
Definition at line 145 of file ndn-forwarding-strategy.cc.
References DidCreatePitEntry(), DidForwardSimilarInterest(), DidReceiveDuplicateInterest(), DidSuppressSimilarInterest(), FailedToCreatePitEntry(), m_contentStore, m_dropInterests, m_inInterests, m_pit, PropagateInterest(), SatisfyPendingInterest(), ShouldSuppressIncomingInterest(), and WillSatisfyPendingInterest().
Referenced by ns3::ndn::L3Protocol::AddFace(), and ns3::ndn::fw::Nacks::OnInterest().
|
protectedvirtual |
Wrapper method, which performs general tasks and calls DoPropagateInterest method.
General tasks so far are adding face to the list of incoming face, updating PIT entry lifetime, calling DoPropagateInterest, and retransmissions (enabled by default).
inFace | incoming face |
interest | Interest packet |
pitEntry | reference to PIT entry (reference to corresponding FIB entry inside) |
Definition at line 454 of file ndn-forwarding-strategy.cc.
References DetectRetransmittedInterest(), DidExhaustForwardingOptions(), and DoPropagateInterest().
Referenced by OnInterest().
|
virtual |
Event fired every time face is removed from NDN stack.
face | face to be removed |
For example, when an application terminates, AppFace is removed and this method called by NDN stack.
Definition at line 578 of file ndn-forwarding-strategy.cc.
|
protectedvirtual |
Actual procedure to satisfy Interest.
Note that when Interest is satisfied from the cache, incoming face will be 0
inFace | incoming face |
data | Data packet |
pitEntry | an existing PIT entry, corresponding to the duplicated Interest |
Definition at line 356 of file ndn-forwarding-strategy.cc.
References DidSendOutData(), m_dropData, ns3::ndn::pit::IncomingFace::m_face, and m_pit.
Referenced by OnData(), and OnInterest().
|
protectedvirtual |
Method implementing logic to suppress (collapse) similar Interests.
In the base class implementation this method checks list of incoming/outgoing faces of the PIT entry (for new Intersets, both lists are empty before this call)
For more details, refer to the source code.
Definition at line 420 of file ndn-forwarding-strategy.cc.
References DetectRetransmittedInterest().
Referenced by OnInterest().
|
protectedvirtual |
Method implementing actual interest forwarding, taking into account CanSendOutInterest decision.
If event returns false, then there is some kind of a problem exists
inFace | incoming face of the Interest |
outFace | proposed outgoing face of the Interest |
interest | Interest packet |
pitEntry | reference to PIT entry (reference to corresponding FIB entry inside) |
Definition at line 523 of file ndn-forwarding-strategy.cc.
References CanSendOutInterest(), DidSendOutInterest(), and m_dropInterests.
Referenced by ns3::ndn::fw::GreenYellowRed::DoPropagateInterest(), ns3::ndn::fw::SmartFlooding::DoPropagateInterest(), ns3::ndn::fw::BestRoute::DoPropagateInterest(), and ns3::ndn::fw::Flooding::DoPropagateInterest().
|
virtual |
Event fired just before PIT entry is removed by timeout.
pitEntry | PIT entry to be removed |
Reimplemented in ns3::ndn::fw::PerOutFaceLimits< SmartFlooding >, ns3::ndn::fw::PerOutFaceLimits< BestRoute >, ns3::ndn::fw::PerOutFaceLimits< Flooding >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< SmartFlooding > >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< BestRoute > >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< Flooding > >, and ns3::ndn::fw::GreenYellowRed.
Definition at line 566 of file ndn-forwarding-strategy.cc.
Referenced by ns3::ndn::fw::GreenYellowRed::WillEraseTimedOutPendingInterest().
|
virtual |
Fired just before FIB entry will be removed from FIB.
fibEntry | FIB entry that will be removed |
Definition at line 590 of file ndn-forwarding-strategy.cc.
|
protectedvirtual |
Even fired just before Interest will be satisfied.
Note that when Interest is satisfied from the cache, incoming face will be 0
inFace | incoming face |
pitEntry | an existing PIT entry, corresponding to the duplicated Interest |
Reimplemented in ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< SmartFlooding > >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< BestRoute > >, ns3::ndn::fw::PerFibLimits< ::ns3::ndn::fw::PerOutFaceLimits< Flooding > >, ns3::ndn::fw::PerOutFaceLimits< SmartFlooding >, ns3::ndn::fw::PerOutFaceLimits< BestRoute >, ns3::ndn::fw::PerOutFaceLimits< Flooding >, and ns3::ndn::fw::GreenYellowRed.
Definition at line 405 of file ndn-forwarding-strategy.cc.
Referenced by OnData(), OnInterest(), and ns3::ndn::fw::GreenYellowRed::WillSatisfyPendingInterest().