23#ifndef SATELLITE_LOWER_LAYER_SERIVICE_H
24#define SATELLITE_LOWER_LAYER_SERIVICE_H
26#include "ns3/nstime.h"
27#include "ns3/object.h"
28#include "ns3/random-variable-stream.h"
33#include <unordered_set>
427 double averageNormalizedOfferedLoadThreshold)
763 std::stringstream ss;
764 ss << (double)number;
817 Ptr<RandomVariableStream> constantServiceRateStream);
914 double averageNormalizedOfferedLoadThreshold);
973#define SAT_DA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(index) \
974 inline void SetDaServ##index##ConstantAssignmentProvided(bool value) \
976 return SetDaConstantAssignmentProvided(index, value); \
978 inline bool GetDaServ##index##ConstantAssignmentProvided() const \
980 return GetDaConstantAssignmentProvided(index); \
982 inline void SetDaServ##index##RbdcAllowed(bool value) \
984 return SetDaRbdcAllowed(index, value); \
986 inline bool GetDaServ##index##RbdcAllowed() const \
988 return GetDaRbdcAllowed(index); \
990 inline void SetDaServ##index##VolumeAllowed(bool value) \
992 return SetDaVolumeAllowed(index, value); \
994 inline bool GetDaServ##index##VolumeAllowed() const \
996 return GetDaVolumeAllowed(index); \
998 inline void SetDaServ##index##ConstantServiceRateStream(Ptr<RandomVariableStream> value) \
1000 return SetDaConstantServiceRateStream(index, value); \
1002 inline Ptr<RandomVariableStream> GetDaServ##index##ConstantServiceRateStream() const \
1004 return GetDaConstantServiceRateStream(index); \
1006 inline void SetDaServ##index##MaximumServiceRateInKbps(uint16_t value) \
1008 return SetDaMaximumServiceRateInKbps(index, value); \
1010 inline uint16_t GetDaServ##index##MaximumServiceRateInKbps() const \
1012 return GetDaMaximumServiceRateInKbps(index); \
1014 inline void SetDaServ##index##MinimumServiceRateInKbps(uint16_t value) \
1016 return SetDaMinimumServiceRateInKbps(index, value); \
1018 inline uint16_t GetDaServ##index##MinimumServiceRateInKbps() const \
1020 return GetDaMinimumServiceRateInKbps(index); \
1022 inline void SetDaServ##index##MaximumBacklogInKbytes(uint16_t value) \
1024 return SetDaMaximumBacklogInKbytes(index, value); \
1026 inline uint8_t GetDaServ##index##MaximumBacklogInKbytes() const \
1028 return GetDaMaximumBacklogInKbytes(index); \
1076#define SAT_RA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(index) \
1077 inline void SetRaServ##index##MaximumUniquePayloadPerBlock(uint8_t value) \
1079 return SetRaMaximumUniquePayloadPerBlock(index, value); \
1081 inline uint8_t GetRaServ##index##MaximumUniquePayloadPerBlock() const \
1083 return GetRaMaximumUniquePayloadPerBlock(index); \
1085 inline void SetRaServ##index##MaximumConsecutiveBlockAccessed(uint8_t value) \
1087 return SetRaMaximumConsecutiveBlockAccessed(index, value); \
1089 inline uint8_t GetRaServ##index##MaximumConsecutiveBlockAccessed() const \
1091 return GetRaMaximumConsecutiveBlockAccessed(index); \
1093 inline void SetRaServ##index##MinimumIdleBlock(uint8_t value) \
1095 return SetRaMinimumIdleBlock(index, value); \
1097 inline uint8_t GetRaServ##index##MinimumIdleBlock() const \
1099 return GetRaMinimumIdleBlock(index); \
1101 inline void SetRaServ##index##BackOffTimeInMilliSeconds(uint16_t value) \
1103 return SetRaBackOffTimeInMilliSeconds(index, value); \
1105 inline uint16_t GetRaServ##index##BackOffTimeInMilliSeconds() const \
1107 return GetRaBackOffTimeInMilliSeconds(index); \
1109 inline void SetRaServ##index##HighLoadBackOffTimeInMilliSeconds(uint16_t value) \
1111 return SetRaHighLoadBackOffTimeInMilliSeconds(index, value); \
1113 inline uint16_t GetRaServ##index##HighLoadBackOffTimeInMilliSeconds() const \
1115 return GetRaHighLoadBackOffTimeInMilliSeconds(index); \
1117 inline void SetRaServ##index##BackOffProbability(uint16_t value) \
1119 return SetRaBackOffProbability(index, value); \
1121 inline uint16_t GetRaServ##index##BackOffProbability() const \
1123 return GetRaBackOffProbability(index); \
1125 inline void SetRaServ##index##HighLoadBackOffProbability(uint16_t value) \
1127 return SetRaHighLoadBackOffProbability(index, value); \
1129 inline uint16_t GetRaServ##index##HighLoadBackOffProbability() const \
1131 return GetRaHighLoadBackOffProbability(index); \
1133 inline void SetRaServ##index##NumberOfInstances(uint8_t value) \
1135 return SetRaNumberOfInstances(index, value); \
1137 inline uint8_t GetRaServ##index##NumberOfInstances() const \
1139 return GetRaNumberOfInstances(index); \
1141 inline void SetRaServ##index##AverageNormalizedOfferedLoadThreshold(double value) \
1143 return SetRaAverageNormalizedOfferedLoadThreshold(index, value); \
1145 inline double GetRaServ##index##AverageNormalizedOfferedLoadThreshold() const \
1147 return GetRaAverageNormalizedOfferedLoadThreshold(index); \
1149 inline void SetRaServ##index##IsSlottedAlohaAllowed(bool value) \
1151 return SetRaIsSlottedAlohaAllowed(index, value); \
1153 inline bool GetRaServ##index##IsSlottedAlohaAllowed() const \
1155 return GetRaIsSlottedAlohaAllowed(index); \
1157 inline void SetRaServ##index##IsCrdsaAllowed(bool value) \
1159 return SetRaIsCrdsaAllowed(index, value); \
1161 inline bool GetRaServ##index##IsCrdsaAllowed() const \
1163 return GetRaIsCrdsaAllowed(index); \
1165 inline void SetRaServ##index##IsEssaAllowed(bool value) \
1167 return SetRaIsEssaAllowed(index, value); \
1169 inline bool GetRaServ##index##IsEssaAllowed() const \
1171 return GetRaIsEssaAllowed(index); \
void SetDaVolumeAllowed(uint8_t index, bool volumeAllowed)
Set state, if volume is allowed for a DA service.
SAT_DA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(0)
bool GetDaVolumeAllowed(uint8_t index) const
Get state, if volume is allowed for a DA service.
uint16_t GetDaMaximumBacklogInKbytes(uint8_t index) const
Get maximum backlog size for a DA service.
uint8_t GetRaMaximumUniquePayloadPerBlock(uint8_t index) const
Get maximum unique payload per block for a RA service.
Time GetDefaultControlRandomizationInterval() const
Get configured default control randomization interval.
uint8_t m_volumeBacklogPersistence
uint8_t m_raServiceIndexDefault
void SetRaIsCrdsaAllowed(uint8_t index, bool isCrdsaAllowed)
Set CRDSA allowance.
void SetDaMinimumServiceRateInKbps(uint8_t index, uint16_t minimumServiceRateKbps)
Set minimum service rate for a DA service.
static std::string GetIndexAsDaServiceName(uint8_t index)
Method to convert DA service index to service name.
bool GetRaIsSlottedAlohaAllowed(uint8_t index) const
Get Slotted Aloha allowance.
void SetRaHighLoadBackOffProbability(uint8_t index, uint16_t highLoadBackOffProbability)
Set high load back off probability.
static std::string GetNumberAsString(T number)
Template method to convert number to string.
uint8_t GetRaServiceCount() const
Get count of configured RA services.
static const uint8_t m_minDaServiceEntries
static const uint8_t m_maxDaServiceEntries
uint8_t GetRaDefaultService() const
Get index of default RA service.
void SetRaNumberOfInstances(uint8_t index, uint8_t numberOfInstances)
Set number of instances.
void SetDaConstantAssignmentProvided(uint8_t index, bool constAssignmentProvided)
Set state, if constant assignment is provided for a DA service.
bool GetDaRbdcAllowed(uint8_t index) const
Get state, if RBDC is allowed for a DA service.
uint16_t GetRaHighLoadBackOffProbability(uint8_t index) const
Get high load back off probability.
uint16_t GetDaMaximumServiceRateInKbps(uint8_t index) const
Get maximum service rate for a DA service.
void SetRaMaximumUniquePayloadPerBlock(uint8_t index, uint8_t maxUniquePayloadPerBlock)
Set maximum unique payload per block for a RA service.
~SatLowerLayerServiceConf()
Destructor for SatLowerLayerServiceConf.
uint16_t GetRaHighLoadBackOffTimeInMilliSeconds(uint8_t index) const
Get high load back off time in milliseconds.
SAT_DA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(1)
SAT_DA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(2)
static const uint8_t m_maxRaServiceEntries
SAT_RA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(1)
SatLowerLayerServiceConf()
Constructor for SatLowerLayerServiceConf.
uint8_t m_daServiceEntryCount
static const uint8_t m_minRaServiceEntries
void SetRaAverageNormalizedOfferedLoadThreshold(uint8_t index, double averageNormalizedOfferedLoadThreshold)
Set average normalized offeredLoad Threshold.
SatLowerLayerServiceRaEntry m_raServiceEntries[m_maxRaServiceEntries]
bool GetRaIsEssaAllowed(uint8_t index) const
Get E-SSA allowance.
void SetRaIsSlottedAlohaAllowed(uint8_t index, bool isSlottedAlohaAllowed)
Set Slotted Aloha allowance.
void SetRaIsEssaAllowed(uint8_t index, bool isEssaAllowed)
Set ESSA allowance.
static TypeId GetTypeId(void)
methods derived from base classes
uint16_t GetDaMinimumServiceRateInKbps(uint8_t index) const
Get minimum service rate for a DA service.
bool GetRaIsCrdsaAllowed(uint8_t index) const
Get CRDSA allowance.
uint16_t GetDaConstantServiceRateInKbps(uint8_t index) const
Get constant service rate for a DA service.
void SetDaRbdcAllowed(uint8_t index, bool bdcAllowed)
Set state, if RBDC is allowed for a DA service.
double GetRaAverageNormalizedOfferedLoadThreshold(uint8_t index) const
Get average normalized offeredLoad Threshold.
SAT_RA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(0)
uint8_t GetRaNumberOfInstances(uint8_t index) const
Get number of instances.
SAT_RA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(2)
Ptr< RandomVariableStream > GetDaConstantServiceRateStream(uint8_t index) const
Get constant service rate stream for a DA service.
uint8_t GetDynamicRatePersistence() const
Get configured dynamic rate persistence.
void SetRaMaximumConsecutiveBlockAccessed(uint8_t index, uint8_t maxConsecutiveBlockAccessed)
Set maximum consecutive block accessed for a RA service.
void SetRaBackOffProbability(uint8_t index, uint16_t backOffProbability)
Set back off probability.
void SetRaMinimumIdleBlock(uint8_t index, uint8_t minimumIdleBlock)
Set minimum idle block for a RA service.
uint16_t GetRaBackOffProbability(uint8_t index) const
Get back off probability.
static std::string GetIndexAsRaServiceName(uint8_t index)
Method to convert RA service index to service name.
uint8_t GetDaServiceCount() const
Get count of configured DA services.
uint8_t GetRaMaximumConsecutiveBlockAccessed(uint8_t index) const
Get maximum consecutive block accessed for a RA service.
void SetRaBackOffTimeInMilliSeconds(uint8_t index, uint16_t backOffTimeInMilliSeconds)
Set back off time in milliseconds.
void SetDaMaximumServiceRateInKbps(uint8_t index, uint16_t maximumServiceRateKbps)
Set maximum service rate for a DA service.
uint8_t GetVolumeBacklogPersistence() const
Get configured volume backlog persistence.
Time m_defaultControlRandomizationInterval
void SetRaHighLoadBackOffTimeInMilliSeconds(uint8_t index, uint16_t backOffTimeInMilliSeconds)
Set high load back off time in milliseconds.
void SetDaConstantServiceRateStream(uint8_t index, Ptr< RandomVariableStream > constantServiceRateStream)
Set constant service rate stream for a DA service.
bool GetDaConstantAssignmentProvided(uint8_t index) const
Get state, if constant assignment is provided for a DA service.
SAT_DA_SERVICE_ATTRIBUTE_ACCESSOR_DEFINE(3)
SatLowerLayerServiceDaEntry m_daServiceEntries[m_maxDaServiceEntries]
uint8_t GetRaMinimumIdleBlock(uint8_t index) const
Get minimum idle block for a RA service.
uint8_t m_raServiceEntryCount
uint16_t GetRaBackOffTimeInMilliSeconds(uint8_t index) const
Get back off time in milliseconds.
void SetDaMaximumBacklogInKbytes(uint8_t index, uint16_t maximumBacklogInKbytes)
Set maximum backlog size for a DA service.
uint8_t m_dynamicRatePersistence
The SatLowerLayerService class holds information of a satellite lower layer service DA entry.
uint16_t m_minimumServiceRateKbps
bool GetRbdcAllowed() const
Get state, if RBDC is allowed.
uint16_t m_maximumServiceRateKbps
void SetConstantServiceRateStream(Ptr< RandomVariableStream > constantServiceRateStream)
Set constant service rate stream.
Ptr< RandomVariableStream > m_constantServiceRateStream
void SetMaximumBacklogInKbytes(uint16_t maximumBacklogInKbytes)
Set maximum backlog size.
uint16_t GetMinimumServiceRateInKbps() const
Get minimum service rate.
SatLowerLayerServiceDaEntry()
~SatLowerLayerServiceDaEntry()
Destructor for SatLowerLayerServiceDaEntry.
void SetMinimumServiceRateInKbps(uint16_t minimumServiceRateKbps)
Set minimum service rate.
void SetConstantAssignmentProvided(bool constAssignmentProvided)
Set state, if constant assignment is provided.
uint16_t m_maximumBacklogInKbytes
void SetMaximumServiceRateInKbps(uint16_t maximumServiceRateKbps)
Set maximum service rate.
uint16_t GetMaximumServiceRateInKbps() const
Get maximum service rate.
bool GetVolumeAllowed() const
Get state, if volume is allowed.
uint16_t GetMaximumBacklogInKbytes() const
Get maximum backlog size.
Ptr< RandomVariableStream > GetConstantServiceRateStream() const
Get constant service rate stream.
uint16_t GetConstantServiceRateInKbps() const
Get constant service rate.
bool m_constantAssignmentProvided
void SetVolumeAllowed(bool volumeAllowed)
Set state, if volume is allowed.
friend class SatLowerLayerServiceConf
bool GetConstantAssignmentProvided() const
Get state, if constant assignment is provided.
void SetRbdcAllowed(bool bdcAllowed)
Set state, if RBDC is allowed.
The SatLowerLayerService class holds information of a satellite lower layer service RA entry.
void SetHighLoadBackOffProbability(uint16_t highLoadBackOffProbability)
Set high load back off probability.
void SetBackOffProbability(uint16_t backOffProbability)
Set back off probability.
void SetMaximumUniquePayloadPerBlock(uint8_t maxUniquePayloadPerBlock)
Set maximum unique payload per block.
void SetAverageNormalizedOfferedLoadThreshold(double averageNormalizedOfferedLoadThreshold)
Set average normalized offered load threshold.
uint16_t GetBackOffProbability() const
Get back off probability.
SatLowerLayerServiceRaEntry()
void SetMinimumIdleBlock(uint8_t minimumIdleBlock)
Set minimum idle block.
uint16_t m_backOffProbability
bool GetIsEssaAllowed() const
Get ESSA allowance.
void SetBackOffTimeInMilliSeconds(uint16_t backOffTimeInMilliSeconds)
Set back off time in milliseconds.
void SetMaximumConsecutiveBlockAccessed(uint8_t maxConsecutiveBlockAccessed)
Set maximum consecutive block accessed.
double GetAverageNormalizedOfferedLoadThreshold() const
Get average normalized offered load threshold.
void SetIsCrdsaAllowed(bool isCrdsaAllowed)
Set CRDSA allowance.
uint8_t m_maxUniquePayloadPerBlock
uint8_t GetNumberOfInstances() const
Get number of instances.
uint16_t GetHighLoadBackOffTimeInMilliSeconds() const
Get high load back off time in milliseconds.
uint8_t GetMaximumConsecutiveBlockAccessed() const
Get maximum consecutive block accessed.
uint8_t m_minimumIdleBlock
bool GetIsCrdsaAllowed() const
Get CRDSA allowance.
uint8_t m_numberOfInstances
bool m_isSlottedAlohaAllowed
void SetIsSlottedAlohaAllowed(bool isSlottedAlohaAllowed)
Set Slotted Aloha allowance.
uint16_t m_highLoadBackOffTimeInMilliSeconds
void SetHighLoadBackOffTimeInMilliSeconds(uint16_t backOffTimeInMilliSeconds)
Set high load back off time in milliseconds.
uint16_t m_highLoadBackOffProbability
uint8_t m_maxConsecutiveBlockAccessed
bool GetIsSlottedAlohaAllowed() const
Get Slotted Aloha allowance.
uint16_t GetBackOffTimeInMilliSeconds() const
Get back off time in milliseconds.
void SetNumberOfInstances(uint8_t numberOfInstances)
Set number of instances.
uint8_t GetMinimumIdleBlock() const
Get minimum idle block.
~SatLowerLayerServiceRaEntry()
Destructor for SatLowerLayerServiceRaEntry.
friend class SatLowerLayerServiceConf
void SetIsEssaAllowed(bool isEssaAllowed)
Set ESSA allowance.
uint16_t GetHighLoadBackOffProbability() const
Get high load back off probability.
uint16_t m_backOffTimeInMilliSeconds
uint8_t GetMaximumUniquePayloadPerBlock() const
Get maximum unique payload per block.
double m_averageNormalizedOfferedLoadThreshold
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.