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

NDN network-layer rate tracer. More...

#include <ndn-l3-rate-tracer.hpp>

Inheritance diagram for ns3::ndn::L3RateTracer:
Collaboration diagram for ns3::ndn::L3RateTracer:

Public Member Functions

 L3RateTracer (shared_ptr< std::ostream > os, Ptr< Node > node)
 Trace constructor that attaches to the node using node pointer. More...
 
 L3RateTracer (shared_ptr< std::ostream > os, const std::string &node)
 Trace constructor that attaches to the node using node name. More...
 
virtual ~L3RateTracer ()
 Destructor. More...
 
virtual void PrintHeader (std::ostream &os) const
 Print head of the trace (e.g., for post-processing) More...
 
virtual void Print (std::ostream &os) const
 Print current trace data. More...
 
- Public Member Functions inherited from ns3::ndn::L3Tracer
 L3Tracer (Ptr< Node > node)
 Trace constructor that attaches to the node using node pointer. More...
 
 L3Tracer (const std::string &node)
 Trace constructor that attaches to the node using node name. More...
 
virtual ~L3Tracer ()
 Destructor. More...
 

Static Public Member Functions

static void InstallAll (const std::string &file, Time averagingPeriod=Seconds(0.5))
 Helper method to install tracers on all simulation nodes. More...
 
static void Install (const NodeContainer &nodes, const std::string &file, Time averagingPeriod=Seconds(0.5))
 Helper method to install tracers on the selected simulation nodes. More...
 
static void Install (Ptr< Node > node, const std::string &file, Time averagingPeriod=Seconds(0.5))
 Helper method to install tracers on a specific simulation node. More...
 
static void Destroy ()
 Explicit request to remove all statically created tracers. More...
 
static Ptr< L3RateTracerInstall (Ptr< Node > node, shared_ptr< std::ostream > outputStream, Time averagingPeriod=Seconds(0.5))
 Helper method to install tracers on a specific simulation node. More...
 

Protected Member Functions

virtual void OutInterests (const Interest &interest, const Face &face)
 
virtual void InInterests (const Interest &interest, const Face &face)
 
virtual void OutData (const Data &data, const Face &face)
 
virtual void InData (const Data &data, const Face &face)
 
virtual void SatisfiedInterests (const nfd::pit::Entry &, const Face &, const Data &)
 
virtual void TimedOutInterests (const nfd::pit::Entry &)
 
- Protected Member Functions inherited from ns3::ndn::L3Tracer
void Connect ()
 

Additional Inherited Members

- Protected Attributes inherited from ns3::ndn::L3Tracer
std::string m_node
 
Ptr< Node > m_nodePtr
 

Detailed Description

NDN network-layer rate tracer.

Definition at line 42 of file ndn-l3-rate-tracer.hpp.

Constructor & Destructor Documentation

ns3::ndn::L3RateTracer::L3RateTracer ( shared_ptr< std::ostream >  os,
Ptr< Node >  node 
)

Trace constructor that attaches to the node using node pointer.

Parameters
osreference to the output stream
nodepointer to the node

Definition at line 168 of file ndn-l3-rate-tracer.cpp.

ns3::ndn::L3RateTracer::L3RateTracer ( shared_ptr< std::ostream >  os,
const std::string &  node 
)

Trace constructor that attaches to the node using node name.

Parameters
osreference to the output stream
nodeNamename of the node registered using Names::Add

Definition at line 175 of file ndn-l3-rate-tracer.cpp.

ns3::ndn::L3RateTracer::~L3RateTracer ( )
virtual

Destructor.

Definition at line 182 of file ndn-l3-rate-tracer.cpp.

Member Function Documentation

void ns3::ndn::L3RateTracer::Destroy ( )
static

Explicit request to remove all statically created tracers.

This method can be helpful if simulation scenario contains several independent run, or if it is desired to do a postprocessing of the resulting data

Definition at line 43 of file ndn-l3-rate-tracer.cpp.

References ns3::ndn::g_tracers.

void ns3::ndn::L3RateTracer::InData ( const Data data,
const Face face 
)
protectedvirtual

Implements ns3::ndn::L3Tracer.

Definition at line 321 of file ndn-l3-rate-tracer.cpp.

void ns3::ndn::L3RateTracer::InInterests ( const Interest interest,
const Face face 
)
protectedvirtual

Implements ns3::ndn::L3Tracer.

Definition at line 301 of file ndn-l3-rate-tracer.cpp.

void ns3::ndn::L3RateTracer::Install ( const NodeContainer &  nodes,
const std::string &  file,
Time  averagingPeriod = Seconds(0.5) 
)
static

Helper method to install tracers on the selected simulation nodes.

Parameters
nodesNodes on which to install tracer
fileFile to which traces will be written. If filename is -, then std::out is used
averagingPeriodHow often data will be written into the trace file (default, every half second)

Definition at line 83 of file ndn-l3-rate-tracer.cpp.

References ns3::ndn::g_tracers.

Referenced by Install(), and InstallAll().

void ns3::ndn::L3RateTracer::Install ( Ptr< Node >  node,
const std::string &  file,
Time  averagingPeriod = Seconds(0.5) 
)
static

Helper method to install tracers on a specific simulation node.

Parameters
nodesNodes on which to install tracer
fileFile to which traces will be written. If filename is -, then std::out is used
averagingPeriodHow often data will be written into the trace file (default, every half second)

Definition at line 121 of file ndn-l3-rate-tracer.cpp.

References ns3::ndn::g_tracers, and Install().

Ptr< L3RateTracer > ns3::ndn::L3RateTracer::Install ( Ptr< Node >  node,
shared_ptr< std::ostream >  outputStream,
Time  averagingPeriod = Seconds(0.5) 
)
static

Helper method to install tracers on a specific simulation node.

Parameters
nodesNodes on which to install tracer
outputStreamSmart pointer to a stream
averagingPeriodHow often data will be written into the trace file (default, every half second)
Returns
a tuple of reference to output stream and list of tracers. !!! Attention !!! This tuple needs to be preserved for the lifetime of simulation, otherwise SEGFAULTs are inevitable

Definition at line 157 of file ndn-l3-rate-tracer.cpp.

void ns3::ndn::L3RateTracer::InstallAll ( const std::string &  file,
Time  averagingPeriod = Seconds(0.5) 
)
static

Helper method to install tracers on all simulation nodes.

Parameters
fileFile to which traces will be written. If filename is -, then std::out is used
averagingPeriodDefines averaging period for the rate calculation, as well as how often data will be written into the trace file (default, every half second)

Definition at line 49 of file ndn-l3-rate-tracer.cpp.

References ns3::ndn::g_tracers, and Install().

void ns3::ndn::L3RateTracer::OutData ( const Data data,
const Face face 
)
protectedvirtual

Implements ns3::ndn::L3Tracer.

Definition at line 311 of file ndn-l3-rate-tracer.cpp.

void ns3::ndn::L3RateTracer::OutInterests ( const Interest interest,
const Face face 
)
protectedvirtual

Implements ns3::ndn::L3Tracer.

Definition at line 291 of file ndn-l3-rate-tracer.cpp.

void ns3::ndn::L3RateTracer::Print ( std::ostream &  os) const
virtual

Print current trace data.

Parameters
osreference to output stream

Implements ns3::ndn::L3Tracer.

Definition at line 259 of file ndn-l3-rate-tracer.cpp.

References PRINTER.

void ns3::ndn::L3RateTracer::PrintHeader ( std::ostream &  os) const
virtual

Print head of the trace (e.g., for post-processing)

Parameters
osreference to output stream

Implements ns3::ndn::L3Tracer.

Definition at line 205 of file ndn-l3-rate-tracer.cpp.

void ns3::ndn::L3RateTracer::SatisfiedInterests ( const nfd::pit::Entry entry,
const Face ,
const Data  
)
protectedvirtual
void ns3::ndn::L3RateTracer::TimedOutInterests ( const nfd::pit::Entry entry)
protectedvirtual

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