27#include "ns3/lorawan-ground-mac-gateway.h"
28#include "ns3/lorawan-mac-gateway.h"
29#include "ns3/pointer.h"
30#include "ns3/satellite-channel-estimation-error-container.h"
31#include "ns3/satellite-channel.h"
32#include "ns3/satellite-const-variables.h"
33#include "ns3/satellite-enums.h"
34#include "ns3/satellite-gw-phy.h"
35#include "ns3/satellite-id-mapper.h"
36#include "ns3/satellite-link-results.h"
37#include "ns3/satellite-lorawan-net-device.h"
38#include "ns3/satellite-lower-layer-service.h"
39#include "ns3/satellite-net-device.h"
40#include "ns3/satellite-node-info.h"
41#include "ns3/satellite-orbiter-net-device.h"
42#include "ns3/satellite-phy-rx-carrier-conf.h"
43#include "ns3/satellite-topology.h"
44#include "ns3/satellite-typedefs.h"
45#include "ns3/singleton.h"
47NS_LOG_COMPONENT_DEFINE(
"SatGwHelperLora");
58 TypeId(
"ns3::SatGwHelperLora").SetParent<
SatGwHelper>().AddConstructor<SatGwHelperLora>();
65 NS_FATAL_ERROR(
"Default constructor not supported!!!");
69 uint32_t rtnLinkCarrierCount,
70 Ptr<SatSuperframeSeq> seq,
83 NS_LOG_FUNCTION(
this << rtnLinkCarrierCount << seq);
92 uint32_t feederBeamId,
97 Ptr<SatLowerLayerServiceConf> llsConf)
99 NS_LOG_FUNCTION(
this << n << gwId << satId << beamId << fCh << rCh << ncc << llsConf);
101 NetDeviceContainer container;
121 Ptr<SatChannelEstimationErrorContainer> cec;
125 cec = Create<SatSimpleChannelEstimationErrorContainer>();
132 if (Singleton<SatTopology>::Get()->GetReturnLinkRegenerationMode() ==
134 Singleton<SatTopology>::Get()->GetReturnLinkRegenerationMode() ==
137 cec = Create<SatRtnLinkChannelEstimationErrorContainer>(minWfId, maxWfId);
141 cec = Create<SatFwdLinkChannelEstimationErrorContainer>();
145 SatPhyRxCarrierConf::RxCarrierCreateParams_s parameters =
146 SatPhyRxCarrierConf::RxCarrierCreateParams_s();
150 parameters.m_raIfModel =
m_raSettings.m_raInterferenceModel;
151 parameters.m_raIfEliminateModel =
m_raSettings.m_raInterferenceEliminationModel;
152 parameters.m_linkRegenerationMode =
153 Singleton<SatTopology>::Get()->GetReturnLinkRegenerationMode();
156 parameters.m_cec = cec;
157 parameters.m_raCollisionModel =
m_raSettings.m_raCollisionModel;
158 parameters.m_raConstantErrorRate =
m_raSettings.m_raConstantErrorRate;
159 parameters.m_randomAccessModel =
m_raSettings.m_randomAccessModel;
161 Ptr<SatGwPhy> phy = CreateObject<SatGwPhy>(
173 Ptr<LorawanMacGateway> mac = CreateObject<LorawanGroundMacGateway>(satId, beamId);
175 Ptr<SatLoraConf> satLoraConf = CreateObject<SatLoraConf>();
176 satLoraConf->SetConf(mac);
188 phy->SetAttribute(
"ReceiveCb", CallbackValue(recCb));
189 phy->SetAttribute(
"CnoCb", CallbackValue(cnoCb));
190 phy->SetAttribute(
"AverageNormalizedOfferedLoadCallback",
191 CallbackValue(avgNormalizedOfferedLoadCb));
203 Mac48Address addr = Mac48Address::Allocate();
204 dev->SetAddress(addr);
206 Singleton<SatIdMapper>::Get()->AttachMacToTraceId(dev->GetAddress());
207 Singleton<SatIdMapper>::Get()->AttachMacToGwId(dev->GetAddress(), gwId);
208 Singleton<SatIdMapper>::Get()->AttachMacToBeamId(dev->GetAddress(), beamId);
209 Singleton<SatIdMapper>::Get()->AttachMacToSatId(dev->GetAddress(), satId + 1);
214 Ptr<SatNodeInfo> nodeInfo = Create<SatNodeInfo>(
SatEnums::NT_GW, n->GetId(), addr);
215 dev->SetNodeInfo(nodeInfo);
216 mac->SetNodeInfo(nodeInfo);
217 phy->SetNodeInfo(nodeInfo);
224 phy->BeginEndScheduling();
227 Singleton<SatTopology>::Get()->AddGwLayersLora(n,
233 DynamicCast<LorawanGroundMacGateway>(mac),
virtual void Receive(SatPhy::PacketContainer_t packets, Ptr< SatSignalParameters >)=0
Receive a packet from the lower layer.
Base class for fading models such as Markov-based fading or fading trace.
Ptr< SatSuperframeSeq > m_superframeSeq
SatPhy::ErrorModel m_errorModel
RandomAccessSettings_s m_raSettings
The used random access model settings.
uint32_t m_rtnLinkCarrierCount
bool m_enableChannelEstimationError
Enable channel estimation error modeling at forward link receiver (= UT).
double m_daConstantErrorRate
ObjectFactory m_deviceFactory
Ptr< SatLinkResults > m_linkResults
SatGwHelper()
Default constructor.
SatPhy::InterferenceModel m_daInterferenceModel
SatTypedefs::CarrierBandwidthConverter_t m_carrierBandwidthConverter
Creates needed objects for LORA GW nodes like SatorbiterNetDevice objects.
virtual Ptr< NetDevice > Install(Ptr< Node > n, uint32_t gwId, uint32_t satId, uint32_t beamId, uint32_t feederSatId, uint32_t feederBeamId, Ptr< SatChannel > fCh, Ptr< SatChannel > rCh, SatPhy::ChannelPairGetterCallback cbChannel, Ptr< SatNcc > ncc, Ptr< SatLowerLayerServiceConf > llsConf)
SatGwHelperLora()
Default constructor.
static TypeId GetTypeId(void)
Get the type ID.
SatLorawanNetDevice to be utilized in the UT and GW nodes for IoT configuration.
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.
void DoRandomAccessDynamicLoadControl(uint32_t satId, uint32_t beamId, uint32_t carrierId, uint8_t allocationChannelId, double averageNormalizedOfferedLoad)
Function for adjusting the random access allocation channel specific load.
void UtCnoUpdated(uint32_t satId, uint32_t beamId, Address sourceMac, Address gwId, double cno, bool isSatelliteMac)
Update UT specific C/N0 information.
Callback< void, uint32_t, uint32_t, Address, Address, double, bool > CnoCallback
Callback< void, uint32_t, uint32_t, uint32_t, uint8_t, double > AverageNormalizedOfferedLoadCallback
Callback< void, PacketContainer_t, Ptr< SatSignalParameters > > ReceiveCallback
Callback< SatChannelPair::ChannelPair_t, uint32_t, uint32_t > ChannelPairGetterCallback
Callback for retrieving a pair of SatChannel associated to a beam.
Callback< double, SatEnums::ChannelType_t, uint32_t, SatEnums::CarrierBandwidthType_t > CarrierBandwidthConverter_t
Callback for carrier bandwidths.
constexpr uint8_t SUPERFRAME_SEQUENCE
Used superframe sequence in the RTN link.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Random access setting options.
Creation parameters for base PHY object.
Ptr< NetDevice > m_device
SatEnums::SatLoraNodeType_t m_standard