21 #include "ns3/simulator.h"
24 #include "ns3/lte-rlc-header.h"
25 #include "ns3/lte-rlc-am.h"
40 :
TestSuite (
"lte-rlc-am-transmitter", SYSTEM)
82 txPdcp = CreateObject<LteTestPdcp> ();
85 txRlc = CreateObject<LteRlcAm> ();
86 txRlc->SetRnti (rnti);
87 txRlc->SetLcId (lcid);
90 txMac = CreateObject<LteTestMac> ();
94 txPdcp->SetLteRlcSapProvider (txRlc->GetLteRlcSapProvider ());
95 txRlc->SetLteRlcSapUser (
txPdcp->GetLteRlcSapUser ());
97 txRlc->SetLteMacSapProvider (
txMac->GetLteMacSapProvider ());
98 txMac->SetLteMacSapUser (txRlc->GetLteMacSapUser ());
138 txPdcp->SendData (Seconds (0.100),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ");
140 txMac->SendTxOpportunity (Seconds (0.150), 30);
141 CheckDataReceived (Seconds (0.200),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"SDU is not OK");
170 txPdcp->SendData (Seconds (0.100),
"ABCDEFGHIJKLMNOPQRSTUVWXYZZ");
173 txMac->SendTxOpportunity (Seconds (0.150), 12);
176 txMac->SendTxOpportunity (Seconds (0.250), 12);
179 txMac->SendTxOpportunity (Seconds (0.350), 12);
182 txMac->SendTxOpportunity (Seconds (0.450), 7);
212 txPdcp->SendData (Seconds (0.100),
"ABCDEFGH");
213 txPdcp->SendData (Seconds (0.150),
"IJKLMNOPQR");
214 txPdcp->SendData (Seconds (0.200),
"STUVWXYZ");
218 txMac->SendTxOpportunity (Seconds (0.250), 33);
219 CheckDataReceived (Seconds (0.300),
"ABCDEFGHIJKLMNOPQRSTUVWXYZ",
"Concatenation is not OK");
250 txPdcp->SendData (Seconds (0.100),
"ABCDEFGHIJ");
251 txPdcp->SendData (Seconds (0.150),
"KLMNOPQRS");
252 txPdcp->SendData (Seconds (0.200),
"TUVWXYZ");
254 txMac->SendTxOpportunity (Seconds (0.250), (4+2) + (10+6));
257 txPdcp->SendData (Seconds (0.350),
"ABCDEFGH");
258 txPdcp->SendData (Seconds (0.400),
"IJKLMNOPQRST");
259 txPdcp->SendData (Seconds (0.450),
"UVWXYZ");
261 txMac->SendTxOpportunity (Seconds (0.500), 4 + 3);
264 txPdcp->SendData (Seconds (0.600),
"ABCDEFGH");
265 txPdcp->SendData (Seconds (0.650),
"IJKLMNOPQRST");
266 txPdcp->SendData (Seconds (0.700),
"UVWXYZ");
268 txPdcp->SendData (Seconds (0.750),
"ABCDEFGHIJ");
269 txPdcp->SendData (Seconds (0.800),
"KLMNOPQRST");
270 txPdcp->SendData (Seconds (0.850),
"UVWXYZ");
272 txMac->SendTxOpportunity (Seconds (0.900), 4 + 7);
275 txMac->SendTxOpportunity (Seconds (1.000), (4+2) + (8+2));
278 txPdcp->SendData (Seconds (1.100),
"ABCDEFGHIJ");
279 txPdcp->SendData (Seconds (1.150),
"KLMNOPQRSTU");
280 txPdcp->SendData (Seconds (1.200),
"VWXYZ");
282 txMac->SendTxOpportunity (Seconds (1.250), 4 + 3);
285 txMac->SendTxOpportunity (Seconds (1.350), 4 + 3);
288 txMac->SendTxOpportunity (Seconds (1.450), 4 + 4);
291 txMac->SendTxOpportunity (Seconds (1.550), (4+2+1+2+1+2+1) + (6+8+12+6+10+10+3));
292 CheckDataReceived (Seconds (1.600),
"UVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW",
"SDU #8 is not OK");
294 txMac->SendTxOpportunity (Seconds (1.650), (4+2+1+2) + (3+10+10+7));
295 CheckDataReceived (Seconds (1.700),
"XYZABCDEFGHIJKLMNOPQRSTUVWXYZ",
"SDU #9 is not OK");
Test 4.1.1.2 Segmentation (One SDU => n PDUs)
keep track of time values and allow control of global simulation resolution
void CheckDataReceived(Time time, std::string shouldReceived, std::string assertMsg)
virtual ~LteRlcAmTransmitterReportBufferStatusTestCase()
virtual ~LteRlcAmTransmitterConcatenationTestCase()
virtual ~LteRlcAmTransmitterTestCase()
static void Run(void)
Run the simulation until one of:
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
Test 4.1.1.4 Report Buffer Status (test primitive parameters)
LteRlcAmTransmitterOneSduTestCase()
LteRlcAmTransmitterTestCase()
TestSuite 4.1.1 RLC AM: Only transmitter.
NS_LOG_COMPONENT_DEFINE("LteRlcAmTransmitterTest")
virtual void DoRun(void)
Implementation to actually run this TestCase.
static void EnablePrinting(void)
By default, packets do not keep around enough metadata to perform the operations requested by the Pri...
virtual void DoRun(void)
Implementation to actually run this TestCase.
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
LteRlcAmTransmitterReportBufferStatusTestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
static LteRlcAmTransmitterTestSuite lteRlcAmTransmitterTestSuite
void DoCheckDataReceived(std::string shouldReceived, std::string assertMsg)
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
LteRlcAmTransmitterConcatenationTestCase()
virtual void DoRun(void)
Implementation to actually run this TestCase.
LteRlcAmTransmitterSegmentationTestCase()
LteRlcAmTransmitterTestSuite()
TestSuite 4.1.1 RLC AM: Only transmitter.
virtual ~LteRlcAmTransmitterSegmentationTestCase()
Test 4.1.1.3 Concatenation (n SDUs => One PDU)
virtual void DoRun(void)
Implementation to actually run this TestCase.
Test 4.1.1.1 One SDU, One PDU.
Ptr< LteTestPdcp > txPdcp
virtual ~LteRlcAmTransmitterOneSduTestCase()
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.