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

Static Public Member Functions

static TypeId GetTypeId ()
 

Protected Member Functions

virtual void DoDispose ()
 Do cleanup when application is destroyed. More...
 
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. More...
 
shared_ptr< Facem_face
 and StopApplication) More...
 
TracedCallback< shared_ptr
< const Interest >, Ptr< App >
, shared_ptr< Face > > 
m_receivedInterests
 communicates More...
 
TracedCallback< shared_ptr
< const Data >, Ptr< App >
, shared_ptr< Face > > 
m_receivedDatas
 App-level trace of received Data. 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...
 

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.

TraceSources

  • ReceivedInterests: ReceivedInterests
  • ReceivedDatas: ReceivedDatas
  • TransmittedInterests: TransmittedInterests
  • TransmittedDatas: TransmittedDatas

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

Constructor & Destructor Documentation

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

Default constructor.

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

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

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

Member Function Documentation

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

Do cleanup when application is destroyed.

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

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

Get application ID (ID of applications face)

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

References m_face.

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

TypeId ns3::ndn::App::GetTypeId ( void  )
static
void ns3::ndn::App::OnData ( shared_ptr< const Data data)
virtual

Method that will be called every time new Data arrives.

Parameters
contentObjectData header
payloadpayload (potentially virtual) of the Data packet (may include packet tags of original packet)

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

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

References m_face, and m_receivedDatas.

Referenced by ns3::ndn::Consumer::OnData(), and ns3::ndn::AppFace::sendData().

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

Method that will be called every time new Interest arrives.

Parameters
interestInterest header
packet"Payload" of the interests packet. The actual payload should be zero, but packet itself may be useful to get packet tags

Reimplemented in ns3::ndn::Producer.

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

References m_face, and m_receivedInterests.

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

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

Called at time specified by Start.

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

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

References m_active, and m_face.

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

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

Called at time specified by Stop.

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

Definition at line 121 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

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

Flag to indicate that application is active (set by StartApplication.

Definition at line 98 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().

shared_ptr<Face> ns3::ndn::App::m_face
protected

and StopApplication)

automatically created application face through which application

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

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

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 108 of file ndn-app.hpp.

Referenced by GetTypeId(), and OnData().

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

communicates

App-level trace of received Interests

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

Referenced by GetTypeId(), and OnInterest().

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 114 of file ndn-app.hpp.

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

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 111 of file ndn-app.hpp.

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


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