NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ns3::ndn::App Class Reference

Base class that all NDN applications should be derived from. More...

#include <ndn-app.hpp>

Inheritance diagram for ns3::ndn::App:
Collaboration diagram for ns3::ndn::App:

Public Types

typedef void(* InterestTraceCallback) (shared_ptr< const Interest >, Ptr< App >, shared_ptr< Face >)
 
typedef void(* DataTraceCallback) (shared_ptr< const Data >, Ptr< App >, shared_ptr< Face >)
 
typedef void(* NackTraceCallback) (shared_ptr< const lp::Nack >, Ptr< App >, shared_ptr< Face >)
 

Public Member Functions

 App ()
 Default constructor. More...
 
virtual ~App ()
 
uint32_t GetId () const
 Get application ID (ID of applications face) More...
 
virtual void OnInterest (shared_ptr< const Interest > interest)
 Method that will be called every time new Interest arrives. More...
 
virtual void OnData (shared_ptr< const Data > data)
 Method that will be called every time new Data arrives. More...
 
virtual void OnNack (shared_ptr< const lp::Nack > nack)
 Method that will be called every time new Nack arrives. More...
 

Static Public Member Functions

static TypeId GetTypeId ()
 

Protected Member Functions

virtual void DoInitialize ()
 
virtual void DoDispose ()
 
virtual void StartApplication ()
 Called at time specified by Start. More...
 
virtual void StopApplication ()
 Called at time specified by Stop. More...
 

Protected Attributes

bool m_active
 Flag to indicate that application is active (set by StartApplication and StopApplication) More...
 
shared_ptr< Facem_face
 
AppLinkServicem_appLink
 
uint32_t m_appId
 
TracedCallback< shared_ptr< const Interest >, Ptr< App >, shared_ptr< Face > > m_receivedInterests
 App-level trace of received Interests. More...
 
TracedCallback< shared_ptr< const Data >, Ptr< App >, shared_ptr< Face > > m_receivedDatas
 App-level trace of received Data. More...
 
TracedCallback< shared_ptr< const lp::Nack >, Ptr< App >, shared_ptr< Face > > m_receivedNacks
 App-level trace of received Nacks. More...
 
TracedCallback< shared_ptr< const Interest >, Ptr< App >, shared_ptr< Face > > m_transmittedInterests
 App-level trace of transmitted Interests. More...
 
TracedCallback< shared_ptr< const Data >, Ptr< App >, shared_ptr< Face > > m_transmittedDatas
 App-level trace of transmitted Data. More...
 
TracedCallback< shared_ptr< const lp::Nack >, Ptr< App >, shared_ptr< Face > > m_transmittedNacks
 App-level trace of transmitted Nacks. More...
 

Detailed Description

Base class that all NDN applications should be derived from.

The class implements virtual calls onInterest, onNack, and onData

Config Paths

ns3::ndn::App is accessible through the following paths with Config::Set and Config::Connect:

  • "/NodeList/[i]/ApplicationList/[i]/$ns3::ndn::App"

No Attributes are defined for this type.

Attributes defined in parent class ns3::Application

  • StartTime: Time at which the application will start
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +0.0ns
    • Flags: construct write read
  • StopTime: Time at which the application will stop
    • Set with class: ns3::TimeValue
    • Underlying type: Time –9223372036854775808.0ns:+9223372036854775807.0ns
    • Initial value: +0.0ns
    • Flags: construct write read

TraceSources

Size of this type is 288 bytes (on a 64-bit architecture).

Definition at line 48 of file ndn-app.hpp.

Member Typedef Documentation

◆ InterestTraceCallback

typedef void(* ns3::ndn::App::InterestTraceCallback) (shared_ptr< const Interest >, Ptr< App >, shared_ptr< Face >)

Definition at line 84 of file ndn-app.hpp.

◆ DataTraceCallback

typedef void(* ns3::ndn::App::DataTraceCallback) (shared_ptr< const Data >, Ptr< App >, shared_ptr< Face >)

Definition at line 85 of file ndn-app.hpp.

◆ NackTraceCallback

typedef void(* ns3::ndn::App::NackTraceCallback) (shared_ptr< const lp::Nack >, Ptr< App >, shared_ptr< Face >)

Definition at line 86 of file ndn-app.hpp.

Constructor & Destructor Documentation

◆ App()

ns3::ndn::App::App ( )

Default constructor.

Definition at line 70 of file ndn-app.cpp.

◆ ~App()

ns3::ndn::App::~App ( )
virtual

Definition at line 77 of file ndn-app.cpp.

Member Function Documentation

◆ GetTypeId()

TypeId ns3::ndn::App::GetTypeId ( void  )
static

◆ GetId()

uint32_t ns3::ndn::App::GetId ( ) const

Get application ID (ID of applications face)

Definition at line 108 of file ndn-app.cpp.

References m_appId.

Referenced by ns3::ndn::Producer::OnInterest().

◆ OnInterest()

void ns3::ndn::App::OnInterest ( shared_ptr< const Interest >  interest)
virtual

Method that will be called every time new Interest arrives.

Reimplemented in ns3::ndn::Producer.

Definition at line 114 of file ndn-app.cpp.

References m_face, and m_receivedInterests.

Referenced by ns3::ndn::Producer::OnInterest().

◆ OnData()

void ns3::ndn::App::OnData ( shared_ptr< const Data >  data)
virtual

Method that will be called every time new Data arrives.

Reimplemented in ns3::ndn::Consumer, ns3::ndn::ConsumerPcon, and ns3::ndn::ConsumerWindow.

Definition at line 121 of file ndn-app.cpp.

References m_face, and m_receivedDatas.

Referenced by ns3::ndn::Consumer::OnData().

◆ OnNack()

void ns3::ndn::App::OnNack ( shared_ptr< const lp::Nack nack)
virtual

Method that will be called every time new Nack arrives.

Reimplemented in ns3::ndn::Consumer.

Definition at line 128 of file ndn-app.cpp.

References m_face, and m_receivedNacks.

Referenced by ns3::ndn::Consumer::OnNack().

◆ DoInitialize()

void ns3::ndn::App::DoInitialize ( )
protectedvirtual

Definition at line 82 of file ndn-app.cpp.

References m_appId.

◆ DoDispose()

void ns3::ndn::App::DoDispose ( void  )
protectedvirtual

Definition at line 97 of file ndn-app.cpp.

◆ StartApplication()

void ns3::ndn::App::StartApplication ( )
protectedvirtual

Called at time specified by Start.

Reimplemented in ns3::ndn::Consumer, and ns3::ndn::Producer.

Definition at line 138 of file ndn-app.cpp.

References ndn::nfd::FACE_SCOPE_LOCAL, m_active, m_appLink, and m_face.

Referenced by ns3::ndn::Producer::StartApplication(), and ns3::ndn::Consumer::StartApplication().

◆ StopApplication()

void ns3::ndn::App::StopApplication ( )
protectedvirtual

Called at time specified by Stop.

Reimplemented in ns3::ndn::Consumer, and ns3::ndn::Producer.

Definition at line 162 of file ndn-app.cpp.

References m_active, and m_face.

Referenced by ns3::ndn::Producer::StopApplication(), and ns3::ndn::Consumer::StopApplication().

Member Data Documentation

◆ m_active

bool ns3::ndn::App::m_active
protected

Flag to indicate that application is active (set by StartApplication and StopApplication)

Definition at line 103 of file ndn-app.hpp.

Referenced by ns3::ndn::Consumer::OnData(), ns3::ndn::Producer::OnInterest(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), ns3::ndn::Consumer::SendPacket(), StartApplication(), and StopApplication().

◆ m_face

◆ m_appLink

◆ m_appId

uint32_t ns3::ndn::App::m_appId
protected

Definition at line 107 of file ndn-app.hpp.

Referenced by DoInitialize(), and GetId().

◆ m_receivedInterests

TracedCallback<shared_ptr<const Interest>, Ptr<App>, shared_ptr<Face> > ns3::ndn::App::m_receivedInterests
protected

App-level trace of received Interests.

Definition at line 110 of file ndn-app.hpp.

Referenced by GetTypeId(), and OnInterest().

◆ m_receivedDatas

TracedCallback<shared_ptr<const Data>, Ptr<App>, shared_ptr<Face> > ns3::ndn::App::m_receivedDatas
protected

App-level trace of received Data.

Definition at line 113 of file ndn-app.hpp.

Referenced by GetTypeId(), and OnData().

◆ m_receivedNacks

TracedCallback<shared_ptr<const lp::Nack>, Ptr<App>, shared_ptr<Face> > ns3::ndn::App::m_receivedNacks
protected

App-level trace of received Nacks.

Definition at line 116 of file ndn-app.hpp.

Referenced by GetTypeId(), and OnNack().

◆ m_transmittedInterests

TracedCallback<shared_ptr<const Interest>, Ptr<App>, shared_ptr<Face> > ns3::ndn::App::m_transmittedInterests
protected

App-level trace of transmitted Interests.

Definition at line 119 of file ndn-app.hpp.

Referenced by GetTypeId(), ns3::ndn::ConsumerZipfMandelbrot::SendPacket(), and ns3::ndn::Consumer::SendPacket().

◆ m_transmittedDatas

TracedCallback<shared_ptr<const Data>, Ptr<App>, shared_ptr<Face> > ns3::ndn::App::m_transmittedDatas
protected

App-level trace of transmitted Data.

Definition at line 122 of file ndn-app.hpp.

Referenced by GetTypeId(), and ns3::ndn::Producer::OnInterest().

◆ m_transmittedNacks

TracedCallback<shared_ptr<const lp::Nack>, Ptr<App>, shared_ptr<Face> > ns3::ndn::App::m_transmittedNacks
protected

App-level trace of transmitted Nacks.

Definition at line 125 of file ndn-app.hpp.

Referenced by GetTypeId().


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