23 #include "ns3/double.h"
26 #include "ns3/satellite-env-variables.h"
27 #include "ns3/satellite-wave-form-conf.h"
28 #include "ns3/simulator.h"
29 #include "ns3/singleton.h"
30 #include "ns3/string.h"
35 NS_LOG_COMPONENT_DEFINE(
"SatLoraConf");
40 NS_OBJECT_ENSURE_REGISTERED(SatLoraConf);
45 static TypeId tid = TypeId(
"ns3::SatLoraConf")
47 .AddConstructor<SatLoraConf>()
48 .AddAttribute(
"Standard",
49 "Standard used for phy layer configuration",
51 MakeEnumAccessor<SatLoraConf::PhyLayerStandard_t>(
63 NS_LOG_FUNCTION(
this);
70 NS_LOG_FUNCTION(
this);
72 ObjectBase::ConstructSelf(AttributeConstructionList());
78 NS_LOG_FUNCTION(
this << gatewayMac);
96 NS_LOG_FUNCTION(
this << endDeviceMac);
114 NS_LOG_FUNCTION(
this << satConf);
116 double baseFrequency;
119 double allocatedBandwidth;
124 baseFrequency = 1.5e9;
127 allocatedBandwidth = 125000;
131 baseFrequency = 0.868e9;
134 allocatedBandwidth = 125000;
138 NS_FATAL_ERROR(
"Unknown physical layer standard");
142 satConf->SetAttribute(
"FwdFeederLinkBandwidth", DoubleValue(bandwidth));
143 satConf->SetAttribute(
"FwdFeederLinkBaseFrequency", DoubleValue(baseFrequency));
144 satConf->SetAttribute(
"RtnFeederLinkBandwidth", DoubleValue(bandwidth));
145 satConf->SetAttribute(
"RtnFeederLinkBaseFrequency", DoubleValue(baseFrequency));
146 satConf->SetAttribute(
"FwdUserLinkBandwidth", DoubleValue(bandwidth));
147 satConf->SetAttribute(
"FwdUserLinkBaseFrequency", DoubleValue(baseFrequency));
148 satConf->SetAttribute(
"RtnUserLinkBandwidth", DoubleValue(bandwidth));
149 satConf->SetAttribute(
"RtnUserLinkBaseFrequency", DoubleValue(baseFrequency));
150 satConf->SetAttribute(
"FwdUserLinkChannels", UintegerValue(channels));
151 satConf->SetAttribute(
"RtnUserLinkChannels", UintegerValue(channels));
152 satConf->SetAttribute(
"FwdFeederLinkChannels", UintegerValue(channels));
153 satConf->SetAttribute(
"RtnFeederLinkChannels", UintegerValue(channels));
154 satConf->SetAttribute(
"FwdCarrierAllocatedBandwidth", DoubleValue(allocatedBandwidth));
160 NS_LOG_FUNCTION(
this << gatewayMac);
168 Ptr<LoraLogicalChannel> lc1 = CreateObject<LoraLogicalChannel>(868.1, 0, 5);
169 Ptr<LoraLogicalChannel> lc2 = CreateObject<LoraLogicalChannel>(868.3, 0, 5);
170 Ptr<LoraLogicalChannel> lc3 = CreateObject<LoraLogicalChannel>(868.5, 0, 5);
175 gatewayMac->SetLoraLogicalChannelHelper(channelHelper);
177 gatewayMac->SetSfForDataRate(std::vector<uint8_t>{12, 11, 10, 9, 8, 7, 7});
178 gatewayMac->SetBandwidthForDataRate(
179 std::vector<double>{125000, 125000, 125000, 125000, 125000, 125000, 250000});
180 gatewayMac->SetMaxAppPayloadForDataRate(
181 std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});
187 NS_LOG_FUNCTION(
this << endDeviceMac);
195 Ptr<LoraLogicalChannel> lc1 = CreateObject<LoraLogicalChannel>(868.1, 0, 5);
196 Ptr<LoraLogicalChannel> lc2 = CreateObject<LoraLogicalChannel>(868.3, 0, 5);
197 Ptr<LoraLogicalChannel> lc3 = CreateObject<LoraLogicalChannel>(868.5, 0, 5);
202 endDeviceMac->SetLoraLogicalChannelHelper(channelHelper);
204 endDeviceMac->SetSfForDataRate(std::vector<uint8_t>{12, 11, 10, 9, 8, 7, 7});
205 endDeviceMac->SetBandwidthForDataRate(
206 std::vector<double>{125000, 125000, 125000, 125000, 125000, 125000, 250000});
207 endDeviceMac->SetMaxAppPayloadForDataRate(
208 std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});
211 {{1, 0, 0, 0, 0, 0}},
212 {{2, 1, 0, 0, 0, 0}},
213 {{3, 2, 1, 0, 0, 0}},
214 {{4, 3, 2, 1, 0, 0}},
215 {{5, 4, 3, 2, 1, 0}},
216 {{6, 5, 4, 3, 2, 1}},
217 {{7, 6, 5, 4, 3, 2}}}};
218 endDeviceMac->SetReplyDataRateMatrix(matrix);
220 endDeviceMac->SetNPreambleSymbols(8);
224 endDeviceMac->SetSecondReceiveWindowDataRate(4);
225 endDeviceMac->SetSecondReceiveWindowFrequency(869.525);
231 NS_LOG_FUNCTION(
this << gatewayMac);
246 Ptr<LoraLogicalChannel> lc1 = CreateObject<LoraLogicalChannel>(1500.125, 0, 5);
249 gatewayMac->SetLoraLogicalChannelHelper(channelHelper);
251 gatewayMac->SetSfForDataRate(std::vector<uint8_t>{12, 11, 10, 9, 8, 7, 7});
252 gatewayMac->SetBandwidthForDataRate(
253 std::vector<double>{125000, 125000, 125000, 125000, 125000, 125000, 250000});
254 gatewayMac->SetMaxAppPayloadForDataRate(
255 std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});
261 NS_LOG_FUNCTION(
this << endDeviceMac);
269 Ptr<LoraLogicalChannel> lc1 = CreateObject<LoraLogicalChannel>(1500.125, 0, 5);
272 endDeviceMac->SetLoraLogicalChannelHelper(channelHelper);
274 endDeviceMac->SetSfForDataRate(std::vector<uint8_t>{12, 11, 10, 9, 8, 7, 7});
275 endDeviceMac->SetBandwidthForDataRate(
276 std::vector<double>{125000, 125000, 125000, 125000, 125000, 125000, 250000});
277 endDeviceMac->SetMaxAppPayloadForDataRate(
278 std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});
281 {{1, 0, 0, 0, 0, 0}},
282 {{2, 1, 0, 0, 0, 0}},
283 {{3, 2, 1, 0, 0, 0}},
284 {{4, 3, 2, 1, 0, 0}},
285 {{5, 4, 3, 2, 1, 0}},
286 {{6, 5, 4, 3, 2, 1}},
287 {{7, 6, 5, 4, 3, 2}}}};
288 endDeviceMac->SetReplyDataRateMatrix(matrix);
290 endDeviceMac->SetNPreambleSymbols(8);
294 endDeviceMac->SetSecondReceiveWindowDataRate(4);
295 endDeviceMac->SetSecondReceiveWindowFrequency(869.525);
This class supports LorawanMac instances by managing a list of the logical channels that the device i...
void AddLoraSubBand(double firstFrequency, double lastFrequency, double dutyCycle, double maxTxPowerDbm)
Add a new LoraSubBand to this helper.
void AddChannel(double frequency)
Add a new channel to the list.
std::array< std::array< uint8_t, 6 >, 8 > ReplyDataRateMatrix
SatLoraConf()
Default constructor.
void SetConf(Ptr< LorawanMacGateway > gatewayMac)
void SetEu863_870Conf(Ptr< LorawanMacGateway > gatewayMac)
static TypeId GetTypeId(void)
Get the type ID.
@ SATELLITE
For Satellite.
PhyLayerStandard_t m_phyLayerStandard
void SetSatelliteConf(Ptr< LorawanMacGateway > gatewayMac)
TypeId GetInstanceTypeId(void) const
void setSatConfAttributes(Ptr< SatConf > satConf)
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.