satellite-phy-rx-carrier-conf.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Magister Solutions Ltd.
4  * Copyright (c) 2018 CNES
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Author: Jani Puttonen <jani.puttonen@magister.fi>
20  * Author: Mathias Ettinger <mettinger@toulouse.viveris.fr>
21  */
22 
24 
26 #include "satellite-utils.h"
27 
28 #include <ns3/boolean.h>
29 #include <ns3/double.h>
30 #include <ns3/enum.h>
31 #include <ns3/log.h>
32 #include <ns3/uinteger.h>
33 
34 NS_LOG_COMPONENT_DEFINE("SatPhyRxCarrierConf");
35 
36 namespace ns3
37 {
38 
39 NS_OBJECT_ENSURE_REGISTERED(SatPhyRxCarrierConf);
40 
42  : m_daIfModel(),
43  m_raIfModel(),
44  m_raIfEliminateModel(),
45  m_errorModel(),
46  m_daConstantErrorRate(0.0),
47  m_rxTemperatureK(),
48  m_rxAciIfWrtNoiseFactor(),
49  m_rxMode(),
50  m_carrierCount(),
51  m_carrierBandwidthConverter(),
52  m_channelType(),
53  m_linkRegenerationMode(),
54  m_channelEstimationError(),
55  m_additionalInterferenceCallback(),
56  m_linkResults(),
57  m_rxExtNoiseDensityWhz(0),
58  m_enableIntfOutputTrace(false),
59  m_randomAccessAverageNormalizedOfferedLoadMeasurementWindowSize(10),
60  m_raCollisionModel(RA_COLLISION_NOT_DEFINED),
61  m_raConstantErrorRate(0.0),
62  m_enableRandomAccessDynamicLoadControl(true),
63  m_randomAccessModel()
64 {
65  NS_FATAL_ERROR("SatPhyRxCarrierConf::SatPhyRxCarrierConf - Constructor not in use");
66 }
67 
69  : m_daIfModel(createParams.m_daIfModel),
70  m_raIfModel(createParams.m_raIfModel),
71  m_raIfEliminateModel(createParams.m_raIfEliminateModel),
72  m_errorModel(createParams.m_errorModel),
73  m_daConstantErrorRate(createParams.m_daConstantErrorRate),
74  m_rxTemperatureK(createParams.m_rxTemperatureK),
75  m_rxAciIfWrtNoiseFactor(createParams.m_aciIfWrtNoiseFactor),
76  m_rxMode(createParams.m_rxMode),
77  m_carrierCount(createParams.m_carrierCount),
78  m_carrierBandwidthConverter(createParams.m_bwConverter),
79  m_channelType(createParams.m_chType),
80  m_linkRegenerationMode(createParams.m_linkRegenerationMode),
81  m_channelEstimationError(createParams.m_cec),
82  m_additionalInterferenceCallback(),
83  m_linkResults(),
84  m_rxExtNoiseDensityWhz(createParams.m_extNoiseDensityWhz),
85  m_enableIntfOutputTrace(false),
86  m_randomAccessAverageNormalizedOfferedLoadMeasurementWindowSize(10),
87  m_raCollisionModel(createParams.m_raCollisionModel),
88  m_raConstantErrorRate(createParams.m_raConstantErrorRate),
89  m_enableRandomAccessDynamicLoadControl(true),
90  m_randomAccessModel(createParams.m_randomAccessModel)
91 {
92  NS_LOG_FUNCTION(this);
93 }
94 
95 TypeId
97 {
98  static TypeId tid =
99  TypeId("ns3::SatPhyRxCarrierConf")
100  .SetParent<Object>()
101  .AddAttribute("EnableIntfOutputTrace",
102  "Enable interference output trace.",
103  BooleanValue(false),
104  MakeBooleanAccessor(&SatPhyRxCarrierConf::m_enableIntfOutputTrace),
105  MakeBooleanChecker())
106  .AddAttribute("RandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize",
107  "Random access average normalized offered load measurement window size",
108  UintegerValue(10),
109  MakeUintegerAccessor(
112  MakeUintegerChecker<uint32_t>())
113  .AddAttribute(
114  "EnableRandomAccessDynamicLoadControl",
115  "Enable random access dynamic load control.",
116  BooleanValue(true),
118  MakeBooleanChecker())
119  .AddConstructor<SatPhyRxCarrierConf>();
120  return tid;
121 }
122 
123 void
125 {
126  NS_LOG_FUNCTION(this);
127 
128  m_linkResults = NULL;
129  m_carrierBandwidthConverter.Nullify();
131 
132  Object::DoDispose();
133 }
134 
135 void
136 SatPhyRxCarrierConf::SetLinkResults(Ptr<SatLinkResults> linkResults)
137 {
138  m_linkResults = linkResults;
139 }
140 
141 uint32_t
143 {
144  return m_carrierCount;
145 }
146 
149 {
150  return m_errorModel;
151 }
152 
153 double
155 {
156  return m_daConstantErrorRate;
157 }
158 
160 SatPhyRxCarrierConf::GetInterferenceModel(bool isRandomAccessCarrier) const
161 {
162  if (isRandomAccessCarrier)
163  {
164  return m_raIfModel;
165  }
166  else
167  {
168  return m_daIfModel;
169  }
170 }
171 
174 {
175  if (isRandomAccessCarrier)
176  {
177  return m_raIfEliminateModel;
178  }
179  else
180  {
182  }
183 }
184 
185 Ptr<SatLinkResults>
187 {
188  return m_linkResults;
189 }
190 
191 double
193  SatEnums::CarrierBandwidthType_t bandwidthType) const
194 {
195  return m_carrierBandwidthConverter(m_channelType, carrierId, bandwidthType);
196 }
197 
198 double
200 {
201  return m_rxTemperatureK;
202 }
203 
204 double
206 {
207  return m_rxExtNoiseDensityWhz;
208 }
209 
210 double
212 {
214 }
215 
218 {
219  return m_rxMode;
220 }
221 
224 {
225  return m_channelType;
226 }
227 
230 {
231  return m_linkRegenerationMode;
232 }
233 
234 bool
236 {
238 }
239 
240 Ptr<SatChannelEstimationErrorContainer>
242 {
244 }
245 
248 {
250  {
251  return m_raCollisionModel;
252  }
253  else
254  {
256  }
257 }
258 
259 double
261 {
262  return m_raConstantErrorRate;
263 }
264 
265 uint32_t
267 {
269 }
270 
271 bool
273 {
275 }
276 
277 } // namespace ns3
ChannelType_t
Types of channel.
CarrierBandwidthType_t
Types of bandwidth.
RegenerationMode_t
The regeneration mode used in satellites.
Information of beam users liken UTs and their users.
SatEnums::ChannelType_t GetChannelType() const
Get channel type.
static TypeId GetTypeId(void)
Get the type ID.
double GetRandomAccessConstantErrorRate() const
Get random access constant error rate.
ErrorModel GetErrorModel() const
Get configured error model.
AdditionalInterferenceCallback m_additionalInterferenceCallback
SatPhyRxCarrierConf()
Constructor for SatPhyRxCarrierConf.
bool IsRandomAccessDynamicLoadControlEnabled() const
Function for checking if random access dynamic load control is enabled.
InterferenceEliminationModel
Interference cancelation model enum.
double GetCarrierBandwidthHz(uint32_t carrierId, SatEnums::CarrierBandwidthType_t bandwidthType) const
Get configured bandwidth.
uint32_t GetCarrierCount() const
Get the number of configured carriers.
uint32_t m_randomAccessAverageNormalizedOfferedLoadMeasurementWindowSize
SatEnums::RegenerationMode_t GetLinkRegenerationMode() const
Get link regeneration mode.
RandomAccessCollisionModel m_raCollisionModel
double GetConstantDaErrorRate() const
Get constant error rate for dedicated access.
RandomAccessCollisionModel
Random access collision model enum.
void SetLinkResults(Ptr< SatLinkResults > linkResults)
Set link results for the carrier configuration, either DVB-RCS2 or DVB-S2.
uint32_t GetRandomAccessAverageNormalizedOfferedLoadMeasurementWindowSize() const
Get random access average normalized offered load measurement window size.
SatEnums::RegenerationMode_t m_linkRegenerationMode
double GetRxAciInterferenceWrtNoiseFactor() const
Get adjacent channel interference wrt noise (factor)
InterferenceEliminationModel m_raIfEliminateModel
RandomAccessCollisionModel GetRandomAccessCollisionModel() const
Get random access collision model.
RxMode GetRxMode() const
Get configured RX mode.
double GetRxTemperatureK() const
Get configured RX noise temperature.
Ptr< SatLinkResults > GetLinkResults() const
Get configured link results.
SatTypedefs::CarrierBandwidthConverter_t m_carrierBandwidthConverter
Ptr< SatChannelEstimationErrorContainer > GetChannelEstimatorErrorContainer() const
Get channel estimator container.
InterferenceModel
Interference model enum.
double GetExtPowerDensityWhz() const
Get other system RX noise.
bool IsIntfOutputTraceEnabled() const
Is interference output trace enabled.
InterferenceModel GetInterferenceModel(bool isRandomAccessCarrier) const
Get configured interference model.
InterferenceEliminationModel GetInterferenceEliminationModel(bool isRandomAccessCarrier) const
Get configured interference cancelation model.
virtual void DoDispose()
Dispose function.
Ptr< SatChannelEstimationErrorContainer > m_channelEstimationError
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Struct for storing the information for SatPhyRxCarrierConf.