Loading...
Searching...
No Matches
satellite-orbiter-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 SAT_ORBITER_HELPER_H
24#define SAT_ORBITER_HELPER_H
25
26#include "ns3/error-model.h"
27#include "ns3/net-device-container.h"
28#include "ns3/node-container.h"
29#include "ns3/object-factory.h"
30#include "ns3/output-stream-wrapper.h"
31#include "ns3/satellite-bbframe-conf.h"
32#include "ns3/satellite-channel.h"
33#include "ns3/satellite-fwd-link-scheduler.h"
34#include "ns3/satellite-ncc.h"
35#include "ns3/satellite-orbiter-feeder-mac.h"
36#include "ns3/satellite-orbiter-net-device.h"
37#include "ns3/satellite-phy.h"
38#include "ns3/satellite-scpc-scheduler.h"
39#include "ns3/satellite-superframe-sequence.h"
40#include "ns3/satellite-typedefs.h"
41#include "ns3/traced-callback.h"
42
43#include <map>
44#include <stdint.h>
45#include <string>
46#include <utility>
47#include <vector>
48
49namespace ns3
50{
51
57class SatOrbiterHelper : public Object
58{
59 public:
71
76 static TypeId GetTypeId(void);
77
82
88 uint32_t rtnLinkCarrierCount,
89 uint32_t fwdLinkCarrierCount,
90 Ptr<SatSuperframeSeq> seq,
93 RandomAccessSettings_s randomAccessSettings);
94
96 {
97 }
98
99 /*
100 * Initializes the orbiter helper based on attributes.
101 * Link results are used only if satellite is regenerative.
102 * @param lrFwd DVB-S2 or DVB-S2X link results
103 * @param lrRcs2 return link results
104 */
105 void Initialize(Ptr<SatLinkResultsFwd> lrFwd, Ptr<SatLinkResultsRtn> lrRcs2);
106
117 void SetDeviceAttribute(std::string name, const AttributeValue& value);
118
128 void SetUserPhyAttribute(std::string name, const AttributeValue& value);
129
139 void SetFeederPhyAttribute(std::string name, const AttributeValue& value);
140
148 NetDeviceContainer InstallAllOrbiters();
149
158 Ptr<NetDevice> Install(Ptr<Node> n);
159
168 Ptr<NetDevice> Install(std::string aName);
169
175 virtual Ptr<SatOrbiterNetDevice> CreateOrbiterNetDevice() = 0;
176
177 /*
178 * Attach the SatChannels for the beam to NetDevice
179 * @param dev NetDevice to attach channels
180 * @param fr feeder return channel
181 * @param uf user forward channel
182 * @param uf user return channel
183 * @param userAgp user beam antenna gain pattern
184 * @param feederAgp feeder beam antenna gain pattern
185 * @param ncc NCC (Network Control Center)
186 * @param satId ID of satellite associated to this channel
187 * @param gwId ID of GW associated to this channel
188 * @param userBeamId Id of the user beam
189 */
190 void AttachChannels(Ptr<NetDevice> dev,
191 Ptr<SatChannel> ff,
192 Ptr<SatChannel> fr,
193 Ptr<SatChannel> uf,
194 Ptr<SatChannel> ur,
195 Ptr<SatAntennaGainPattern> userAgp,
196 Ptr<SatAntennaGainPattern> feederAgp,
197 Ptr<SatNcc> ncc,
198 uint32_t satId,
199 uint32_t gwId,
200 uint32_t userBeamId);
201
202 /*
203 * Attach the SatChannels for the beam to NetDevice
204 * @param dev NetDevice to attach channels
205 * @param fr feeder forward channel
206 * @param fr feeder return channel
207 * @param feederAgp feeder beam antenna gain pattern
208 * @param ncc NCC (Network Control Center)
209 * @param satId ID of satellite associated to this channel
210 * @param gwId ID of GW associated to this channel
211 * @param userBeamId Id of the user beam
212 */
213 void AttachChannelsFeeder(Ptr<SatOrbiterNetDevice> dev,
214 Ptr<SatChannel> ff,
215 Ptr<SatChannel> fr,
216 Ptr<SatAntennaGainPattern> feederAgp,
217 Ptr<SatNcc> ncc,
218 uint32_t satId,
219 uint32_t gwId,
220 uint32_t userBeamId);
221
222 /*
223 * Attach the SatChannels for the beam to NetDevice
224 * @param dev NetDevice to attach channels
225 * @param uf user forward channel
226 * @param uf user return channel
227 * @param userAgp user beam antenna gain pattern
228 * @param ncc NCC (Network Control Center)
229 * @param satId ID of satellite associated to this channel
230 * @param userBeamId Id of the beam
231 */
232 virtual void AttachChannelsUser(Ptr<SatOrbiterNetDevice> dev,
233 Ptr<SatChannel> uf,
234 Ptr<SatChannel> ur,
235 Ptr<SatAntennaGainPattern> userAgp,
236 Ptr<SatNcc> ncc,
237 uint32_t satId,
238 uint32_t userBeamId) = 0;
239
245 void EnableCreationTraces(Ptr<OutputStreamWrapper> stream, CallbackBase& cb);
246
252 void SetIslRoutes(std::vector<std::pair<uint32_t, uint32_t>> isls);
253
254 protected:
258 std::vector<uint32_t> m_nodeIds;
259
263
264 // count for devices for each node ID. Currently only one device supported by helper.
265 std::map<uint32_t, uint16_t> m_deviceCount;
266
267 ObjectFactory m_deviceFactory;
268
269 /*
270 * Configured forward link interference model for dedicated access
271 */
273
274 /*
275 * Configured return link interference model for dedicated access
276 */
278
279 /*
280 * Configured error model for the forward feeder link. Set as an attribute.
281 */
283
284 /*
285 * Constant error rate for dedicated access in the FWD feeder link.
286 */
288
289 /*
290 * Configured error model for the return user link. Set as an attribute.
291 */
293
294 /*
295 * Constant error rate for dedicated access in the RTN user link.
296 */
298
300
301 Ptr<SatBbFrameConf> m_bbFrameConfRtn;
302
304
305 Ptr<SatBbFrameConf> m_bbFrameConfFwd;
306
310 TracedCallback<std::string> m_creationTrace;
311
315 Ptr<SatSuperframeSeq> m_superframeSeq;
316
321
326 Ptr<SatLinkResults> m_fwdLinkResults;
327
332 Ptr<SatLinkResults> m_rtnLinkResults;
333
337 std::map<std::pair<uint32_t, uint32_t>, Ptr<SatOrbiterFeederMac>> m_gwMacMap;
338
343
348
353};
354
355} // namespace ns3
356
357#endif /* SAT_ORBITER_HELPER_H */
IslArbiterType_t
Choose the arbiter to use to route packets on ISLs.
RandomAccessModel_t
The defined random access models.
Callback< Ptr< SatControlMessage >, uint32_t > ReadCtrlMsgCallback
Callback to read control messages from container storing control messages.
Ptr< SatLinkResults > m_rtnLinkResults
Return channel link results (DVB-RCS2) are created if ErrorModel is configured to be AVI.
SatPhy::InterferenceModel m_daFwdLinkInterferenceModel
SatMac::ReadCtrlMsgCallback m_fwdReadCtrlCb
Control forward link messages callback.
SatEnums::IslArbiterType_t m_islArbiterType
Arbiter in use to route packets on ISLs.
virtual void AttachChannelsUser(Ptr< SatOrbiterNetDevice > dev, Ptr< SatChannel > uf, Ptr< SatChannel > ur, Ptr< SatAntennaGainPattern > userAgp, Ptr< SatNcc > ncc, uint32_t satId, uint32_t userBeamId)=0
void Initialize(Ptr< SatLinkResultsFwd > lrFwd, Ptr< SatLinkResultsRtn > lrRcs2)
std::map< std::pair< uint32_t, uint32_t >, Ptr< SatOrbiterFeederMac > > m_gwMacMap
Map used in regenerative mode to store if MAC already created for a given pair SAT ID / GW ID.
void SetFeederPhyAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Feeder Phy created by the helper.
void SetUserPhyAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each User Phy created by the helper.
RandomAccessSettings_s m_raSettings
The used random access model settings.
std::vector< uint32_t > m_nodeIds
Satellites node id.
NetDeviceContainer InstallAllOrbiters()
This method creates a ns3::SatOrbiterNetDevices with the requested attributes and associate the resul...
Ptr< SatBbFrameConf > m_bbFrameConfFwd
void AttachChannelsFeeder(Ptr< SatOrbiterNetDevice > dev, Ptr< SatChannel > ff, Ptr< SatChannel > fr, Ptr< SatAntennaGainPattern > feederAgp, Ptr< SatNcc > ncc, uint32_t satId, uint32_t gwId, uint32_t userBeamId)
TracedCallback< std::string > m_creationTrace
Trace callback for creation traces.
Ptr< SatLinkResults > m_fwdLinkResults
Forward channel link results (DVB-S2) are created if ErrorModel is configured to be AVI.
Ptr< SatSuperframeSeq > m_superframeSeq
Superframe sequence.
SatPhy::InterferenceModel m_daRtnLinkInterferenceModel
void AttachChannels(Ptr< NetDevice > dev, Ptr< SatChannel > ff, Ptr< SatChannel > fr, Ptr< SatChannel > uf, Ptr< SatChannel > ur, Ptr< SatAntennaGainPattern > userAgp, Ptr< SatAntennaGainPattern > feederAgp, Ptr< SatNcc > ncc, uint32_t satId, uint32_t gwId, uint32_t userBeamId)
SatTypedefs::CarrierBandwidthConverter_t m_carrierBandwidthConverter
void EnableCreationTraces(Ptr< OutputStreamWrapper > stream, CallbackBase &cb)
Enables creation traces to be written in given file.
virtual Ptr< SatOrbiterNetDevice > CreateOrbiterNetDevice()=0
Create a SatOrbiterNetDevice instance, with correct type infered from child classes.
Ptr< SatBbFrameConf > m_bbFrameConfRtn
SatOrbiterHelper()
Default constructor.
Ptr< NetDevice > Install(Ptr< Node > n)
SatMac::ReadCtrlMsgCallback m_rtnReadCtrlCb
Control return link messages callback.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
static TypeId GetTypeId(void)
Get the type ID.
std::map< uint32_t, uint16_t > m_deviceCount
void SetIslRoutes(std::vector< std::pair< uint32_t, uint32_t > > isls)
Set ISL routes.
SatPhyRxCarrierConf::ErrorModel ErrorModel
Define ErrorModel in SatPhy.
SatPhyRxCarrierConf::InterferenceModel InterferenceModel
Define InterferenceModel in SatPhy.
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_raFwdInterferenceModel
SatPhyRxCarrierConf::InterferenceModel m_raRtnInterferenceModel
SatPhyRxCarrierConf::RandomAccessCollisionModel m_raCollisionModel
SatPhyRxCarrierConf::InterferenceEliminationModel m_raInterferenceEliminationModel