lte: Add PDCP-RLC discard timer

This commit is contained in:
Biljana Bojovic
2023-02-21 15:35:07 +01:00
committed by Tom Henderson
parent 1bde892f0a
commit 0164d8d3d4
5 changed files with 59 additions and 4 deletions

View File

@@ -436,6 +436,7 @@ UeManager::SetupDataRadioBearer(EpsBearer bearer,
Ptr<LteRlc> rlc = rlcObjectFactory.Create()->GetObject<LteRlc>();
rlc->SetLteMacSapProvider(m_rrc->m_macSapProvider);
rlc->SetRnti(m_rnti);
rlc->SetPacketDelayBudgetMs(bearer.GetPacketDelayBudgetMs());
drbInfo->m_rlc = rlc;

View File

@@ -68,7 +68,21 @@ LteRlcUm::GetTypeId()
"Value of the t-Reordering timer (See section 7.3 of 3GPP TS 36.322)",
TimeValue(MilliSeconds(100)),
MakeTimeAccessor(&LteRlcUm::m_reorderingTimerValue),
MakeTimeChecker());
MakeTimeChecker())
.AddAttribute(
"EnablePdcpDiscarding",
"Whether to use the PDCP discarding, i.e., perform discarding at the moment "
"of passing the PDCP SDU to RLC)",
BooleanValue(true),
MakeBooleanAccessor(&LteRlcUm::m_enablePdcpDiscarding),
MakeBooleanChecker())
.AddAttribute("DiscardTimerMs",
"Discard timer in milliseconds to be used to discard packets. "
"If set to 0 then packet delay budget will be used as the discard "
"timer value, otherwise it will be used this value.",
UintegerValue(0),
MakeUintegerAccessor(&LteRlcUm::m_discardTimerMs),
MakeUintegerChecker<uint32_t>());
return tid;
}
@@ -93,6 +107,29 @@ LteRlcUm::DoTransmitPdcpPdu(Ptr<Packet> p)
if (m_txBufferSize + p->GetSize() <= m_maxTxBufferSize)
{
if (m_enablePdcpDiscarding)
{
// discart the packet
uint32_t headOfLineDelayInMs = 0;
uint32_t discardTimerMs =
(m_discardTimerMs > 0) ? m_discardTimerMs : m_packetDelayBudgetMs;
if (!m_txBuffer.empty())
{
headOfLineDelayInMs =
(Simulator::Now() - m_txBuffer.begin()->m_waitingSince).GetMilliSeconds();
}
NS_LOG_DEBUG("head of line delay in MS:" << headOfLineDelayInMs);
if (headOfLineDelayInMs > discardTimerMs)
{
NS_LOG_DEBUG("Tx HOL is higher than this packet can allow. RLC SDU discarded");
NS_LOG_DEBUG("headOfLineDelayInMs = " << headOfLineDelayInMs);
NS_LOG_DEBUG("m_packetDelayBudgetMs = " << m_packetDelayBudgetMs);
NS_LOG_DEBUG("packet size = " << p->GetSize());
m_txDropTrace(p);
}
}
/** Store PDCP PDU */
LteRlcSduStatusTag tag;
tag.SetStatus(LteRlcSduStatusTag::FULL_SDU);

View File

@@ -143,9 +143,12 @@ class LteRlcUm : public LteRlc
/**
* Timers. See section 7.3 in TS 36.322
*/
Time m_reorderingTimerValue; ///< reordering timer value
EventId m_reorderingTimer; ///< reordering timer
EventId m_rbsTimer; ///< RBS timer
Time m_reorderingTimerValue; ///< reordering timer value
EventId m_reorderingTimer; ///< reordering timer
EventId m_rbsTimer; ///< RBS timer
bool m_enablePdcpDiscarding{false}; //!< whether to use the PDCP discarding (perform discarding
//!< at the moment of passing the PDCP SDU to RLC)
uint32_t m_discardTimerMs{0}; //!< the discard timer value in milliseconds
/**
* Reassembling state

View File

@@ -144,6 +144,13 @@ LteRlc::SetLcId(uint8_t lcId)
m_lcid = lcId;
}
void
LteRlc::SetPacketDelayBudgetMs(uint16_t packetDelayBudget)
{
NS_LOG_FUNCTION(this << +packetDelayBudget);
m_packetDelayBudgetMs = packetDelayBudget;
}
void
LteRlc::SetLteRlcSapUser(LteRlcSapUser* s)
{

View File

@@ -75,6 +75,11 @@ class LteRlc : public Object // SimpleRefCount<LteRlc>
*/
void SetLcId(uint8_t lcId);
/**
* \param packetDelayBudget
*/
void SetPacketDelayBudgetMs(uint16_t packetDelayBudget);
/**
*
*
@@ -165,6 +170,8 @@ class LteRlc : public Object // SimpleRefCount<LteRlc>
uint16_t m_rnti; ///< RNTI
uint8_t m_lcid; ///< LCID
uint16_t m_packetDelayBudgetMs{
UINT16_MAX}; //!< the packet delay budget in ms of the corresponding logical channel
/**
* Used to inform of a PDU delivery to the MAC SAP provider