Loading...
Searching...
No Matches
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
26
27#include "ns3/address.h"
28#include "ns3/collector-map.h"
29#include "ns3/ptr.h"
30#include "ns3/satellite-enums.h"
31#include "ns3/satellite-phy-rx-carrier.h"
32
33#include <map>
34#include <string>
35#include <utility>
36
37namespace ns3
38{
39
40// BASE CLASS /////////////////////////////////////////////////////////////////
41
42class SatHelper;
43class Node;
44class DataCollectionObject;
45class Probe;
46
52{
53 public:
54 // inherited from SatStatsHelper base class
55 SatStatsPacketErrorHelper(Ptr<const SatHelper> satHelper);
56
61
65 static TypeId GetTypeId();
66
76 void ErrorRxCallback(uint32_t nPackets, const Address& fromOrTo, bool isError);
77
83 bool ConnectProbeToCollector(Ptr<Probe> probe, uint32_t identifier);
84
90 bool DisconnectProbeFromCollector(Ptr<Probe> probe, uint32_t identifier);
91
95 virtual void UpdateIdentifierOnProbes();
96
100 void SetTraceSourceName(std::string traceSourceName);
101
105 std::string GetTraceSourceName() const;
106
110 void SetChannelType(SatEnums::ChannelType_t channelType);
111
116
122 {
123 return m_carrierType;
124 }
125
126 protected:
127 // inherited from SatStatsHelper base class
128 void DoInstall();
129
135 {
136 m_carrierType = carrierType;
137 }
138
139 private:
145 void InstallProbeOnGw(Ptr<Node> gwNode);
146
152 void InstallProbeOnSatFeeder(Ptr<Node> satNode);
153
159 void InstallProbeOnSatUser(Ptr<Node> satNode);
160
166 void InstallProbeOnUt(Ptr<Node> utNode);
167
169 std::map<Ptr<Probe>, std::pair<Ptr<Node>, uint32_t>> m_probes;
170
173
175 Ptr<DataCollectionObject> m_aggregator;
176
178 std::string m_traceSourceName;
179
182
185
186}; // end of class SatStatsPacketErrorHelper
187
188// FORWARD FEEDER LINK DEDICATED ACCESS //////////////////////////////////////////////
189
207{
208 public:
209 // inherited from SatStatsPacketErrorHelper base class
210 SatStatsFwdFeederDaPacketErrorHelper(Ptr<const SatHelper> satHelper);
211
216
220 static TypeId GetTypeId();
221};
222
223// FORWARD USER LINK DEDICATED ACCESS //////////////////////////////////////////////
224
242{
243 public:
244 // inherited from SatStatsPacketErrorHelper base class
245 SatStatsFwdUserDaPacketErrorHelper(Ptr<const SatHelper> satHelper);
246
251
255 static TypeId GetTypeId();
256};
257
258// RETURN FEEDER LINK DEDICATED ACCESS ///////////////////////////////////////////////
259
277{
278 public:
279 // inherited from SatStatsPacketErrorHelper base class
280 SatStatsRtnFeederDaPacketErrorHelper(Ptr<const SatHelper> satHelper);
281
286
290 static TypeId GetTypeId();
291};
292
293// RETURN USER LINK DEDICATED ACCESS ///////////////////////////////////////////////
294
312{
313 public:
314 // inherited from SatStatsPacketErrorHelper base class
315 SatStatsRtnUserDaPacketErrorHelper(Ptr<const SatHelper> satHelper);
316
321
325 static TypeId GetTypeId();
326};
327
328// FEEDER SLOTTED ALOHA //////////////////////////////////////////////////////////////
329
348{
349 public:
350 // inherited from SatStatsPacketErrorHelper base class
351 SatStatsFeederSlottedAlohaPacketErrorHelper(Ptr<const SatHelper> satHelper);
352
357
361 static TypeId GetTypeId();
362};
363
364// USER SLOTTED ALOHA //////////////////////////////////////////////////////////////
365
384{
385 public:
386 // inherited from SatStatsPacketErrorHelper base class
387 SatStatsUserSlottedAlohaPacketErrorHelper(Ptr<const SatHelper> satHelper);
388
393
397 static TypeId GetTypeId();
398};
399
400// FEEDER CRDSA //////////////////////////////////////////////////////////////////////
401
419{
420 public:
421 // inherited from SatStatsPacketErrorHelper base class
422 SatStatsFeederCrdsaPacketErrorHelper(Ptr<const SatHelper> satHelper);
423
428
432 static TypeId GetTypeId();
433};
434
435// USER CRDSA //////////////////////////////////////////////////////////////////////
436
454{
455 public:
456 // inherited from SatStatsPacketErrorHelper base class
457 SatStatsUserCrdsaPacketErrorHelper(Ptr<const SatHelper> satHelper);
458
463
467 static TypeId GetTypeId();
468};
469
470// FEEDER E-SSA //////////////////////////////////////////////////////////////
471
489{
490 public:
491 // inherited from SatStatsPacketErrorHelper base class
492 SatStatsFeederEssaPacketErrorHelper(Ptr<const SatHelper> satHelper);
493
498
502 static TypeId GetTypeId();
503};
504
505// USER E-SSA //////////////////////////////////////////////////////////////
506
525{
526 public:
527 // inherited from SatStatsPacketErrorHelper base class
528 SatStatsUserEssaPacketErrorHelper(Ptr<const SatHelper> satHelper);
529
534
538 static TypeId GetTypeId();
539};
540
541} // end of namespace ns3
542
543#endif /* SATELLITE_STATS_PACKET_ERROR_HELPER_H */
ChannelType_t
Types of channel.
Build a satellite network set with needed objects and configuration.
CarrierType
Possible carrier types.
SatStatsFeederCrdsaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsFeederEssaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsFwdFeederDaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsFwdUserDaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsHelper(Ptr< const SatHelper > satHelper)
Creates a new helper instance.
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.
virtual void UpdateIdentifierOnProbes()
Change identifier used on probes, when handovers occur.
void InstallProbeOnGw(Ptr< Node > gwNode)
Set up several listeners on a GW node and connect them to the collectors.
std::map< Ptr< Probe >, std::pair< Ptr< Node >, uint32_t > > m_probes
Maintains a list of probes created by this helper (for forward link).
Ptr< DataCollectionObject > m_aggregator
The aggregator created by this helper.
SatPhyRxCarrier::CarrierType GetValidCarrierType() const
Get the valid carrier type.
bool DisconnectProbeFromCollector(Ptr< Probe > probe, uint32_t identifier)
Disconnect the probe from the right collector.
SatStatsPacketErrorHelper(Ptr< const SatHelper > satHelper)
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)
bool ConnectProbeToCollector(Ptr< Probe > probe, uint32_t identifier)
Connect the probe to the right collector.
SatPhyRxCarrier::CarrierType m_carrierType
Valid carrier type.
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.
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsRtnFeederDaPacketErrorHelper(Ptr< const SatHelper > satHelper)
SatStatsRtnUserDaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsUserCrdsaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
static TypeId GetTypeId()
inherited from ObjectBase base class
SatStatsUserEssaPacketErrorHelper(Ptr< const SatHelper > satHelper)
static TypeId GetTypeId()
inherited from ObjectBase base class
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.