31 NS_LOG_COMPONENT_DEFINE(
"SatDamaEntry");
37 : m_dynamicRatePersistence(0),
38 m_volumeBacklogPersistence(0)
40 NS_LOG_FUNCTION(
this);
41 NS_FATAL_ERROR(
"The default version of the constructor not supported!!!");
45 : m_dynamicRatePersistence(0),
46 m_volumeBacklogPersistence(0),
49 NS_LOG_FUNCTION(
this);
57 NS_LOG_FUNCTION(
this);
63 NS_LOG_FUNCTION(
this);
71 NS_LOG_FUNCTION(
this << duration);
73 uint32_t totalBytes = 0;
75 for (uint8_t i = 0; i <
m_llsConf->GetDaServiceCount(); i++)
77 if (
m_llsConf->GetDaConstantAssignmentProvided(i))
80 m_llsConf->GetDaConstantServiceRateInKbps(i) * duration.GetSeconds()) /
91 NS_LOG_FUNCTION(
this << duration);
93 uint32_t totalBytes = 0;
95 for (uint8_t i = 0; i <
m_llsConf->GetDaServiceCount(); i++)
97 uint16_t minRateInKbps = 0;
101 minRateInKbps = std::max<uint16_t>(
m_llsConf->GetDaMinimumServiceRateInKbps(i),
102 m_llsConf->GetDaConstantServiceRateInKbps(i));
104 else if (
m_llsConf->GetDaConstantAssignmentProvided(i))
106 minRateInKbps =
m_llsConf->GetDaConstantServiceRateInKbps(i);
110 minRateInKbps =
m_llsConf->GetDaMinimumServiceRateInKbps(i);
123 NS_LOG_FUNCTION(
this << duration);
125 uint32_t totalBytes = 0;
130 duration.GetSeconds()) /
140 NS_LOG_FUNCTION(
this);
142 uint32_t totalBytes = 0;
155 NS_LOG_FUNCTION(
this << (uint32_t)index);
157 if (index >=
m_llsConf->GetDaServiceCount())
159 NS_FATAL_ERROR(
"RC index requested is out of range!!!");
163 if (
m_llsConf->GetDaConstantAssignmentProvided(index))
165 cra =
m_llsConf->GetDaConstantServiceRateInKbps(index);
174 NS_LOG_FUNCTION(
this << (uint32_t)index);
176 if (index >=
m_llsConf->GetDaServiceCount())
178 NS_FATAL_ERROR(
"RC index requested is out of range!!!");
185 minRbdc = std::max<uint16_t>(
m_llsConf->GetDaMinimumServiceRateInKbps(index),
195 NS_LOG_FUNCTION(
this << (uint32_t)index);
199 NS_FATAL_ERROR(
"RC index requested is out of range!!!");
208 NS_LOG_FUNCTION(
this << (uint32_t)index << rateInKbps);
218 else if (craRbdcSum >
m_llsConf->GetDaMaximumServiceRateInKbps(index))
221 std::max<double>(0.0,
222 (
m_llsConf->GetDaMaximumServiceRateInKbps(index) -
223 m_llsConf->GetDaConstantServiceRateInKbps(index)));
235 NS_LOG_FUNCTION(
this << (uint32_t)index);
239 NS_FATAL_ERROR(
"RC index requested is out of range!!!");
248 NS_LOG_FUNCTION(
this << (uint32_t)index << volumeInBytes);
250 if (
m_llsConf->GetDaVolumeAllowed(index))
252 NS_LOG_INFO(
"Update VBDC! RC index: " << index <<
" existing VBDC bytes: "
254 <<
" updated with " << volumeInBytes <<
" bytes!");
263 NS_LOG_FUNCTION(
this << (uint32_t)index << volumeInBytes);
265 if (
m_llsConf->GetDaVolumeAllowed(index))
267 NS_LOG_INFO(
"Set VBDC bytes to " << volumeInBytes <<
" for RC index: " << index);
274 uint32_t maxVolumeBacklogInBytes =
276 NS_LOG_INFO(
"Max volume backlog reached! Set VBDC bytes to "
277 << maxVolumeBacklogInBytes <<
" for RC index: " << index);
286 NS_LOG_FUNCTION(
this);
294 NS_LOG_FUNCTION(
this);
310 NS_LOG_FUNCTION(
this);
318 NS_LOG_FUNCTION(
this);
uint32_t GetCraBasedBytes(Time duration) const
Get CRA based bytes with given duration.
uint32_t GetVbdcBasedBytes() const
Get VBDC based bytes.
uint8_t m_volumeBacklogPersistence
void DecrementDynamicRatePersistence()
Decrement dynamic rate persistence.
uint16_t GetCraInKbps(uint8_t index) const
Get configured value of the CRA.
~SatDamaEntry()
Destroy a SatDamaEntry.
void UpdateVbdcInBytes(uint8_t index, uint32_t volumeInBytes)
Update VBDC request of the RC.
void UpdateRbdcInKbps(uint8_t index, uint16_t rateInKbps)
Update RBDC request of a RC.
std::vector< uint32_t > m_volumeBacklogRequestedInBytes
void ResetDynamicRatePersistence()
Reset dynamic rate persistence to the value given in lower layer service configuration.
uint32_t GetMinRateBasedBytes(Time duration) const
Get minimum rate based bytes with given duration.
void DecrementVolumeBacklogPersistence()
Decrement volume backlog persistence.
SatDamaEntry()
Default construct a SatDamaEntry.
uint16_t GetRbdcInKbps(uint8_t index) const
Get current value of the RBDC requested.
void ResetVolumeBacklogPersistence()
Reset volume backlog persistence to the value given in lower layer service configuration.
uint32_t GetRbdcBasedBytes(Time duration) const
Get RBDC based bytes with given duration.
std::vector< uint16_t > m_dynamicRateRequestedInKbps
void SetVbdcInBytes(uint8_t index, uint32_t volumeInBytes)
Set VBDC request of the RC.
uint8_t m_dynamicRatePersistence
uint16_t GetMinRbdcInKbps(uint8_t index) const
Get configured value of the minimum RBDC.
uint8_t GetRcCount() const
Get number of RCs in the SatDamaEntry.
Ptr< SatLowerLayerServiceConf > m_llsConf
uint32_t GetVbdcInBytes(uint8_t index) const
Get current value of the VBDC requested.
constexpr uint32_t BITS_IN_KBIT
Number of bits consisting a kilobit.
constexpr uint32_t BITS_PER_BYTE
Number of bits in a byte.
constexpr uint32_t BYTES_IN_KBYTE
Number of bytes consisting a kilobyte.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.