A Discrete-Event Network Simulator
API
flow-monitor.cc
Go to the documentation of this file.
1 //
2 // Copyright (c) 2009 INESC Porto
3 //
4 // This program is free software; you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License version 2 as
6 // published by the Free Software Foundation;
7 //
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // Author: Gustavo J. A. M. Carneiro <gjc@inescporto.pt> <gjcarneiro@gmail.com>
18 //
19 
20 #include "flow-monitor.h"
21 
22 #include "ns3/double.h"
23 #include "ns3/log.h"
24 #include "ns3/simulator.h"
25 
26 #include <fstream>
27 #include <sstream>
28 
29 #define PERIODIC_CHECK_INTERVAL (Seconds(1))
30 
31 namespace ns3
32 {
33 
34 NS_LOG_COMPONENT_DEFINE("FlowMonitor");
35 
36 NS_OBJECT_ENSURE_REGISTERED(FlowMonitor);
37 
38 TypeId
40 {
41  static TypeId tid =
42  TypeId("ns3::FlowMonitor")
43  .SetParent<Object>()
44  .SetGroupName("FlowMonitor")
45  .AddConstructor<FlowMonitor>()
46  .AddAttribute(
47  "MaxPerHopDelay",
48  ("The maximum per-hop delay that should be considered. "
49  "Packets still not received after this delay are to be considered lost."),
50  TimeValue(Seconds(10.0)),
53  .AddAttribute("StartTime",
54  ("The time when the monitoring starts."),
55  TimeValue(Seconds(0.0)),
58  .AddAttribute("DelayBinWidth",
59  ("The width used in the delay histogram."),
60  DoubleValue(0.001),
62  MakeDoubleChecker<double>())
63  .AddAttribute("JitterBinWidth",
64  ("The width used in the jitter histogram."),
65  DoubleValue(0.001),
67  MakeDoubleChecker<double>())
68  .AddAttribute("PacketSizeBinWidth",
69  ("The width used in the packetSize histogram."),
70  DoubleValue(20),
72  MakeDoubleChecker<double>())
73  .AddAttribute("FlowInterruptionsBinWidth",
74  ("The width used in the flowInterruptions histogram."),
75  DoubleValue(0.250),
77  MakeDoubleChecker<double>())
78  .AddAttribute(
79  "FlowInterruptionsMinTime",
80  ("The minimum inter-arrival time that is considered a flow interruption."),
81  TimeValue(Seconds(0.5)),
83  MakeTimeChecker());
84  return tid;
85 }
86 
87 TypeId
89 {
90  return GetTypeId();
91 }
92 
94  : m_enabled(false)
95 {
96  NS_LOG_FUNCTION(this);
97 }
98 
99 void
101 {
102  NS_LOG_FUNCTION(this);
105  for (std::list<Ptr<FlowClassifier>>::iterator iter = m_classifiers.begin();
106  iter != m_classifiers.end();
107  iter++)
108  {
109  *iter = nullptr;
110  }
111  for (uint32_t i = 0; i < m_flowProbes.size(); i++)
112  {
113  m_flowProbes[i]->Dispose();
114  m_flowProbes[i] = nullptr;
115  }
117 }
118 
121 {
122  NS_LOG_FUNCTION(this);
123  FlowStatsContainerI iter;
124  iter = m_flowStats.find(flowId);
125  if (iter == m_flowStats.end())
126  {
127  FlowMonitor::FlowStats& ref = m_flowStats[flowId];
128  ref.delaySum = Seconds(0);
129  ref.jitterSum = Seconds(0);
130  ref.lastDelay = Seconds(0);
131  ref.txBytes = 0;
132  ref.rxBytes = 0;
133  ref.txPackets = 0;
134  ref.rxPackets = 0;
135  ref.lostPackets = 0;
136  ref.timesForwarded = 0;
141  return ref;
142  }
143  else
144  {
145  return iter->second;
146  }
147 }
148 
149 void
151  uint32_t flowId,
152  uint32_t packetId,
153  uint32_t packetSize)
154 {
155  NS_LOG_FUNCTION(this << probe << flowId << packetId << packetSize);
156  if (!m_enabled)
157  {
158  NS_LOG_DEBUG("FlowMonitor not enabled; returning");
159  return;
160  }
161  Time now = Simulator::Now();
162  TrackedPacket& tracked = m_trackedPackets[std::make_pair(flowId, packetId)];
163  tracked.firstSeenTime = now;
164  tracked.lastSeenTime = tracked.firstSeenTime;
165  tracked.timesForwarded = 0;
166  NS_LOG_DEBUG("ReportFirstTx: adding tracked packet (flowId=" << flowId << ", packetId="
167  << packetId << ").");
168 
169  probe->AddPacketStats(flowId, packetSize, Seconds(0));
170 
171  FlowStats& stats = GetStatsForFlow(flowId);
172  stats.txBytes += packetSize;
173  stats.txPackets++;
174  if (stats.txPackets == 1)
175  {
176  stats.timeFirstTxPacket = now;
177  }
178  stats.timeLastTxPacket = now;
179 }
180 
181 void
183  uint32_t flowId,
184  uint32_t packetId,
185  uint32_t packetSize)
186 {
187  NS_LOG_FUNCTION(this << probe << flowId << packetId << packetSize);
188  if (!m_enabled)
189  {
190  NS_LOG_DEBUG("FlowMonitor not enabled; returning");
191  return;
192  }
193  std::pair<FlowId, FlowPacketId> key(flowId, packetId);
194  TrackedPacketMap::iterator tracked = m_trackedPackets.find(key);
195  if (tracked == m_trackedPackets.end())
196  {
197  NS_LOG_WARN("Received packet forward report (flowId="
198  << flowId << ", packetId=" << packetId << ") but not known to be transmitted.");
199  return;
200  }
201 
202  tracked->second.timesForwarded++;
203  tracked->second.lastSeenTime = Simulator::Now();
204 
205  Time delay = (Simulator::Now() - tracked->second.firstSeenTime);
206  probe->AddPacketStats(flowId, packetSize, delay);
207 }
208 
209 void
211  uint32_t flowId,
212  uint32_t packetId,
213  uint32_t packetSize)
214 {
215  NS_LOG_FUNCTION(this << probe << flowId << packetId << packetSize);
216  if (!m_enabled)
217  {
218  NS_LOG_DEBUG("FlowMonitor not enabled; returning");
219  return;
220  }
221  TrackedPacketMap::iterator tracked = m_trackedPackets.find(std::make_pair(flowId, packetId));
222  if (tracked == m_trackedPackets.end())
223  {
224  NS_LOG_WARN("Received packet last-tx report (flowId="
225  << flowId << ", packetId=" << packetId << ") but not known to be transmitted.");
226  return;
227  }
228 
229  Time now = Simulator::Now();
230  Time delay = (now - tracked->second.firstSeenTime);
231  probe->AddPacketStats(flowId, packetSize, delay);
232 
233  FlowStats& stats = GetStatsForFlow(flowId);
234  stats.delaySum += delay;
235  stats.delayHistogram.AddValue(delay.GetSeconds());
236  if (stats.rxPackets > 0)
237  {
238  Time jitter = stats.lastDelay - delay;
239  if (jitter > Seconds(0))
240  {
241  stats.jitterSum += jitter;
242  stats.jitterHistogram.AddValue(jitter.GetSeconds());
243  }
244  else
245  {
246  stats.jitterSum -= jitter;
247  stats.jitterHistogram.AddValue(-jitter.GetSeconds());
248  }
249  }
250  stats.lastDelay = delay;
251 
252  stats.rxBytes += packetSize;
253  stats.packetSizeHistogram.AddValue((double)packetSize);
254  stats.rxPackets++;
255  if (stats.rxPackets == 1)
256  {
257  stats.timeFirstRxPacket = now;
258  }
259  else
260  {
261  // measure possible flow interruptions
262  Time interArrivalTime = now - stats.timeLastRxPacket;
263  if (interArrivalTime > m_flowInterruptionsMinTime)
264  {
265  stats.flowInterruptionsHistogram.AddValue(interArrivalTime.GetSeconds());
266  }
267  }
268  stats.timeLastRxPacket = now;
269  stats.timesForwarded += tracked->second.timesForwarded;
270 
271  NS_LOG_DEBUG("ReportLastTx: removing tracked packet (flowId=" << flowId << ", packetId="
272  << packetId << ").");
273 
274  m_trackedPackets.erase(tracked); // we don't need to track this packet anymore
275 }
276 
277 void
279  uint32_t flowId,
280  uint32_t packetId,
281  uint32_t packetSize,
282  uint32_t reasonCode)
283 {
284  NS_LOG_FUNCTION(this << probe << flowId << packetId << packetSize << reasonCode);
285  if (!m_enabled)
286  {
287  NS_LOG_DEBUG("FlowMonitor not enabled; returning");
288  return;
289  }
290 
291  probe->AddPacketDropStats(flowId, packetSize, reasonCode);
292 
293  FlowStats& stats = GetStatsForFlow(flowId);
294  stats.lostPackets++;
295  if (stats.packetsDropped.size() < reasonCode + 1)
296  {
297  stats.packetsDropped.resize(reasonCode + 1, 0);
298  stats.bytesDropped.resize(reasonCode + 1, 0);
299  }
300  ++stats.packetsDropped[reasonCode];
301  stats.bytesDropped[reasonCode] += packetSize;
302  NS_LOG_DEBUG("++stats.packetsDropped["
303  << reasonCode << "]; // becomes: " << stats.packetsDropped[reasonCode]);
304 
305  TrackedPacketMap::iterator tracked = m_trackedPackets.find(std::make_pair(flowId, packetId));
306  if (tracked != m_trackedPackets.end())
307  {
308  // we don't need to track this packet anymore
309  // FIXME: this will not necessarily be true with broadcast/multicast
310  NS_LOG_DEBUG("ReportDrop: removing tracked packet (flowId=" << flowId << ", packetId="
311  << packetId << ").");
312  m_trackedPackets.erase(tracked);
313  }
314 }
315 
318 {
319  return m_flowStats;
320 }
321 
322 void
324 {
325  NS_LOG_FUNCTION(this << maxDelay.As(Time::S));
326  Time now = Simulator::Now();
327 
328  for (TrackedPacketMap::iterator iter = m_trackedPackets.begin();
329  iter != m_trackedPackets.end();)
330  {
331  if (now - iter->second.lastSeenTime >= maxDelay)
332  {
333  // packet is considered lost, add it to the loss statistics
334  FlowStatsContainerI flow = m_flowStats.find(iter->first.first);
335  NS_ASSERT(flow != m_flowStats.end());
336  flow->second.lostPackets++;
337 
338  // we won't track it anymore
339  m_trackedPackets.erase(iter++);
340  }
341  else
342  {
343  iter++;
344  }
345  }
346 }
347 
348 void
350 {
352 }
353 
354 void
356 {
359 }
360 
361 void
363 {
366 }
367 
368 void
370 {
371  m_flowProbes.push_back(probe);
372 }
373 
376 {
377  return m_flowProbes;
378 }
379 
380 void
382 {
383  NS_LOG_FUNCTION(this << time.As(Time::S));
384  if (m_enabled)
385  {
386  NS_LOG_DEBUG("FlowMonitor already enabled; returning");
387  return;
388  }
390  NS_LOG_DEBUG("Scheduling start at " << time.As(Time::S));
392 }
393 
394 void
396 {
397  NS_LOG_FUNCTION(this << time.As(Time::S));
399  NS_LOG_DEBUG("Scheduling stop at " << time.As(Time::S));
401 }
402 
403 void
405 {
406  NS_LOG_FUNCTION(this);
407  if (m_enabled)
408  {
409  NS_LOG_DEBUG("FlowMonitor already enabled; returning");
410  return;
411  }
412  m_enabled = true;
413 }
414 
415 void
417 {
418  NS_LOG_FUNCTION(this);
419  if (!m_enabled)
420  {
421  NS_LOG_DEBUG("FlowMonitor not enabled; returning");
422  return;
423  }
424  m_enabled = false;
426 }
427 
428 void
430 {
431  m_classifiers.push_back(classifier);
432 }
433 
434 void
436  uint16_t indent,
437  bool enableHistograms,
438  bool enableProbes)
439 {
440  NS_LOG_FUNCTION(this << indent << enableHistograms << enableProbes);
442 
443  os << std::string(indent, ' ') << "<FlowMonitor>\n";
444  indent += 2;
445  os << std::string(indent, ' ') << "<FlowStats>\n";
446  indent += 2;
447  for (FlowStatsContainerCI flowI = m_flowStats.begin(); flowI != m_flowStats.end(); flowI++)
448  {
449  os << std::string(indent, ' ');
450 #define ATTRIB(name) << " " #name "=\"" << flowI->second.name << "\""
451 #define ATTRIB_TIME(name) << " " #name "=\"" << flowI->second.name.As(Time::NS) << "\""
452  os << "<Flow flowId=\"" << flowI->first
453  << "\"" ATTRIB_TIME(timeFirstTxPacket) ATTRIB_TIME(timeFirstRxPacket)
454  ATTRIB_TIME(timeLastTxPacket) ATTRIB_TIME(timeLastRxPacket) ATTRIB_TIME(delaySum)
455  ATTRIB_TIME(jitterSum) ATTRIB_TIME(lastDelay) ATTRIB(txBytes) ATTRIB(rxBytes)
456  ATTRIB(txPackets) ATTRIB(rxPackets) ATTRIB(lostPackets)
457  ATTRIB(timesForwarded)
458  << ">\n";
459 #undef ATTRIB_TIME
460 #undef ATTRIB
461 
462  indent += 2;
463  for (uint32_t reasonCode = 0; reasonCode < flowI->second.packetsDropped.size();
464  reasonCode++)
465  {
466  os << std::string(indent, ' ');
467  os << "<packetsDropped reasonCode=\"" << reasonCode << "\""
468  << " number=\"" << flowI->second.packetsDropped[reasonCode] << "\" />\n";
469  }
470  for (uint32_t reasonCode = 0; reasonCode < flowI->second.bytesDropped.size(); reasonCode++)
471  {
472  os << std::string(indent, ' ');
473  os << "<bytesDropped reasonCode=\"" << reasonCode << "\""
474  << " bytes=\"" << flowI->second.bytesDropped[reasonCode] << "\" />\n";
475  }
476  if (enableHistograms)
477  {
478  flowI->second.delayHistogram.SerializeToXmlStream(os, indent, "delayHistogram");
479  flowI->second.jitterHistogram.SerializeToXmlStream(os, indent, "jitterHistogram");
480  flowI->second.packetSizeHistogram.SerializeToXmlStream(os,
481  indent,
482  "packetSizeHistogram");
483  flowI->second.flowInterruptionsHistogram.SerializeToXmlStream(
484  os,
485  indent,
486  "flowInterruptionsHistogram");
487  }
488  indent -= 2;
489 
490  os << std::string(indent, ' ') << "</Flow>\n";
491  }
492  indent -= 2;
493  os << std::string(indent, ' ') << "</FlowStats>\n";
494 
495  for (std::list<Ptr<FlowClassifier>>::iterator iter = m_classifiers.begin();
496  iter != m_classifiers.end();
497  iter++)
498  {
499  (*iter)->SerializeToXmlStream(os, indent);
500  }
501 
502  if (enableProbes)
503  {
504  os << std::string(indent, ' ') << "<FlowProbes>\n";
505  indent += 2;
506  for (uint32_t i = 0; i < m_flowProbes.size(); i++)
507  {
508  m_flowProbes[i]->SerializeToXmlStream(os, indent, i);
509  }
510  indent -= 2;
511  os << std::string(indent, ' ') << "</FlowProbes>\n";
512  }
513 
514  indent -= 2;
515  os << std::string(indent, ' ') << "</FlowMonitor>\n";
516 }
517 
518 std::string
519 FlowMonitor::SerializeToXmlString(uint16_t indent, bool enableHistograms, bool enableProbes)
520 {
521  NS_LOG_FUNCTION(this << indent << enableHistograms << enableProbes);
522  std::ostringstream os;
523  SerializeToXmlStream(os, indent, enableHistograms, enableProbes);
524  return os.str();
525 }
526 
527 void
528 FlowMonitor::SerializeToXmlFile(std::string fileName, bool enableHistograms, bool enableProbes)
529 {
530  NS_LOG_FUNCTION(this << fileName << enableHistograms << enableProbes);
531  std::ofstream os(fileName, std::ios::out | std::ios::binary);
532  os << "<?xml version=\"1.0\" ?>\n";
533  SerializeToXmlStream(os, 0, enableHistograms, enableProbes);
534  os.close();
535 }
536 
537 } // namespace ns3
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:42
An object that monitors and reports back packet flows observed during a simulation.
Definition: flow-monitor.h:51
FlowStats & GetStatsForFlow(FlowId flowId)
Get the stats for a given flow.
FlowProbeContainer m_flowProbes
all the FlowProbes
Definition: flow-monitor.h:296
void StopRightNow()
End monitoring flows right now
const FlowProbeContainer & GetAllProbes() const
Get a list of all FlowProbe's associated with this FlowMonitor.
std::vector< Ptr< FlowProbe > > FlowProbeContainer
Container: FlowProbe.
Definition: flow-monitor.h:236
FlowStatsContainer m_flowStats
FlowId --> FlowStats.
Definition: flow-monitor.h:290
bool m_enabled
FlowMon is enabled.
Definition: flow-monitor.h:303
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.
double m_flowInterruptionsBinWidth
Flow interruptions bin width (for histograms)
Definition: flow-monitor.h:307
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.
Definition: flow-monitor.h:301
std::list< Ptr< FlowClassifier > > m_classifiers
the FlowClassifiers
Definition: flow-monitor.h:299
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.
Definition: flow-monitor.h:308
std::map< FlowId, FlowStats > FlowStatsContainer
Container: FlowId, FlowStats.
Definition: flow-monitor.h:230
double m_jitterBinWidth
Jitter bin width (for histograms)
Definition: flow-monitor.h:305
std::map< FlowId, FlowStats >::const_iterator FlowStatsContainerCI
Container Const Iterator: FlowId, FlowStats.
Definition: flow-monitor.h:234
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)
Definition: flow-monitor.h:306
Time m_maxPerHopDelay
Minimum per-hop delay.
Definition: flow-monitor.h:295
void DoDispose() override
Destructor implementation.
std::map< FlowId, FlowStats >::iterator FlowStatsContainerI
Container Iterator: FlowId, FlowStats.
Definition: flow-monitor.h:232
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.
Definition: flow-monitor.h:294
TypeId GetInstanceTypeId() const override
Get the most derived TypeId for this Object.
Definition: flow-monitor.cc:88
double m_delayBinWidth
Delay bin width (for histograms)
Definition: flow-monitor.h:304
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.
Definition: flow-monitor.h:302
static TypeId GetTypeId()
Get the type ID.
Definition: flow-monitor.cc:39
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...
void AddPacketStats(FlowId flowId, uint32_t packetSize, Time delayFromFirstProbe)
Add a packet data to the flow stats.
Definition: flow-probe.cc:56
void AddPacketDropStats(FlowId flowId, uint32_t packetSize, uint32_t reasonCode)
Add a packet drop data to the flow stats.
Definition: flow-probe.cc:65
void SetDefaultBinWidth(double binWidth)
Set the bin width.
Definition: histogram.cc:67
void AddValue(double value)
Add a value to the histogram.
Definition: histogram.cc:81
virtual void NotifyConstructionCompleted()
Notifier called once the ObjectBase is fully constructed.
Definition: object-base.cc:75
A base class which provides memory management and object aggregation.
Definition: object.h:89
virtual void DoDispose()
Destructor implementation.
Definition: object.cc:353
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:78
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:568
static void Cancel(const EventId &id)
Set the cancel bit on this event: the event's associated function will not be invoked when it expires...
Definition: simulator.cc:276
static Time Now()
Return the current simulation virtual time.
Definition: simulator.cc:199
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
TimeWithUnit As(const Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:417
double GetSeconds() const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:402
@ S
second
Definition: nstime.h:116
AttributeValue implementation for Time.
Definition: nstime.h:1423
a unique identifier for an interface.
Definition: type-id.h:60
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:935
#define ATTRIB(name)
#define PERIODIC_CHECK_INTERVAL
Definition: flow-monitor.cc:29
#define ATTRIB_TIME(name)
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:66
Ptr< const AttributeAccessor > MakeDoubleAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: double.h:43
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Definition: nstime.h:1424
uint32_t FlowId
Abstract identifier of a packet flow.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:268
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
Definition: log.h:261
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:46
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1336
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:535
#define list
Structure that represents the measured metrics of an individual packet flow.
Definition: flow-monitor.h:55
uint32_t rxPackets
Total number of received packets for the flow.
Definition: flow-monitor.h:99
Histogram packetSizeHistogram
Histogram of the packet sizes.
Definition: flow-monitor.h:117
Time timeLastTxPacket
Contains the absolute time when the last packet in the flow was transmitted, i.e.
Definition: flow-monitor.h:69
uint32_t lostPackets
Total number of packets that are assumed to be lost, i.e.
Definition: flow-monitor.h:106
Histogram jitterHistogram
Histogram of the packet jitters.
Definition: flow-monitor.h:115
Time lastDelay
Contains the last measured delay of a packet It is stored to measure the packet's Jitter.
Definition: flow-monitor.h:90
Time timeLastRxPacket
Contains the absolute time when the last packet in the flow was received, i.e.
Definition: flow-monitor.h:73
Histogram flowInterruptionsHistogram
histogram of durations of flow interruptions
Definition: flow-monitor.h:137
uint64_t rxBytes
Total number of received bytes for the flow.
Definition: flow-monitor.h:95
Time delaySum
Contains the sum of all end-to-end delays for all received packets of the flow.
Definition: flow-monitor.h:77
Time timeFirstRxPacket
Contains the absolute time when the first packet in the flow was received by an end node,...
Definition: flow-monitor.h:64
uint32_t timesForwarded
Contains the number of times a packet has been reportedly forwarded, summed for all received packets ...
Definition: flow-monitor.h:110
uint32_t txPackets
Total number of transmitted packets for the flow.
Definition: flow-monitor.h:97
uint64_t txBytes
Total number of transmitted bytes for the flow.
Definition: flow-monitor.h:93
Histogram delayHistogram
Histogram of the packet delays.
Definition: flow-monitor.h:113
Time jitterSum
Contains the sum of all end-to-end delay jitter (delay variation) values for all received packets of ...
Definition: flow-monitor.h:86
std::vector< uint64_t > bytesDropped
This attribute also tracks the number of lost bytes.
Definition: flow-monitor.h:136
Time timeFirstTxPacket
Contains the absolute time when the first packet in the flow was transmitted, i.e.
Definition: flow-monitor.h:59
std::vector< uint32_t > packetsDropped
This attribute also tracks the number of lost packets and bytes, but discriminates the losses by a re...
Definition: flow-monitor.h:132
Structure to represent a single tracked packet data.
Definition: flow-monitor.h:283
Time lastSeenTime
absolute time when the packet was last seen by a probe
Definition: flow-monitor.h:285
Time firstSeenTime
absolute time when the packet was first seen by a probe
Definition: flow-monitor.h:284
uint32_t timesForwarded
number of times the packet was reportedly forwarded
Definition: flow-monitor.h:286
static const uint32_t packetSize
Packet size generated at the AP.