Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions

ns3::FlowMonitor Class Reference

An object that monitors and reports back packet flows observed during a simulation. More...

#include <flow-monitor.h>

Inheritance diagram for ns3::FlowMonitor:
Inheritance graph
[legend]
Collaboration diagram for ns3::FlowMonitor:
Collaboration graph
[legend]

List of all members.

Classes

struct  FlowStats
 Structure that represents the measured metrics of an individual packet flow. More...
struct  TrackedPacket

Public Member Functions

TypeId GetInstanceTypeId () const
void SetFlowClassifier (Ptr< FlowClassifier > classifier)
 Set the FlowClassifier to be used by the flow monitor.
void Start (const Time &time)
 Set the time, counting from the current time, from which to start monitoring flows.
void Stop (const Time &time)
 Set the time, counting from the current time, from which to stop monitoring flows.
void StartRightNow ()
 Begin monitoring flows *right now*.
void StopRightNow ()
 End monitoring flows *right now*.
void AddProbe (Ptr< FlowProbe > probe)
void ReportFirstTx (Ptr< FlowProbe > probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize)
void ReportForwarding (Ptr< FlowProbe > probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize)
void ReportLastRx (Ptr< FlowProbe > probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize)
void ReportDrop (Ptr< FlowProbe > probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize, uint32_t reasonCode)
void CheckForLostPackets ()
 Check right now for packets that appear to be lost.
void CheckForLostPackets (Time maxDelay)
std::map< FlowId, FlowStatsGetFlowStats () const
std::vector< Ptr< FlowProbe > > GetAllProbes () const
 Get a list of all FlowProbe's associated with this FlowMonitor.
void SerializeToXmlStream (std::ostream &os, int indent, bool enableHistograms, bool enableProbes)
std::string SerializeToXmlString (int indent, bool enableHistograms, bool enableProbes)
void SerializeToXmlFile (std::string fileName, bool enableHistograms, bool enableProbes)

Static Public Member Functions

static TypeId GetTypeId ()
 This method returns the TypeId associated to ns3::FlowMonitor.

Protected Member Functions

virtual void NotifyConstructionCompleted ()

Detailed Description

An object that monitors and reports back packet flows observed during a simulation.

The FlowMonitor class is responsible forcoordinating efforts regarding probes, and collects end-to-end flowstatistics.


Member Function Documentation

void ns3::FlowMonitor::AddProbe ( Ptr< FlowProbe probe  ) 

Register a new FlowProbe that will begin monitoring and report events to this monitor. This method is normally only used by FlowProbe implementations.

void ns3::FlowMonitor::CheckForLostPackets ( Time  maxDelay  ) 

Check right now for packets that appear to be lost, considering packets as lost if not seen in the network for a time larger than maxDelay

std::map<FlowId, FlowStats> ns3::FlowMonitor::GetFlowStats (  )  const

Retrieve all collected the flow statistics. Note, if the FlowMonitor has not stopped monitoring yet, you should call CheckForLostPackets() to make sure all possibly lost packets are accounted for.

TypeId ns3::FlowMonitor::GetInstanceTypeId (  )  const [virtual]
Returns:
the TypeId associated to the most-derived type of this instance.

This method is typically implemented by ns3::Object::GetInstanceTypeId but some classes which derive from ns3::ObjectBase directly have to implement it themselves.

Reimplemented from ns3::Object.

static TypeId ns3::FlowMonitor::GetTypeId ( void   )  [static]

This method returns the TypeId associated to ns3::FlowMonitor.

This object is accessible through the following paths with Config::Set and Config::Connect:

  • /NodeList/[i]/DeviceList/[i]/$ns3::AlohaNoackNetDevice/Phy/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/LinkManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/SSManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::NonCommunicatingNetDevice/Phy/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/Classifier/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/NoiseModel/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Channel/PropagationModel/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Mac/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Phy/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::UanNetDevice/Transducer/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/BsIpcsPacketClassifier/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/LinkManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/SSManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::BaseStationNetDevice/ServiceFlowManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/Classifier/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/LinkManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/$ns3::SubscriberStationNetDevice/SSScheduler/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BandwidthManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/BurstProfileManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/NoiseModel/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Channel/$ns3::UanChannel/PropagationModel/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/ConnectionManager/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/NoiseModel/$ns3::FlowMonitor
  • /NodeList/[i]/DeviceList/[i]/$ns3::WimaxNetDevice/Phy/Channel/$ns3::UanChannel/PropagationModel/$ns3::FlowMonitor

Attributes defined for this type:

  • MaxPerHopDelay: The maximum per-hop delay that should be considered. Packets still not received after this delay are to be considered lost.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 10000000000ns
    • Flags: construct write read
  • StartTime: The time when the monitoring starts.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 0ns
    • Flags: construct write
  • DelayBinWidth: The width used in the delay histogram.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.001
    • Flags: construct write read
  • JitterBinWidth: The width used in the jitter histogram.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.001
    • Flags: construct write read
  • PacketSizeBinWidth: The width used in the packetSize histogram.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 20
    • Flags: construct write read
  • FlowInterruptionsBinWidth: The width used in the flowInterruptions histogram.
    • Set with class: ns3::DoubleValue
    • Underlying type: double -1.79769e+308:1.79769e+308
    • Initial value: 0.25
    • Flags: construct write read
  • FlowInterruptionsMinTime: The minimum inter-arrival time that is considered a flow interruption.
    • Set with class: TimeValue
    • Underlying type: Time
    • Initial value: 500000000ns
    • Flags: construct write read

No TraceSources defined for this type.

Reimplemented from ns3::Object.

virtual void ns3::FlowMonitor::NotifyConstructionCompleted (  )  [protected, virtual]

This method is invoked once all member attributes have been initialized. Subclasses can override this method to be notified of this event but if they do this, they must chain up to their parent's NotifyConstructionCompleted method.

Reimplemented from ns3::ObjectBase.

void ns3::FlowMonitor::ReportDrop ( Ptr< FlowProbe probe,
FlowId  flowId,
FlowPacketId  packetId,
uint32_t  packetSize,
uint32_t  reasonCode 
)

FlowProbe implementations are supposed to call this method to report that a known packet is being dropped due to some reason.

void ns3::FlowMonitor::ReportFirstTx ( Ptr< FlowProbe probe,
FlowId  flowId,
FlowPacketId  packetId,
uint32_t  packetSize 
)

FlowProbe implementations are supposed to call this method to report that a new packet was transmitted (but keep in mind the distinction between a new packet entering the system and a packet that is already known and is only being forwarded).

void ns3::FlowMonitor::ReportForwarding ( Ptr< FlowProbe probe,
FlowId  flowId,
FlowPacketId  packetId,
uint32_t  packetSize 
)

FlowProbe implementations are supposed to call this method to report that a known packet is being forwarded.

void ns3::FlowMonitor::ReportLastRx ( Ptr< FlowProbe probe,
FlowId  flowId,
FlowPacketId  packetId,
uint32_t  packetSize 
)

FlowProbe implementations are supposed to call this method to report that a known packet is being received.

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

Same as SerializeToXmlStream, but writes to a file instead

Parameters:
fileName name or path of the output file that will be created
enableHistograms if true, include also the histograms in the output
enableProbes if true, include also the per-probe/flow pair statistics in the output
void ns3::FlowMonitor::SerializeToXmlStream ( std::ostream &  os,
int  indent,
bool  enableHistograms,
bool  enableProbes 
)

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

Parameters:
os the output stream
indent number of spaces to use as base indentation level
enableHistograms if true, include also the histograms in the output
enableProbes if true, include also the per-probe/flow pair statistics in the output
std::string ns3::FlowMonitor::SerializeToXmlString ( int  indent,
bool  enableHistograms,
bool  enableProbes 
)

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

Parameters:
indent number of spaces to use as base indentation level
enableHistograms if true, include also the histograms in the output
enableProbes if true, include also the per-probe/flow pair statistics in the output
Returns:
the XML output as string

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