An object that monitors and reports back packet flows observed during a simulation. More...
#include <flow-monitor.h>
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, FlowStats > | GetFlowStats () 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 () |
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.
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] |
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.
Attributes defined for this type:
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
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
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
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 |