satellite-stats-satellite-queue-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: Bastien Tauran <bastien.tauran@viveris.fr>
19  *
20  */
21 
22 #ifndef SATELLITE_STATS_SAT_QUEUE_HELPER_H
23 #define SATELLITE_STATS_SAT_QUEUE_HELPER_H
24 
25 #include <ns3/callback.h>
26 #include <ns3/collector-map.h>
27 #include <ns3/ptr.h>
28 #include <ns3/satellite-stats-helper.h>
29 
30 namespace ns3
31 {
32 
33 // BASE CLASS /////////////////////////////////////////////////////////////////
34 
35 class SatHelper;
36 class Node;
37 class DataCollectionObject;
38 class DistributionCollector;
39 
45 {
46  public:
51  typedef enum
52  {
55  } UnitType_t;
56 
61  static std::string GetUnitTypeName(UnitType_t unitType);
62 
63  // inherited from SatStatsHelper base class
64  SatStatsSatelliteQueueHelper(Ptr<const SatHelper> satHelper);
65 
70 
74  static TypeId GetTypeId();
75 
79  void SetUnitType(UnitType_t unitType);
80 
84  void SetAveragingMode(bool averagingMode);
85 
90  void InstallProbes();
91 
97  void QueueSizeCallback(uint32_t size, const Address& addr);
98 
99  protected:
100  // inherited from SatStatsHelper base class
101  void DoInstall();
102 
106  virtual void DoInstallProbes() = 0;
107 
118  void SaveAddressAndIdentifier(Ptr<Node> utNode);
119 
125  bool ConnectProbeToCollector(Ptr<Probe> probe, uint32_t identifier);
126 
133  void PassSampleToCollector(uint32_t size, uint32_t identifier);
134 
136  CollectorMap m_terminalCollectors;
137 
139  Ptr<DataCollectionObject> m_collector;
140 
142  Ptr<DataCollectionObject> m_aggregator;
143 
145  Ptr<DistributionCollector> m_averagingCollector;
146 
148  std::map<const Address, uint32_t> m_identifierMap;
149 
150  private:
153  std::string m_shortLabel;
154  std::string m_longLabel;
155 
156 }; // end of class SatStatsLinkSinrHelper
157 
158 // RTN FEEDER QUEUE IN PACKETS ////////////////////////////////////////////////////////
159 
175 {
176  public:
177  // inherited from SatStatsHelper base class
178  SatStatsRtnFeederQueuePacketsHelper(Ptr<const SatHelper> satHelper);
179 
184 
188  static TypeId GetTypeId();
189 
190  protected:
191  // inherited from SatStatsLinkSinrHelper base class
192  void DoInstallProbes();
193 
194 }; // end of class SatStatsRtnFeederQueuePacketsHelper
195 
196 // RTN FEEDER QUEUE IN BYTES ////////////////////////////////////////////////////////
197 
214 {
215  public:
216  // inherited from SatStatsHelper base class
217  SatStatsRtnFeederQueueBytesHelper(Ptr<const SatHelper> satHelper);
218 
223 
227  static TypeId GetTypeId();
228 
229  protected:
230  // inherited from SatStatsLinkSinrHelper base class
231  void DoInstallProbes();
232 
233 }; // end of class SatStatsRtnFeederQueueBytesHelper
234 
235 // FWD USER QUEUE IN PACKETS ////////////////////////////////////////////////////////
236 
253 {
254  public:
255  // inherited from SatStatsHelper base class
256  SatStatsFwdUserQueuePacketsHelper(Ptr<const SatHelper> satHelper);
257 
262 
266  static TypeId GetTypeId();
267 
268  protected:
269  // inherited from SatStatsLinkSinrHelper base class
270  void DoInstallProbes();
271 
272 }; // end of class SatStatsFwdUserQueuePacketsHelper
273 
274 // FWD USER QUEUE IN BYTES ////////////////////////////////////////////////////////
275 
292 {
293  public:
294  // inherited from SatStatsHelper base class
295  SatStatsFwdUserQueueBytesHelper(Ptr<const SatHelper> satHelper);
296 
301 
305  static TypeId GetTypeId();
306 
307  protected:
308  // inherited from SatStatsLinkSinrHelper base class
309  void DoInstallProbes();
310 
311 }; // end of class SatStatsFwdUserQueueBytesHelper
312 
313 } // end of namespace ns3
314 
315 #endif /* SATELLITE_STATS_SAT_QUEUE_HELPER_H */
Produce queue size statistics in packets for return feeder link.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsFwdUserQueueBytesHelper(Ptr< const SatHelper > satHelper)
Produce queue size statistics in packets for return feeder link.
SatStatsFwdUserQueuePacketsHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Parent abstract class of all satellite statistics helpers.
Produce queue size statistics in packets for return feeder link.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnFeederQueueBytesHelper(Ptr< const SatHelper > satHelper)
Produce queue size statistics in packets for return feeder link.
static TypeId GetTypeId()
inherited from ObjectBase base class
Base class for sat queue statistics helpers.
SatStatsSatelliteQueueHelper(Ptr< const SatHelper > satHelper)
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
bool ConnectProbeToCollector(Ptr< Probe > probe, uint32_t identifier)
Connect the probe to the right collector.
void SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
Ptr< DataCollectionObject > m_collector
The collector created by this helper.
Ptr< DistributionCollector > m_averagingCollector
The final collector utilized in averaged output (histogram, PDF, and CDF).
void InstallProbes()
Set up several probes or other means of listeners and connect them to the collectors.
static TypeId GetTypeId()
inherited from ObjectBase base class
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it (for return link).
void QueueSizeCallback(uint32_t size, const Address &addr)
Receive inputs from trace sources and forward them to the collector.
CollectorMap m_terminalCollectors
Maintains a list of collectors created by this helper.
static std::string GetUnitTypeName(UnitType_t unitType)
void PassSampleToCollector(uint32_t size, 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.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.