21 #ifndef FLOW_MONITOR_H
22 #define FLOW_MONITOR_H
28 #include "ns3/object.h"
29 #include "ns3/flow-probe.h"
30 #include "ns3/flow-classifier.h"
31 #include "ns3/histogram.h"
32 #include "ns3/nstime.h"
33 #include "ns3/event-id.h"
130 static TypeId GetTypeId ();
166 uint32_t packetSize, uint32_t reasonCode);
191 void SerializeToXmlStream (std::ostream &os,
int indent,
bool enableHistograms,
bool enableProbes);
202 void SerializeToXmlFile (std::string fileName,
bool enableHistograms,
bool enableProbes);
216 uint32_t timesForwarded;
220 std::map<FlowId, FlowStats> m_flowStats;
223 typedef std::map< std::pair<FlowId, FlowPacketId>,
TrackedPacket> TrackedPacketMap;
224 TrackedPacketMap m_trackedPackets;
225 Time m_maxPerHopDelay;
226 std::vector< Ptr<FlowProbe> > m_flowProbes;
234 double m_delayBinWidth;
235 double m_jitterBinWidth;
236 double m_packetSizeBinWidth;
237 double m_flowInterruptionsBinWidth;
238 Time m_flowInterruptionsMinTime;
240 FlowStats& GetStatsForFlow (FlowId flowId);
241 void PeriodicCheckForLostPackets ();
smart pointer class similar to boost::intrusive_ptr
void CheckForLostPackets()
Check right now for packets that appear to be lost.
void StartRightNow()
Begin monitoring flows right now
uint32_t rxPackets
Total number of received packets for the flow.
uint32_t txPackets
Total number of transmitted packets for the flow.
void ReportDrop(Ptr< FlowProbe > probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize, uint32_t reasonCode)
std::vector< uint64_t > bytesDropped
void ReportFirstTx(Ptr< FlowProbe > probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize)
void SetFlowClassifier(Ptr< FlowClassifier > classifier)
Set the FlowClassifier to be used by the flow monitor.
std::map< FlowId, FlowStats > GetFlowStats() const
void SerializeToXmlStream(std::ostream &os, int indent, bool enableHistograms, bool enableProbes)
std::string SerializeToXmlString(int indent, bool enableHistograms, bool enableProbes)
virtual void NotifyConstructionCompleted()
void Stop(const Time &time)
Set the time, counting from the current time, from which to stop monitoring flows.
void StopRightNow()
End monitoring flows right now
an identifier for simulation events.
Histogram delayHistogram
Histogram of the packet delays.
void SerializeToXmlFile(std::string fileName, bool enableHistograms, bool enableProbes)
std::vector< Ptr< FlowProbe > > GetAllProbes() const
Get a list of all FlowProbe's associated with this FlowMonitor.
virtual void DoDispose(void)
uint64_t txBytes
Total number of transmitted bytes for the flow.
Structure that represents the measured metrics of an individual packet flow.
Histogram jitterHistogram
Histogram of the packet jitters.
a base class which provides memory management and object aggregation
void Start(const Time &time)
Set the time, counting from the current time, from which to start monitoring flows.
void ReportForwarding(Ptr< FlowProbe > probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize)
uint64_t rxBytes
Total number of received bytes for the flow.
An object that monitors and reports back packet flows observed during a simulation.
void AddProbe(Ptr< FlowProbe > probe)
a unique identifier for an interface.
void ReportLastRx(Ptr< FlowProbe > probe, FlowId flowId, FlowPacketId packetId, uint32_t packetSize)
Histogram packetSizeHistogram
Histogram of the packet sizes.
TypeId GetInstanceTypeId() const
std::vector< uint32_t > packetsDropped