A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::FlowMonitorHelper Class Reference

Helper to enable IP flow monitoring on a set of Nodes. More...

#include "flow-monitor-helper.h"

+ Collaboration diagram for ns3::FlowMonitorHelper:

Public Member Functions

 FlowMonitorHelper ()
 
 FlowMonitorHelper (const FlowMonitorHelper &)=delete
 
 ~FlowMonitorHelper ()
 
Ptr< FlowClassifierGetClassifier ()
 Retrieve the FlowClassifier object for IPv4 created by the Install* methods.
 
Ptr< FlowClassifierGetClassifier6 ()
 Retrieve the FlowClassifier object for IPv6 created by the Install* methods.
 
Ptr< FlowMonitorGetMonitor ()
 Retrieve the FlowMonitor object created by the Install* methods.
 
Ptr< FlowMonitorInstall (NodeContainer nodes)
 Enable flow monitoring on a set of nodes.
 
Ptr< FlowMonitorInstall (Ptr< Node > node)
 Enable flow monitoring on a single node.
 
Ptr< FlowMonitorInstallAll ()
 Enable flow monitoring on all nodes.
 
FlowMonitorHelperoperator= (const FlowMonitorHelper &)=delete
 
void SerializeToXmlFile (std::string fileName, bool enableHistograms, bool enableProbes)
 Same as SerializeToXmlStream, but writes to a file instead.
 
void SerializeToXmlStream (std::ostream &os, uint16_t indent, bool enableHistograms, bool enableProbes)
 Serializes the results to an std::ostream in XML format.
 
std::string SerializeToXmlString (uint16_t indent, bool enableHistograms, bool enableProbes)
 Same as SerializeToXmlStream, but returns the output as a std::string.
 
void SetMonitorAttribute (std::string n1, const AttributeValue &v1)
 Set an attribute for the to-be-created FlowMonitor object.
 

Private Attributes

Ptr< FlowClassifierm_flowClassifier4
 the FlowClassifier object for IPv4
 
Ptr< FlowClassifierm_flowClassifier6
 the FlowClassifier object for IPv6
 
Ptr< FlowMonitorm_flowMonitor
 the FlowMonitor object
 
ObjectFactory m_monitorFactory
 Object factory.
 

Detailed Description

Helper to enable IP flow monitoring on a set of Nodes.

Definition at line 29 of file flow-monitor-helper.h.

Constructor & Destructor Documentation

◆ FlowMonitorHelper() [1/2]

ns3::FlowMonitorHelper::FlowMonitorHelper ( )

Definition at line 24 of file flow-monitor-helper.cc.

References m_monitorFactory, and ns3::ObjectFactory::SetTypeId().

+ Here is the call graph for this function:

◆ ~FlowMonitorHelper()

ns3::FlowMonitorHelper::~FlowMonitorHelper ( )

Definition at line 29 of file flow-monitor-helper.cc.

References m_flowClassifier4, m_flowClassifier6, and m_flowMonitor.

◆ FlowMonitorHelper() [2/2]

ns3::FlowMonitorHelper::FlowMonitorHelper ( const FlowMonitorHelper & )
delete

Member Function Documentation

◆ GetClassifier()

Ptr< FlowClassifier > ns3::FlowMonitorHelper::GetClassifier ( )

Retrieve the FlowClassifier object for IPv4 created by the Install* methods.

Returns
a pointer to the FlowClassifier object

Definition at line 61 of file flow-monitor-helper.cc.

References ns3::Create(), and m_flowClassifier4.

Referenced by experiment(), and Install().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetClassifier6()

Ptr< FlowClassifier > ns3::FlowMonitorHelper::GetClassifier6 ( )

Retrieve the FlowClassifier object for IPv6 created by the Install* methods.

Returns
a pointer to the FlowClassifier object

Definition at line 71 of file flow-monitor-helper.cc.

References ns3::Create(), and m_flowClassifier6.

Referenced by Install().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetMonitor()

Ptr< FlowMonitor > ns3::FlowMonitorHelper::GetMonitor ( )

Retrieve the FlowMonitor object created by the Install* methods.

Returns
a pointer to the FlowMonitor object

Definition at line 47 of file flow-monitor-helper.cc.

References ns3::Create(), ns3::ObjectFactory::Create(), m_flowClassifier4, m_flowClassifier6, m_flowMonitor, and m_monitorFactory.

Referenced by Install().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Install() [1/2]

Ptr< FlowMonitor > ns3::FlowMonitorHelper::Install ( NodeContainer nodes)

Enable flow monitoring on a set of nodes.

Parameters
nodesA NodeContainer holding the set of nodes to work with.
Returns
a pointer to the FlowMonitor object

Definition at line 102 of file flow-monitor-helper.cc.

References Install(), m_flowMonitor, and nodes.

Referenced by Install(), and InstallAll().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Install() [2/2]

Ptr< FlowMonitor > ns3::FlowMonitorHelper::Install ( Ptr< Node > node)

Enable flow monitoring on a single node.

Parameters
nodeA Ptr<Node> to the node on which to enable flow monitoring.
Returns
a pointer to the FlowMonitor object

Definition at line 81 of file flow-monitor-helper.cc.

References ns3::Create(), ns3::DynamicCast(), GetClassifier(), GetClassifier6(), GetMonitor(), and m_flowMonitor.

+ Here is the call graph for this function:

◆ InstallAll()

Ptr< FlowMonitor > ns3::FlowMonitorHelper::InstallAll ( )

Enable flow monitoring on all nodes.

Returns
a pointer to the FlowMonitor object

Definition at line 116 of file flow-monitor-helper.cc.

References ns3::NodeList::Begin(), ns3::NodeList::End(), Install(), and m_flowMonitor.

Referenced by experiment(), Experiment::Run(), and RoutingExperiment::Run().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator=()

FlowMonitorHelper & ns3::FlowMonitorHelper::operator= ( const FlowMonitorHelper & )
delete

◆ SerializeToXmlFile()

void ns3::FlowMonitorHelper::SerializeToXmlFile ( std::string fileName,
bool enableHistograms,
bool enableProbes )

Same as SerializeToXmlStream, but writes to a file instead.

Parameters
fileNamename or path of the output file that will be created
enableHistogramsif true, include also the histograms in the output
enableProbesif true, include also the per-probe/flow pair statistics in the output

Definition at line 153 of file flow-monitor-helper.cc.

References m_flowMonitor.

Referenced by Experiment::Run().

+ Here is the caller graph for this function:

◆ SerializeToXmlStream()

void ns3::FlowMonitorHelper::SerializeToXmlStream ( std::ostream & os,
uint16_t indent,
bool enableHistograms,
bool enableProbes )

Serializes the results to an std::ostream in XML format.

Parameters
osthe output stream
indentnumber of spaces to use as base indentation level
enableHistogramsif true, include also the histograms in the output
enableProbesif true, include also the per-probe/flow pair statistics in the output

Definition at line 130 of file flow-monitor-helper.cc.

References m_flowMonitor.

◆ SerializeToXmlString()

std::string ns3::FlowMonitorHelper::SerializeToXmlString ( uint16_t indent,
bool enableHistograms,
bool enableProbes )

Same as SerializeToXmlStream, but returns the output as a std::string.

Parameters
indentnumber of spaces to use as base indentation level
enableHistogramsif true, include also the histograms in the output
enableProbesif true, include also the per-probe/flow pair statistics in the output
Returns
the XML output as string

Definition at line 142 of file flow-monitor-helper.cc.

References m_flowMonitor.

◆ SetMonitorAttribute()

void ns3::FlowMonitorHelper::SetMonitorAttribute ( std::string n1,
const AttributeValue & v1 )

Set an attribute for the to-be-created FlowMonitor object.

Parameters
n1attribute name
v1attribute value

Definition at line 41 of file flow-monitor-helper.cc.

References m_monitorFactory, and ns3::ObjectFactory::Set().

+ Here is the call graph for this function:

Member Data Documentation

◆ m_flowClassifier4

Ptr<FlowClassifier> ns3::FlowMonitorHelper::m_flowClassifier4
private

the FlowClassifier object for IPv4

Definition at line 114 of file flow-monitor-helper.h.

Referenced by ~FlowMonitorHelper(), GetClassifier(), and GetMonitor().

◆ m_flowClassifier6

Ptr<FlowClassifier> ns3::FlowMonitorHelper::m_flowClassifier6
private

the FlowClassifier object for IPv6

Definition at line 115 of file flow-monitor-helper.h.

Referenced by ~FlowMonitorHelper(), GetClassifier6(), and GetMonitor().

◆ m_flowMonitor

Ptr<FlowMonitor> ns3::FlowMonitorHelper::m_flowMonitor
private

◆ m_monitorFactory

ObjectFactory ns3::FlowMonitorHelper::m_monitorFactory
private

Object factory.

Definition at line 112 of file flow-monitor-helper.h.

Referenced by FlowMonitorHelper(), GetMonitor(), and SetMonitorAttribute().


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