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"
32 NS_LOG_COMPONENT_DEFINE(
"SatLoraConf");
37 NS_OBJECT_ENSURE_REGISTERED(SatLoraConf);
42 static TypeId tid = TypeId(
"ns3::SatLoraConf")
44 .AddConstructor<SatLoraConf>()
45 .AddAttribute(
"Standard",
46 "Standard used for phy layer configuration",
59 NS_LOG_FUNCTION(
this);
66 NS_LOG_FUNCTION(
this);
68 ObjectBase::ConstructSelf(AttributeConstructionList());
74 NS_LOG_FUNCTION(
this << gatewayMac);
92 NS_LOG_FUNCTION(
this << endDeviceMac);
110 NS_LOG_FUNCTION(
this << satConf);
112 double baseFrequency;
115 double allocatedBandwidth;
120 baseFrequency = 1.5e9;
123 allocatedBandwidth = 125000;
127 baseFrequency = 0.868e9;
130 allocatedBandwidth = 125000;
134 NS_FATAL_ERROR(
"Unknown physical layer standard");
138 satConf->SetAttribute(
"FwdFeederLinkBandwidth", DoubleValue(bandwidth));
139 satConf->SetAttribute(
"FwdFeederLinkBaseFrequency", DoubleValue(baseFrequency));
140 satConf->SetAttribute(
"RtnFeederLinkBandwidth", DoubleValue(bandwidth));
141 satConf->SetAttribute(
"RtnFeederLinkBaseFrequency", DoubleValue(baseFrequency));
142 satConf->SetAttribute(
"FwdUserLinkBandwidth", DoubleValue(bandwidth));
143 satConf->SetAttribute(
"FwdUserLinkBaseFrequency", DoubleValue(baseFrequency));
144 satConf->SetAttribute(
"RtnUserLinkBandwidth", DoubleValue(bandwidth));
145 satConf->SetAttribute(
"RtnUserLinkBaseFrequency", DoubleValue(baseFrequency));
146 satConf->SetAttribute(
"FwdUserLinkChannels", UintegerValue(channels));
147 satConf->SetAttribute(
"RtnUserLinkChannels", UintegerValue(channels));
148 satConf->SetAttribute(
"FwdFeederLinkChannels", UintegerValue(channels));
149 satConf->SetAttribute(
"RtnFeederLinkChannels", UintegerValue(channels));
150 satConf->SetAttribute(
"FwdCarrierAllocatedBandwidth", DoubleValue(allocatedBandwidth));
156 NS_LOG_FUNCTION(
this << gatewayMac);
164 Ptr<LoraLogicalChannel> lc1 = CreateObject<LoraLogicalChannel>(868.1, 0, 5);
165 Ptr<LoraLogicalChannel> lc2 = CreateObject<LoraLogicalChannel>(868.3, 0, 5);
166 Ptr<LoraLogicalChannel> lc3 = CreateObject<LoraLogicalChannel>(868.5, 0, 5);
171 gatewayMac->SetLoraLogicalChannelHelper(channelHelper);
173 gatewayMac->SetSfForDataRate(std::vector<uint8_t>{12, 11, 10, 9, 8, 7, 7});
174 gatewayMac->SetBandwidthForDataRate(
175 std::vector<double>{125000, 125000, 125000, 125000, 125000, 125000, 250000});
176 gatewayMac->SetMaxAppPayloadForDataRate(
177 std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});
183 NS_LOG_FUNCTION(
this << endDeviceMac);
191 Ptr<LoraLogicalChannel> lc1 = CreateObject<LoraLogicalChannel>(868.1, 0, 5);
192 Ptr<LoraLogicalChannel> lc2 = CreateObject<LoraLogicalChannel>(868.3, 0, 5);
193 Ptr<LoraLogicalChannel> lc3 = CreateObject<LoraLogicalChannel>(868.5, 0, 5);
198 endDeviceMac->SetLoraLogicalChannelHelper(channelHelper);
200 endDeviceMac->SetSfForDataRate(std::vector<uint8_t>{12, 11, 10, 9, 8, 7, 7});
201 endDeviceMac->SetBandwidthForDataRate(
202 std::vector<double>{125000, 125000, 125000, 125000, 125000, 125000, 250000});
203 endDeviceMac->SetMaxAppPayloadForDataRate(
204 std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});
207 {{1, 0, 0, 0, 0, 0}},
208 {{2, 1, 0, 0, 0, 0}},
209 {{3, 2, 1, 0, 0, 0}},
210 {{4, 3, 2, 1, 0, 0}},
211 {{5, 4, 3, 2, 1, 0}},
212 {{6, 5, 4, 3, 2, 1}},
213 {{7, 6, 5, 4, 3, 2}}}};
214 endDeviceMac->SetReplyDataRateMatrix(matrix);
216 endDeviceMac->SetNPreambleSymbols(8);
220 endDeviceMac->SetSecondReceiveWindowDataRate(4);
221 endDeviceMac->SetSecondReceiveWindowFrequency(869.525);
227 NS_LOG_FUNCTION(
this << gatewayMac);
242 Ptr<LoraLogicalChannel> lc1 = CreateObject<LoraLogicalChannel>(1500.125, 0, 5);
245 gatewayMac->SetLoraLogicalChannelHelper(channelHelper);
247 gatewayMac->SetSfForDataRate(std::vector<uint8_t>{12, 11, 10, 9, 8, 7, 7});
248 gatewayMac->SetBandwidthForDataRate(
249 std::vector<double>{125000, 125000, 125000, 125000, 125000, 125000, 250000});
250 gatewayMac->SetMaxAppPayloadForDataRate(
251 std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});
257 NS_LOG_FUNCTION(
this << endDeviceMac);
265 Ptr<LoraLogicalChannel> lc1 = CreateObject<LoraLogicalChannel>(1500.125, 0, 5);
268 endDeviceMac->SetLoraLogicalChannelHelper(channelHelper);
270 endDeviceMac->SetSfForDataRate(std::vector<uint8_t>{12, 11, 10, 9, 8, 7, 7});
271 endDeviceMac->SetBandwidthForDataRate(
272 std::vector<double>{125000, 125000, 125000, 125000, 125000, 125000, 250000});
273 endDeviceMac->SetMaxAppPayloadForDataRate(
274 std::vector<uint32_t>{59, 59, 59, 123, 230, 230, 230, 230});
277 {{1, 0, 0, 0, 0, 0}},
278 {{2, 1, 0, 0, 0, 0}},
279 {{3, 2, 1, 0, 0, 0}},
280 {{4, 3, 2, 1, 0, 0}},
281 {{5, 4, 3, 2, 1, 0}},
282 {{6, 5, 4, 3, 2, 1}},
283 {{7, 6, 5, 4, 3, 2}}}};
284 endDeviceMac->SetReplyDataRateMatrix(matrix);
286 endDeviceMac->SetNPreambleSymbols(8);
290 endDeviceMac->SetSecondReceiveWindowDataRate(4);
291 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.