LteRlcAm: fixed ACK SN setting, added more moduls base updates, restored sending of data from transmitted buffer
This commit is contained in:
@@ -202,6 +202,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId)
|
||||
std::map<uint16_t, PduBuffer>::iterator pduIt;
|
||||
for (sn = m_vrR; sn < m_vrMs; sn++)
|
||||
{
|
||||
NS_LOG_LOGIC ("SN = " << sn);
|
||||
if (!rlcAmHeader.OneMoreNackWouldFitIn (bytes))
|
||||
{
|
||||
NS_LOG_LOGIC ("Can't fit more NACKs in STATUS PDU");
|
||||
@@ -214,22 +215,21 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId)
|
||||
rlcAmHeader.PushNack (sn.GetValue ());
|
||||
}
|
||||
}
|
||||
|
||||
NS_LOG_LOGIC ("SN at end of NACK loop = " << sn);
|
||||
// 3GPP TS 36.322 section 6.2.2.1.4 ACK SN
|
||||
// find the SN of the next not received RLC Data PDU
|
||||
// which is not reported as missing in the STATUS PDU.
|
||||
do
|
||||
pduIt = m_rxonBuffer.find (sn.GetValue ());
|
||||
while ((sn < m_vrMs) && (pduIt != m_rxonBuffer.end ()) && (pduIt->second.m_pduComplete))
|
||||
{
|
||||
NS_LOG_LOGIC ("SN = " << sn << " < " << m_vrMs << " = " << (sn < m_vrMs));
|
||||
sn++;
|
||||
NS_LOG_LOGIC ("SN = " << sn);
|
||||
pduIt = m_rxonBuffer.find (sn.GetValue ());
|
||||
}
|
||||
while (pduIt != m_rxonBuffer.end () && (pduIt->second.m_pduComplete) && (sn < m_vrH));
|
||||
|
||||
if (sn != m_vrMs)
|
||||
{
|
||||
NS_LOG_WARN ("SN=" << sn << ", VR(MS)=" << m_vrMs);
|
||||
}
|
||||
rlcAmHeader.SetAckSn (m_vrMs);
|
||||
NS_ASSERT_MSG (sn <= m_vrMs, "first SN not reported as missing = " << sn << ", VR(MS) = " << m_vrMs);
|
||||
rlcAmHeader.SetAckSn (sn);
|
||||
|
||||
|
||||
NS_LOG_LOGIC ("RLC header: " << rlcAmHeader);
|
||||
@@ -293,7 +293,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId)
|
||||
|
||||
NS_LOG_LOGIC ("Sending data from Transmission Buffer");
|
||||
}
|
||||
/* else if ( m_txedBufferSize > 0 )
|
||||
else if ( m_txedBufferSize > 0 )
|
||||
{
|
||||
NS_LOG_LOGIC ("Sending data from Transmitted Buffer");
|
||||
|
||||
@@ -335,7 +335,7 @@ LteRlcAm::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId)
|
||||
NS_LOG_LOGIC ("Waiting for bigger TxOpportunity");
|
||||
return;
|
||||
}
|
||||
} */
|
||||
}
|
||||
else
|
||||
{
|
||||
NS_LOG_LOGIC ("No data pending");
|
||||
@@ -734,6 +734,7 @@ LteRlcAm::DoReceivePdu (Ptr<Packet> p)
|
||||
|
||||
|
||||
SequenceNumber10 seqNumber = rlcAmHeader.GetSequenceNumber ();
|
||||
seqNumber.SetModulusBase (m_vrR);
|
||||
|
||||
if ( rlcAmHeader.GetResegmentationFlag () == LteRlcAmHeader::SEGMENT )
|
||||
{
|
||||
@@ -854,12 +855,17 @@ LteRlcAm::DoReceivePdu (Ptr<Packet> p)
|
||||
m_rxonBuffer.erase (m_vrR.GetValue ());
|
||||
|
||||
m_vrR++;
|
||||
m_vrR.SetModulusBase (m_vrR);
|
||||
m_vrX.SetModulusBase (m_vrR);
|
||||
m_vrMs.SetModulusBase (m_vrR);
|
||||
m_vrH.SetModulusBase (m_vrR);
|
||||
it = m_rxonBuffer.find (m_vrR.GetValue ());
|
||||
|
||||
NS_ASSERT_MSG (firstVrR != m_vrR.GetValue (), "Infinite loop in RxonBuffer");
|
||||
}
|
||||
NS_LOG_LOGIC ("New VR(R) = " << m_vrR);
|
||||
m_vrMr = m_vrR + m_windowSize;
|
||||
|
||||
NS_LOG_LOGIC ("New VR(MR) = " << m_vrMr);
|
||||
}
|
||||
|
||||
|
||||
@@ -55,17 +55,17 @@ LteRlcAmE2eTestSuite::LteRlcAmE2eTestSuite ()
|
||||
{
|
||||
// NS_LOG_INFO ("Creating LteRlcAmE2eTestSuite");
|
||||
|
||||
AddTestCase (new LteRlcAmE2eTestCase ("the one that fails", 1111, 0.10), TestCase::QUICK);
|
||||
AddTestCase (new LteRlcAmE2eTestCase ("the one that fails", 6666, 0.25), TestCase::QUICK);
|
||||
|
||||
double losses[] = {0.0, 0.10, 0.25, 0.50, 0.75, 0.90, 0.95};
|
||||
uint32_t seeds[] = {1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 10101};
|
||||
uint32_t runs[] = {1111, 2222, 3333, 4444, 5555, 6666, 7777, 8888, 9999, 10101};
|
||||
|
||||
for ( uint32_t l = 0 ; l < (sizeof (losses) / sizeof (double)) ; l++ )
|
||||
{
|
||||
for ( uint32_t s = 0 ; s < (sizeof (seeds) / sizeof (uint32_t)) ; s++ )
|
||||
for ( uint32_t s = 0 ; s < (sizeof (runs) / sizeof (uint32_t)) ; s++ )
|
||||
{
|
||||
std::ostringstream name;
|
||||
name << " Losses = " << losses[l] * 100 << "%. Seed = " << seeds[s];
|
||||
name << " Losses = " << losses[l] * 100 << "%. Run = " << runs[s];
|
||||
TestCase::TestDuration testDuration;
|
||||
if (l == 1 && s == 0)
|
||||
{
|
||||
@@ -75,7 +75,7 @@ LteRlcAmE2eTestSuite::LteRlcAmE2eTestSuite ()
|
||||
{
|
||||
testDuration = TestCase::EXTENSIVE;
|
||||
}
|
||||
AddTestCase (new LteRlcAmE2eTestCase (name.str (), seeds[s], losses[l]), testDuration);
|
||||
AddTestCase (new LteRlcAmE2eTestCase (name.str (), runs[s], losses[l]), testDuration);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -87,12 +87,12 @@ static LteRlcAmE2eTestSuite lteRlcAmE2eTestSuite;
|
||||
* TestCase
|
||||
*/
|
||||
|
||||
LteRlcAmE2eTestCase::LteRlcAmE2eTestCase (std::string name, uint32_t seed, double losses)
|
||||
LteRlcAmE2eTestCase::LteRlcAmE2eTestCase (std::string name, uint32_t run, double losses)
|
||||
: TestCase (name)
|
||||
{
|
||||
// NS_LOG_UNCOND ("Creating LteRlcAmTestingTestCase: " + name);
|
||||
|
||||
m_seed = seed;
|
||||
m_run = run;
|
||||
m_losses = losses;
|
||||
|
||||
m_dlDrops = 0;
|
||||
@@ -136,7 +136,7 @@ LteRlcAmE2eTestCase::DoRun (void)
|
||||
// LogComponentEnable ("LteRlcUm", level);
|
||||
// LogComponentEnable ("LteRlcAm", level);
|
||||
|
||||
RngSeedManager::SetSeed (m_seed);
|
||||
Config::SetGlobal ("RngRun", IntegerValue (m_run));
|
||||
|
||||
Ptr<LteSimpleHelper> lteSimpleHelper = CreateObject<LteSimpleHelper> ();
|
||||
// lteSimpleHelper->EnableLogComponents ();
|
||||
@@ -198,25 +198,27 @@ LteRlcAmE2eTestCase::DoRun (void)
|
||||
Simulator::Schedule (Seconds (0.100), &LteTestRrc::Start, lteSimpleHelper->m_enbRrc);
|
||||
Simulator::Schedule (Seconds (10.100), &LteTestRrc::Stop, lteSimpleHelper->m_enbRrc);
|
||||
|
||||
|
||||
Simulator::Stop (Seconds (100.000));
|
||||
double throughput = (150.0/0.005) * (1.0-m_losses);
|
||||
double totBytes = ((100 + 4) * 10.0 / 0.010);
|
||||
Time stopTime = Seconds (std::max (totBytes/throughput, 10.0) + 10);
|
||||
NS_LOG_INFO ("throughput=" << throughput << ", totBytes=" << totBytes << ", stopTime=" << stopTime);
|
||||
|
||||
Simulator::Stop (stopTime);
|
||||
Simulator::Run ();
|
||||
|
||||
uint32_t txEnbRrcPdus = lteSimpleHelper->m_enbRrc->GetTxPdus ();
|
||||
uint32_t rxUeRrcPdus = lteSimpleHelper->m_ueRrc->GetRxPdus ();
|
||||
|
||||
// NS_LOG_INFO ("Seed = " << m_seed);
|
||||
// NS_LOG_INFO ("Losses (%) = " << uint32_t (m_losses * 100));
|
||||
NS_LOG_INFO ("Run = " << m_run);
|
||||
NS_LOG_INFO ("Losses (%) = " << uint32_t (m_losses * 100));
|
||||
|
||||
// NS_LOG_INFO ("dl dev drops = " << m_dlDrops);
|
||||
// NS_LOG_INFO ("ul dev drops = " << m_ulDrops);
|
||||
NS_LOG_INFO ("dl dev drops = " << m_dlDrops);
|
||||
NS_LOG_INFO ("ul dev drops = " << m_ulDrops);
|
||||
|
||||
// NS_LOG_INFO ("eNB tx RRC count = " << txEnbRrcPdus);
|
||||
// NS_LOG_INFO ("eNB rx RRC count = " << rxEnbRrcPdus);
|
||||
// NS_LOG_INFO ("UE tx RRC count = " << txUeRrcPdus);
|
||||
// NS_LOG_INFO ("UE rx RRC count = " << rxUeRrcPdus);
|
||||
NS_LOG_INFO ("eNB tx RRC count = " << txEnbRrcPdus);
|
||||
NS_LOG_INFO ("UE rx RRC count = " << rxUeRrcPdus);
|
||||
|
||||
NS_LOG_INFO (m_seed << "\t" << m_losses << "\t" << txEnbRrcPdus << "\t" << rxUeRrcPdus << "\t" << m_dlDrops);
|
||||
NS_LOG_INFO (m_run << "\t" << m_losses << "\t" << txEnbRrcPdus << "\t" << rxUeRrcPdus << "\t" << m_dlDrops);
|
||||
|
||||
NS_TEST_ASSERT_MSG_EQ (txEnbRrcPdus, rxUeRrcPdus,
|
||||
"TX PDUs (" << txEnbRrcPdus << ") != RX PDUs (" << rxUeRrcPdus << ")");
|
||||
|
||||
@@ -53,7 +53,7 @@ class LteRlcAmE2eTestCase : public TestCase
|
||||
uint32_t m_dlDrops;
|
||||
uint32_t m_ulDrops;
|
||||
|
||||
uint32_t m_seed;
|
||||
uint32_t m_run;
|
||||
double m_losses;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user