satellite-stats-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: Budiarto Herman <budiarto.herman@magister.fi>
19  *
20  */
21 
22 #ifndef SATELLITE_STATS_QUEUE_HELPER_H
23 #define SATELLITE_STATS_QUEUE_HELPER_H
24 
25 #include "satellite-stats-helper.h"
26 
27 #include <ns3/collector-map.h>
28 #include <ns3/nstime.h>
29 #include <ns3/ptr.h>
30 
31 #include <list>
32 #include <string>
33 #include <utility>
34 
35 namespace ns3
36 {
37 
38 // BASE CLASS /////////////////////////////////////////////////////////////////
39 
40 class SatHelper;
41 class Mac48Address;
42 class DataCollectionObject;
43 
49 {
50  public:
55  typedef enum
56  {
59  } UnitType_t;
60 
65  static std::string GetUnitTypeName(UnitType_t unitType);
66 
67  // inherited from SatStatsHelper base class
68  SatStatsQueueHelper(Ptr<const SatHelper> satHelper);
69 
73  virtual ~SatStatsQueueHelper();
74 
78  static TypeId GetTypeId();
79 
83  void SetPollInterval(Time pollInterval);
84 
88  Time GetPollInterval() const;
89 
93  void SetUnitType(UnitType_t unitType);
94 
98  UnitType_t GetUnitType() const;
99 
103  void EnlistSource();
104 
109  void Poll();
110 
111  protected:
112  // inherited from SatStatsHelper base class
113  void DoInstall();
114 
118  virtual void DoEnlistSource() = 0;
119 
124  virtual void DoPoll() = 0;
125 
130  void PushToCollector(uint32_t identifier, uint32_t value);
131 
133  CollectorMap m_terminalCollectors;
134 
136  Ptr<DataCollectionObject> m_aggregator;
137 
138  private:
141  std::string m_shortLabel;
142  std::string m_longLabel;
143 
144 }; // end of class SatStatsQueueHelper
145 
146 // FORWARD LINK ///////////////////////////////////////////////////////////////
147 
148 class SatLlc;
149 
155 {
156  public:
157  // inherited from SatStatsHelper base class
158  SatStatsFwdQueueHelper(Ptr<const SatHelper> satHelper);
159 
163  virtual ~SatStatsFwdQueueHelper();
164 
168  static TypeId GetTypeId();
169 
170  protected:
171  // inherited from SatStatsQueueHelper base class
172  void DoEnlistSource();
173  void DoPoll();
174 
175  private:
177  typedef std::list<std::pair<Mac48Address, uint32_t>> ListOfUt_t;
178 
180  std::list<std::pair<Ptr<SatLlc>, ListOfUt_t>> m_llc;
181 
182 }; // end of class SatStatsFwdQueueHelper
183 
189 {
190  public:
191  // inherited from SatStatsHelper base class
192  SatStatsFwdQueueBytesHelper(Ptr<const SatHelper> satHelper);
193 
198 
202  static TypeId GetTypeId();
203 
204 }; // end of class SatStatsFwdQueueBytesHelper
205 
211 {
212  public:
213  // inherited from SatStatsHelper base class
214  SatStatsFwdQueuePacketsHelper(Ptr<const SatHelper> satHelper);
215 
220 
224  static TypeId GetTypeId();
225 
226 }; // end of class SatStatsFwdQueuePacketsHelper
227 
228 // RETURN LINK ////////////////////////////////////////////////////////////////
229 
235 {
236  public:
237  // inherited from SatStatsHelper base class
238  SatStatsRtnQueueHelper(Ptr<const SatHelper> satHelper);
239 
243  virtual ~SatStatsRtnQueueHelper();
244 
248  static TypeId GetTypeId();
249 
250  protected:
251  // inherited from SatStatsQueueHelper base class
252  void DoEnlistSource();
253  void DoPoll();
254 
255  private:
257  std::list<std::pair<Ptr<SatLlc>, uint32_t>> m_llc;
258 
259 }; // end of class SatStatsRtnQueueHelper
260 
266 {
267  public:
268  // inherited from SatStatsHelper base class
269  SatStatsRtnQueueBytesHelper(Ptr<const SatHelper> satHelper);
270 
275 
279  static TypeId GetTypeId();
280 
281 }; // end of class SatStatsRtnQueueBytesHelper
282 
288 {
289  public:
290  // inherited from SatStatsHelper base class
291  SatStatsRtnQueuePacketsHelper(Ptr<const SatHelper> satHelper);
292 
297 
301  static TypeId GetTypeId();
302 
303 }; // end of class SatStatsRtnQueuePacketsHelper
304 
305 } // end of namespace ns3
306 
307 #endif /* SATELLITE_STATS_QUEUE_HELPER_H */
SatLlc base class holds the UT specific SatBaseEncapsulator instances, which are responsible of fragm...
Helper for forward link queue statistics using byte as unit.
SatStatsFwdQueueBytesHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Helper for forward link queue statistics.
SatStatsFwdQueueHelper(Ptr< const SatHelper > satHelper)
void DoPoll()
Retrieve the queue size of every relevant encapsulator and push the values to the right collectors.
virtual ~SatStatsFwdQueueHelper()
/ Destructor.
std::list< std::pair< Mac48Address, uint32_t > > ListOfUt_t
std::list< std::pair< Ptr< SatLlc >, ListOfUt_t > > m_llc
Maintains a list of GW LLC, its UT address, and its identifier.
static TypeId GetTypeId()
inherited from ObjectBase base class
Helper for forward link queue statistics using packet as unit.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsFwdQueuePacketsHelper(Ptr< const SatHelper > satHelper)
Parent abstract class of all satellite statistics helpers.
Helper for queue statistics.
static std::string GetUnitTypeName(UnitType_t unitType)
virtual void DoEnlistSource()=0
CollectorMap m_terminalCollectors
Maintains a list of collectors created by this helper.
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
void Poll()
Retrieve the queue size of every relevant encapsulator and push the values to the right collectors.
virtual ~SatStatsQueueHelper()
/ Destructor.
void EnlistSource()
Identify the list of source of queue events.
void SetPollInterval(Time pollInterval)
void PushToCollector(uint32_t identifier, uint32_t value)
static TypeId GetTypeId()
inherited from ObjectBase base class
void SetUnitType(UnitType_t unitType)
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
SatStatsQueueHelper(Ptr< const SatHelper > satHelper)
Time m_pollInterval
PollInterval attribute.
virtual void DoPoll()=0
Retrieve the queue size of every relevant encapsulator and push the values to the right collectors.
Helper for return link queue statistics using byte as unit.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnQueueBytesHelper(Ptr< const SatHelper > satHelper)
Helper for return link queue statistics.
virtual ~SatStatsRtnQueueHelper()
/ Destructor.
std::list< std::pair< Ptr< SatLlc >, uint32_t > > m_llc
Maintains a list of UT LLC and its identifier.
SatStatsRtnQueueHelper(Ptr< const SatHelper > satHelper)
void DoPoll()
Retrieve the queue size of every relevant encapsulator and push the values to the right collectors.
static TypeId GetTypeId()
inherited from ObjectBase base class
Helper for return link queue statistics using packet as unit.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnQueuePacketsHelper(Ptr< const SatHelper > satHelper)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.