20 #ifndef FLOW_MONITOR_H
21 #define FLOW_MONITOR_H
26 #include "ns3/event-id.h"
27 #include "ns3/histogram.h"
28 #include "ns3/nstime.h"
29 #include "ns3/object.h"
132 std::vector<uint32_t>
217 uint32_t reasonCode);
261 bool enableHistograms,
275 void SerializeToXmlFile(std::string fileName,
bool enableHistograms,
bool enableProbes);
An identifier for simulation events.
An object that monitors and reports back packet flows observed during a simulation.
FlowStats & GetStatsForFlow(FlowId flowId)
Get the stats for a given flow.
FlowProbeContainer m_flowProbes
all the FlowProbes
void StopRightNow()
End monitoring flows right now
void ResetAllStats()
Reset all the statistics.
const FlowProbeContainer & GetAllProbes() const
Get a list of all FlowProbe's associated with this FlowMonitor.
std::vector< Ptr< FlowProbe > >::const_iterator FlowProbeContainerCI
Container Const Iterator: FlowProbe.
std::vector< Ptr< FlowProbe > > FlowProbeContainer
Container: FlowProbe.
FlowStatsContainer m_flowStats
FlowId --> FlowStats.
bool m_enabled
FlowMon is enabled.
void CheckForLostPackets()
Check right now for packets that appear to be lost.
void Start(const Time &time)
Set the time, counting from the current time, from which to start monitoring flows.
std::map< std::pair< FlowId, FlowPacketId >, TrackedPacket > TrackedPacketMap
(FlowId,PacketId) --> TrackedPacket
double m_flowInterruptionsBinWidth
Flow interruptions bin width (for histograms)
void SerializeToXmlFile(std::string fileName, bool enableHistograms, bool enableProbes)
Same as SerializeToXmlStream, but writes to a file instead.
void AddFlowClassifier(Ptr< FlowClassifier > classifier)
Add a FlowClassifier to be used by the flow monitor.
void 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 rec...
EventId m_startEvent
Start event.
std::list< Ptr< FlowClassifier > > m_classifiers
the FlowClassifiers
void AddProbe(Ptr< FlowProbe > probe)
Register a new FlowProbe that will begin monitoring and report events to this monitor.
void 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 for...
Time m_flowInterruptionsMinTime
Flow interruptions minimum time.
std::vector< Ptr< FlowProbe > >::iterator FlowProbeContainerI
Container Iterator: FlowProbe.
std::map< FlowId, FlowStats > FlowStatsContainer
Container: FlowId, FlowStats.
double m_jitterBinWidth
Jitter bin width (for histograms)
std::map< FlowId, FlowStats >::const_iterator FlowStatsContainerCI
Container Const Iterator: FlowId, FlowStats.
std::string SerializeToXmlString(uint16_t indent, bool enableHistograms, bool enableProbes)
Same as SerializeToXmlStream, but returns the output as a std::string.
void Stop(const Time &time)
Set the time, counting from the current time, from which to stop monitoring flows.
void PeriodicCheckForLostPackets()
Periodic function to check for lost packets and prune statistics.
double m_packetSizeBinWidth
packet size bin width (for histograms)
Time m_maxPerHopDelay
Minimum per-hop delay.
void DoDispose() override
Destructor implementation.
std::map< FlowId, FlowStats >::iterator FlowStatsContainerI
Container Iterator: FlowId, FlowStats.
void NotifyConstructionCompleted() override
Notifier called once the ObjectBase is fully constructed.
const FlowStatsContainer & GetFlowStats() const
Retrieve all collected the flow statistics.
TrackedPacketMap m_trackedPackets
Tracked packets.
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
double m_delayBinWidth
Delay bin width (for histograms)
void StartRightNow()
Begin monitoring flows right now
void 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 transmitte...
void SerializeToXmlStream(std::ostream &os, uint16_t indent, bool enableHistograms, bool enableProbes)
Serializes the results to an std::ostream in XML format.
EventId m_stopEvent
Stop event.
static TypeId GetTypeId()
Get the type ID.
void 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 dro...
Class used to store data and make an histogram of the data frequency.
A base class which provides memory management and object aggregation.
Smart pointer class similar to boost::intrusive_ptr.
Simulation virtual time values and global simulation resolution.
a unique identifier for an interface.
uint32_t FlowId
Abstract identifier of a packet flow.
uint32_t FlowPacketId
Abstract identifier of a packet within a flow.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Structure that represents the measured metrics of an individual packet flow.
uint32_t rxPackets
Total number of received packets for the flow.
Histogram packetSizeHistogram
Histogram of the packet sizes.
Time timeLastTxPacket
Contains the absolute time when the last packet in the flow was transmitted, i.e.
uint32_t lostPackets
Total number of packets that are assumed to be lost, i.e.
Histogram jitterHistogram
Histogram of the packet jitters.
Time lastDelay
Contains the last measured delay of a packet It is stored to measure the packet's Jitter.
Time timeLastRxPacket
Contains the absolute time when the last packet in the flow was received, i.e.
Histogram flowInterruptionsHistogram
histogram of durations of flow interruptions
uint64_t rxBytes
Total number of received bytes for the flow.
Time delaySum
Contains the sum of all end-to-end delays for all received packets of the flow.
Time timeFirstRxPacket
Contains the absolute time when the first packet in the flow was received by an end node,...
uint32_t timesForwarded
Contains the number of times a packet has been reportedly forwarded, summed for all received packets ...
uint32_t txPackets
Total number of transmitted packets for the flow.
uint64_t txBytes
Total number of transmitted bytes for the flow.
Histogram delayHistogram
Histogram of the packet delays.
Time jitterSum
Contains the sum of all end-to-end delay jitter (delay variation) values for all received packets of ...
std::vector< uint64_t > bytesDropped
This attribute also tracks the number of lost bytes.
Time timeFirstTxPacket
Contains the absolute time when the first packet in the flow was transmitted, i.e.
std::vector< uint32_t > packetsDropped
This attribute also tracks the number of lost packets and bytes, but discriminates the losses by a re...
Structure to represent a single tracked packet data.
Time lastSeenTime
absolute time when the packet was last seen by a probe
Time firstSeenTime
absolute time when the packet was first seen by a probe
uint32_t timesForwarded
number of times the packet was reportedly forwarded
static const uint32_t packetSize
Packet size generated at the AP.