safer RLC overhead estimation for SRB1

This commit is contained in:
Nicola Baldo
2013-03-28 13:44:27 +01:00
parent 0355008a71
commit eabfc6f5e2
3 changed files with 53 additions and 12 deletions

View File

@@ -633,11 +633,26 @@ LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg)
}
else if ((*itBsr).second.txQueueSize > 0)
{
NS_LOG_DEBUG (this << " serve tx DATA, bytes " << bytesForThisLc);
(*it).second.macSapUser->NotifyTxOpportunity (bytesForThisLc, 0, 0);
if ((*itBsr).second.txQueueSize >= bytesForThisLc - 2)
uint16_t lcid = (*it).first;
uint32_t rlcOverhead;
if (lcid == 1)
{
(*itBsr).second.txQueueSize -= bytesForThisLc - 2;
// for SRB1 (using RLC AM) it's better to
// overestimate RLC overhead rather than
// underestimate it and risk unneeded
// segmentation which increases delay
rlcOverhead = 4;
}
else
{
// minimum RLC overhead due to header
rlcOverhead = 2;
}
NS_LOG_DEBUG (this << " serve tx DATA, bytes " << bytesForThisLc << ", RLC overhead " << rlcOverhead);
(*it).second.macSapUser->NotifyTxOpportunity (bytesForThisLc, 0, 0);
if ((*itBsr).second.txQueueSize >= bytesForThisLc - rlcOverhead)
{
(*itBsr).second.txQueueSize -= bytesForThisLc - rlcOverhead;
}
else
{

View File

@@ -2058,15 +2058,28 @@ PfFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t s
}
else if ((*it).second.m_rlcTransmissionQueueSize > 0)
{
uint32_t rlcOverhead;
if (lcid == 1)
{
// for SRB1 (using RLC AM) it's better to
// overestimate RLC overhead rather than
// underestimate it and risk unneeded
// segmentation which increases delay
rlcOverhead = 4;
}
else
{
// minimum RLC overhead due to header
rlcOverhead = 2;
}
// update transmission queue
if ((*it).second.m_rlcTransmissionQueueSize <= size)
if ((*it).second.m_rlcTransmissionQueueSize <= size - rlcOverhead)
{
(*it).second.m_rlcTransmissionQueueSize = 0;
}
else
{
size -= 2; // remove minimun RLC overhead due to header
(*it).second.m_rlcTransmissionQueueSize -= size;
{
(*it).second.m_rlcTransmissionQueueSize -= size - rlcOverhead;
}
}
}

View File

@@ -1840,15 +1840,28 @@ RrFfMacScheduler::UpdateDlRlcBufferInfo (uint16_t rnti, uint8_t lcid, uint16_t s
}
else if ((*it).m_rlcTransmissionQueueSize > 0)
{
uint32_t rlcOverhead;
if (lcid == 1)
{
// for SRB1 (using RLC AM) it's better to
// overestimate RLC overhead rather than
// underestimate it and risk unneeded
// segmentation which increases delay
rlcOverhead = 4;
}
else
{
// minimum RLC overhead due to header
rlcOverhead = 2;
}
// update transmission queue
if ((*it).m_rlcTransmissionQueueSize <= size)
if ((*it).m_rlcTransmissionQueueSize <= size - rlcOverhead)
{
(*it).m_rlcTransmissionQueueSize = 0;
}
else
{
size -= 2; // remove minimun RLC overhead due to header
(*it).m_rlcTransmissionQueueSize -= size;
{
(*it).m_rlcTransmissionQueueSize -= size - rlcOverhead;
}
}
return;