NS-3 based Named Data Networking (NDN) simulator
ndnSIM: NDN, CCN, CCNx, content centric networks
API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
ns3::ndn::pit::Entry Class Reference

structure for PIT entry More...

#include <ndn-pit-entry.h>

Inheritance diagram for ns3::ndn::pit::Entry:
Collaboration diagram for ns3::ndn::pit::Entry:

Public Types

typedef std::set< IncomingFacein_container
 incoming faces container type
 
typedef in_container::iterator in_iterator
 iterator to incoming faces
 
typedef std::set< OutgoingFaceout_container
 outgoing faces container type
 
typedef out_container::iterator out_iterator
 iterator to outgoing faces
 
typedef std::set< uint32_t > nonce_container
 nonce container type
 

Public Member Functions

 Entry (Pit &container, Ptr< const Interest > header, Ptr< fib::Entry > fibEntry)
 PIT entry constructor. More...
 
virtual ~Entry ()
 Virtual destructor.
 
virtual void UpdateLifetime (const Time &lifetime)
 Update lifetime of PIT entry. More...
 
virtual void OffsetLifetime (const Time &offsetTime)
 Offset the currently set PIT lifetime (allowed both negative and positive offsets) More...
 
const NameGetPrefix () const
 Get prefix of the PIT entry.
 
const Time & GetExpireTime () const
 Get current expiration time of the record. More...
 
bool IsNonceSeen (uint32_t nonce) const
 Check if nonce nonce for the same prefix has already been seen. More...
 
virtual void AddSeenNonce (uint32_t nonce)
 Add nonce to the list of seen nonces. More...
 
virtual in_iterator AddIncoming (Ptr< Face > face)
 Add face to the list of incoming faces. More...
 
virtual void RemoveIncoming (Ptr< Face > face)
 Remove incoming entry for face face
 
virtual void ClearIncoming ()
 Clear all incoming faces either after all of them were satisfied or NACKed.
 
virtual out_iterator AddOutgoing (Ptr< Face > face)
 Add face to the list of outgoing faces. More...
 
virtual void ClearOutgoing ()
 Clear all incoming faces either after all of them were satisfied or NACKed.
 
virtual void RemoveAllReferencesToFace (Ptr< Face > face)
 Remove all references to face. More...
 
virtual void SetWaitingInVain (Ptr< Face > face)
 Flag outgoing face as hopeless.
 
bool AreAllOutgoingInVain () const
 Check if all outgoing faces are NACKed.
 
bool AreTherePromisingOutgoingFacesExcept (Ptr< Face > face) const
 Similar to AreAllOutgoingInVain, but ignores face More...
 
virtual void IncreaseAllowedRetxCount ()
 Increase maximum limit of allowed retransmission per outgoing face.
 
uint32_t GetMaxRetxCount () const
 Get maximum allowed number of retransmissions via outgoing faces.
 
Ptr< fib::EntryGetFibEntry ()
 Get associated FIB entry.
 
const in_containerGetIncoming () const
 Get associated list (const reference) of incoming faces.
 
const out_containerGetOutgoing () const
 Get associated list (const reference) of outgoing faces.
 
uint32_t GetOutgoingCount () const
 Get number of outgoing faces (needed for python bindings)
 
void AddFwTag (boost::shared_ptr< fw::Tag > tag)
 Add new forwarding strategy tag.
 
template<class T >
boost::shared_ptr< T > GetFwTag ()
 Get forwarding strategy tag (tag is not removed) More...
 
template<class T >
void RemoveFwTag ()
 Remove the forwarding strategy tag. More...
 
Ptr< const InterestGetInterest () const
 Get Interest (if several interests are received, then nonce is from the first Interest)
 

Protected Attributes

Pitm_container
 Reference to the container (to rearrange indexes, if necessary)
 
Ptr< const Interestm_interest
 Interest of the PIT entry (if several interests are received, then nonce is from the first Interest)
 
Ptr< fib::Entrym_fibEntry
 FIB entry related to this prefix.
 
nonce_container m_seenNonces
 map of nonces that were seen for this prefix
 
in_container m_incoming
 container for incoming interests
 
out_container m_outgoing
 container for outgoing interests
 
Time m_expireTime
 Time when PIT entry will be removed.
 
Time m_lastRetransmission
 Last time when number of retransmissions were increased.
 
uint32_t m_maxRetxCount
 Maximum allowed number of retransmissions via outgoing faces.
 
std::list< boost::shared_ptr
< fw::Tag > > 
m_fwTags
 Forwarding strategy tags.
 

Friends

std::ostream & operator<< (std::ostream &os, const Entry &entry)
 

Detailed Description

structure for PIT entry

All set-methods are virtual, in case index rearrangement is necessary in the derived classes

Definition at line 57 of file ndn-pit-entry.h.

Constructor & Destructor Documentation

ns3::ndn::pit::Entry::Entry ( Pit container,
Ptr< const Interest header,
Ptr< fib::Entry fibEntry 
)

PIT entry constructor.

Parameters
prefixPrefix of the PIT entry
offsetTimeRelative time to the current moment, representing PIT entry lifetime
fibEntryA FIB entry associated with the PIT entry

Definition at line 43 of file ndn-pit-entry.cc.

References UpdateLifetime().

Member Function Documentation

Entry::in_iterator ns3::ndn::pit::Entry::AddIncoming ( Ptr< Face face)
virtual

Add face to the list of incoming faces.

Parameters
faceFace to add to the list of incoming faces
Returns
iterator to the added entry

Definition at line 117 of file ndn-pit-entry.cc.

References m_incoming.

Entry::out_iterator ns3::ndn::pit::Entry::AddOutgoing ( Ptr< Face face)
virtual

Add face to the list of outgoing faces.

Parameters
faceFace to add to the list of outgoing faces
Returns
iterator to the added entry

Definition at line 140 of file ndn-pit-entry.cc.

References m_outgoing.

void ns3::ndn::pit::Entry::AddSeenNonce ( uint32_t  nonce)
virtual

Add nonce to the list of seen nonces.

Parameters
noncenonce to add to the list of seen nonces

All nonces are stored for the lifetime of the PIT entry

Definition at line 110 of file ndn-pit-entry.cc.

References m_seenNonces.

bool ns3::ndn::pit::Entry::AreTherePromisingOutgoingFacesExcept ( Ptr< Face face) const

Similar to AreAllOutgoingInVain, but ignores face

See also
AreAllOutgoingInVain

Definition at line 214 of file ndn-pit-entry.cc.

References ns3::ndn::pit::OutgoingFace::m_face, m_outgoing, and ns3::ndn::pit::OutgoingFace::m_waitingInVain.

const Time & ns3::ndn::pit::Entry::GetExpireTime ( ) const

Get current expiration time of the record.

Returns
current expiration time of the record

Definition at line 98 of file ndn-pit-entry.cc.

References m_expireTime.

template<class T >
boost::shared_ptr< T > ns3::ndn::pit::Entry::GetFwTag ( )
inline

Get forwarding strategy tag (tag is not removed)

Get and remove forwarding strategy tag.

Definition at line 308 of file ndn-pit-entry.h.

References m_fwTags.

bool ns3::ndn::pit::Entry::IsNonceSeen ( uint32_t  nonce) const

Check if nonce nonce for the same prefix has already been seen.

Parameters
nonceNonce to check

Definition at line 104 of file ndn-pit-entry.cc.

References m_seenNonces.

void ns3::ndn::pit::Entry::OffsetLifetime ( const Time &  offsetTime)
virtual

Offset the currently set PIT lifetime (allowed both negative and positive offsets)

Parameters
offsetTimepositive or negative offset for the PIT lifetime.

If PIT expire time becomes less than Simulator::Now, then it is adjusted to Simulator::Now.

Reimplemented in ns3::ndn::pit::EntryImpl< Pit >.

Definition at line 80 of file ndn-pit-entry.cc.

References GetPrefix(), and m_expireTime.

Referenced by ns3::ndn::pit::EntryImpl< Pit >::OffsetLifetime().

void ns3::ndn::pit::Entry::RemoveAllReferencesToFace ( Ptr< Face face)
virtual

Remove all references to face.

This method should be called before face is completely removed from the stack. Face is removed from the lists of incoming and outgoing faces

Definition at line 162 of file ndn-pit-entry.cc.

References m_incoming, and m_outgoing.

template<class T >
void ns3::ndn::pit::Entry::RemoveFwTag ( )
inline

Remove the forwarding strategy tag.

Peek the forwarding strategy tag.

Definition at line 347 of file ndn-pit-entry.h.

References m_fwTags.

void ns3::ndn::pit::Entry::UpdateLifetime ( const Time &  lifetime)
virtual

Update lifetime of PIT entry.

Parameters
lifetimedesired lifetime of the pit entry (relative to the Simulator::Now ())

This function will update PIT entry lifetime to the maximum of the current lifetime and the lifetime Simulator::Now () + lifetime

Reimplemented in ns3::ndn::pit::EntryImpl< Pit >.

Definition at line 66 of file ndn-pit-entry.cc.

References ns3::ndn::Pit::GetMaxPitEntryLifetime(), GetPrefix(), m_container, and m_expireTime.

Referenced by Entry(), and ns3::ndn::pit::EntryImpl< Pit >::UpdateLifetime().


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