A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  .AddConstructor<FlowMonitor> ()
45  .AddAttribute ("MaxPerHopDelay", ("The maximum per-hop delay that should be considered. "
46  "Packets still not received after this delay are to be considered lost."),
47  TimeValue (Seconds (10.0)),
48  MakeTimeAccessor (&FlowMonitor::m_maxPerHopDelay),
49  MakeTimeChecker ())
50  .AddAttribute ("StartTime", ("The time when the monitoring starts."),
51  TimeValue (Seconds (0.0)),
52  MakeTimeAccessor (&FlowMonitor::Start),
53  MakeTimeChecker ())
54  .AddAttribute ("DelayBinWidth", ("The width used in the delay histogram."),
55  DoubleValue (0.001),
56  MakeDoubleAccessor (&FlowMonitor::m_delayBinWidth),
57  MakeDoubleChecker <double> ())
58  .AddAttribute ("JitterBinWidth", ("The width used in the jitter histogram."),
59  DoubleValue (0.001),
60  MakeDoubleAccessor (&FlowMonitor::m_jitterBinWidth),
61  MakeDoubleChecker <double> ())
62  .AddAttribute ("PacketSizeBinWidth", ("The width used in the packetSize histogram."),
63  DoubleValue (20),
64  MakeDoubleAccessor (&FlowMonitor::m_packetSizeBinWidth),
65  MakeDoubleChecker <double> ())
66  .AddAttribute ("FlowInterruptionsBinWidth", ("The width used in the flowInterruptions histogram."),
67  DoubleValue (0.250),
68  MakeDoubleAccessor (&FlowMonitor::m_flowInterruptionsBinWidth),
69  MakeDoubleChecker <double> ())
70  .AddAttribute ("FlowInterruptionsMinTime", ("The minimum inter-arrival time that is considered a flow interruption."),
71  TimeValue (Seconds (0.5)),
72  MakeTimeAccessor (&FlowMonitor::m_flowInterruptionsMinTime),
73  MakeTimeChecker ())
74  ;
75  return tid;
76 }
77 
78 TypeId
80 {
81  return GetTypeId ();
82 }
83 
85  : m_enabled (false)
86 {
87  // m_histogramBinWidth=DEFAULT_BIN_WIDTH;
88 }
89 
90 void
92 {
93  for (std::list<Ptr<FlowClassifier> >::iterator iter = m_classifiers.begin ();
94  iter != m_classifiers.end ();
95  iter ++)
96  {
97  *iter = 0;
98  }
99  for (uint32_t i = 0; i < m_flowProbes.size (); i++)
100  {
101  m_flowProbes[i]->Dispose ();
102  m_flowProbes[i] = 0;
103  }
105 }
106 
109 {
110  std::map<FlowId, FlowStats>::iterator iter;
111  iter = m_flowStats.find (flowId);
112  if (iter == m_flowStats.end ())
113  {
114  FlowMonitor::FlowStats &ref = m_flowStats[flowId];
115  ref.delaySum = Seconds (0);
116  ref.jitterSum = Seconds (0);
117  ref.lastDelay = Seconds (0);
118  ref.txBytes = 0;
119  ref.rxBytes = 0;
120  ref.txPackets = 0;
121  ref.rxPackets = 0;
122  ref.lostPackets = 0;
123  ref.timesForwarded = 0;
128  return ref;
129  }
130  else
131  {
132  return iter->second;
133  }
134 }
135 
136 
137 void
138 FlowMonitor::ReportFirstTx (Ptr<FlowProbe> probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize)
139 {
140  if (!m_enabled)
141  {
142  return;
143  }
144  Time now = Simulator::Now ();
145  TrackedPacket &tracked = m_trackedPackets[std::make_pair (flowId, packetId)];
146  tracked.firstSeenTime = now;
147  tracked.lastSeenTime = tracked.firstSeenTime;
148  tracked.timesForwarded = 0;
149  NS_LOG_DEBUG ("ReportFirstTx: adding tracked packet (flowId=" << flowId << ", packetId=" << packetId
150  << ").");
151 
152  probe->AddPacketStats (flowId, packetSize, Seconds (0));
153 
154  FlowStats &stats = GetStatsForFlow (flowId);
155  stats.txBytes += packetSize;
156  stats.txPackets++;
157  if (stats.txPackets == 1)
158  {
159  stats.timeFirstTxPacket = now;
160  }
161  stats.timeLastTxPacket = now;
162 }
163 
164 
165 void
166 FlowMonitor::ReportForwarding (Ptr<FlowProbe> probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize)
167 {
168  if (!m_enabled)
169  {
170  return;
171  }
172  std::pair<FlowId, FlowPacketId> key (flowId, packetId);
173  TrackedPacketMap::iterator tracked = m_trackedPackets.find (key);
174  if (tracked == m_trackedPackets.end ())
175  {
176  NS_LOG_WARN ("Received packet forward report (flowId=" << flowId << ", packetId=" << packetId
177  << ") but not known to be transmitted.");
178  return;
179  }
180 
181  tracked->second.timesForwarded++;
182  tracked->second.lastSeenTime = Simulator::Now ();
183 
184  Time delay = (Simulator::Now () - tracked->second.firstSeenTime);
185  probe->AddPacketStats (flowId, packetSize, delay);
186 }
187 
188 
189 void
190 FlowMonitor::ReportLastRx (Ptr<FlowProbe> probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize)
191 {
192  if (!m_enabled)
193  {
194  return;
195  }
196  TrackedPacketMap::iterator tracked = m_trackedPackets.find (std::make_pair (flowId, packetId));
197  if (tracked == m_trackedPackets.end ())
198  {
199  NS_LOG_WARN ("Received packet last-tx report (flowId=" << flowId << ", packetId=" << packetId
200  << ") but not known to be transmitted.");
201  return;
202  }
203 
204  Time now = Simulator::Now ();
205  Time delay = (now - tracked->second.firstSeenTime);
206  probe->AddPacketStats (flowId, packetSize, delay);
207 
208  FlowStats &stats = GetStatsForFlow (flowId);
209  stats.delaySum += delay;
210  stats.delayHistogram.AddValue (delay.GetSeconds ());
211  if (stats.rxPackets > 0 )
212  {
213  Time jitter = stats.lastDelay - delay;
214  if (jitter > Seconds (0))
215  {
216  stats.jitterSum += jitter;
217  stats.jitterHistogram.AddValue (jitter.GetSeconds ());
218  }
219  else
220  {
221  stats.jitterSum -= jitter;
222  stats.jitterHistogram.AddValue (-jitter.GetSeconds ());
223  }
224  }
225  stats.lastDelay = delay;
226 
227  stats.rxBytes += packetSize;
228  stats.packetSizeHistogram.AddValue ((double) packetSize);
229  stats.rxPackets++;
230  if (stats.rxPackets == 1)
231  {
232  stats.timeFirstRxPacket = now;
233  }
234  else
235  {
236  // measure possible flow interruptions
237  Time interArrivalTime = now - stats.timeLastRxPacket;
238  if (interArrivalTime > m_flowInterruptionsMinTime)
239  {
240  stats.flowInterruptionsHistogram.AddValue (interArrivalTime.GetSeconds ());
241  }
242  }
243  stats.timeLastRxPacket = now;
244  stats.timesForwarded += tracked->second.timesForwarded;
245 
246  NS_LOG_DEBUG ("ReportLastTx: removing tracked packet (flowId="
247  << flowId << ", packetId=" << packetId << ").");
248 
249  m_trackedPackets.erase (tracked); // we don't need to track this packet anymore
250 }
251 
252 void
253 FlowMonitor::ReportDrop (Ptr<FlowProbe> probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize,
254  uint32_t reasonCode)
255 {
256  if (!m_enabled)
257  {
258  return;
259  }
260 
261  probe->AddPacketDropStats (flowId, packetSize, reasonCode);
262 
263  FlowStats &stats = GetStatsForFlow (flowId);
264  stats.lostPackets++;
265  if (stats.packetsDropped.size () < reasonCode + 1)
266  {
267  stats.packetsDropped.resize (reasonCode + 1, 0);
268  stats.bytesDropped.resize (reasonCode + 1, 0);
269  }
270  ++stats.packetsDropped[reasonCode];
271  stats.bytesDropped[reasonCode] += packetSize;
272  NS_LOG_DEBUG ("++stats.packetsDropped[" << reasonCode<< "]; // becomes: " << stats.packetsDropped[reasonCode]);
273 
274  TrackedPacketMap::iterator tracked = m_trackedPackets.find (std::make_pair (flowId, packetId));
275  if (tracked != m_trackedPackets.end ())
276  {
277  // we don't need to track this packet anymore
278  // FIXME: this will not necessarily be true with broadcast/multicast
279  NS_LOG_DEBUG ("ReportDrop: removing tracked packet (flowId="
280  << flowId << ", packetId=" << packetId << ").");
281  m_trackedPackets.erase (tracked);
282  }
283 }
284 
285 std::map<FlowId, FlowMonitor::FlowStats>
287 {
288  return m_flowStats;
289 }
290 
291 
292 void
294 {
295  Time now = Simulator::Now ();
296 
297  for (TrackedPacketMap::iterator iter = m_trackedPackets.begin ();
298  iter != m_trackedPackets.end (); )
299  {
300  if (now - iter->second.lastSeenTime >= maxDelay)
301  {
302  // packet is considered lost, add it to the loss statistics
303  std::map<FlowId, FlowStats>::iterator
304  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 std::vector< Ptr<FlowProbe> >
346 {
347  return m_flowProbes;
348 }
349 
350 
351 void
353 {
354  if (m_enabled)
355  {
356  return;
357  }
360 }
361 
362 void
363 FlowMonitor::Stop (const Time &time)
364 {
365  if (!m_enabled)
366  {
367  return;
368  }
371 }
372 
373 
374 void
376 {
377  if (m_enabled)
378  {
379  return;
380  }
381  m_enabled = true;
382 }
383 
384 
385 void
387 {
388  if (!m_enabled)
389  {
390  return;
391  }
392  m_enabled = false;
394 }
395 
396 void
398 {
399  m_classifiers.push_back (classifier);
400 }
401 
402 void
403 FlowMonitor::SerializeToXmlStream (std::ostream &os, int indent, bool enableHistograms, bool enableProbes)
404 {
406 
407  INDENT (indent); os << "<FlowMonitor>\n";
408  indent += 2;
409  INDENT (indent); os << "<FlowStats>\n";
410  indent += 2;
411  for (std::map<FlowId, FlowStats>::const_iterator flowI = m_flowStats.begin ();
412  flowI != m_flowStats.end (); flowI++)
413  {
414 
415  INDENT (indent);
416 #define ATTRIB(name) << " " # name "=\"" << flowI->second.name << "\""
417  os << "<Flow flowId=\"" << flowI->first << "\""
418  ATTRIB (timeFirstTxPacket)
419  ATTRIB (timeFirstRxPacket)
420  ATTRIB (timeLastTxPacket)
421  ATTRIB (timeLastRxPacket)
422  ATTRIB (delaySum)
423  ATTRIB (jitterSum)
424  ATTRIB (lastDelay)
425  ATTRIB (txBytes)
426  ATTRIB (rxBytes)
427  ATTRIB (txPackets)
428  ATTRIB (rxPackets)
429  ATTRIB (lostPackets)
430  ATTRIB (timesForwarded)
431  << ">\n";
432 #undef ATTRIB
433 
434 
435  indent += 2;
436  for (uint32_t reasonCode = 0; reasonCode < flowI->second.packetsDropped.size (); reasonCode++)
437  {
438  INDENT (indent);
439  os << "<packetsDropped reasonCode=\"" << reasonCode << "\""
440  << " number=\"" << flowI->second.packetsDropped[reasonCode]
441  << "\" />\n";
442  }
443  for (uint32_t reasonCode = 0; reasonCode < flowI->second.bytesDropped.size (); reasonCode++)
444  {
445  INDENT (indent);
446  os << "<bytesDropped reasonCode=\"" << reasonCode << "\""
447  << " bytes=\"" << flowI->second.bytesDropped[reasonCode]
448  << "\" />\n";
449  }
450  if (enableHistograms)
451  {
452  flowI->second.delayHistogram.SerializeToXmlStream (os, indent, "delayHistogram");
453  flowI->second.jitterHistogram.SerializeToXmlStream (os, indent, "jitterHistogram");
454  flowI->second.packetSizeHistogram.SerializeToXmlStream (os, indent, "packetSizeHistogram");
455  flowI->second.flowInterruptionsHistogram.SerializeToXmlStream (os, indent, "flowInterruptionsHistogram");
456  }
457  indent -= 2;
458 
459  INDENT (indent); os << "</Flow>\n";
460  }
461  indent -= 2;
462  INDENT (indent); os << "</FlowStats>\n";
463 
464  for (std::list<Ptr<FlowClassifier> >::iterator iter = m_classifiers.begin ();
465  iter != m_classifiers.end ();
466  iter ++)
467  {
468  (*iter)->SerializeToXmlStream (os, indent);
469  }
470 
471  if (enableProbes)
472  {
473  INDENT (indent); os << "<FlowProbes>\n";
474  indent += 2;
475  for (uint32_t i = 0; i < m_flowProbes.size (); i++)
476  {
477  m_flowProbes[i]->SerializeToXmlStream (os, indent, i);
478  }
479  indent -= 2;
480  INDENT (indent); os << "</FlowProbes>\n";
481  }
482 
483  indent -= 2;
484  INDENT (indent); os << "</FlowMonitor>\n";
485 }
486 
487 
488 std::string
489 FlowMonitor::SerializeToXmlString (int indent, bool enableHistograms, bool enableProbes)
490 {
491  std::ostringstream os;
492  SerializeToXmlStream (os, indent, enableHistograms, enableProbes);
493  return os.str ();
494 }
495 
496 
497 void
498 FlowMonitor::SerializeToXmlFile (std::string fileName, bool enableHistograms, bool enableProbes)
499 {
500  std::ofstream os (fileName.c_str (), std::ios::out|std::ios::binary);
501  os << "<?xml version=\"1.0\" ?>\n";
502  SerializeToXmlStream (os, 0, enableHistograms, enableProbes);
503  os.close ();
504 }
505 
506 
507 } // namespace ns3
508 
#define PERIODIC_CHECK_INTERVAL
Definition: flow-monitor.cc:30
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:79
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register the class in the ns-3 factory.
Definition: object-base.h:38
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:61
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:170
Time m_maxPerHopDelay
Minimum per-hop delay.
Definition: flow-monitor.h:265
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...
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: object.cc:335
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:268
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
Definition: simulator.h:825
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
std::map< FlowId, FlowStats > m_flowStats
FlowId –> FlowStats.
Definition: flow-monitor.h:260
Time m_flowInterruptionsMinTime
Flow interruptions minimum time.
Definition: flow-monitor.h:278
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...
TrackedPacketMap m_trackedPackets
Tracked packets.
Definition: flow-monitor.h:264
Time lastDelay
Contains the last measured delay of a packet It is stored to measure the packet's Jitter...
Definition: flow-monitor.h:91
std::map< FlowId, FlowStats > GetFlowStats() const
Retrieve all collected the flow statistics.
void SerializeToXmlStream(std::ostream &os, int indent, bool enableHistograms, bool enableProbes)
Serializes the results to an std::ostream in XML format.
double GetSeconds(void) const
Definition: nstime.h:272
Time firstSeenTime
absolute time when the packet was first seen by a probe
Definition: flow-monitor.h:254
hold objects of type ns3::Time
Definition: nstime.h:1008
std::list< Ptr< FlowClassifier > > m_classifiers
the FlowClassifiers
Definition: flow-monitor.h:269
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:273
virtual void NotifyConstructionCompleted(void)
This method is invoked once all member attributes have been initialized.
Definition: object-base.cc:59
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:276
FlowStats & GetStatsForFlow(FlowId flowId)
Get the stats for a given flow.
double m_jitterBinWidth
Jitter bin width (for histograms)
Definition: flow-monitor.h:275
EventId m_stopEvent
Stop event.
Definition: flow-monitor.h:272
#define list
Time lastSeenTime
absolute time when the packet was last seen by a probe
Definition: flow-monitor.h:255
double m_delayBinWidth
Delay bin width (for histograms)
Definition: flow-monitor.h:274
#define INDENT(level)
Definition: flow-monitor.cc:28
virtual void NotifyConstructionCompleted()
This method is invoked once all member attributes have been initialized.
#define ATTRIB(name)
void Stop(const Time &time)
Set the time, counting from the current time, from which to stop monitoring flows.
std::vector< Ptr< FlowProbe > > m_flowProbes
all the FlowProbes
Definition: flow-monitor.h:266
Time timeFirstRxPacket
Contains the absolute time when the first packet in the flow was received by an end node...
Definition: flow-monitor.h:65
static Time Now(void)
Return the "current simulation time".
Definition: simulator.cc:180
uint32_t timesForwarded
Contains the number of times a packet has been reportedly forwarded, summed for all received packets ...
Definition: flow-monitor.h:111
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.
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:203
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.
std::vector< Ptr< FlowProbe > > GetAllProbes() const
Get a list of all FlowProbe's associated with this FlowMonitor.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:213
virtual void DoDispose(void)
This method is called by Object::Dispose or by the object's destructor, whichever comes first...
Definition: flow-monitor.cc:91
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:277
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Definition: time.cc:441
Structure to represent a single tracked packet data.
Definition: flow-monitor.h:252
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:64
EventId m_startEvent
Start event.
Definition: flow-monitor.h:271
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
Hold a floating point type.
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:256
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:49
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)
Definition: type-id.cc:610
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
TypeId GetInstanceTypeId() const
Definition: flow-monitor.cc:79
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