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

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

#include <ndn-app.h>

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

Public Member Functions

 App ()
 Default constructor.
 
uint32_t GetId () const
 Get application ID (ID of applications face)
 
virtual void OnInterest (Ptr< const Interest > interest)
 Method that will be called every time new Interest arrives. More...
 
virtual void OnNack (Ptr< const Interest > interest)
 Method that will be called every time new NACK arrives. More...
 
virtual void OnData (Ptr< const Data > contentObject)
 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.
 
virtual void StartApplication ()
 Called at time specified by Start.
 
virtual void StopApplication ()
 Called at time specified by Stop.
 

Protected Attributes

bool m_active
 Flag to indicate that application is active (set by StartApplication and StopApplication)
 
Ptr< Facem_face
 automatically created application face through which application communicates
 
TracedCallback< Ptr< const
Interest >, Ptr< App >, Ptr
< Face > > 
m_receivedInterests
 App-level trace of received Interests.
 
TracedCallback< Ptr< const
Interest >, Ptr< App >, Ptr
< Face > > 
m_receivedNacks
 App-level trace of received NACKs.
 
TracedCallback< Ptr< const
Data >, Ptr< App >, Ptr< Face > > 
m_receivedDatas
 App-level trace of received Data.
 
TracedCallback< Ptr< const
Interest >, Ptr< App >, Ptr
< Face > > 
m_transmittedInterests
 App-level trace of transmitted Interests.
 
TracedCallback< Ptr< const
Data >, Ptr< App >, Ptr< Face > > 
m_transmittedDatas
 App-level trace of transmitted Data.
 

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
  • ReceivedNacks: ReceivedNacks
  • ReceivedDatas: ReceivedDatas
  • TransmittedInterests: TransmittedInterests
  • TransmittedDatas: TransmittedDatas

Definition at line 50 of file ndn-app.h.

Member Function Documentation

void ns3::ndn::App::OnData ( Ptr< const Data contentObject)
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 111 of file ndn-app.cc.

References m_face, and m_receivedDatas.

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

void ns3::ndn::App::OnInterest ( 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 97 of file ndn-app.cc.

References m_face, and m_receivedInterests.

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

void ns3::ndn::App::OnNack ( Ptr< const Interest interest)
virtual

Method that will be called every time new NACK arrives.

Parameters
interestInterest header

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

Definition at line 104 of file ndn-app.cc.

References m_face, and m_receivedNacks.

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


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