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::Interest Class Reference

NDN Interest (wire formats are defined in wire) More...

#include <ndn-interest.h>

Inheritance diagram for ns3::ndn::Interest:
Collaboration diagram for ns3::ndn::Interest:

Classes

class  Ccnb
 
class  ndnSIM
 

Public Types

enum  { NORMAL_INTEREST = 0, NACK_LOOP = 10, NACK_CONGESTION = 11, NACK_GIVEUP_PIT = 12 }
 NACK Type Specifies the type of Interest packet.
 

Public Member Functions

 Interest (Ptr< Packet > payload=Create< Packet >())
 Constructor. More...
 
 Interest (const Interest &interest)
 Copy constructor.
 
void SetName (Ptr< Name > name)
 Set interest name. More...
 
void SetName (const Name &name)
 Another variant to set interest name. More...
 
const NameGetName () const
 Get interest name. More...
 
Ptr< const NameGetNamePtr () const
 Get smart pointer to the interest name (to avoid extra memory usage)
 
void SetScope (int8_t scope)
 Set Scope Scope limits where the Interest may propagate. More...
 
int8_t GetScope () const
 Get Scope value Scope limits where the Interest may propagate. More...
 
void SetInterestLifetime (Time time)
 Set InterestLifetime InterestLifetime indicates the (approximate) time remaining before the interest times out. More...
 
Time GetInterestLifetime () const
 Get InterestLifetime value InterestLifetime indicates the (approximate) time remaining before the interest times out. More...
 
void SetNonce (uint32_t nonce)
 Set Nonce Nonce carries a randomly-genenerated bytestring that is used to detect and discard duplicate Interest messages. More...
 
uint32_t GetNonce () const
 Get Nonce value Nonce carries a randomly-genenerated bytestring that is used to detect and discard duplicate Interest messages.
 
void SetNack (uint8_t nackType)
 Mark the Interest as a Negative Acknowledgement Three types of NACKs are supported. More...
 
uint8_t GetNack () const
 Get NACK type Returns NACK_LOOP, NACK_CONGESTION or NACK_GIVEUP_PIT. More...
 
void SetExclude (Ptr< Exclude > exclude)
 Set exclude filter of interest packet. More...
 
Ptr< const ExcludeGetExclude () const
 Get exclude filter of interest packet.
 
void SetPayload (Ptr< Packet > payload)
 Set virtual "payload" of interest packet. More...
 
Ptr< const Packet > GetPayload () const
 Get virtual "payload" to interest packet. More...
 
Ptr< const Packet > GetWire () const
 Get wire formatted packet. More...
 
void SetWire (Ptr< const Packet > packet) const
 Set (cache) wire formatted packet.
 
void Print (std::ostream &os) const
 Print Interest in plain-text to the specified output stream.
 

Detailed Description

NDN Interest (wire formats are defined in wire)

Definition at line 43 of file ndn-interest.h.

Constructor & Destructor Documentation

ns3::ndn::Interest::Interest ( Ptr< Packet >  payload = Create<Packet> ())

Constructor.

Creates a null header

Definition at line 32 of file ndn-interest.cc.

Member Function Documentation

Time ns3::ndn::Interest::GetInterestLifetime ( ) const

Get InterestLifetime value InterestLifetime indicates the (approximate) time remaining before the interest times out.

The timeout is relative to the arrival time of the interest at the current node.

See also
http://www.ndn.org/releases/latest/doc/technical/InterestMessage.html for more information.

Definition at line 109 of file ndn-interest.cc.

Referenced by Print().

uint8_t ns3::ndn::Interest::GetNack ( ) const

Get NACK type Returns NACK_LOOP, NACK_CONGESTION or NACK_GIVEUP_PIT.

Otherwise, in case of normal interest packet, returns NORMAL_INTEREST (equals 0).

Definition at line 135 of file ndn-interest.cc.

Referenced by Print().

const Name & ns3::ndn::Interest::GetName ( ) const

Get interest name.

Gets name of the interest.

Definition at line 76 of file ndn-interest.cc.

Referenced by ns3::ndn::fib::FibImpl::LongestPrefixMatch(), ns3::ndn::pit::PitImpl< Policy >::Lookup(), and Print().

Ptr< const Packet > ns3::ndn::Interest::GetPayload ( ) const

Get virtual "payload" to interest packet.

This payload can carry packet tags

Definition at line 161 of file ndn-interest.cc.

int8_t ns3::ndn::Interest::GetScope ( ) const

Get Scope value Scope limits where the Interest may propagate.

Scope 0 prevents propagation beyond the local ccnd (even to other applications on the same host). Scope 1 limits propagation to the applications on the originating host. Scope 2 limits propagation to no further than the next host. Other values are not defined, and will cause the Interest message to be dropped. Note that this is not a hop count - the value is not decremented as the interest is forwarded.

Definition at line 96 of file ndn-interest.cc.

Referenced by Print().

Ptr< const Packet > ns3::ndn::Interest::GetWire ( ) const
inline

Get wire formatted packet.

If wire formatted packet has not been set before, 0 will be returned

Definition at line 257 of file ndn-interest.h.

void ns3::ndn::Interest::SetExclude ( Ptr< Exclude exclude)

Set exclude filter of interest packet.

Empty or 0 means no exclude filter

Definition at line 141 of file ndn-interest.cc.

void ns3::ndn::Interest::SetInterestLifetime ( Time  time)

Set InterestLifetime InterestLifetime indicates the (approximate) time remaining before the interest times out.

The timeout is relative to the arrival time of the interest at the current node.

See also
http://www.ndn.org/releases/latest/doc/technical/InterestMessage.html for more information.
Parameters
[in]timeinterest lifetime

Definition at line 102 of file ndn-interest.cc.

Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().

void ns3::ndn::Interest::SetNack ( uint8_t  nackType)

Mark the Interest as a Negative Acknowledgement Three types of NACKs are supported.

  1. NACK_LOOP
  2. NACK_CONGESTION
  3. NACK_GIVEUP_PIT
    Parameters
    [in]nackTypeNACK_LOOP or NACK_CONGESTION or NACK_GIVEUP_PIT or NORMAL_INTEREST

Definition at line 128 of file ndn-interest.cc.

Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().

void ns3::ndn::Interest::SetName ( Ptr< Name name)

Set interest name.

Parameters
namesmart pointer to Name

Definition at line 62 of file ndn-interest.cc.

Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().

void ns3::ndn::Interest::SetName ( const Name name)

Another variant to set interest name.

Parameters
nameconst reference to Name object

Definition at line 69 of file ndn-interest.cc.

void ns3::ndn::Interest::SetNonce ( uint32_t  nonce)

Set Nonce Nonce carries a randomly-genenerated bytestring that is used to detect and discard duplicate Interest messages.

Parameters
[in]nonceUnique packet identification number

Definition at line 115 of file ndn-interest.cc.

Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().

void ns3::ndn::Interest::SetPayload ( Ptr< Packet >  payload)

Set virtual "payload" of interest packet.

This payload can carry packet tags

Definition at line 154 of file ndn-interest.cc.

void ns3::ndn::Interest::SetScope ( int8_t  scope)

Set Scope Scope limits where the Interest may propagate.

Scope 0 prevents propagation beyond the local ccnd (even to other applications on the same host). Scope 1 limits propagation to the applications on the originating host. Scope 2 limits propagation to no further than the next host. Other values are not defined, and will cause the Interest message to be dropped. Note that this is not a hop count - the value is not decremented as the interest is forwarded.

Parameters
[in]scopeinterest scope

Definition at line 89 of file ndn-interest.cc.

Referenced by ns3::ndn::wire::ccnb::InterestVisitor::visit().


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