satellite-stats-packet-error-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_ERROR_HELPER_H
23 #define SATELLITE_STATS_PACKET_ERROR_HELPER_H
24 
25 #include <ns3/address.h>
26 #include <ns3/collector-map.h>
27 #include <ns3/ptr.h>
28 #include <ns3/satellite-enums.h>
29 #include <ns3/satellite-phy-rx-carrier.h>
30 #include <ns3/satellite-stats-helper.h>
31 
32 #include <map>
33 
34 namespace ns3
35 {
36 
37 // BASE CLASS /////////////////////////////////////////////////////////////////
38 
39 class SatHelper;
40 class Node;
41 class DataCollectionObject;
42 class Probe;
43 
49 {
50  public:
51  // inherited from SatStatsHelper base class
52  SatStatsPacketErrorHelper(Ptr<const SatHelper> satHelper);
53 
58 
62  static TypeId GetTypeId();
63 
73  void ErrorRxCallback(uint32_t nPackets, const Address& fromOrTo, bool isError);
74 
78  void SetTraceSourceName(std::string traceSourceName);
79 
83  std::string GetTraceSourceName() const;
84 
88  void SetChannelType(SatEnums::ChannelType_t channelType);
89 
94 
100  {
101  return m_carrierType;
102  }
103 
104  protected:
105  // inherited from SatStatsHelper base class
106  void DoInstall();
107 
113  {
114  m_carrierType = carrierType;
115  }
116 
117  private:
125  void SaveAddressAndIdentifier(Ptr<Node> utNode);
126 
132  void InstallProbeOnGw(Ptr<Node> gwNode);
133 
139  void InstallProbeOnSatFeeder(Ptr<Node> satNode);
140 
146  void InstallProbeOnSatUser(Ptr<Node> satNode);
147 
153  void InstallProbeOnUt(Ptr<Node> utNode);
154 
156  std::list<Ptr<Probe>> m_probes;
157 
159  CollectorMap m_terminalCollectors;
160 
162  Ptr<DataCollectionObject> m_aggregator;
163 
165  std::map<const Address, uint32_t> m_identifierMap;
166 
168  std::string m_traceSourceName;
169 
172 
175 
176 }; // end of class SatStatsPacketErrorHelper
177 
178 // FORWARD FEEDER LINK DEDICATED ACCESS //////////////////////////////////////////////
179 
197 {
198  public:
199  // inherited from SatStatsPacketErrorHelper base class
200  SatStatsFwdFeederDaPacketErrorHelper(Ptr<const SatHelper> satHelper);
201 
206 
210  static TypeId GetTypeId();
211 };
212 
213 // FORWARD USER LINK DEDICATED ACCESS //////////////////////////////////////////////
214 
232 {
233  public:
234  // inherited from SatStatsPacketErrorHelper base class
235  SatStatsFwdUserDaPacketErrorHelper(Ptr<const SatHelper> satHelper);
236 
241 
245  static TypeId GetTypeId();
246 };
247 
248 // RETURN FEEDER LINK DEDICATED ACCESS ///////////////////////////////////////////////
249 
267 {
268  public:
269  // inherited from SatStatsPacketErrorHelper base class
270  SatStatsRtnFeederDaPacketErrorHelper(Ptr<const SatHelper> satHelper);
271 
276 
280  static TypeId GetTypeId();
281 };
282 
283 // RETURN USER LINK DEDICATED ACCESS ///////////////////////////////////////////////
284 
302 {
303  public:
304  // inherited from SatStatsPacketErrorHelper base class
305  SatStatsRtnUserDaPacketErrorHelper(Ptr<const SatHelper> satHelper);
306 
311 
315  static TypeId GetTypeId();
316 };
317 
318 // FEEDER SLOTTED ALOHA //////////////////////////////////////////////////////////////
319 
338 {
339  public:
340  // inherited from SatStatsPacketErrorHelper base class
341  SatStatsFeederSlottedAlohaPacketErrorHelper(Ptr<const SatHelper> satHelper);
342 
347 
351  static TypeId GetTypeId();
352 };
353 
354 // USER SLOTTED ALOHA //////////////////////////////////////////////////////////////
355 
374 {
375  public:
376  // inherited from SatStatsPacketErrorHelper base class
377  SatStatsUserSlottedAlohaPacketErrorHelper(Ptr<const SatHelper> satHelper);
378 
383 
387  static TypeId GetTypeId();
388 };
389 
390 // FEEDER CRDSA //////////////////////////////////////////////////////////////////////
391 
409 {
410  public:
411  // inherited from SatStatsPacketErrorHelper base class
412  SatStatsFeederCrdsaPacketErrorHelper(Ptr<const SatHelper> satHelper);
413 
418 
422  static TypeId GetTypeId();
423 };
424 
425 // USER CRDSA //////////////////////////////////////////////////////////////////////
426 
444 {
445  public:
446  // inherited from SatStatsPacketErrorHelper base class
447  SatStatsUserCrdsaPacketErrorHelper(Ptr<const SatHelper> satHelper);
448 
453 
457  static TypeId GetTypeId();
458 };
459 
460 // FEEDER E-SSA //////////////////////////////////////////////////////////////
461 
479 {
480  public:
481  // inherited from SatStatsPacketErrorHelper base class
482  SatStatsFeederEssaPacketErrorHelper(Ptr<const SatHelper> satHelper);
483 
488 
492  static TypeId GetTypeId();
493 };
494 
495 // USER E-SSA //////////////////////////////////////////////////////////////
496 
515 {
516  public:
517  // inherited from SatStatsPacketErrorHelper base class
518  SatStatsUserEssaPacketErrorHelper(Ptr<const SatHelper> satHelper);
519 
524 
528  static TypeId GetTypeId();
529 };
530 
531 } // end of namespace ns3
532 
533 #endif /* SATELLITE_STATS_PACKET_ERROR_HELPER_H */
ChannelType_t
Types of channel.
CarrierType
Possible carrier types.
Produce packet error statistics of Random Access CRDSA on feeder link from a satellite module simulat...
SatStatsFeederCrdsaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet error statistics of Random Access E-SSA on feeder link from a satellite module simulat...
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsFeederEssaPacketErrorHelper(Ptr< const SatHelper > satHelper)
Produce packet error statistics of Random Access Slotted ALOHA on feeder link from a satellite module...
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet error statistics of Dedicated Access in forward feeder link from a satellite module si...
SatStatsFwdFeederDaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet error statistics of Dedicated Access in forward user link from a satellite module simu...
SatStatsFwdUserDaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Parent abstract class of all satellite statistics helpers.
Base class for packet error statistics helpers.
static TypeId GetTypeId()
inherited from ObjectBase base class
void DoInstall()
Install the probes, collectors, and aggregators necessary to produce the statistics output.
std::string m_traceSourceName
Name of trace source of PHY RX carrier to listen to.
SatEnums::ChannelType_t GetChannelType() const
void InstallProbeOnGw(Ptr< Node > gwNode)
Set up several listeners on a GW node and connect them to the collectors.
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
SatPhyRxCarrier::CarrierType GetValidCarrierType() const
Get the valid carrier type.
SatStatsPacketErrorHelper(Ptr< const SatHelper > satHelper)
void SaveAddressAndIdentifier(Ptr< Node > utNode)
Save the address and the proper identifier from the given UT node.
CollectorMap m_terminalCollectors
Maintains a list of collectors created by this helper.
void InstallProbeOnUt(Ptr< Node > utNode)
Set up several probes on a UT node and connect them to the collectors.
SatEnums::ChannelType_t m_channelType
Link where statistics are gathered from.
void InstallProbeOnSatUser(Ptr< Node > satNode)
Set up several listeners on a SAT user node and connect them to the collectors.
void SetChannelType(SatEnums::ChannelType_t channelType)
std::map< const Address, uint32_t > m_identifierMap
Map of address and the identifier associated with it (for return link).
SatPhyRxCarrier::CarrierType m_carrierType
Valid carrier type.
std::list< Ptr< Probe > > m_probes
Maintains a list of probes created by this helper (for forward link).
void SetValidCarrierType(SatPhyRxCarrier::CarrierType carrierType)
Set valid carrier type for this statistics helper type.
void SetTraceSourceName(std::string traceSourceName)
void ErrorRxCallback(uint32_t nPackets, const Address &fromOrTo, bool isError)
Receive inputs from trace sources and determine the right collector to forward the inputs to.
void InstallProbeOnSatFeeder(Ptr< Node > satNode)
Set up several listeners on a SAT feeder node and connect them to the collectors.
Produce packet error statistics of Dedicated Access in return feeder link from a satellite module sim...
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnFeederDaPacketErrorHelper(Ptr< const SatHelper > satHelper)
Produce packet error statistics of Dedicated Access in return user link from a satellite module simul...
SatStatsRtnUserDaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet error statistics of Random Access CRDSA on user link from a satellite module simulatio...
SatStatsUserCrdsaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
Produce packet error statistics of Random Access E-SSA on user link from a satellite module simulatio...
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsUserEssaPacketErrorHelper(Ptr< const SatHelper > satHelper)
Produce packet error statistics of Random Access Slotted ALOHA on user link from a satellite module s...
static TypeId GetTypeId()
inherited from ObjectBase base class
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.