34 #include <ns3/ipv4-header.h>
36 #include <ns3/simulator.h>
37 #include <ns3/singleton.h>
47 NS_LOG_COMPONENT_DEFINE(
"LorawanMacEndDevice");
49 NS_OBJECT_ENSURE_REGISTERED(LorawanMacEndDevice);
55 TypeId(
"ns3::LorawanMacEndDevice")
57 .AddTraceSource(
"RequiredTransmissions",
58 "Total number of transmissions required to deliver this packet",
60 "ns3::TracedValueCallback::uint8_t")
61 .AddAttribute(
"DataRate",
62 "Data Rate currently employed by this end device",
65 MakeUintegerChecker<uint8_t>(0, 5))
66 .AddTraceSource(
"DataRate",
67 "Data Rate currently employed by this end device",
69 "ns3::TracedValueCallback::uint8_t")
70 .AddAttribute(
"DRControl",
71 "Whether to request the NS to control this device's Data Rate",
75 .AddTraceSource(
"TxPower",
76 "Transmission power currently employed by this end device",
78 "ns3::TracedValueCallback::Double")
79 .AddTraceSource(
"LastKnownLinkMargin",
80 "Last known demodulation margin in "
81 "communications between this end device "
84 "ns3::TracedValueCallback::Double")
85 .AddTraceSource(
"LastKnownGatewayCount",
86 "Last known number of gateways able to "
87 "listen to this end device",
89 "ns3::TracedValueCallback::Int")
90 .AddTraceSource(
"AggregatedDutyCycle",
91 "Aggregate duty cycle, in fraction form, "
92 "this end device must respect",
94 "ns3::TracedValueCallback::Double")
95 .AddAttribute(
"MaxTransmissions",
96 "Maximum number of transmissions for a packet",
99 MakeIntegerChecker<uint8_t>())
100 .AddAttribute(
"EnableEDDataRateAdaptation",
101 "Whether the End Device should up its Data Rate "
102 "in case it doesn't get a reply from the NS.",
105 MakeBooleanChecker())
106 .AddAttribute(
"MType",
107 "Specify type of message will be sent by this ED.",
119 NS_FATAL_ERROR(
"Default constructor not in use");
125 m_enableDRAdapt(false),
129 m_codingRate(4.0 / 5),
135 m_receiveWindowDurationInSymbols(8),
136 m_gatewayUpdateCallback(),
137 m_isRegenerative(false),
139 m_controlDataRate(false),
140 m_lastKnownLinkMargin(0),
141 m_lastKnownGatewayCount(0),
142 m_aggregatedDutyCycle(1),
147 NS_LOG_FUNCTION(
this);
151 m_uniformRV = CreateObject<UniformRandomVariable>();
164 NS_LOG_FUNCTION_NOARGS();
174 NS_LOG_FUNCTION(
this << packet);
179 if (nextTxDelay != Seconds(0))
192 NS_LOG_INFO(
"Cannot send because of duty cycle.");
197 NS_LOG_INFO(
"Max number of transmission achieved: packet not transmitted.");
206 " The selected power is too hight to be supported by this channel.");
214 NS_LOG_FUNCTION(
this);
218 NS_LOG_WARN(
"Attempting to send, but the aggregate duty cycle won't allow it. Scheduling a tx "
220 << nextTxDelay.GetSeconds() <<
".");
226 NS_LOG_FUNCTION(
this << packet);
239 "Received a new packet from application. Resetting retransmission parameters.");
241 NS_LOG_DEBUG(
"APP packet: " << packet <<
".");
246 NS_LOG_WARN(
"Attempting to send a packet larger than the maximum allowed"
247 <<
" size at this DataRate (DR" <<
unsigned(
m_dataRate)
248 <<
"). Transmission canceled. ");
255 packet->AddHeader(frameHdr);
256 NS_LOG_INFO(
"Added frame header of size " << frameHdr.
GetSerializedSize() <<
" bytes.");
261 packet->AddHeader(macHdr);
271 NS_LOG_DEBUG(
" Received new packet from the application layer: stopping retransmission "
273 <<
unsigned(txs) <<
" transmissions out of a maximum of "
291 NS_LOG_DEBUG(
"Message type is " <<
m_mType);
292 NS_LOG_DEBUG(
"It is a confirmed packet. Setting retransmission parameters and "
293 "decreasing the number of transmissions left.");
312 packet->RemovePacketTag(satPhyTimeTag);
314 packet->RemovePacketTag(satPhyLinkTimeTag);
320 packet->RemoveHeader(macHdr);
321 packet->RemoveHeader(frameHdr);
326 packet->AddHeader(frameHdr);
328 NS_LOG_INFO(
"Added frame header of size " << frameHdr.
GetSerializedSize() <<
" bytes.");
333 packet->AddHeader(macHdr);
336 NS_LOG_DEBUG(
"Retransmitting an old packet.");
354 Ptr<SatSignalParameters> )
357 for (SatPhy::PacketContainer_t::iterator i = packets.begin(); i != packets.end(); i++)
371 NS_LOG_FUNCTION(
this << frameHeader);
377 NS_LOG_INFO(
"The message is an ACK, not waiting for it anymore.");
379 NS_LOG_DEBUG(
"Reset retransmission variables to default values and cancel "
380 "retransmission if already scheduled.");
384 NS_LOG_DEBUG(
"Received ACK packet after "
385 <<
unsigned(txs) <<
" transmissions: stopping retransmission procedure. ");
393 "Received downlink message not containing an ACK while we were waiting for it!");
397 std::list<Ptr<LorawanMacCommand>> commands = frameHeader.
GetCommands();
398 std::list<Ptr<LorawanMacCommand>>::iterator it;
399 for (it = commands.begin(); it != commands.end(); it++)
401 NS_LOG_DEBUG(
"Iterating over the MAC commands...");
406 NS_LOG_DEBUG(
"Detected a LinkCheckAns command.");
409 Ptr<LinkCheckAns> linkCheckAns = (*it)->GetObject<
LinkCheckAns>();
412 OnLinkCheckAns(linkCheckAns->GetMargin(), linkCheckAns->GetGwCnt());
417 NS_LOG_DEBUG(
"Detected a LinkAdrReq command.");
420 Ptr<LinkAdrReq> linkAdrReq = (*it)->GetObject<
LinkAdrReq>();
424 linkAdrReq->GetTxPower(),
425 linkAdrReq->GetEnabledChannelsList(),
426 linkAdrReq->GetRepetitions());
431 NS_LOG_DEBUG(
"Detected a DutyCycleReq command.");
434 Ptr<DutyCycleReq> dutyCycleReq = (*it)->GetObject<
DutyCycleReq>();
442 NS_LOG_DEBUG(
"Detected a RxParamSetupReq command.");
445 Ptr<RxParamSetupReq> rxParamSetupReq = (*it)->GetObject<
RxParamSetupReq>();
453 NS_LOG_DEBUG(
"Detected a DevStatusReq command.");
456 Ptr<DevStatusReq> devStatusReq = (*it)->GetObject<
DevStatusReq>();
464 NS_LOG_DEBUG(
"Detected a NewChannelReq command.");
467 Ptr<NewChannelReq> newChannelReq = (*it)->GetObject<
NewChannelReq>();
471 newChannelReq->GetFrequency(),
472 newChannelReq->GetMinDataRate(),
473 newChannelReq->GetMaxDataRate());
486 NS_LOG_ERROR(
"CID not recognized");
496 NS_LOG_FUNCTION_NOARGS();
510 NS_LOG_INFO(
"Applying a MAC Command of CID " <<
unsigned(
520 NS_LOG_FUNCTION_NOARGS();
530 NS_LOG_DEBUG(
"Message type is set to " << mType);
547 NS_LOG_FUNCTION(
this);
553 NS_LOG_INFO(
"Lora UT handover, old satellite is " <<
m_satId <<
", old beam is "
561 NS_LOG_INFO(
"Lora UT handover, new satellite is " <<
m_satId <<
", new beam is "
564 Ptr<SatTopology> satTopology = Singleton<SatTopology>::Get();
567 Ptr<Node> gwNode = satTopology->GetGwFromBeam(
m_beamId);
568 satTopology->UpdateGwConnectedToUt(
m_node, gwNode);
571 Mac48Address satAddress48 = Mac48Address::ConvertFrom(satAddress);
577 Mac48Address gwAddress =
578 Singleton<SatTopology>::Get()->GetGwAddressInUt(
m_nodeInfo->GetNodeId());
587 srcScheduler->DisconnectUt(
m_nodeInfo->GetMacAddress());
588 dstScheduler->ConnectUt(
m_nodeInfo->GetMacAddress());
590 Ptr<SatIdMapper> satIdMapper = Singleton<SatIdMapper>::Get();
611 NS_LOG_FUNCTION(
this << satId << beamId);
617 NS_LOG_FUNCTION_NOARGS();
624 NS_LOG_FUNCTION_NOARGS();
629 std::vector<Ptr<LoraLogicalChannel>> logicalChannels;
634 Time waitingTime = Time::Max();
637 std::vector<Ptr<LoraLogicalChannel>>::iterator it;
638 for (it = logicalChannels.begin(); it != logicalChannels.end(); ++it)
641 Ptr<LoraLogicalChannel> logicalChannel = *it;
642 double frequency = logicalChannel->GetFrequency();
646 NS_LOG_DEBUG(
"Waiting time before the next transmission in channel with frequecy "
647 << frequency <<
" is = " << waitingTime.GetSeconds() <<
".");
655 Ptr<LoraLogicalChannel>
658 NS_LOG_FUNCTION_NOARGS();
661 std::vector<Ptr<LoraLogicalChannel>> logicalChannels;
664 logicalChannels =
Shuffle(logicalChannels);
667 std::vector<Ptr<LoraLogicalChannel>>::iterator it;
668 for (it = logicalChannels.begin(); it != logicalChannels.end(); ++it)
671 Ptr<LoraLogicalChannel> logicalChannel = *it;
672 double frequency = logicalChannel->GetFrequency();
674 NS_LOG_DEBUG(
"Frequency of the current channel: " << frequency);
679 NS_LOG_DEBUG(
"Waiting time for current channel = " << waitingTime.GetSeconds());
682 if (waitingTime == Seconds(0))
688 NS_LOG_DEBUG(
"Packet cannot be immediately transmitted on "
689 <<
"the current channel because of duty cycle limitations.");
695 std::vector<Ptr<LoraLogicalChannel>>
698 NS_LOG_FUNCTION_NOARGS();
700 int size = vector.size();
702 for (
int i = 0; i < size; ++i)
704 uint16_t random = std::floor(
m_uniformRV->GetValue(0, size));
705 Ptr<LoraLogicalChannel> temp = vector.at(random);
706 vector.at(random) = vector.at(i);
732 NS_LOG_FUNCTION(
this << adapt);
745 NS_LOG_FUNCTION(
this <<
unsigned(maxNumbTx));
753 NS_LOG_FUNCTION(
this);
760 NS_LOG_FUNCTION(
this <<
unsigned(dataRate));
768 NS_LOG_FUNCTION(
this);
776 NS_LOG_FUNCTION(
this << address);
784 NS_LOG_FUNCTION(
this);
792 NS_LOG_FUNCTION(
this <<
unsigned(margin) <<
unsigned(gwCnt));
801 std::list<int> enabledChannels,
804 NS_LOG_FUNCTION(
this <<
unsigned(dataRate) <<
unsigned(txPower) << repetitions);
807 bool channelMaskOk =
true;
808 bool dataRateOk =
true;
809 bool txPowerOk =
true;
815 int channelListSize = channelList.size();
817 for (
auto it = enabledChannels.begin(); it != enabledChannels.end(); it++)
819 if ((*it) > channelListSize)
821 channelMaskOk =
false;
835 NS_LOG_DEBUG(
"SF: " <<
unsigned(sf) <<
", BW: " << bw);
836 if (sf == 0 || bw == 0)
839 NS_LOG_DEBUG(
"Data rate non valid");
845 if (dataRateOk && channelMaskOk)
847 bool foundAvailableChannel =
false;
848 for (
auto it = enabledChannels.begin(); it != enabledChannels.end(); it++)
850 NS_LOG_DEBUG(
"MinDR: " <<
unsigned(channelList.at(*it)->GetMinimumDataRate()));
851 NS_LOG_DEBUG(
"MaxDR: " <<
unsigned(channelList.at(*it)->GetMaximumDataRate()));
852 if (channelList.at(*it)->GetMinimumDataRate() <= dataRate &&
853 channelList.at(*it)->GetMaximumDataRate() >= dataRate)
855 foundAvailableChannel =
true;
860 if (!foundAvailableChannel)
863 NS_LOG_DEBUG(
"Available channel not found");
875 NS_LOG_DEBUG(
"Finished checking. "
876 <<
"ChannelMaskOk: " << channelMaskOk <<
", "
877 <<
"DataRateOk: " << dataRateOk <<
", "
878 <<
"txPowerOk: " << txPowerOk);
882 if (channelMaskOk && dataRateOk && txPowerOk)
887 if (std::find(enabledChannels.begin(), enabledChannels.end(), i) !=
888 enabledChannels.end())
891 NS_LOG_DEBUG(
"Channel " << i <<
" enabled");
896 NS_LOG_DEBUG(
"Channel " << i <<
" disabled");
909 m_macCommandList.push_back(CreateObject<LinkAdrAns>(txPowerOk, dataRateOk, channelMaskOk));
915 NS_LOG_FUNCTION(
this << dutyCycle);
918 NS_ASSERT(0 <= dutyCycle && dutyCycle < 1);
924 NS_LOG_INFO(
"Adding DutyCycleAns reply");
936 NS_LOG_FUNCTION(
this << rxParamSetupReq);
945 NS_LOG_FUNCTION(
this);
947 uint8_t battery = 10;
951 NS_LOG_INFO(
"Adding DevStatusAns reply");
961 NS_LOG_FUNCTION(
this);
963 bool dataRateRangeOk =
true;
964 bool channelFrequencyOk =
true;
971 NS_LOG_INFO(
"Adding NewChannelAns reply");
972 m_macCommandList.push_back(CreateObject<NewChannelAns>(dataRateRangeOk, channelFrequencyOk));
978 NS_LOG_FUNCTION(
this << frequency);
986 NS_LOG_FUNCTION(
this << logicalChannel);
997 NS_LOG_FUNCTION(
this <<
unsigned(chIndex) << frequency <<
unsigned(minDataRate)
998 <<
unsigned(maxDataRate));
1002 CreateObject<LoraLogicalChannel>(frequency, minDataRate, maxDataRate));
1007 double endFrequency,
1009 double maxTxPowerDbm)
1011 NS_LOG_FUNCTION_NOARGS();
1019 NS_LOG_FUNCTION_NOARGS();
1027 NS_LOG_FUNCTION(
this << macCommand);
1041 NS_LOG_FUNCTION(
this << &cb);
1048 NS_LOG_FUNCTION(
this << &cb);
1056 NS_LOG_FUNCTION(
this << &cb);
1063 NS_LOG_FUNCTION(
this << gwAddress);
1072 NS_LOG_FUNCTION(
this << satAddress);
1080 NS_LOG_FUNCTION(
this << isRegenerative);
Implementation of the DevStatusReq LoRaWAN MAC command.
Implementation of the DutyCycleReq LoRaWAN MAC command.
Implementation of the LinkAdrReq LoRaWAN MAC command.
Implementation of the LinkCheckAns LoRaWAN MAC command.
This class represents the device address of a LoraWAN End Device.
Time GetWaitingTime(Ptr< LoraLogicalChannel > channel)
Get the time it is necessary to wait for before transmitting on a given channel.
void AddLoraSubBand(double firstFrequency, double lastFrequency, double dutyCycle, double maxTxPowerDbm)
Add a new LoraSubBand to this helper.
void SetChannel(uint8_t chIndex, Ptr< LoraLogicalChannel > logicalChannel)
Set a new channel at a fixed index.
void AddChannel(double frequency)
Add a new channel to the list.
std::vector< Ptr< LoraLogicalChannel > > GetChannelList(void)
Get the list of LoraLogicalChannels currently registered on this helper.
std::vector< Ptr< LoraLogicalChannel > > GetEnabledChannelList(void)
Get the list of LoraLogicalChannels currently registered on this helper that have been enabled for Up...
double GetTxPowerForChannel(Ptr< LoraLogicalChannel > logicalChannel)
Returns the maximum transmission power [dBm] that is allowed on a channel.
static uint8_t GetCIDFromLorawanMacCommand(enum MacCommandType commandType)
Get the CID that corresponds to this MAC command.
void SetDeviceAddress(LoraDeviceAddress address)
Set the network address of this device.
Time GetNextTransmissionDelay(void)
Find the minimum waiting time before the next possible transmission.
std::list< Ptr< LorawanMacCommand > > m_macCommandList
List of the MAC commands that need to be applied to the next UL packet.
uint8_t GetDataRate(void)
Get the data rate this end device is set to use.
void OnNewChannelReq(uint8_t chIndex, double frequency, uint8_t minDataRate, uint8_t maxDataRate)
Perform the actions that need to be taken when receiving a NewChannelReq command.
uint8_t GetMaxNumberOfTransmissions(void)
Set the maximum number of transmissions allowed.
bool m_enableDRAdapt
Enable Data Rate adaptation during the retransmission procedure.
static TypeId GetTypeId(void)
EventId m_nextTx
The event of retransmitting a packet in a consecutive moment if an ACK is not received.
virtual void FailedReception(Ptr< const Packet > packet)
Function called by lower layers to inform this layer that reception of a packet we were locked on fai...
TracedValue< double > m_txPower
The transmission power this device is using to transmit.
TracedCallback< uint8_t, bool, Time, Ptr< Packet > > m_requiredTxCallback
The trace source fired when the transmission procedure is finished.
LorawanMacHeader::MType m_mType
The message type to apply to packets sent with the Send method.
void SetSatAddress(Mac48Address satAddress)
Set address of the Lorawan GW (or its MAC) serving this UT.
void OnLinkCheckAns(uint8_t margin, uint8_t gwCnt)
Perform the actions that need to be taken when receiving a LinkCheckAns command.
Callback< void, Mac48Address > GatewayUpdateCallback
Callback to update gateway address after handover.
void SetHandoverCallback(LorawanMacEndDevice::HandoverCallback cb)
Method to set handover callback.
Callback< void, uint32_t, uint32_t > HandoverCallback
Callback to reconfigure physical layer during handover.
LorawanMacHeader::MType GetMType(void)
Get the message type to send when the Send method is called.
virtual void DoSend(Ptr< Packet > packet)
Checking if we are performing the transmission of a new packet or a retransmission,...
void SetMType(LorawanMacHeader::MType mType)
Set the message type to send when the Send method is called.
bool GetDataRateAdaptation(void)
Get if data rate adaptation is enabled or not.
TracedValue< double > m_aggregatedDutyCycle
The aggregated duty cycle this device needs to respect across all sub-bands.
virtual void postponeTransmission(Time nextTxDelay, Ptr< Packet >)
Postpone transmission to the specified time and delete previously scheduled transmissions if present.
LorawanMacEndDevice::GatewayUpdateCallback m_gatewayUpdateCallback
Gateway address update callback.
void SetRegenerative(bool isRegenerative)
Set if associated satellite is regenerative.
void SetPhyRx(Ptr< SatLoraPhyRx > phyRx)
Ptr< LoraLogicalChannel > GetChannelForTx(void)
Find a suitable channel for transmission.
Ptr< SatLoraPhyRx > m_phyRx
Reception phy layer for Lora operations.
double GetAggregatedDutyCycle(void)
Set a value for the RX1DROffset parameter.
TracedValue< double > m_lastKnownLinkMargin
The last known link margin.
Mac48Address m_gwAddress
Gateway address used in case of transparent satellite.
uint8_t m_maxNumbTx
Maximum number of transmission allowed.
bool m_controlDataRate
Whether this device's data rate should be controlled by the NS.
uint32_t m_raChannel
RA channel assigned to the UT.
virtual void SendToPhy(Ptr< Packet > packet)
Add headers and send a packet with the sending function of the physical layer.
void SetUpdateAddressAndIdentifierCallback(LorawanMacEndDevice::UpdateAddressAndIdentifierCallback cb)
Set the callback to update addresses in statistics helpers.
Ptr< SatLoraPhyRx > GetPhyRx()
void SetDataRateAdaptation(bool adapt)
Enable data rate adaptation in the retransmitting procedure.
void OnDevStatusReq(void)
Perform the actions that need to be taken when receiving a DevStatusReq command.
Ptr< UniformRandomVariable > m_uniformRV
An uniform random variable, used by the Shuffle method to randomly reorder the channel list.
virtual void Send(Ptr< Packet > packet)
Send a packet.
void SetDataRate(uint8_t dataRate)
Set the data rate this end device will use when transmitting.
void AddLogicalChannel(double frequency)
Add a logical channel to the helper.
Callback< void, Ptr< Node > > UpdateAddressAndIdentifierCallback
Callback to update addresses in statistics helpers.
void OnLinkAdrReq(uint8_t dataRate, uint8_t txPower, std::list< int > enabledChannels, int repetitions)
Perform the actions that need to be taken when receiving a LinkAdrReq command.
void AddLorawanMacCommand(Ptr< LorawanMacCommand > macCommand)
Add a MAC command to the list of those that will be sent out in the next packet.
void AddLoraSubBand(double startFrequency, double endFrequency, double dutyCycle, double maxTxPowerDbm)
Add a subband to the logical channel helper.
void SetLogicalChannel(uint8_t chIndex, double frequency, uint8_t minDataRate, uint8_t maxDataRate)
Set a new logical channel in the helper.
void ChangeBeam(uint32_t satId, uint32_t beamId)
Method handling beam handover.
Ptr< Node > m_node
Node containing this MAC.
void SetRaChannel(uint32_t raChannel)
Set RA channel assigned for this UT.
TracedValue< uint8_t > m_dataRate
The DataRate this device is using to transmit.
LoraDeviceAddress GetDeviceAddress(void)
Get the network address of this device.
TracedValue< int > m_lastKnownGatewayCount
The last known gateway count (i.e., gateways that are in communication range with this end device)
virtual void TxFinished()
Perform the actions that are required after a packet send.
void ParseCommands(LoraFrameHeader frameHeader)
Parse and take action on the commands contained on this FrameHeader.
bool CheckHandovers()
Check for UT handovers and perform it if necessary.
void SetGwAddress(Mac48Address gwAddress)
Set address of the GW (or its MAC) serving this UT.
std::vector< Ptr< LoraLogicalChannel > > Shuffle(std::vector< Ptr< LoraLogicalChannel >> vector)
Randomly shuffle a Ptr<LoraLogicalChannel> vector.
virtual void resetRetransmissionParameters()
Reset retransmission parameters contained in the structure LoraRetxParams.
virtual uint8_t GetTransmissionPower(void)
Get the transmission power this end device is set to use.
bool m_isRegenerative
Tell if satellite is regenerative.
void SetGatewayUpdateCallback(LorawanMacEndDevice::GatewayUpdateCallback cb)
Method to set the gateway address update callback.
LoraDeviceAddress m_address
The address of this device.
LorawanMacEndDevice::UpdateAddressAndIdentifierCallback m_updateAddressAndIdentifierCallback
Callback to update addresses in statistics helpers.
struct LoraRetxParameters m_retxParams
void ApplyNecessaryOptions(LoraFrameHeader &frameHeader)
Add the necessary options and MAC commands to the LoraFrameHeader.
virtual void Receive(Ptr< Packet > packet)=0
Receive a packet.
virtual void OnRxClassParamSetupReq(Ptr< RxParamSetupReq > rxParamSetupReq)
Perform the actions that need to be taken when receiving a RxParamSetupReq command based on the Devic...
virtual Time GetNextClassTransmissionDelay(Time waitingTime)
Find the minimum waiting time before the next possible transmission based on End Device's Class Type.
void OnDutyCycleReq(double dutyCycle)
Perform the actions that need to be taken when receiving a DutyCycleReq command.
void OnRxParamSetupReq(Ptr< RxParamSetupReq > rxParamSetupReq)
Perform the actions that need to be taken when receiving a RxParamSetupReq command.
virtual ~LorawanMacEndDevice()
LorawanMacEndDevice::HandoverCallback m_handoverCallback
The physical layer handover callback.
void SetMaxNumberOfTransmissions(uint8_t maxNumbTx)
Set the maximum number of transmissions allowed.
Class representing the LoRaWAN MAC layer.
std::vector< uint32_t > m_maxAppPayloadForDataRate
A vector holding the maximum app payload size that corresponds to a certain DataRate.
uint32_t m_beamId
ID of beam for UT.
TracedCallback< Ptr< const Packet > > m_cannotSendBecauseDutyCycle
The trace source that is fired when a packet cannot be sent because of duty cycle limitations.
TracedCallback< Ptr< const Packet > > m_sentNewPacket
Trace source that is fired when a new APP layer packet arrives at the MAC layer.
uint8_t GetSfFromDataRate(uint8_t dataRate)
Get the SF corresponding to a data rate, based on this MAC's region.
double GetDbmForTxPower(uint8_t txPower)
Get the transmission power in dBm that corresponds, in this region, to the encoded 8-bit txPower.
LoraLogicalChannelHelper m_channelHelper
The LoraLogicalChannelHelper instance that is assigned to this MAC.
double GetBandwidthFromDataRate(uint8_t dataRate)
Get the BW corresponding to a data rate, based on this MAC's region.
Implementation of the NewChannelReq LoRaWAN MAC command.
Implementation of the RxParamSetupReq LoRaWAN MAC command.
virtual void SetSatelliteAddress(Address satelliteAddress)
Set the satellite MAC address on the other side of this link (if regenerative satellite).
SatMac::BeamSchedulerCallback m_beamSchedulerCallback
Callback to get the SatBeamScheduler linked to a beam ID.
SatMac::RoutingUpdateCallback m_routingUpdateCallback
Callback to update routing and ARP tables after a beam handover.
Address m_satelliteAddress
MAC address of satellite on other side of the link.
Ptr< SatHandoverModule > m_handoverModule
Module used to perform handovers.
Ptr< SatNodeInfo > m_nodeInfo
Node info containing node related information, such as node type, node id and MAC address (of the Sat...
uint32_t m_satId
The ID of the sat where mac belongs.
SatMac::UpdateIslCallback m_updateIslCallback
The update ISL routes callback.
SatSignalParameters::PacketsInBurst_t PacketContainer_t
Define PacketContainer in SatPhy.
Time tag used to identify the time when packet is enqueued at PHY on current link level.
Time tag used to identify the time when packet is enqueued at PHY on first link between GW and UT lev...
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
MacCommandType
Enum for every possible command type.
Structure representing the parameters that will be used in the retransmission procedure.