28 NS_LOG_COMPONENT_DEFINE(
"SatDamaEntry");
34 : m_dynamicRatePersistence(0),
35 m_volumeBacklogPersistence(0)
37 NS_LOG_FUNCTION(
this);
38 NS_FATAL_ERROR(
"The default version of the constructor not supported!!!");
42 : m_dynamicRatePersistence(0),
43 m_volumeBacklogPersistence(0),
46 NS_LOG_FUNCTION(
this);
54 NS_LOG_FUNCTION(
this);
60 NS_LOG_FUNCTION(
this);
68 NS_LOG_FUNCTION(
this << duration);
70 uint32_t totalBytes = 0;
72 for (uint8_t i = 0; i <
m_llsConf->GetDaServiceCount(); i++)
74 if (
m_llsConf->GetDaConstantAssignmentProvided(i))
77 m_llsConf->GetDaConstantServiceRateInKbps(i) * duration.GetSeconds()) /
88 NS_LOG_FUNCTION(
this << duration);
90 uint32_t totalBytes = 0;
92 for (uint8_t i = 0; i <
m_llsConf->GetDaServiceCount(); i++)
94 uint16_t minRateInKbps = 0;
98 minRateInKbps = std::max<uint16_t>(
m_llsConf->GetDaMinimumServiceRateInKbps(i),
99 m_llsConf->GetDaConstantServiceRateInKbps(i));
101 else if (
m_llsConf->GetDaConstantAssignmentProvided(i))
103 minRateInKbps =
m_llsConf->GetDaConstantServiceRateInKbps(i);
107 minRateInKbps =
m_llsConf->GetDaMinimumServiceRateInKbps(i);
120 NS_LOG_FUNCTION(
this << duration);
122 uint32_t totalBytes = 0;
127 duration.GetSeconds()) /
137 NS_LOG_FUNCTION(
this);
139 uint32_t totalBytes = 0;
152 NS_LOG_FUNCTION(
this << (uint32_t)index);
154 if (index >=
m_llsConf->GetDaServiceCount())
156 NS_FATAL_ERROR(
"RC index requested is out of range!!!");
160 if (
m_llsConf->GetDaConstantAssignmentProvided(index))
162 cra =
m_llsConf->GetDaConstantServiceRateInKbps(index);
171 NS_LOG_FUNCTION(
this << (uint32_t)index);
173 if (index >=
m_llsConf->GetDaServiceCount())
175 NS_FATAL_ERROR(
"RC index requested is out of range!!!");
182 minRbdc = std::max<uint16_t>(
m_llsConf->GetDaMinimumServiceRateInKbps(index),
192 NS_LOG_FUNCTION(
this << (uint32_t)index);
196 NS_FATAL_ERROR(
"RC index requested is out of range!!!");
205 NS_LOG_FUNCTION(
this << (uint32_t)index << rateInKbps);
215 else if (craRbdcSum >
m_llsConf->GetDaMaximumServiceRateInKbps(index))
218 std::max<double>(0.0,
219 (
m_llsConf->GetDaMaximumServiceRateInKbps(index) -
220 m_llsConf->GetDaConstantServiceRateInKbps(index)));
232 NS_LOG_FUNCTION(
this << (uint32_t)index);
236 NS_FATAL_ERROR(
"RC index requested is out of range!!!");
245 NS_LOG_FUNCTION(
this << (uint32_t)index << volumeInBytes);
247 if (
m_llsConf->GetDaVolumeAllowed(index))
249 NS_LOG_INFO(
"Update VBDC! RC index: " << index <<
" existing VBDC bytes: "
251 <<
" updated with " << volumeInBytes <<
" bytes!");
260 NS_LOG_FUNCTION(
this << (uint32_t)index << volumeInBytes);
262 if (
m_llsConf->GetDaVolumeAllowed(index))
264 NS_LOG_INFO(
"Set VBDC bytes to " << volumeInBytes <<
" for RC index: " << index);
271 uint32_t maxVolumeBacklogInBytes =
273 NS_LOG_INFO(
"Max volume backlog reached! Set VBDC bytes to "
274 << maxVolumeBacklogInBytes <<
" for RC index: " << index);
283 NS_LOG_FUNCTION(
this);
291 NS_LOG_FUNCTION(
this);
307 NS_LOG_FUNCTION(
this);
315 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.