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 PERIODIC_CHECK_INTERVAL (Seconds (1))
29 
30 namespace ns3 {
31 
32 NS_LOG_COMPONENT_DEFINE ("FlowMonitor");
33 
34 NS_OBJECT_ENSURE_REGISTERED (FlowMonitor);
35 
36 TypeId
38 {
39  static TypeId tid = TypeId ("ns3::FlowMonitor")
40  .SetParent<Object> ()
41  .SetGroupName ("FlowMonitor")
42  .AddConstructor<FlowMonitor> ()
43  .AddAttribute ("MaxPerHopDelay", ("The maximum per-hop delay that should be considered. "
44  "Packets still not received after this delay are to be considered lost."),
45  TimeValue (Seconds (10.0)),
47  MakeTimeChecker ())
48  .AddAttribute ("StartTime", ("The time when the monitoring starts."),
49  TimeValue (Seconds (0.0)),
51  MakeTimeChecker ())
52  .AddAttribute ("DelayBinWidth", ("The width used in the delay histogram."),
53  DoubleValue (0.001),
55  MakeDoubleChecker <double> ())
56  .AddAttribute ("JitterBinWidth", ("The width used in the jitter histogram."),
57  DoubleValue (0.001),
59  MakeDoubleChecker <double> ())
60  .AddAttribute ("PacketSizeBinWidth", ("The width used in the packetSize histogram."),
61  DoubleValue (20),
63  MakeDoubleChecker <double> ())
64  .AddAttribute ("FlowInterruptionsBinWidth", ("The width used in the flowInterruptions histogram."),
65  DoubleValue (0.250),
67  MakeDoubleChecker <double> ())
68  .AddAttribute ("FlowInterruptionsMinTime", ("The minimum inter-arrival time that is considered a flow interruption."),
69  TimeValue (Seconds (0.5)),
71  MakeTimeChecker ())
72  ;
73  return tid;
74 }
75 
76 TypeId
78 {
79  return GetTypeId ();
80 }
81 
83  : m_enabled (false)
84 {
85  NS_LOG_FUNCTION (this);
86 }
87 
88 void
90 {
91  NS_LOG_FUNCTION (this);
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  NS_LOG_FUNCTION (this);
112  FlowStatsContainerI iter;
113  iter = m_flowStats.find (flowId);
114  if (iter == m_flowStats.end ())
115  {
116  FlowMonitor::FlowStats &ref = m_flowStats[flowId];
117  ref.delaySum = Seconds (0);
118  ref.jitterSum = Seconds (0);
119  ref.lastDelay = Seconds (0);
120  ref.txBytes = 0;
121  ref.rxBytes = 0;
122  ref.txPackets = 0;
123  ref.rxPackets = 0;
124  ref.lostPackets = 0;
125  ref.timesForwarded = 0;
130  return ref;
131  }
132  else
133  {
134  return iter->second;
135  }
136 }
137 
138 
139 void
140 FlowMonitor::ReportFirstTx (Ptr<FlowProbe> probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize)
141 {
142  NS_LOG_FUNCTION (this << probe << flowId << packetId << packetSize);
143  if (!m_enabled)
144  {
145  NS_LOG_DEBUG ("FlowMonitor not enabled; returning");
146  return;
147  }
148  Time now = Simulator::Now ();
149  TrackedPacket &tracked = m_trackedPackets[std::make_pair (flowId, packetId)];
150  tracked.firstSeenTime = now;
151  tracked.lastSeenTime = tracked.firstSeenTime;
152  tracked.timesForwarded = 0;
153  NS_LOG_DEBUG ("ReportFirstTx: adding tracked packet (flowId=" << flowId << ", packetId=" << packetId
154  << ").");
155 
156  probe->AddPacketStats (flowId, packetSize, Seconds (0));
157 
158  FlowStats &stats = GetStatsForFlow (flowId);
159  stats.txBytes += packetSize;
160  stats.txPackets++;
161  if (stats.txPackets == 1)
162  {
163  stats.timeFirstTxPacket = now;
164  }
165  stats.timeLastTxPacket = now;
166 }
167 
168 
169 void
170 FlowMonitor::ReportForwarding (Ptr<FlowProbe> probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize)
171 {
172  NS_LOG_FUNCTION (this << probe << flowId << packetId << packetSize);
173  if (!m_enabled)
174  {
175  NS_LOG_DEBUG ("FlowMonitor not enabled; returning");
176  return;
177  }
178  std::pair<FlowId, FlowPacketId> key (flowId, packetId);
179  TrackedPacketMap::iterator tracked = m_trackedPackets.find (key);
180  if (tracked == m_trackedPackets.end ())
181  {
182  NS_LOG_WARN ("Received packet forward report (flowId=" << flowId << ", packetId=" << packetId
183  << ") but not known to be transmitted.");
184  return;
185  }
186 
187  tracked->second.timesForwarded++;
188  tracked->second.lastSeenTime = Simulator::Now ();
189 
190  Time delay = (Simulator::Now () - tracked->second.firstSeenTime);
191  probe->AddPacketStats (flowId, packetSize, delay);
192 }
193 
194 
195 void
196 FlowMonitor::ReportLastRx (Ptr<FlowProbe> probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize)
197 {
198  NS_LOG_FUNCTION (this << probe << flowId << packetId << packetSize);
199  if (!m_enabled)
200  {
201  NS_LOG_DEBUG ("FlowMonitor not enabled; returning");
202  return;
203  }
204  TrackedPacketMap::iterator tracked = m_trackedPackets.find (std::make_pair (flowId, packetId));
205  if (tracked == m_trackedPackets.end ())
206  {
207  NS_LOG_WARN ("Received packet last-tx report (flowId=" << flowId << ", packetId=" << packetId
208  << ") but not known to be transmitted.");
209  return;
210  }
211 
212  Time now = Simulator::Now ();
213  Time delay = (now - tracked->second.firstSeenTime);
214  probe->AddPacketStats (flowId, packetSize, delay);
215 
216  FlowStats &stats = GetStatsForFlow (flowId);
217  stats.delaySum += delay;
218  stats.delayHistogram.AddValue (delay.GetSeconds ());
219  if (stats.rxPackets > 0 )
220  {
221  Time jitter = stats.lastDelay - delay;
222  if (jitter > Seconds (0))
223  {
224  stats.jitterSum += jitter;
225  stats.jitterHistogram.AddValue (jitter.GetSeconds ());
226  }
227  else
228  {
229  stats.jitterSum -= jitter;
230  stats.jitterHistogram.AddValue (-jitter.GetSeconds ());
231  }
232  }
233  stats.lastDelay = delay;
234 
235  stats.rxBytes += packetSize;
236  stats.packetSizeHistogram.AddValue ((double) packetSize);
237  stats.rxPackets++;
238  if (stats.rxPackets == 1)
239  {
240  stats.timeFirstRxPacket = now;
241  }
242  else
243  {
244  // measure possible flow interruptions
245  Time interArrivalTime = now - stats.timeLastRxPacket;
246  if (interArrivalTime > m_flowInterruptionsMinTime)
247  {
248  stats.flowInterruptionsHistogram.AddValue (interArrivalTime.GetSeconds ());
249  }
250  }
251  stats.timeLastRxPacket = now;
252  stats.timesForwarded += tracked->second.timesForwarded;
253 
254  NS_LOG_DEBUG ("ReportLastTx: removing tracked packet (flowId="
255  << flowId << ", packetId=" << packetId << ").");
256 
257  m_trackedPackets.erase (tracked); // we don't need to track this packet anymore
258 }
259 
260 void
261 FlowMonitor::ReportDrop (Ptr<FlowProbe> probe, uint32_t flowId, uint32_t packetId, uint32_t packetSize,
262  uint32_t reasonCode)
263 {
264  NS_LOG_FUNCTION (this << probe << flowId << packetId << packetSize << reasonCode);
265  if (!m_enabled)
266  {
267  NS_LOG_DEBUG ("FlowMonitor not enabled; returning");
268  return;
269  }
270 
271  probe->AddPacketDropStats (flowId, packetSize, reasonCode);
272 
273  FlowStats &stats = GetStatsForFlow (flowId);
274  stats.lostPackets++;
275  if (stats.packetsDropped.size () < reasonCode + 1)
276  {
277  stats.packetsDropped.resize (reasonCode + 1, 0);
278  stats.bytesDropped.resize (reasonCode + 1, 0);
279  }
280  ++stats.packetsDropped[reasonCode];
281  stats.bytesDropped[reasonCode] += packetSize;
282  NS_LOG_DEBUG ("++stats.packetsDropped[" << reasonCode<< "]; // becomes: " << stats.packetsDropped[reasonCode]);
283 
284  TrackedPacketMap::iterator tracked = m_trackedPackets.find (std::make_pair (flowId, packetId));
285  if (tracked != m_trackedPackets.end ())
286  {
287  // we don't need to track this packet anymore
288  // FIXME: this will not necessarily be true with broadcast/multicast
289  NS_LOG_DEBUG ("ReportDrop: removing tracked packet (flowId="
290  << flowId << ", packetId=" << packetId << ").");
291  m_trackedPackets.erase (tracked);
292  }
293 }
294 
297 {
298  return m_flowStats;
299 }
300 
301 
302 void
304 {
305  NS_LOG_FUNCTION (this << maxDelay.As (Time::S));
306  Time now = Simulator::Now ();
307 
308  for (TrackedPacketMap::iterator iter = m_trackedPackets.begin ();
309  iter != m_trackedPackets.end (); )
310  {
311  if (now - iter->second.lastSeenTime >= maxDelay)
312  {
313  // packet is considered lost, add it to the loss statistics
314  FlowStatsContainerI flow = m_flowStats.find (iter->first.first);
315  NS_ASSERT (flow != m_flowStats.end ());
316  flow->second.lostPackets++;
317 
318  // we won't track it anymore
319  m_trackedPackets.erase (iter++);
320  }
321  else
322  {
323  iter++;
324  }
325  }
326 }
327 
328 void
330 {
332 }
333 
334 void
336 {
339 }
340 
341 void
343 {
346 }
347 
348 void
350 {
351  m_flowProbes.push_back (probe);
352 }
353 
354 
357 {
358  return m_flowProbes;
359 }
360 
361 
362 void
364 {
365  NS_LOG_FUNCTION (this << time.As (Time::S));
366  if (m_enabled)
367  {
368  NS_LOG_DEBUG ("FlowMonitor already enabled; returning");
369  return;
370  }
372  NS_LOG_DEBUG ("Scheduling start at " << time.As (Time::S));
374 }
375 
376 void
377 FlowMonitor::Stop (const Time &time)
378 {
379  NS_LOG_FUNCTION (this << time.As (Time::S));
381  NS_LOG_DEBUG ("Scheduling stop at " << time.As (Time::S));
383 }
384 
385 
386 void
388 {
389  NS_LOG_FUNCTION (this);
390  if (m_enabled)
391  {
392  NS_LOG_DEBUG ("FlowMonitor already enabled; returning");
393  return;
394  }
395  m_enabled = true;
396 }
397 
398 
399 void
401 {
402  NS_LOG_FUNCTION (this);
403  if (!m_enabled)
404  {
405  NS_LOG_DEBUG ("FlowMonitor not enabled; returning");
406  return;
407  }
408  m_enabled = false;
410 }
411 
412 void
414 {
415  m_classifiers.push_back (classifier);
416 }
417 
418 void
419 FlowMonitor::SerializeToXmlStream (std::ostream &os, uint16_t indent, bool enableHistograms, bool enableProbes)
420 {
421  NS_LOG_FUNCTION (this << indent << enableHistograms << enableProbes);
423 
424  os << std::string ( indent, ' ' ) << "<FlowMonitor>\n";
425  indent += 2;
426  os << std::string ( indent, ' ' ) << "<FlowStats>\n";
427  indent += 2;
428  for (FlowStatsContainerCI flowI = m_flowStats.begin ();
429  flowI != m_flowStats.end (); flowI++)
430  {
431  os << std::string ( indent, ' ' );
432 #define ATTRIB(name) << " " # name "=\"" << flowI->second.name << "\""
433 #define ATTRIB_TIME(name) << " " #name "=\"" << flowI->second.name.As (Time::NS) << "\""
434  os << "<Flow flowId=\"" << flowI->first << "\""
435  ATTRIB_TIME (timeFirstTxPacket)
436  ATTRIB_TIME (timeFirstRxPacket)
437  ATTRIB_TIME (timeLastTxPacket)
438  ATTRIB_TIME (timeLastRxPacket)
439  ATTRIB_TIME (delaySum)
440  ATTRIB_TIME (jitterSum)
441  ATTRIB_TIME (lastDelay)
442  ATTRIB (txBytes)
443  ATTRIB (rxBytes)
444  ATTRIB (txPackets)
445  ATTRIB (rxPackets)
446  ATTRIB (lostPackets)
447  ATTRIB (timesForwarded)
448  << ">\n";
449 #undef ATTRIB_TIME
450 #undef ATTRIB
451 
452  indent += 2;
453  for (uint32_t reasonCode = 0; reasonCode < flowI->second.packetsDropped.size (); reasonCode++)
454  {
455  os << std::string ( indent, ' ' );
456  os << "<packetsDropped reasonCode=\"" << reasonCode << "\""
457  << " number=\"" << flowI->second.packetsDropped[reasonCode]
458  << "\" />\n";
459  }
460  for (uint32_t reasonCode = 0; reasonCode < flowI->second.bytesDropped.size (); reasonCode++)
461  {
462  os << std::string ( indent, ' ' );
463  os << "<bytesDropped reasonCode=\"" << reasonCode << "\""
464  << " bytes=\"" << flowI->second.bytesDropped[reasonCode]
465  << "\" />\n";
466  }
467  if (enableHistograms)
468  {
469  flowI->second.delayHistogram.SerializeToXmlStream (os, indent, "delayHistogram");
470  flowI->second.jitterHistogram.SerializeToXmlStream (os, indent, "jitterHistogram");
471  flowI->second.packetSizeHistogram.SerializeToXmlStream (os, indent, "packetSizeHistogram");
472  flowI->second.flowInterruptionsHistogram.SerializeToXmlStream (os, indent, "flowInterruptionsHistogram");
473  }
474  indent -= 2;
475 
476  os << std::string ( indent, ' ' ) << "</Flow>\n";
477  }
478  indent -= 2;
479  os << std::string ( indent, ' ' ) << "</FlowStats>\n";
480 
481  for (std::list<Ptr<FlowClassifier> >::iterator iter = m_classifiers.begin ();
482  iter != m_classifiers.end ();
483  iter ++)
484  {
485  (*iter)->SerializeToXmlStream (os, indent);
486  }
487 
488  if (enableProbes)
489  {
490  os << std::string ( indent, ' ' ) << "<FlowProbes>\n";
491  indent += 2;
492  for (uint32_t i = 0; i < m_flowProbes.size (); i++)
493  {
494  m_flowProbes[i]->SerializeToXmlStream (os, indent, i);
495  }
496  indent -= 2;
497  os << std::string ( indent, ' ' ) << "</FlowProbes>\n";
498  }
499 
500  indent -= 2;
501  os << std::string ( indent, ' ' ) << "</FlowMonitor>\n";
502 }
503 
504 
505 std::string
506 FlowMonitor::SerializeToXmlString (uint16_t indent, bool enableHistograms, bool enableProbes)
507 {
508  NS_LOG_FUNCTION (this << indent << enableHistograms << enableProbes);
509  std::ostringstream os;
510  SerializeToXmlStream (os, indent, enableHistograms, enableProbes);
511  return os.str ();
512 }
513 
514 
515 void
516 FlowMonitor::SerializeToXmlFile (std::string fileName, bool enableHistograms, bool enableProbes)
517 {
518  NS_LOG_FUNCTION (this << fileName << enableHistograms << enableProbes);
519  std::ofstream os (fileName.c_str (), std::ios::out|std::ios::binary);
520  os << "<?xml version=\"1.0\" ?>\n";
521  SerializeToXmlStream (os, 0, enableHistograms, enableProbes);
522  os.close ();
523 }
524 
525 
526 } // namespace ns3
527 
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:41
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:284
virtual TypeId GetInstanceTypeId() const
Get the most derived TypeId for this Object.
Definition: flow-monitor.cc:77
void StopRightNow()
End monitoring flows right now
const FlowProbeContainer & GetAllProbes() const
Get a list of all FlowProbe's associated with this FlowMonitor.
FlowStatsContainer m_flowStats
FlowId --> FlowStats.
Definition: flow-monitor.h:278
bool m_enabled
FlowMon is enabled.
Definition: flow-monitor.h:291
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::vector< Ptr< FlowProbe > > FlowProbeContainer
Container: FlowProbe.
Definition: flow-monitor.h:224
double m_flowInterruptionsBinWidth
Flow interruptions bin width (for histograms)
Definition: flow-monitor.h:295
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:289
std::list< Ptr< FlowClassifier > > m_classifiers
the FlowClassifiers
Definition: flow-monitor.h:287
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:296
std::map< FlowId, FlowStats > FlowStatsContainer
Container: FlowId, FlowStats.
Definition: flow-monitor.h:218
double m_jitterBinWidth
Jitter bin width (for histograms)
Definition: flow-monitor.h:293
std::map< FlowId, FlowStats >::const_iterator FlowStatsContainerCI
Container Const Iterator: FlowId, FlowStats.
Definition: flow-monitor.h:222
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.
virtual void NotifyConstructionCompleted()
Notifier called once the ObjectBase is fully constructed.
double m_packetSizeBinWidth
packet size bin width (for histograms)
Definition: flow-monitor.h:294
Time m_maxPerHopDelay
Minimum per-hop delay.
Definition: flow-monitor.h:283
std::map< FlowId, FlowStats >::iterator FlowStatsContainerI
Container Iterator: FlowId, FlowStats.
Definition: flow-monitor.h:220
const FlowStatsContainer & GetFlowStats() const
Retrieve all collected the flow statistics.
TrackedPacketMap m_trackedPackets
Tracked packets.
Definition: flow-monitor.h:282
double m_delayBinWidth
Delay bin width (for histograms)
Definition: flow-monitor.h:292
void StartRightNow()
Begin monitoring flows right now
virtual void DoDispose(void)
Destructor implementation.
Definition: flow-monitor.cc:89
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:290
static TypeId GetTypeId()
Get the type ID.
Definition: flow-monitor.cc:37
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:57
void AddPacketDropStats(FlowId flowId, uint32_t packetSize, uint32_t reasonCode)
Add a packet drop data to the flow stats.
Definition: flow-probe.cc:66
void SetDefaultBinWidth(double binWidth)
Set the bin width.
Definition: histogram.cc:66
void AddValue(double value)
Add a value to the histogram.
Definition: histogram.cc:80
virtual void NotifyConstructionCompleted(void)
Notifier called once the ObjectBase is fully constructed.
Definition: object-base.cc:133
A base class which provides memory management and object aggregation.
Definition: object.h:88
virtual void DoDispose(void)
Destructor implementation.
Definition: object.cc:346
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
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 &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Definition: simulator.h:556
static Time Now(void)
Return the current simulation virtual time.
Definition: simulator.cc:195
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
double GetSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:379
@ S
second
Definition: nstime.h:114
TimeWithUnit As(const enum Unit unit=Time::AUTO) const
Attach a unit to a Time, to facilitate output in a specific unit.
Definition: time.cc:418
AttributeValue implementation for Time.
Definition: nstime.h:1308
a unique identifier for an interface.
Definition: type-id.h:59
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:922
#define ATTRIB(name)
#define PERIODIC_CHECK_INTERVAL
Definition: flow-monitor.cc:28
#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:67
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
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:1309
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:205
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
#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:265
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1244
def indent(source, debug, level)
Definition: check-style.py:432
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:522
#define list
Structure that represents the measured metrics of an individual packet flow.
Definition: flow-monitor.h:56
uint32_t rxPackets
Total number of received packets for the flow.
Definition: flow-monitor.h:100
Histogram packetSizeHistogram
Histogram of the packet sizes.
Definition: flow-monitor.h:118
Time timeLastTxPacket
Contains the absolute time when the last packet in the flow was transmitted, i.e.
Definition: flow-monitor.h:70
uint32_t lostPackets
Total number of packets that are assumed to be lost, i.e.
Definition: flow-monitor.h:107
Histogram jitterHistogram
Histogram of the packet jitters.
Definition: flow-monitor.h:116
Time lastDelay
Contains the last measured delay of a packet It is stored to measure the packet's Jitter.
Definition: flow-monitor.h:91
Time timeLastRxPacket
Contains the absolute time when the last packet in the flow was received, i.e.
Definition: flow-monitor.h:74
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:96
Time delaySum
Contains the sum of all end-to-end delays for all received packets of the flow.
Definition: flow-monitor.h:78
Time timeFirstRxPacket
Contains the absolute time when the first packet in the flow was received by an end node,...
Definition: flow-monitor.h:65
uint32_t timesForwarded
Contains the number of times a packet has been reportedly forwarded, summed for all received packets ...
Definition: flow-monitor.h:111
uint32_t txPackets
Total number of transmitted packets for the flow.
Definition: flow-monitor.h:98
uint64_t txBytes
Total number of transmitted bytes for the flow.
Definition: flow-monitor.h:94
Histogram delayHistogram
Histogram of the packet delays.
Definition: flow-monitor.h:114
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::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:60
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:271
Time lastSeenTime
absolute time when the packet was last seen by a probe
Definition: flow-monitor.h:273
Time firstSeenTime
absolute time when the packet was first seen by a probe
Definition: flow-monitor.h:272
uint32_t timesForwarded
number of times the packet was reportedly forwarded
Definition: flow-monitor.h:274
static const uint32_t packetSize