Class representing the MAC layer of a Class A LoRaWAN device. More...
#include "lorawan-mac-end-device-class-a.h"
Public Member Functions | |
LorawanMacEndDeviceClassA () | |
LorawanMacEndDeviceClassA (Ptr< Node > node, uint32_t satId, uint32_t beamId, Ptr< SatSuperframeSeq > seq) | |
virtual | ~LorawanMacEndDeviceClassA () |
void | CloseFirstReceiveWindow (void) |
Perform operations needed to close the first receive window. More... | |
void | CloseSecondReceiveWindow (void) |
Perform operations needed to close the second receive window. More... | |
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 failed. More... | |
uint8_t | GetFirstReceiveWindowDataRate (void) |
Get the Data Rate that will be used in the first receive window. More... | |
TypeId | GetInstanceTypeId (void) const |
virtual Time | GetNextClassTransmissionDelay (Time waitingTime) |
Find the minimum waiting time before the next possible transmission based on End Device's Class Type. More... | |
uint8_t | GetSecondReceiveWindowDataRate (void) |
Get the Data Rate that will be used in the second receive window. More... | |
double | GetSecondReceiveWindowFrequency (void) |
Get the frequency that is used for the second receive window. More... | |
virtual void | OnRxClassParamSetupReq (Ptr< RxParamSetupReq > rxParamSetupReq) |
Perform the actions that need to be taken when receiving a RxParamSetupReq command based on the Device's Class Type. More... | |
void | OpenFirstReceiveWindow (void) |
Perform operations needed to open the first receive window. More... | |
void | OpenSecondReceiveWindow (void) |
Perform operations needed to open the second receive window. More... | |
virtual void | Receive (Ptr< Packet > packet) |
Receive a packet. More... | |
virtual void | SendToPhy (Ptr< Packet > packet) |
Add headers and send a packet with the sending function of the physical layer. More... | |
void | SetRaModel (SatEnums::RandomAccessModel_t randomAccessModel) |
Set the random access model. More... | |
void | SetSecondReceiveWindowDataRate (uint8_t dataRate) |
Set the Data Rate to be used in the second receive window. More... | |
void | SetSecondReceiveWindowFrequency (double frequencyMHz) |
Set the frequency that will be used for the second receive window. More... | |
virtual void | TxFinished () |
Perform the actions that are required after a packet send. More... | |
Public Member Functions inherited from ns3::LorawanMacEndDevice | |
LorawanMacEndDevice () | |
LorawanMacEndDevice (Ptr< Node > node, uint32_t satId, uint32_t beamId) | |
virtual | ~LorawanMacEndDevice () |
void | AddLogicalChannel (double frequency) |
Add a logical channel to the helper. More... | |
void | AddLogicalChannel (Ptr< LoraLogicalChannel > logicalChannel) |
Add a logical channel to the helper. More... | |
void | AddLoraSubBand (double startFrequency, double endFrequency, double dutyCycle, double maxTxPowerDbm) |
Add a subband to the logical channel helper. More... | |
void | AddLorawanMacCommand (Ptr< LorawanMacCommand > macCommand) |
Add a MAC command to the list of those that will be sent out in the next packet. More... | |
void | ApplyNecessaryOptions (LoraFrameHeader &frameHeader) |
Add the necessary options and MAC commands to the LoraFrameHeader. More... | |
void | ApplyNecessaryOptions (LorawanMacHeader &macHeader) |
Add the necessary options and MAC commands to the LorawanMacHeader. More... | |
void | ChangeBeam (uint32_t satId, uint32_t beamId) |
Method handling beam handover. More... | |
virtual void | DoSend (Ptr< Packet > packet) |
Checking if we are performing the transmission of a new packet or a retransmission, and call SendToPhy function. More... | |
double | GetAggregatedDutyCycle (void) |
Set a value for the RX1DROffset parameter. More... | |
uint8_t | GetDataRate (void) |
Get the data rate this end device is set to use. More... | |
bool | GetDataRateAdaptation (void) |
Get if data rate adaptation is enabled or not. More... | |
LoraDeviceAddress | GetDeviceAddress (void) |
Get the network address of this device. More... | |
uint8_t | GetMaxNumberOfTransmissions (void) |
Set the maximum number of transmissions allowed. More... | |
LorawanMacHeader::MType | GetMType (void) |
Get the message type to send when the Send method is called. More... | |
Ptr< SatLoraPhyRx > | GetPhyRx () |
virtual uint8_t | GetTransmissionPower (void) |
Get the transmission power this end device is set to use. More... | |
void | OnDevStatusReq (void) |
Perform the actions that need to be taken when receiving a DevStatusReq command. More... | |
void | OnDutyCycleReq (double dutyCycle) |
Perform the actions that need to be taken when receiving a DutyCycleReq command. More... | |
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. More... | |
void | OnLinkCheckAns (uint8_t margin, uint8_t gwCnt) |
Perform the actions that need to be taken when receiving a LinkCheckAns command. More... | |
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. More... | |
void | OnRxParamSetupReq (Ptr< RxParamSetupReq > rxParamSetupReq) |
Perform the actions that need to be taken when receiving a RxParamSetupReq command. More... | |
void | ParseCommands (LoraFrameHeader frameHeader) |
Parse and take action on the commands contained on this FrameHeader. More... | |
virtual void | postponeTransmission (Time nextTxDelay, Ptr< Packet >) |
Postpone transmission to the specified time and delete previously scheduled transmissions if present. More... | |
virtual void | Receive (SatPhy::PacketContainer_t packets, Ptr< SatSignalParameters >) |
Receive a packet from the lower layer. More... | |
virtual void | resetRetransmissionParameters () |
Reset retransmission parameters contained in the structure LoraRetxParams. More... | |
virtual void | Send (Ptr< Packet > packet) |
Send a packet. More... | |
void | SetDataRate (uint8_t dataRate) |
Set the data rate this end device will use when transmitting. More... | |
void | SetDataRateAdaptation (bool adapt) |
Enable data rate adaptation in the retransmitting procedure. More... | |
void | SetDeviceAddress (LoraDeviceAddress address) |
Set the network address of this device. More... | |
void | SetGatewayUpdateCallback (LorawanMacEndDevice::GatewayUpdateCallback cb) |
Method to set the gateway address update callback. More... | |
void | SetGwAddress (Mac48Address gwAddress) |
Set address of the GW (or its MAC) serving this UT. More... | |
void | SetHandoverCallback (LorawanMacEndDevice::HandoverCallback cb) |
Method to set handover callback. More... | |
void | SetLogicalChannel (uint8_t chIndex, double frequency, uint8_t minDataRate, uint8_t maxDataRate) |
Set a new logical channel in the helper. More... | |
void | SetMaxNumberOfTransmissions (uint8_t maxNumbTx) |
Set the maximum number of transmissions allowed. More... | |
void | SetMType (LorawanMacHeader::MType mType) |
Set the message type to send when the Send method is called. More... | |
void | SetPhyRx (Ptr< SatLoraPhyRx > phyRx) |
void | SetRaChannel (uint32_t raChannel) |
Set RA channel assigned for this UT. More... | |
void | SetRegenerative (bool isRegenerative) |
Set if associated satellite is regenerative. More... | |
void | SetSatAddress (Mac48Address satAddress) |
Set address of the Lorawan GW (or its MAC) serving this UT. More... | |
void | SetUpdateAddressAndIdentifierCallback (LorawanMacEndDevice::UpdateAddressAndIdentifierCallback cb) |
Set the callback to update addresses in statistics helpers. More... | |
Public Member Functions inherited from ns3::LorawanMac | |
LorawanMac () | |
LorawanMac (uint32_t satId, uint32_t beamId) | |
virtual | ~LorawanMac () |
double | GetBandwidthFromDataRate (uint8_t dataRate) |
Get the BW corresponding to a data rate, based on this MAC's region. More... | |
double | GetDbmForTxPower (uint8_t txPower) |
Get the transmission power in dBm that corresponds, in this region, to the encoded 8-bit txPower. More... | |
Ptr< NetDevice > | GetDevice (void) |
Get the device this MAC layer is installed on. More... | |
LoraLogicalChannelHelper | GetLoraLogicalChannelHelper (void) |
Get the logical lora channel helper associated with this MAC. More... | |
int | GetNPreambleSymbols (void) |
Get the number of PHY preamble symbols this MAC is set to use. More... | |
Time | GetOnAirTime (Ptr< Packet > packet, LoraTxParameters txParams) |
Compute the time that a packet with certain characteristics will take to be transmitted. More... | |
Ptr< SatPhy > | GetPhy (void) |
Get the underlying PHY layer. More... | |
Ptr< SatLoraPhyTx > | GetPhyTx (void) |
Get the underlying PHY TX layer. More... | |
uint8_t | GetSfFromDataRate (uint8_t dataRate) |
Get the SF corresponding to a data rate, based on this MAC's region. More... | |
virtual void | Send (Ptr< Packet > packet, const Address &dest, uint16_t protocolNumber) |
Send a packet. More... | |
void | SetBandwidthForDataRate (std::vector< double > bandwidthForDataRate) |
Set the vector to use to check up correspondence between bandwidth and DataRate. More... | |
void | SetDevice (Ptr< NetDevice > device) |
Set the device this MAC layer is installed on. More... | |
void | SetLoraLogicalChannelHelper (LoraLogicalChannelHelper helper) |
Set the LoraLogicalChannelHelper this MAC instance will use. More... | |
void | SetMaxAppPayloadForDataRate (std::vector< uint32_t > maxAppPayloadForDataRate) |
Set the maximum App layer payload for a set DataRate. More... | |
void | SetNPreambleSymbols (int nPreambleSymbols) |
Set the number of PHY preamble symbols this MAC is set to use. More... | |
void | SetPhy (Ptr< SatPhy > phy) |
Set the underlying PHY layer. More... | |
void | SetPhyTx (Ptr< SatLoraPhyTx > phyTx) |
Set the underlying PHY TX layer. More... | |
void | setRegenerative (bool isRegenerative) |
Indicates if the satellite is regenerative on the link this layer is sending packets. More... | |
void | SetReplyDataRateMatrix (ReplyDataRateMatrix replyDataRateMatrix) |
Set the matrix to use when deciding with which DataRate to respond. More... | |
void | SetSfForDataRate (std::vector< uint8_t > sfForDataRate) |
Set the vector to use to check up correspondence between SF and DataRate. More... | |
void | SetTxDbmForTxPower (std::vector< double > txDbmForTxPower) |
Set the vector to use to check up which transmission power in Dbm corresponds to a certain TxPower value in this MAC's region. More... | |
Public Member Functions inherited from ns3::SatMac | |
SatMac () | |
Construct a SatMac. More... | |
SatMac (uint32_t satId, uint32_t beamId) | |
Construct a SatMac. More... | |
~SatMac () | |
Destroy a SatMac. More... | |
virtual void | Disable () |
Disable the MAC layer, i.e. More... | |
virtual void | Enable () |
Enable the MAC layer, i.e. More... | |
Address | GetAddress () const |
Get MAC address. More... | |
uint32_t | GetBeamId () const |
Get beam ID of the object. More... | |
uint32_t | GetSatId () const |
Get sat ID of the object. More... | |
virtual void | ReceiveQueueEvent (SatQueue::QueueEvent_t event, uint8_t flowIndex) |
Receive a queue event: More... | |
uint32_t | ReserveIdAndStoreCtrlMsgToContainer (Ptr< SatControlMessage > msg) |
Reserve id and store the control message. More... | |
uint32_t | SendCtrlMsgFromContainer (uint32_t sendId) |
Send the control message from the container. More... | |
void | SetBeamId (uint32_t beamId) |
Set beam ID of the object. More... | |
void | SetBeamSchedulerCallback (SatMac::BeamSchedulerCallback cb) |
Set the beam scheduler callback. More... | |
void | SetHandoverModule (Ptr< SatHandoverModule > handoverModule) |
Set the handover module. More... | |
void | SetLoraReceiveCallback (SatMac::LoraReceiveCallback cb) |
Method to set receive callback. More... | |
virtual void | SetNodeInfo (Ptr< SatNodeInfo > nodeInfo) |
Set the node info. More... | |
void | SetReadCtrlCallback (SatMac::ReadCtrlMsgCallback cb) |
Method to set read control message callback. More... | |
void | SetReceiveCallback (SatMac::ReceiveCallback cb) |
Method to set receive callback. More... | |
void | SetReserveCtrlCallback (SatMac::ReserveCtrlMsgCallback cb) |
Method to set reserve control message id callback. More... | |
void | SetRoutingUpdateCallback (SatMac::RoutingUpdateCallback cb) |
Method to set the routing update callback. More... | |
virtual void | SetSatelliteAddress (Address satelliteAddress) |
Set the satellite MAC address on the other side of this link (if regenerative satellite). More... | |
void | SetSatId (uint32_t satId) |
Set sat ID of the object. More... | |
void | SetSendCtrlCallback (SatMac::SendCtrlMsgCallback cb) |
Method to set send control message callback. More... | |
void | SetTransmitCallback (SatMac::TransmitCallback cb) |
Method to set transmit callback. More... | |
void | SetUpdateIslCallback (SatMac::UpdateIslCallback cb) |
Method to set update ISL callback. More... | |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::LorawanMacEndDevice | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::LorawanMac | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::SatMac | |
static TypeId | GetTypeId (void) |
Derived from Object. More... | |
Private Attributes | |
EventId | m_closeFirstWindow |
The event of the closing the first receive window. More... | |
EventId | m_closeSecondWindow |
The event of the closing the second receive window. More... | |
Time | m_firstWindowDelay |
Time to wait between end of message transmission and opening of first reception window. More... | |
Time | m_firstWindowDuration |
Duration of first reception window. More... | |
SatEnums::PacketType_t | m_packetType |
Packet type used on RTN channel. More... | |
uint8_t | m_rx1DrOffset |
The RX1DROffset parameter value. More... | |
EventId | m_secondReceiveWindow |
The event of the second receive window opening. More... | |
uint8_t | m_secondReceiveWindowDataRate |
The Data Rate to listen for during the second downlink transmission. More... | |
double | m_secondReceiveWindowFrequency |
The frequency to listen on for the second receive window. More... | |
Time | m_secondWindowDelay |
Time to wait between end of message transmission and opening of second reception window. More... | |
Time | m_secondWindowDuration |
Duration of second reception window. More... | |
Ptr< SatSuperframeSeq > | m_superframeSeq |
Used superframe sequence for the return link. More... | |
Additional Inherited Members | |
Public Types inherited from ns3::LorawanMacEndDevice | |
typedef Callback< void, Mac48Address > | GatewayUpdateCallback |
Callback to update gateway address after handover. More... | |
typedef Callback< void, uint32_t, uint32_t > | HandoverCallback |
Callback to reconfigure physical layer during handover. More... | |
typedef Callback< void, Ptr< Node > > | UpdateAddressAndIdentifierCallback |
Callback to update addresses in statistics helpers. More... | |
Public Types inherited from ns3::LorawanMac | |
typedef std::array< std::array< uint8_t, 6 >, 8 > | ReplyDataRateMatrix |
Public Types inherited from ns3::SatMac | |
typedef Callback< Ptr< SatBeamScheduler >, uint32_t, uint32_t > | BeamSchedulerCallback |
Callback to get the SatBeamScheduler from the beam ID for handover. More... | |
typedef Callback< void, Ptr< const Packet > > | LoraReceiveCallback |
Callback to receive packet by upper layer. More... | |
typedef Callback< Ptr< SatControlMessage >, uint32_t > | ReadCtrlMsgCallback |
Callback to read control messages from container storing control messages. More... | |
typedef Callback< void, Ptr< Packet >, Mac48Address, Mac48Address > | ReceiveCallback |
Callback to receive packet by upper layer. More... | |
typedef Callback< uint32_t, Ptr< SatControlMessage > > | ReserveCtrlMsgCallback |
Callback to reserve an id and initially store the control message. More... | |
typedef Callback< void, Address, Address > | RoutingUpdateCallback |
Callback to update routing and ARP tables after handover. More... | |
typedef Callback< uint32_t, uint32_t > | SendCtrlMsgCallback |
Callback to send a control message and allocate a recv ID for it. More... | |
typedef Callback< void, SatPhy::PacketContainer_t, uint32_t, Time, SatSignalParameters::txInfo_s > | TransmitCallback |
Callback to send packet to lower layer. More... | |
typedef Callback< void > | UpdateIslCallback |
Callback to update ISL routes when handovers are performed. More... | |
Protected Member Functions inherited from ns3::LorawanMacEndDevice | |
bool | CheckHandovers () |
Check for UT handovers and perform it if necessary. More... | |
Ptr< LoraLogicalChannel > | GetChannelForTx (void) |
Find a suitable channel for transmission. More... | |
Protected Member Functions inherited from ns3::SatMac | |
void | DoDispose (void) |
Dispose of SatMac. More... | |
void | RxTraces (SatPhy::PacketContainer_t packets) |
Invoke the Rx trace source for each received packet. More... | |
virtual void | SendPacket (SatPhy::PacketContainer_t packets, uint32_t carrierId, Time duration, SatSignalParameters::txInfo_s txInfo) |
Send packets to lower layer by using a callback. More... | |
void | SetTimeTag (SatPhy::PacketContainer_t packets) |
Set SatMacTimeTag of packets. More... | |
Protected Attributes inherited from ns3::LorawanMacEndDevice | |
LoraDeviceAddress | m_address |
The address of this device. More... | |
uint8_t | m_codingRate |
The coding rate used by this device. More... | |
TracedValue< uint8_t > | m_dataRate |
The DataRate this device is using to transmit. More... | |
bool | m_enableDRAdapt |
Enable Data Rate adaptation during the retransmission procedure. More... | |
LorawanMacEndDevice::GatewayUpdateCallback | m_gatewayUpdateCallback |
Gateway address update callback. More... | |
Mac48Address | m_gwAddress |
Gateway address used in case of transparent satellite. More... | |
bool | m_headerDisabled |
Whether or not the header is disabled for communications by this device. More... | |
bool | m_isRegenerative |
Tell if satellite is regenerative. More... | |
std::list< Ptr< LorawanMacCommand > > | m_macCommandList |
List of the MAC commands that need to be applied to the next UL packet. More... | |
uint8_t | m_maxNumbTx |
Maximum number of transmission allowed. More... | |
Ptr< Node > | m_node |
Node containing this MAC. More... | |
Ptr< SatLoraPhyRx > | m_phyRx |
Reception phy layer for Lora operations. More... | |
uint32_t | m_raChannel |
RA channel assigned to the UT. More... | |
uint8_t | m_receiveWindowDurationInSymbols |
The duration of a receive window in number of symbols. More... | |
TracedCallback< uint8_t, bool, Time, Ptr< Packet > > | m_requiredTxCallback |
The trace source fired when the transmission procedure is finished. More... | |
struct LoraRetxParameters | m_retxParams |
TracedValue< double > | m_txPower |
The transmission power this device is using to transmit. More... | |
Ptr< UniformRandomVariable > | m_uniformRV |
An uniform random variable, used by the Shuffle method to randomly reorder the channel list. More... | |
Protected Attributes inherited from ns3::LorawanMac | |
std::vector< double > | m_bandwidthForDataRate |
A vector holding the bandwidth each Data Rate corresponds to. More... | |
uint32_t | m_beamId |
ID of beam for UT. More... | |
TracedCallback< Ptr< const Packet > > | m_cannotSendBecauseDutyCycle |
The trace source that is fired when a packet cannot be sent because of duty cycle limitations. More... | |
LoraLogicalChannelHelper | m_channelHelper |
The LoraLogicalChannelHelper instance that is assigned to this MAC. More... | |
Ptr< NetDevice > | m_device |
The device this MAC layer is installed on. More... | |
bool | m_isRegenerative |
Indicates if satellite is regenerative on the link where this layer is sending packets. More... | |
std::vector< uint32_t > | m_maxAppPayloadForDataRate |
A vector holding the maximum app payload size that corresponds to a certain DataRate. More... | |
int | m_nPreambleSymbols |
The number of symbols to use in the PHY preamble. More... | |
Ptr< SatPhy > | m_phy |
The PHY instance that sits under this MAC layer. More... | |
TracedCallback< Ptr< const Packet > > | m_receivedPacket |
Trace source that is fired when a packet reaches the MAC layer. More... | |
ReplyDataRateMatrix | m_replyDataRateMatrix |
The matrix that decides the DR the GW will use in a reply based on the ED's sending DR and on the value of the RX1DROffset parameter. More... | |
TracedCallback< Ptr< const Packet > > | m_sentNewPacket |
Trace source that is fired when a new APP layer packet arrives at the MAC layer. More... | |
std::vector< uint8_t > | m_sfForDataRate |
A vector holding the SF each Data Rate corresponds to. More... | |
std::vector< double > | m_txDbmForTxPower |
A vector holding the power that corresponds to a certain TxPower value. More... | |
Protected Attributes inherited from ns3::SatMac | |
Time | m_beamEnabledTime |
Time of the last beam enable event. More... | |
uint32_t | m_beamId |
The ID of the beam where mac belongs. More... | |
SatMac::BeamSchedulerCallback | m_beamSchedulerCallback |
Callback to get the SatBeamScheduler linked to a beam ID. More... | |
TracedCallback< Time > | m_beamServiceTrace |
Traced callback for beam being disabled and including service time. More... | |
SatEnums::RegenerationMode_t | m_forwardLinkRegenerationMode |
Regeneration mode on forward link. More... | |
Ptr< SatHandoverModule > | m_handoverModule |
Module used to perform handovers. More... | |
bool | m_isRegenerative |
Indicate if satellite is regeneration (at least LINK level) for TX. More... | |
bool | m_isStatisticsTagsEnabled |
EnableStatisticsTags attribute. More... | |
Time | m_lastDelay |
Last delay measurement. More... | |
Time | m_lastLinkDelay |
Last delay measurement for link. More... | |
std::queue< Time > | m_lastSOF |
Store last 3 SOF date for Forward messages, to insert in NCR packets. More... | |
std::queue< Ptr< SatNcrMessage > > | m_ncrMessagesToSend |
List of NCR control messages created but not sent yet. More... | |
bool | m_ncrV2 |
Use of version 2 of NCR dates. More... | |
Ptr< SatNodeInfo > | m_nodeInfo |
Node info containing node related information, such as node type, node id and MAC address (of the SatNetDevice) More... | |
TracedCallback< Time, SatEnums::SatPacketEvent_t, SatEnums::SatNodeType_t, uint32_t, Mac48Address, SatEnums::SatLogLevel_t, SatEnums::SatLinkDir_t, std::string > | m_packetTrace |
Trace callback used for packet tracing. More... | |
SatMac::ReadCtrlMsgCallback | m_readCtrlCallback |
The read control message callback. More... | |
SatMac::ReserveCtrlMsgCallback | m_reserveCtrlCallback |
The reserve control message id callback. More... | |
SatEnums::RegenerationMode_t | m_returnLinkRegenerationMode |
Regeneration mode on return link. More... | |
SatMac::RoutingUpdateCallback | m_routingUpdateCallback |
Callback to update routing and ARP tables after a beam handover. More... | |
SatMac::ReceiveCallback | m_rxCallback |
The upper layer package receive callback. More... | |
TracedCallback< const Time &, const Address & > | m_rxDelayTrace |
Traced callback for all received packets, including delay information and the address of the senders. More... | |
TracedCallback< const Time &, const Address & > | m_rxJitterTrace |
Traced callback for all received packets, including jitter information and the address of the senders. More... | |
TracedCallback< const Time &, const Address & > | m_rxLinkDelayTrace |
Traced callback for all received packets, including link delay information and the address of the senders. More... | |
TracedCallback< const Time &, const Address & > | m_rxLinkJitterTrace |
Traced callback for all received packets, including link jitter information and the address of the senders. More... | |
SatMac::LoraReceiveCallback | m_rxLoraCallback |
The upper layer package receive callback. More... | |
TracedCallback< Ptr< const Packet >, const Address & > | m_rxTrace |
Traced callback for all received packets, including the address of the senders. More... | |
Address | m_satelliteAddress |
MAC address of satellite on other side of the link. More... | |
uint32_t | m_satId |
The ID of the sat where mac belongs. More... | |
SatMac::SendCtrlMsgCallback | m_sendCtrlCallback |
The send control message callback. More... | |
SatMac::TransmitCallback | m_txCallback |
The lower layer packet transmit callback. More... | |
bool | m_txEnabled |
Flag indicating whether the MAC is enabled, i.e. More... | |
SatMac::UpdateIslCallback | m_updateIslCallback |
The update ISL routes callback. More... | |
Class representing the MAC layer of a Class A LoRaWAN device.
Definition at line 41 of file lorawan-mac-end-device-class-a.h.
ns3::LorawanMacEndDeviceClassA::LorawanMacEndDeviceClassA | ( | ) |
Definition at line 84 of file lorawan-mac-end-device-class-a.cc.
ns3::LorawanMacEndDeviceClassA::LorawanMacEndDeviceClassA | ( | Ptr< Node > | node, |
uint32_t | satId, | ||
uint32_t | beamId, | ||
Ptr< SatSuperframeSeq > | seq | ||
) |
Definition at line 89 of file lorawan-mac-end-device-class-a.cc.
References m_closeFirstWindow, m_closeSecondWindow, m_firstWindowDelay, m_firstWindowDuration, m_secondReceiveWindow, and m_secondWindowDelay.
|
virtual |
Definition at line 117 of file lorawan-mac-end-device-class-a.cc.
void ns3::LorawanMacEndDeviceClassA::CloseFirstReceiveWindow | ( | void | ) |
Perform operations needed to close the first receive window.
Definition at line 486 of file lorawan-mac-end-device-class-a.cc.
References ns3::LorawanMacEndDevice::m_phyRx, ns3::SatLoraPhyRx::RX, ns3::SatLoraPhyRx::SLEEP, ns3::SatLoraPhyRx::STANDBY, and ns3::SatLoraPhyRx::TX.
Referenced by OpenFirstReceiveWindow().
void ns3::LorawanMacEndDeviceClassA::CloseSecondReceiveWindow | ( | void | ) |
Perform operations needed to close the second receive window.
Definition at line 546 of file lorawan-mac-end-device-class-a.cc.
References ns3::LorawanMacEndDevice::LoraRetxParameters::firstAttempt, ns3::LorawanMacEndDevice::m_maxNumbTx, ns3::LorawanMacEndDevice::m_phyRx, ns3::LorawanMacEndDevice::m_requiredTxCallback, ns3::LorawanMacEndDevice::m_retxParams, ns3::LorawanMacEndDevice::LoraRetxParameters::packet, ns3::LorawanMacEndDevice::resetRetransmissionParameters(), ns3::LorawanMacEndDevice::LoraRetxParameters::retxLeft, ns3::SatLoraPhyRx::RX, ns3::LorawanMacEndDevice::Send(), ns3::SatLoraPhyRx::SLEEP, ns3::SatLoraPhyRx::STANDBY, ns3::SatLoraPhyRx::TX, and ns3::LorawanMacEndDevice::LoraRetxParameters::waitingAck.
Referenced by OpenSecondReceiveWindow().
|
virtual |
Function called by lower layers to inform this layer that reception of a packet we were locked on failed.
packet | the packet we failed to receive |
Reimplemented from ns3::LorawanMacEndDevice.
Definition at line 394 of file lorawan-mac-end-device-class-a.cc.
References ns3::LorawanMacEndDevice::LoraRetxParameters::firstAttempt, ns3::LorawanMacEndDevice::m_maxNumbTx, ns3::LorawanMacEndDevice::m_phyRx, ns3::LorawanMacEndDevice::m_requiredTxCallback, ns3::LorawanMacEndDevice::m_retxParams, m_secondReceiveWindow, ns3::LorawanMacEndDevice::LoraRetxParameters::packet, ns3::LorawanMacEndDevice::resetRetransmissionParameters(), ns3::LorawanMacEndDevice::LoraRetxParameters::retxLeft, ns3::LorawanMacEndDevice::Send(), and ns3::LorawanMacEndDevice::LoraRetxParameters::waitingAck.
uint8_t ns3::LorawanMacEndDeviceClassA::GetFirstReceiveWindowDataRate | ( | void | ) |
Get the Data Rate that will be used in the first receive window.
Definition at line 660 of file lorawan-mac-end-device-class-a.cc.
References ns3::LorawanMacEndDevice::m_dataRate, ns3::LorawanMac::m_replyDataRateMatrix, and m_rx1DrOffset.
Referenced by SendToPhy().
TypeId ns3::LorawanMacEndDeviceClassA::GetInstanceTypeId | ( | void | ) | const |
Definition at line 79 of file lorawan-mac-end-device-class-a.cc.
References GetTypeId().
|
virtual |
Find the minimum waiting time before the next possible transmission based on End Device's Class Type.
waitingTime | The minimum waiting time that has to be respected, irrespective of the class (e.g., because of duty cycle limitations). |
Reimplemented from ns3::LorawanMacEndDevice.
Definition at line 616 of file lorawan-mac-end-device-class-a.cc.
References ns3::LorawanMac::GetBandwidthFromDataRate(), GetSecondReceiveWindowDataRate(), ns3::LorawanMac::GetSfFromDataRate(), m_closeFirstWindow, m_closeSecondWindow, ns3::LorawanMacEndDevice::m_receiveWindowDurationInSymbols, ns3::LorawanMacEndDevice::m_retxParams, m_secondReceiveWindow, ns3::LorawanMacEndDevice::m_uniformRV, and ns3::LorawanMacEndDevice::LoraRetxParameters::waitingAck.
uint8_t ns3::LorawanMacEndDeviceClassA::GetSecondReceiveWindowDataRate | ( | void | ) |
Get the Data Rate that will be used in the second receive window.
Definition at line 672 of file lorawan-mac-end-device-class-a.cc.
References m_secondReceiveWindowDataRate.
Referenced by GetNextClassTransmissionDelay().
double ns3::LorawanMacEndDeviceClassA::GetSecondReceiveWindowFrequency | ( | void | ) |
Get the frequency that is used for the second receive window.
Definition at line 684 of file lorawan-mac-end-device-class-a.cc.
References m_secondReceiveWindowFrequency.
|
static |
Definition at line 47 of file lorawan-mac-end-device-class-a.cc.
References m_firstWindowDelay, m_firstWindowDuration, m_secondWindowDelay, and m_secondWindowDuration.
Referenced by GetInstanceTypeId().
|
virtual |
Perform the actions that need to be taken when receiving a RxParamSetupReq command based on the Device's Class Type.
rxParamSetupReq | The Parameter Setup Request, which contains:
|
Reimplemented from ns3::LorawanMacEndDevice.
Definition at line 694 of file lorawan-mac-end-device-class-a.cc.
References ns3::LorawanMac::GetBandwidthFromDataRate(), ns3::LorawanMac::GetSfFromDataRate(), ns3::LorawanMacEndDevice::m_macCommandList, m_rx1DrOffset, m_secondReceiveWindowDataRate, and m_secondReceiveWindowFrequency.
void ns3::LorawanMacEndDeviceClassA::OpenFirstReceiveWindow | ( | void | ) |
Perform operations needed to open the first receive window.
Definition at line 470 of file lorawan-mac-end-device-class-a.cc.
References CloseFirstReceiveWindow(), m_closeFirstWindow, m_firstWindowDuration, and ns3::LorawanMacEndDevice::m_phyRx.
Referenced by TxFinished().
void ns3::LorawanMacEndDeviceClassA::OpenSecondReceiveWindow | ( | void | ) |
Perform operations needed to open the second receive window.
Definition at line 515 of file lorawan-mac-end-device-class-a.cc.
References CloseSecondReceiveWindow(), ns3::LorawanMac::GetSfFromDataRate(), m_closeSecondWindow, ns3::LorawanMacEndDevice::m_phyRx, m_secondReceiveWindowDataRate, m_secondReceiveWindowFrequency, m_secondWindowDuration, and ns3::SatLoraPhyRx::RX.
Referenced by TxFinished().
|
virtual |
Receive a packet.
This method is typically registered as a callback in the underlying PHY layer so that it's called when a packet is going up the stack.
packet | the received packet. |
Implements ns3::LorawanMacEndDevice.
Definition at line 274 of file lorawan-mac-end-device-class-a.cc.
References ns3::LorawanMacEndDevice::LoraRetxParameters::firstAttempt, ns3::LoraFrameHeader::GetAddress(), ns3::LorawanMacHeader::IsUplink(), ns3::LorawanMacEndDevice::m_address, ns3::LorawanMacEndDevice::m_maxNumbTx, ns3::SatMac::m_nodeInfo, ns3::LorawanMacEndDevice::m_phyRx, ns3::LorawanMac::m_receivedPacket, ns3::LorawanMacEndDevice::m_requiredTxCallback, ns3::LorawanMacEndDevice::m_retxParams, m_secondReceiveWindow, ns3::LorawanMacEndDevice::LoraRetxParameters::packet, ns3::LorawanMacEndDevice::ParseCommands(), ns3::LorawanMacEndDevice::resetRetransmissionParameters(), ns3::LorawanMacEndDevice::LoraRetxParameters::retxLeft, ns3::SatMac::RxTraces(), ns3::LorawanMacEndDevice::Send(), ns3::LoraFrameHeader::SetAsDownlink(), ns3::SatMacTag::SetDestAddress(), ns3::SatAddressE2ETag::SetE2EDestAddress(), and ns3::LorawanMacEndDevice::LoraRetxParameters::waitingAck.
|
virtual |
Add headers and send a packet with the sending function of the physical layer.
packet | the packet to send |
Reimplemented from ns3::LorawanMacEndDevice.
Definition at line 127 of file lorawan-mac-end-device-class-a.cc.
References ns3::LoraLogicalChannelHelper::AddEvent(), ns3::LoraTxParameters::bandwidthHz, ns3::LoraTxParameters::codingRate, ns3::LoraTxParameters::crcEnabled, ns3::SatSignalParameters::txInfo_s::fecBlockSizeInBytes, ns3::SatSignalParameters::txInfo_s::frameType, ns3::LorawanMac::GetBandwidthFromDataRate(), ns3::LorawanMacEndDevice::GetChannelForTx(), ns3::SatUtils::GetCodingRate(), GetFirstReceiveWindowDataRate(), ns3::LorawanMac::GetOnAirTime(), ns3::LorawanMac::GetSfFromDataRate(), ns3::LoraTxParameters::headerDisabled, ns3::LoraTxParameters::lowDataRateOptimizationEnabled, ns3::LorawanMac::m_channelHelper, ns3::LorawanMacEndDevice::m_dataRate, ns3::LorawanMac::m_device, ns3::LorawanMacEndDevice::m_enableDRAdapt, ns3::LorawanMacEndDevice::m_gwAddress, ns3::LorawanMacEndDevice::m_headerDisabled, ns3::LorawanMacEndDevice::m_isRegenerative, ns3::SatMac::m_isStatisticsTagsEnabled, ns3::LorawanMacEndDevice::m_maxNumbTx, ns3::SatMac::m_nodeInfo, ns3::LorawanMac::m_nPreambleSymbols, m_packetType, ns3::LorawanMac::m_phy, ns3::LorawanMacEndDevice::m_phyRx, ns3::LorawanMacEndDevice::m_retxParams, m_rx1DrOffset, ns3::SatMac::m_satelliteAddress, m_superframeSeq, ns3::LorawanMacEndDevice::m_txPower, ns3::SatSignalParameters::txInfo_s::modCod, ns3::LoraTxParameters::nPreamble, ns3::SatSignalParameters::txInfo_s::packetType, ns3::LorawanMacEndDevice::LoraRetxParameters::retxLeft, ns3::LoraTag::SetDataRate(), ns3::SatMacTag::SetDestAddress(), ns3::SatAddressE2ETag::SetE2EDestAddress(), ns3::SatAddressE2ETag::SetE2ESourceAddress(), ns3::LoraTag::SetFrequency(), ns3::LoraTag::SetModcod(), ns3::SatMacTag::SetSourceAddress(), ns3::LoraTxParameters::sf, ns3::SatConstVariables::SUPERFRAME_SEQUENCE, ns3::SatEnums::UNDEFINED_FRAME, and ns3::SatSignalParameters::txInfo_s::waveformId.
void ns3::LorawanMacEndDeviceClassA::SetRaModel | ( | SatEnums::RandomAccessModel_t | randomAccessModel | ) |
Set the random access model.
randomAccessModel | The model to use. |
Definition at line 444 of file lorawan-mac-end-device-class-a.cc.
References m_packetType, ns3::SatEnums::PACKET_TYPE_CRDSA, ns3::SatEnums::PACKET_TYPE_DEDICATED_ACCESS, ns3::SatEnums::PACKET_TYPE_ESSA, ns3::SatEnums::PACKET_TYPE_SLOTTED_ALOHA, ns3::SatEnums::RA_MODEL_CRDSA, ns3::SatEnums::RA_MODEL_ESSA, ns3::SatEnums::RA_MODEL_MARSALA, ns3::SatEnums::RA_MODEL_OFF, ns3::SatEnums::RA_MODEL_RCS2_SPECIFICATION, and ns3::SatEnums::RA_MODEL_SLOTTED_ALOHA.
void ns3::LorawanMacEndDeviceClassA::SetSecondReceiveWindowDataRate | ( | uint8_t | dataRate | ) |
Set the Data Rate to be used in the second receive window.
dataRate | The Data Rate. |
Definition at line 666 of file lorawan-mac-end-device-class-a.cc.
References m_secondReceiveWindowDataRate.
void ns3::LorawanMacEndDeviceClassA::SetSecondReceiveWindowFrequency | ( | double | frequencyMHz | ) |
Set the frequency that will be used for the second receive window.
frequencyMHz | the Frequency. |
Definition at line 678 of file lorawan-mac-end-device-class-a.cc.
References m_secondReceiveWindowFrequency.
|
virtual |
Perform the actions that are required after a packet send.
This function handles opening of the first receive window.
Reimplemented from ns3::LorawanMacEndDevice.
Definition at line 423 of file lorawan-mac-end-device-class-a.cc.
References m_firstWindowDelay, ns3::LorawanMacEndDevice::m_phyRx, m_secondReceiveWindow, m_secondWindowDelay, OpenFirstReceiveWindow(), and OpenSecondReceiveWindow().
|
private |
The event of the closing the first receive window.
This Event will be canceled if there's a successful reception of a packet.
Definition at line 215 of file lorawan-mac-end-device-class-a.h.
Referenced by LorawanMacEndDeviceClassA(), GetNextClassTransmissionDelay(), and OpenFirstReceiveWindow().
|
private |
The event of the closing the second receive window.
This Event will be canceled if there's a successful reception of a packet.
Definition at line 222 of file lorawan-mac-end-device-class-a.h.
Referenced by LorawanMacEndDeviceClassA(), GetNextClassTransmissionDelay(), and OpenSecondReceiveWindow().
|
private |
Time to wait between end of message transmission and opening of first reception window.
Definition at line 193 of file lorawan-mac-end-device-class-a.h.
Referenced by LorawanMacEndDeviceClassA(), GetTypeId(), and TxFinished().
|
private |
Duration of first reception window.
Definition at line 203 of file lorawan-mac-end-device-class-a.h.
Referenced by LorawanMacEndDeviceClassA(), GetTypeId(), and OpenFirstReceiveWindow().
|
private |
Packet type used on RTN channel.
Definition at line 188 of file lorawan-mac-end-device-class-a.h.
Referenced by SendToPhy(), and SetRaModel().
|
private |
The RX1DROffset parameter value.
Definition at line 245 of file lorawan-mac-end-device-class-a.h.
Referenced by GetFirstReceiveWindowDataRate(), OnRxClassParamSetupReq(), and SendToPhy().
|
private |
The event of the second receive window opening.
This Event is used to cancel the second window in case the first one is successful.
Definition at line 230 of file lorawan-mac-end-device-class-a.h.
Referenced by LorawanMacEndDeviceClassA(), FailedReception(), GetNextClassTransmissionDelay(), Receive(), and TxFinished().
|
private |
The Data Rate to listen for during the second downlink transmission.
Definition at line 240 of file lorawan-mac-end-device-class-a.h.
Referenced by GetSecondReceiveWindowDataRate(), OnRxClassParamSetupReq(), OpenSecondReceiveWindow(), and SetSecondReceiveWindowDataRate().
|
private |
The frequency to listen on for the second receive window.
Definition at line 235 of file lorawan-mac-end-device-class-a.h.
Referenced by GetSecondReceiveWindowFrequency(), OnRxClassParamSetupReq(), OpenSecondReceiveWindow(), and SetSecondReceiveWindowFrequency().
|
private |
Time to wait between end of message transmission and opening of second reception window.
Definition at line 198 of file lorawan-mac-end-device-class-a.h.
Referenced by LorawanMacEndDeviceClassA(), GetTypeId(), and TxFinished().
|
private |
Duration of second reception window.
Definition at line 208 of file lorawan-mac-end-device-class-a.h.
Referenced by GetTypeId(), and OpenSecondReceiveWindow().
|
private |
Used superframe sequence for the return link.
Definition at line 183 of file lorawan-mac-end-device-class-a.h.
Referenced by SendToPhy().