satellite-stats-packet-collision-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_PACKET_COLLISION_HELPER_H
23 #define SATELLITE_STATS_PACKET_COLLISION_HELPER_H
24 
25 #include "satellite-stats-helper.h"
26 
27 #include <ns3/address.h>
28 #include <ns3/collector-map.h>
29 #include <ns3/ptr.h>
30 #include <ns3/satellite-phy-rx-carrier.h>
31 
32 #include <map>
33 #include <string>
34 
35 namespace ns3
36 {
37 
38 // BASE CLASS /////////////////////////////////////////////////////////////////
39 
40 class SatHelper;
41 class Node;
42 class DataCollectionObject;
43 
49 {
50  public:
51  // inherited from SatStatsHelper base class
52  SatStatsPacketCollisionHelper(Ptr<const SatHelper> satHelper);
53 
58 
62  static TypeId GetTypeId();
63 
71  void CollisionRxCallback(uint32_t nPackets, const Address& from, bool isCollided);
72 
76  std::string GetTraceSourceName() const;
77 
83  {
84  return m_carrierType;
85  }
86 
87  protected:
91  void SetTraceSourceName(std::string traceSourceName);
92 
98  {
99  m_carrierType = carrierType;
100  }
101 
103  CollectorMap m_terminalCollectors;
104 
105  private:
107 
108  std::string m_traceSourceName;
109 
110 }; // end of class SatStatsPacketCollisionHelper
111 
112 // BASE CLASS FEEDER /////////////////////////////////////////////////////////////////
113 
119 {
120  public:
121  // inherited from SatStatsPacketCollisionHelper base class
122  SatStatsFeederPacketCollisionHelper(Ptr<const SatHelper> satHelper);
123 
128 
132  static TypeId GetTypeId();
133 
134  protected:
135  // inherited from SatStatsHelper base class
136  void DoInstall();
137 
138  private:
140  Ptr<DataCollectionObject> m_aggregator;
141 
142 }; // end of class SatStatsFeederPacketCollisionHelper
143 
144 // BASE CLASS USER /////////////////////////////////////////////////////////////////
145 
151 {
152  public:
153  // inherited from SatStatsPacketCollisionHelper base class
154  SatStatsUserPacketCollisionHelper(Ptr<const SatHelper> satHelper);
155 
160 
164  static TypeId GetTypeId();
165 
166  protected:
167  // inherited from SatStatsHelper base class
168  void DoInstall();
169 
170  private:
172  Ptr<DataCollectionObject> m_aggregator;
173 
174 }; // end of class SatStatsUserPacketCollisionHelper
175 
176 // SLOTTED ALOHA FEEDER //////////////////////////////////////////////////////////////
177 
196 {
197  public:
198  // inherited from SatStatsFeederPacketCollisionHelper base class
199  SatStatsFeederSlottedAlohaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
200 
205 
209  static TypeId GetTypeId();
210 };
211 
212 // CRDSA FEEDER //////////////////////////////////////////////////////////////////////
213 
232 {
233  public:
234  // inherited from SatStatsFeederPacketCollisionHelper base class
235  SatStatsFeederCrdsaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
236 
241 
245  static TypeId GetTypeId();
246 };
247 
248 // E-SSA FEEDER //////////////////////////////////////////////////////////////
249 
267 {
268  public:
269  // inherited from SatStatsFeederPacketCollisionHelper base class
270  SatStatsFeederEssaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
271 
276 
280  static TypeId GetTypeId();
281 };
282 
283 // SLOTTED ALOHA USER //////////////////////////////////////////////////////////////
284 
303 {
304  public:
305  // inherited from SatStatsUserPacketCollisionHelper base class
306  SatStatsUserSlottedAlohaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
307 
312 
316  static TypeId GetTypeId();
317 };
318 
319 // CRDSA USER //////////////////////////////////////////////////////////////////////
320 
338 {
339  public:
340  // inherited from SatStatsUserPacketCollisionHelper base class
341  SatStatsUserCrdsaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
342 
347 
351  static TypeId GetTypeId();
352 };
353 
354 // E-SSA USER //////////////////////////////////////////////////////////////
355 
373 {
374  public:
375  // inherited from SatStatsUserPacketCollisionHelper base class
376  SatStatsUserEssaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
377 
382 
386  static TypeId GetTypeId();
387 };
388 
389 } // end of namespace ns3
390 
391 #endif /* SATELLITE_STATS_PACKET_COLLISION_HELPER_H */
CarrierType
Possible carrier types.
Produce packet collision statistics of Random Access CRDSA from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet collision statistics of Random Access E-SSA from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
static TypeId GetTypeId()
inherited from ObjectBase base class
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
Produce packet collision statistics of Random Access Slotted ALOHA from a satellite module simulation...
static TypeId GetTypeId()
inherited from ObjectBase base class
Parent abstract class of all satellite statistics helpers.
void CollisionRxCallback(uint32_t nPackets, const Address &from, bool isCollided)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
void SetValidCarrierType(SatPhyRxCarrier::CarrierType carrierType)
Set valid carrier type for this statistics helper type.
SatStatsPacketCollisionHelper(Ptr< const SatHelper > satHelper)
SatPhyRxCarrier::CarrierType GetValidCarrierType() const
Get the valid carrier type.
CollectorMap m_terminalCollectors
Maintains a list of collectors created by this helper.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet collision statistics of Random Access CRDSA from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet collision statistics of Random Access E-SSA from a satellite module simulation.
static TypeId GetTypeId()
inherited from ObjectBase base class
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet collision statistics of Random Access Slotted ALOHA from a satellite module simulation...
static TypeId GetTypeId()
inherited from ObjectBase base class
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.