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 <ns3/collector-map.h>
26 #include <ns3/nstime.h>
27 #include <ns3/ptr.h>
28 #include <ns3/satellite-stats-helper.h>
29 
30 #include <list>
31 #include <utility>
32 
33 namespace ns3
34 {
35 
36 // BASE CLASS /////////////////////////////////////////////////////////////////
37 
38 class SatHelper;
39 class Mac48Address;
40 class DataCollectionObject;
41 
47 {
48  public:
53  typedef enum
54  {
57  } UnitType_t;
58 
63  static std::string GetUnitTypeName(UnitType_t unitType);
64 
65  // inherited from SatStatsHelper base class
66  SatStatsQueueHelper(Ptr<const SatHelper> satHelper);
67 
71  virtual ~SatStatsQueueHelper();
72 
76  static TypeId GetTypeId();
77 
81  void SetPollInterval(Time pollInterval);
82 
86  Time GetPollInterval() const;
87 
91  void SetUnitType(UnitType_t unitType);
92 
96  UnitType_t GetUnitType() const;
97 
101  void EnlistSource();
102 
107  void Poll();
108 
109  protected:
110  // inherited from SatStatsHelper base class
111  void DoInstall();
112 
116  virtual void DoEnlistSource() = 0;
117 
122  virtual void DoPoll() = 0;
123 
128  void PushToCollector(uint32_t identifier, uint32_t value);
129 
131  CollectorMap m_terminalCollectors;
132 
134  Ptr<DataCollectionObject> m_aggregator;
135 
136  private:
139  std::string m_shortLabel;
140  std::string m_longLabel;
141 
142 }; // end of class SatStatsQueueHelper
143 
144 // FORWARD LINK ///////////////////////////////////////////////////////////////
145 
146 class SatLlc;
147 
153 {
154  public:
155  // inherited from SatStatsHelper base class
156  SatStatsFwdQueueHelper(Ptr<const SatHelper> satHelper);
157 
161  virtual ~SatStatsFwdQueueHelper();
162 
166  static TypeId GetTypeId();
167 
168  protected:
169  // inherited from SatStatsQueueHelper base class
170  void DoEnlistSource();
171  void DoPoll();
172 
173  private:
175  typedef std::list<std::pair<Mac48Address, uint32_t>> ListOfUt_t;
176 
178  std::list<std::pair<Ptr<SatLlc>, ListOfUt_t>> m_llc;
179 
180 }; // end of class SatStatsFwdQueueHelper
181 
187 {
188  public:
189  // inherited from SatStatsHelper base class
190  SatStatsFwdQueueBytesHelper(Ptr<const SatHelper> satHelper);
191 
196 
200  static TypeId GetTypeId();
201 
202 }; // end of class SatStatsFwdQueueBytesHelper
203 
209 {
210  public:
211  // inherited from SatStatsHelper base class
212  SatStatsFwdQueuePacketsHelper(Ptr<const SatHelper> satHelper);
213 
218 
222  static TypeId GetTypeId();
223 
224 }; // end of class SatStatsFwdQueuePacketsHelper
225 
226 // RETURN LINK ////////////////////////////////////////////////////////////////
227 
233 {
234  public:
235  // inherited from SatStatsHelper base class
236  SatStatsRtnQueueHelper(Ptr<const SatHelper> satHelper);
237 
241  virtual ~SatStatsRtnQueueHelper();
242 
246  static TypeId GetTypeId();
247 
248  protected:
249  // inherited from SatStatsQueueHelper base class
250  void DoEnlistSource();
251  void DoPoll();
252 
253  private:
255  std::list<std::pair<Ptr<SatLlc>, uint32_t>> m_llc;
256 
257 }; // end of class SatStatsRtnQueueHelper
258 
264 {
265  public:
266  // inherited from SatStatsHelper base class
267  SatStatsRtnQueueBytesHelper(Ptr<const SatHelper> satHelper);
268 
273 
277  static TypeId GetTypeId();
278 
279 }; // end of class SatStatsRtnQueueBytesHelper
280 
286 {
287  public:
288  // inherited from SatStatsHelper base class
289  SatStatsRtnQueuePacketsHelper(Ptr<const SatHelper> satHelper);
290 
295 
299  static TypeId GetTypeId();
300 
301 }; // end of class SatStatsRtnQueuePacketsHelper
302 
303 } // end of namespace ns3
304 
305 #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.