23 #ifndef SATELLITE_RANDOM_ACCESS_H
24 #define SATELLITE_RANDOM_ACCESS_H
29 #include <ns3/object.h>
30 #include <ns3/random-variable-stream.h>
31 #include <ns3/simulator.h>
32 #include <ns3/uinteger.h>
113 uint32_t backoffTimeInMilliSeconds);
130 uint32_t minRandomizationValue,
131 uint32_t maxRandomizationValue,
132 uint32_t numOfInstances);
142 uint32_t maxUniquePayloadPerBlock,
143 uint32_t maxConsecutiveBlocksAccessed,
144 uint32_t minIdleBlocks);
165 void SetBackoffTime(uint32_t allocationChannel, uint32_t backoffTime);
180 uint32_t controlRandomizationIntervalInMilliSeconds);
190 uint32_t allocationChannel,
290 uint32_t allocationChannel,
291 std::pair<std::set<uint32_t>, std::set<uint32_t>> slots);
300 uint32_t allocationChannel);
RandomAccessTxOpportunityType_t
Random access Tx opportunity types.
RandomAccessModel_t
The defined random access models.
RandomAccessTriggerType_t
The defined random access trigger types.
Class for random access algorithms.
SatEnums::RandomAccessModel_t m_randomAccessModel
The used random access model.
void CrdsaResetConsecutiveBlocksUsedForAllAllocationChannels()
Function for resetting the number of consecutive blocks to zero for all allocation channels.
bool IsEssaAllocationChannel(uint32_t allocationChannel)
Function for checking if the allocation channel is ESSA allocation channel.
void PrintVariables()
Function for printing out various module variables to console.
void SetCrdsaMaximumDataRateLimitationParameters(uint32_t allocationChannel, uint32_t maxUniquePayloadPerBlock, uint32_t maxConsecutiveBlocksAccessed, uint32_t minIdleBlocks)
Function for setting the maximum rate limitation parameters.
SatRandomAccess::RandomAccessTxOpportunities_s DoEssa(uint32_t allocationChannel)
Main function for ESSA.
void SetCrdsaBackoffTimeInMilliSeconds(uint32_t allocationChannel, uint32_t backoffTimeInMilliSeconds)
Function for setting the backoff time in milliseconds.
SatRandomAccess()
Constructor.
IsDamaAvailableCallback m_isDamaAvailableCb
Callback for known DAMA status.
std::pair< std::set< uint32_t >, std::set< uint32_t > > CrdsaRandomizeTxOpportunities(uint32_t allocationChannel, std::pair< std::set< uint32_t >, std::set< uint32_t >> slots)
Function for randomizing the CRDSA Tx opportunities (slots) for each unique packet.
bool IsSlottedAlohaAllocationChannel(uint32_t allocationChannel)
Function for checking if the allocation channel is Slotted ALOHA allocation channel.
SatRandomAccess::RandomAccessTxOpportunities_s DoRandomAccess(uint32_t allocationChannel, SatEnums::RandomAccessTriggerType_t triggerType)
Main function of this module.
uint32_t m_numOfAllocationChannels
Number of allocation channels available.
void SlottedAlohaDoVariableSanityCheck()
Function for checking the sanity of Slotted ALOHA related variables.
void CrdsaIncreaseConsecutiveBlocksUsed(uint32_t allocationChannel)
Function for increasing the allocation channel specific count of consecutive used blocks.
uint32_t GetConfigurationIdForAllocationChannel(uint32_t allocationChannelId)
Function to convert a carrier allocation channel ID into its allocation channel configuration ID.
void CrdsaResetConsecutiveBlocksUsed(uint32_t allocationChannel)
Function for resetting the number of consecutive blocks to zero for a specific allocation channel.
SatRandomAccess::RandomAccessTxOpportunities_s CrdsaPrepareToTransmit(uint32_t allocationChannel)
Function for evaluating backoff for each unique CRDSA packet and calling the randomization of Tx oppo...
bool CrdsaIsAllocationChannelFree(uint32_t allocationChannel)
Function for checking if the allocation channel is free.
void CrdsaIncreaseConsecutiveBlocksUsedForAllAllocationChannels()
Function for increasing the count of consecutive used blocks for all allocation channels.
void SetSlottedAlohaControlRandomizationIntervalInMilliSeconds(uint32_t controlRandomizationIntervalInMilliSeconds)
Function for setting the Slotted ALOHA control randomization interval.
AreBuffersEmptyCallback m_areBuffersEmptyCb
Callback for buffer status.
static TypeId GetTypeId(void)
NS-3 type id function.
Callback< bool > AreBuffersEmptyCallback
Typedef of callback for buffer status.
void CrdsaSetBackoffTimer(uint32_t allocationChannel)
Function for setting the allocation channel specific backoff timer.
void SetFSimBackoffTimeInFrames(uint32_t allocationChannel, uint32_t backoffTimeInFrames)
Function for setting the backoff time in frames.
SatRandomAccess::RandomAccessTxOpportunities_s DoCrdsa(uint32_t allocationChannel)
Main function for CRDSA algorithm.
void SetFSimBackoffProbability(uint32_t allocationChannel, uint16_t backoffPersistence)
Function for setting the backoff probability.
void SetCrdsaRandomizationParameters(uint32_t allocationChannel, uint32_t minRandomizationValue, uint32_t maxRandomizationValue, uint32_t numOfInstances)
Function for setting the parameters related to CRDSA randomization.
Ptr< SatRandomAccessConf > m_randomAccessConf
A pointer to random access configuration.
bool CrdsaHasBackoffTimePassed(uint32_t allocationChannel) const
Function for checking whether the backoff time has passed for this allocation channel.
Ptr< UniformRandomVariable > m_uniformRandomVariable
Uniform random variable object.
void SetAreBuffersEmptyCallback(SatRandomAccess::AreBuffersEmptyCallback callback)
Function for setting the AreBuffersEmpty callback.
void SetRandomAccessModel(SatEnums::RandomAccessModel_t randomAccessModel)
Function for setting the used random access model.
void SetIsDamaAvailableCallback(SatRandomAccess::IsDamaAvailableCallback callback)
Function for setting the IsDamaAvailable callback.
uint32_t GetSlottedAlohaSignalingOverheadInBytes()
Function for getting the Slotted ALOHA signaling overhead in bytes.
bool CrdsaDoBackoff(uint32_t allocationChannel)
Function for evaluating the backoff for this allocation channel.
SatRandomAccess::RandomAccessTxOpportunities_s DoSlottedAloha()
Main function for Slotted ALOHA.
uint32_t SlottedAlohaRandomizeReleaseTime()
Function for performing the Slotted ALOHA release time randomization, i.e., the time after which the ...
void CrdsaReduceIdleBlocksForAllAllocationChannels()
Function for reducing the idle blocks in effect for all allocation channels.
void SetBackoffTime(uint32_t allocationChannel, uint32_t backoffTime)
Function for setting the backoff time.
uint32_t GetCrdsaSignalingOverheadInBytes()
Function for getting the CRDSA signaling overhead in bytes.
bool m_crdsaNewData
A flag defining whether the buffers were emptied the last time RA was evaluated, i....
bool IsCrdsaAllocationChannel(uint32_t allocationChannel)
Function for checking if the allocation channel is CRDSA allocation channel.
void SetCrdsaBackoffProbability(uint32_t allocationChannel, uint16_t backoffProbability)
Function for setting the backoff probability.
void DoDispose()
Function for disposing the module and its variables.
void SetBackoffProbability(uint32_t allocationChannel, uint16_t backoffProbability)
Function for setting the backoff probability.
void CrdsaReduceIdleBlocks(uint32_t allocationChannel)
Function for reducing the allocation channel specific number of idle blocks in effect.
virtual ~SatRandomAccess()
Destructor.
Callback< bool > IsDamaAvailableCallback
Typedef of callback for known DAMA status.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
Random access Tx opportunities.
uint32_t slottedAlohaTxOpportunity
SatEnums::RandomAccessTxOpportunityType_t txOpportunityType
uint32_t allocationChannel
std::map< uint32_t, std::set< uint32_t > > crdsaTxOpportunities