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 <ns3/address.h>
26 #include <ns3/collector-map.h>
27 #include <ns3/ptr.h>
28 #include <ns3/satellite-phy-rx-carrier.h>
29 #include <ns3/satellite-stats-helper.h>
30 
31 #include <map>
32 
33 namespace ns3
34 {
35 
36 // BASE CLASS /////////////////////////////////////////////////////////////////
37 
38 class SatHelper;
39 class Node;
40 class DataCollectionObject;
41 
47 {
48  public:
49  // inherited from SatStatsHelper base class
50  SatStatsPacketCollisionHelper(Ptr<const SatHelper> satHelper);
51 
56 
60  static TypeId GetTypeId();
61 
69  void CollisionRxCallback(uint32_t nPackets, const Address& from, bool isCollided);
70 
74  std::string GetTraceSourceName() const;
75 
81  {
82  return m_carrierType;
83  }
84 
85  protected:
93  void SaveAddressAndIdentifier(Ptr<Node> utNode);
94 
98  void SetTraceSourceName(std::string traceSourceName);
99 
105  {
106  m_carrierType = carrierType;
107  }
108 
110  CollectorMap m_terminalCollectors;
111 
113  std::map<const Address, uint32_t> m_identifierMap;
114 
115  private:
117 
118  std::string m_traceSourceName;
119 
120 }; // end of class SatStatsPacketCollisionHelper
121 
122 // BASE CLASS FEEDER /////////////////////////////////////////////////////////////////
123 
129 {
130  public:
131  // inherited from SatStatsPacketCollisionHelper base class
132  SatStatsFeederPacketCollisionHelper(Ptr<const SatHelper> satHelper);
133 
138 
142  static TypeId GetTypeId();
143 
144  protected:
145  // inherited from SatStatsHelper base class
146  void DoInstall();
147 
148  private:
150  Ptr<DataCollectionObject> m_aggregator;
151 
152 }; // end of class SatStatsFeederPacketCollisionHelper
153 
154 // BASE CLASS USER /////////////////////////////////////////////////////////////////
155 
161 {
162  public:
163  // inherited from SatStatsPacketCollisionHelper base class
164  SatStatsUserPacketCollisionHelper(Ptr<const SatHelper> satHelper);
165 
170 
174  static TypeId GetTypeId();
175 
176  protected:
177  // inherited from SatStatsHelper base class
178  void DoInstall();
179 
180  private:
182  Ptr<DataCollectionObject> m_aggregator;
183 
184 }; // end of class SatStatsUserPacketCollisionHelper
185 
186 // SLOTTED ALOHA FEEDER //////////////////////////////////////////////////////////////
187 
206 {
207  public:
208  // inherited from SatStatsFeederPacketCollisionHelper base class
209  SatStatsFeederSlottedAlohaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
210 
215 
219  static TypeId GetTypeId();
220 };
221 
222 // CRDSA FEEDER //////////////////////////////////////////////////////////////////////
223 
242 {
243  public:
244  // inherited from SatStatsFeederPacketCollisionHelper base class
245  SatStatsFeederCrdsaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
246 
251 
255  static TypeId GetTypeId();
256 };
257 
258 // E-SSA FEEDER //////////////////////////////////////////////////////////////
259 
277 {
278  public:
279  // inherited from SatStatsFeederPacketCollisionHelper base class
280  SatStatsFeederEssaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
281 
286 
290  static TypeId GetTypeId();
291 };
292 
293 // SLOTTED ALOHA USER //////////////////////////////////////////////////////////////
294 
313 {
314  public:
315  // inherited from SatStatsUserPacketCollisionHelper base class
316  SatStatsUserSlottedAlohaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
317 
322 
326  static TypeId GetTypeId();
327 };
328 
329 // CRDSA USER //////////////////////////////////////////////////////////////////////
330 
348 {
349  public:
350  // inherited from SatStatsUserPacketCollisionHelper base class
351  SatStatsUserCrdsaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
352 
357 
361  static TypeId GetTypeId();
362 };
363 
364 // E-SSA USER //////////////////////////////////////////////////////////////
365 
383 {
384  public:
385  // inherited from SatStatsUserPacketCollisionHelper base class
386  SatStatsUserEssaPacketCollisionHelper(Ptr<const SatHelper> satHelper);
387 
392 
396  static TypeId GetTypeId();
397 };
398 
399 } // end of namespace ns3
400 
401 #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 SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
void SetValidCarrierType(SatPhyRxCarrier::CarrierType carrierType)
Set valid carrier type for this statistics helper type.
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it (for forward link).
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.