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