satellite-stats-delay-helper.h
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Magister Solutions
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: Budiarto Herman <budiarto.herman@magister.fi>
19  *
20  */
21 
22 #ifndef SATELLITE_STATS_DELAY_HELPER_H
23 #define SATELLITE_STATS_DELAY_HELPER_H
24 
25 #include <ns3/address.h>
26 #include <ns3/collector-map.h>
27 #include <ns3/ptr.h>
28 #include <ns3/satellite-stats-helper.h>
29 
30 #include <list>
31 #include <map>
32 
33 namespace ns3
34 {
35 
36 // BASE CLASS /////////////////////////////////////////////////////////////////
37 
38 class SatHelper;
39 class Node;
40 class Time;
41 class DataCollectionObject;
42 class DistributionCollector;
43 
49 {
50  public:
51  // inherited from SatStatsHelper base class
52  SatStatsDelayHelper(Ptr<const SatHelper> satHelper);
53 
57  virtual ~SatStatsDelayHelper();
58 
62  static TypeId GetTypeId();
63 
67  void SetAveragingMode(bool averagingMode);
68 
72  bool GetAveragingMode() const;
73 
78  void InstallProbes();
79 
89  void RxDelayCallback(const Time& delay, const Address& from);
90 
91  protected:
92  // inherited from SatStatsHelper base class
93  void DoInstall();
94 
98  virtual void DoInstallProbes() = 0;
99 
110  void SaveAddressAndIdentifier(Ptr<Node> utNode);
111 
117  bool ConnectProbeToCollector(Ptr<Probe> probe, uint32_t identifier);
118 
125  void PassSampleToCollector(const Time& delay, uint32_t identifier);
126 
128  CollectorMap m_terminalCollectors;
129 
131  Ptr<DistributionCollector> m_averagingCollector;
132 
134  Ptr<DataCollectionObject> m_aggregator;
135 
137  std::map<const Address, uint32_t> m_identifierMap;
138 
139  private:
141 
142 }; // end of class SatStatsDelayHelper
143 
144 // FORWARD LINK APPLICATION-LEVEL /////////////////////////////////////////////
145 
146 class Probe;
147 
166 {
167  public:
168  // inherited from SatStatsHelper base class
169  SatStatsFwdAppDelayHelper(Ptr<const SatHelper> satHelper);
170 
174  virtual ~SatStatsFwdAppDelayHelper();
175 
179  static TypeId GetTypeId();
180 
190  static void RxCallback(Ptr<SatStatsFwdAppDelayHelper> helper,
191  uint32_t identifier,
192  Ptr<const Packet> packet,
193  const Address& from);
194 
195  protected:
196  // inherited from SatStatsDelayHelper base class
197  void DoInstallProbes();
198 
199  private:
201  std::list<Ptr<Probe>> m_probes;
202 
203 }; // end of class SatStatsFwdAppDelayHelper
204 
205 // FORWARD LINK DEVICE-LEVEL /////////////////////////////////////////////////////
206 
225 {
226  public:
227  // inherited from SatStatsHelper base class
228  SatStatsFwdDevDelayHelper(Ptr<const SatHelper> satHelper);
229 
233  virtual ~SatStatsFwdDevDelayHelper();
234 
238  static TypeId GetTypeId();
239 
240  protected:
241  // inherited from SatStatsDelayHelper base class
242  void DoInstallProbes();
243 
244  private:
246  std::list<Ptr<Probe>> m_probes;
247 
248 }; // end of class SatStatsFwdDevDelayHelper
249 
250 // FORWARD LINK MAC-LEVEL /////////////////////////////////////////////////////
251 
270 {
271  public:
272  // inherited from SatStatsHelper base class
273  SatStatsFwdMacDelayHelper(Ptr<const SatHelper> satHelper);
274 
278  virtual ~SatStatsFwdMacDelayHelper();
279 
283  static TypeId GetTypeId();
284 
285  protected:
286  // inherited from SatStatsDelayHelper base class
287  void DoInstallProbes();
288 
289  private:
291  std::list<Ptr<Probe>> m_probes;
292 
293 }; // end of class SatStatsFwdMacDelayHelper
294 
295 // FORWARD LINK PHY-LEVEL /////////////////////////////////////////////////////
296 
315 {
316  public:
317  // inherited from SatStatsHelper base class
318  SatStatsFwdPhyDelayHelper(Ptr<const SatHelper> satHelper);
319 
323  virtual ~SatStatsFwdPhyDelayHelper();
324 
328  static TypeId GetTypeId();
329 
330  protected:
331  // inherited from SatStatsDelayHelper base class
332  void DoInstallProbes();
333 
334  private:
336  std::list<Ptr<Probe>> m_probes;
337 
338 }; // end of class SatStatsFwdPhyDelayHelper
339 
340 // RETURN LINK APPLICATION-LEVEL //////////////////////////////////////////////
341 
360 {
361  public:
362  // inherited from SatStatsHelper base class
363  SatStatsRtnAppDelayHelper(Ptr<const SatHelper> satHelper);
364 
368  virtual ~SatStatsRtnAppDelayHelper();
369 
373  static TypeId GetTypeId();
374 
382  void RxCallback(Ptr<const Packet> packet, const Address& from);
383 
390  void Ipv4Callback(const Time& delay, const Address& from);
391 
392  protected:
393  // inherited from SatStatsDelayHelper base class
394  void DoInstallProbes();
395 
396  private:
405  void SaveIpv4AddressAndIdentifier(Ptr<Node> utUserNode);
406 
408 
409 }; // end of class SatStatsRtnAppDelayHelper
410 
411 // RETURN LINK DEVICE-LEVEL //////////////////////////////////////////////
412 
431 {
432  public:
433  // inherited from SatStatsHelper base class
434  SatStatsRtnDevDelayHelper(Ptr<const SatHelper> satHelper);
435 
439  virtual ~SatStatsRtnDevDelayHelper();
440 
444  static TypeId GetTypeId();
445 
446  protected:
447  // inherited from SatStatsDelayHelper base class
448  void DoInstallProbes();
449 
450 }; // end of class SatStatsRtnDevDelayHelper
451 
452 // RETURN LINK MAC-LEVEL //////////////////////////////////////////////
453 
472 {
473  public:
474  // inherited from SatStatsHelper base class
475  SatStatsRtnMacDelayHelper(Ptr<const SatHelper> satHelper);
476 
480  virtual ~SatStatsRtnMacDelayHelper();
481 
485  static TypeId GetTypeId();
486 
487  protected:
488  // inherited from SatStatsDelayHelper base class
489  void DoInstallProbes();
490 
491 }; // end of class SatStatsRtnMacDelayHelper
492 
493 // RETURN LINK PHY-LEVEL //////////////////////////////////////////////
494 
513 {
514  public:
515  // inherited from SatStatsHelper base class
516  SatStatsRtnPhyDelayHelper(Ptr<const SatHelper> satHelper);
517 
521  virtual ~SatStatsRtnPhyDelayHelper();
522 
526  static TypeId GetTypeId();
527 
528  protected:
529  // inherited from SatStatsDelayHelper base class
530  void DoInstallProbes();
531 
532 }; // end of class SatStatsRtnPhyDelayHelper
533 
534 } // end of namespace ns3
535 
536 #endif /* SATELLITE_STATS_DELAY_HELPER_H */
Base class for delay statistics helpers.
CollectorMap m_terminalCollectors
Maintains a list of collectors created by this helper.
void InstallProbes()
Set up several probes or other means of listeners and connect them to the collectors.
void SetAveragingMode(bool averagingMode)
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
void RxDelayCallback(const Time &delay, const Address &from)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
virtual void DoInstallProbes()=0
void PassSampleToCollector(const Time &delay, uint32_t identifier)
Find a collector with the right identifier and pass a sample data to it.
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it (for return link).
static TypeId GetTypeId()
inherited from ObjectBase base class
void SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
bool m_averagingMode
AveragingMode attribute.
Ptr< DistributionCollector > m_averagingCollector
The final collector utilized in averaged output (histogram, PDF, and CDF).
SatStatsDelayHelper(Ptr< const SatHelper > satHelper)
virtual ~SatStatsDelayHelper()
/ Destructor.
bool ConnectProbeToCollector(Ptr< Probe > probe, uint32_t identifier)
Connect the probe to the right collector.
Produce forward link application-level delay statistics from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
std::list< Ptr< Probe > > m_probes
Maintains a list of probes created by this helper.
static void RxCallback(Ptr< SatStatsFwdAppDelayHelper > helper, uint32_t identifier, Ptr< const Packet > packet, const Address &from)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
SatStatsFwdAppDelayHelper(Ptr< const SatHelper > satHelper)
virtual ~SatStatsFwdAppDelayHelper()
Destructor for SatStatsFwdAppDelayHelper.
Produce forward link device-level delay statistics from a satellite module simulation.
SatStatsFwdDevDelayHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
std::list< Ptr< Probe > > m_probes
Maintains a list of probes created by this helper.
Produce forward link MAC-level delay statistics from a satellite module simulation.
SatStatsFwdMacDelayHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
std::list< Ptr< Probe > > m_probes
Maintains a list of probes created by this helper.
Produce forward link PHY-level delay statistics from a satellite module simulation.
std::list< Ptr< Probe > > m_probes
Maintains a list of probes created by this helper.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsFwdPhyDelayHelper(Ptr< const SatHelper > satHelper)
Parent abstract class of all satellite statistics helpers.
Produce return link application-level delay statistics from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
void Ipv4Callback(const Time &delay, const Address &from)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
void RxCallback(Ptr< const Packet > packet, const Address &from)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
SatStatsRtnAppDelayHelper(Ptr< const SatHelper > satHelper)
void SaveIpv4AddressAndIdentifier(Ptr< Node > utUserNode)
Save the IPv4 address and the proper identifier from the given UT user node.
Produce return link device-level delay statistics from a satellite module simulation.
SatStatsRtnDevDelayHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce return link MAC-level delay statistics from a satellite module simulation.
SatStatsRtnMacDelayHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce return link PHY-level delay statistics from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnPhyDelayHelper(Ptr< const SatHelper > satHelper)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.