satellite-gw-helper.h
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: Sami Rantanen <sami.rantanen@magister.fi>
20  * Author: Mathias Ettinger <mettinger@viveris.toulouse.fr>
21  */
22 
23 #ifndef SATELLITE_GW_HELPER_H
24 #define SATELLITE_GW_HELPER_H
25 
26 #include <ns3/net-device-container.h>
27 #include <ns3/node-container.h>
28 #include <ns3/object-factory.h>
29 #include <ns3/satellite-bbframe-conf.h>
30 #include <ns3/satellite-channel.h>
31 #include <ns3/satellite-link-results.h>
32 #include <ns3/satellite-mac.h>
33 #include <ns3/satellite-ncc.h>
34 #include <ns3/satellite-superframe-sequence.h>
35 #include <ns3/satellite-typedefs.h>
36 #include <ns3/traced-callback.h>
37 
38 #include <string>
39 
40 namespace ns3
41 {
42 
43 class OutputStreamWrapper;
44 
50 class SatGwHelper : public Object
51 {
52  public:
56  typedef struct
57  {
64 
69  static TypeId GetTypeId(void);
70  TypeId GetInstanceTypeId(void) const;
71 
75  SatGwHelper();
80  SatGwHelper(SatTypedefs::CarrierBandwidthConverter_t carrierBandwidthConverter,
81  uint32_t fwdLinkCarrierCount,
82  Ptr<SatSuperframeSeq> seq,
86  RandomAccessSettings_s randomAccessSettings);
87 
88  virtual ~SatGwHelper()
89  {
90  }
91 
92  /*
93  * Initializes the GW helper based on attributes
94  * \param lrRcs2 return link results
95  * \param lrFwd DVB-S2 or DVB-S2X link results
96  * \param dvbVersion The DVB version chosen
97  * \param useScpc Use SCPC on return feeder (and then lrFwd link results)
98  */
99  void Initialize(Ptr<SatLinkResultsRtn> lrRcs2,
100  Ptr<SatLinkResultsFwd> lrFwd,
101  SatEnums::DvbVersion_t dvbVersion,
102  bool useScpc);
103 
109  Ptr<SatBbFrameConf> GetBbFrameConf() const;
110 
121  void SetDeviceAttribute(std::string name, const AttributeValue& value);
122 
133  void SetChannelAttribute(std::string name, const AttributeValue& value);
134 
144  void SetPhyAttribute(std::string name, const AttributeValue& value);
145 
164  NetDeviceContainer InstallDvb(NodeContainer c,
165  uint32_t gwId,
166  uint32_t satId,
167  uint32_t beamId,
168  Ptr<SatChannel> fCh,
169  Ptr<SatChannel> rCh,
170  Ptr<SatNcc> ncc,
171  Ptr<SatLowerLayerServiceConf> llsConf,
172  SatEnums::RegenerationMode_t forwardLinkRegenerationMode,
173  SatEnums::RegenerationMode_t returnLinkRegenerationMode);
174 
188  Ptr<NetDevice> InstallDvb(Ptr<Node> n,
189  uint32_t gwId,
190  uint32_t satId,
191  uint32_t beamId,
192  Ptr<SatChannel> fCh,
193  Ptr<SatChannel> rCh,
194  Ptr<SatNcc> ncc,
195  Ptr<SatLowerLayerServiceConf> llsConf,
196  SatEnums::RegenerationMode_t forwardLinkRegenerationMode,
197  SatEnums::RegenerationMode_t returnLinkRegenerationMode);
198 
217  NetDeviceContainer InstallLora(NodeContainer c,
218  uint32_t gwId,
219  uint32_t satId,
220  uint32_t beamId,
221  Ptr<SatChannel> fCh,
222  Ptr<SatChannel> rCh,
223  Ptr<SatNcc> ncc,
224  Ptr<SatLowerLayerServiceConf> llsConf,
225  SatEnums::RegenerationMode_t forwardLinkRegenerationMode,
226  SatEnums::RegenerationMode_t returnLinkRegenerationMode);
227 
241  Ptr<NetDevice> InstallLora(Ptr<Node> n,
242  uint32_t gwId,
243  uint32_t satId,
244  uint32_t beamId,
245  Ptr<SatChannel> fCh,
246  Ptr<SatChannel> rCh,
247  Ptr<SatNcc> ncc,
248  Ptr<SatLowerLayerServiceConf> llsConf,
249  SatEnums::RegenerationMode_t forwardLinkRegenerationMode,
250  SatEnums::RegenerationMode_t returnLinkRegenerationMode);
251 
257  void EnableCreationTraces(Ptr<OutputStreamWrapper> stream, CallbackBase& cb);
258 
259  private:
262  Ptr<SatSuperframeSeq> m_superframeSeq;
263 
264  Ptr<SatBbFrameConf> m_bbFrameConf;
265 
266  // The control message container callbacks
270 
271  ObjectFactory m_channelFactory;
272  ObjectFactory m_deviceFactory;
273 
274  /*
275  * Configured dedicated access interference model for the return link. Set as an attribute.
276  */
278 
279  /*
280  * Configured error model for the return link. Set as an attribute.
281  */
283 
284  /*
285  * Constant error rate for dedicated access in the RTN link.
286  */
288 
289  /*
290  * Return channel link results (DVB-RCS2) are created if ErrorModel
291  * is configured to be AVI. Note, that only one instance of the
292  * link results is needed for all GWs.
293  */
294  Ptr<SatLinkResults> m_linkResults;
295 
299  TracedCallback<std::string> m_creationTrace;
300 
301  double m_symbolRate;
302 
308 
313 
318 };
319 
320 } // namespace ns3
321 
322 #endif /* SATELLITE_GW_HELPER_H */
FwdSchedulingAlgorithm_t
The scheduling algorithm used to fill the BBFrames.
RandomAccessModel_t
The defined random access models.
RegenerationMode_t
The regeneration mode used in satellites.
DvbVersion_t
The scheduling algorithm used to fill the BBFrames.
Creates needed objects for GW nodes like SatGeoNetDevice objects.
Ptr< SatSuperframeSeq > m_superframeSeq
SatPhy::ErrorModel m_errorModel
ObjectFactory m_channelFactory
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
void Initialize(Ptr< SatLinkResultsRtn > lrRcs2, Ptr< SatLinkResultsFwd > lrFwd, SatEnums::DvbVersion_t dvbVersion, bool useScpc)
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void SetPhyAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Phy created by the helper.
static TypeId GetTypeId(void)
Get the type ID.
SatMac::SendCtrlMsgCallback m_sendCtrlCb
RandomAccessSettings_s m_raSettings
The used random access model settings.
TracedCallback< std::string > m_creationTrace
Trace callback for creation traces.
NetDeviceContainer InstallDvb(NodeContainer c, uint32_t gwId, uint32_t satId, uint32_t beamId, Ptr< SatChannel > fCh, Ptr< SatChannel > rCh, Ptr< SatNcc > ncc, Ptr< SatLowerLayerServiceConf > llsConf, SatEnums::RegenerationMode_t forwardLinkRegenerationMode, SatEnums::RegenerationMode_t returnLinkRegenerationMode)
void EnableCreationTraces(Ptr< OutputStreamWrapper > stream, CallbackBase &cb)
Enables creation traces to be written in given file.
SatEnums::FwdSchedulingAlgorithm_t m_fwdSchedulingAlgorithm
The forward link algorithm used.
bool m_enableChannelEstimationError
Enable channel estimation error modeling at forward link receiver (= UT).
Ptr< SatBbFrameConf > GetBbFrameConf() const
Get BB frame configuration.
SatMac::ReadCtrlMsgCallback m_readCtrlCb
ObjectFactory m_deviceFactory
Ptr< SatBbFrameConf > m_bbFrameConf
Ptr< SatLinkResults > m_linkResults
TypeId GetInstanceTypeId(void) const
NetDeviceContainer InstallLora(NodeContainer c, uint32_t gwId, uint32_t satId, uint32_t beamId, Ptr< SatChannel > fCh, Ptr< SatChannel > rCh, Ptr< SatNcc > ncc, Ptr< SatLowerLayerServiceConf > llsConf, SatEnums::RegenerationMode_t forwardLinkRegenerationMode, SatEnums::RegenerationMode_t returnLinkRegenerationMode)
SatMac::ReserveCtrlMsgCallback m_reserveCtrlCb
SatGwHelper()
Default constructor.
SatPhy::InterferenceModel m_daInterferenceModel
SatTypedefs::CarrierBandwidthConverter_t m_carrierBandwidthConverter
Callback< uint32_t, Ptr< SatControlMessage > > ReserveCtrlMsgCallback
Callback to reserve an id and initially store the control message.
Callback< uint32_t, uint32_t > SendCtrlMsgCallback
Callback to send a control message and allocate a recv ID for it.
Callback< Ptr< SatControlMessage >, uint32_t > ReadCtrlMsgCallback
Callback to read control messages from container storing control messages.
InterferenceEliminationModel
Interference cancelation model enum.
RandomAccessCollisionModel
Random access collision model enum.
InterferenceModel
Interference model enum.
Callback< double, SatEnums::ChannelType_t, uint32_t, SatEnums::CarrierBandwidthType_t > CarrierBandwidthConverter_t
Callback for carrier bandwidths.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
SatPhyRxCarrierConf::InterferenceModel m_raInterferenceModel
SatPhyRxCarrierConf::InterferenceEliminationModel m_raInterferenceEliminationModel
SatEnums::RandomAccessModel_t m_randomAccessModel
SatPhyRxCarrierConf::RandomAccessCollisionModel m_raCollisionModel