src/lte/test/lte-test-pss-ff-mac-scheduler.cc
changeset 9677 31a4e3806084
parent 9675 a14ab3098785
child 9680 31fbdb962ad0
--- a/src/lte/test/lte-test-pss-ff-mac-scheduler.cc	Fri Apr 05 19:05:31 2013 +0200
+++ b/src/lte/test/lte-test-pss-ff-mac-scheduler.cc	Fri Apr 05 21:05:55 2013 -0300
@@ -58,7 +58,7 @@
 
 #include "lte-test-pss-ff-mac-scheduler.h"
 
-NS_LOG_COMPONENT_DEFINE ("LenaTestPssFfMacCheduler");
+NS_LOG_COMPONENT_DEFINE ("LenaTestPssFfMacScheduler");
 
 namespace ns3 {
 
@@ -67,6 +67,8 @@
 {
   NS_LOG_INFO ("creating LenaTestPssFfMacSchedulerSuite");
 
+  bool errorModel = false;
+
   // General config
   // Traffic: UDP traffic with fixed rate
   // Token generation rate = traffic rate
@@ -75,7 +77,6 @@
   // Throughput in this file is calculated in RLC layer
 
   //Test Case 1: homogeneous flow test in PSS (same distance)
-
   // DOWNLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2    13)
   // Traffic info
   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
@@ -90,185 +91,136 @@
   // 3 users -> 8 PRB at Itbs 26 -> 749 -> 749000 > 232000 -> throughput = 232000 bytes/sec 
   // 6 users -> 4 PRB at Itbs 26 -> 373 -> 373000 > 232000 -> throughput = 232000 bytes/sec
   // 12 users -> 2 PRB at Itbs 26 -> 185 -> 185000 < 232000 -> throughput = 185000 bytes/sec
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,0,232000,232000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,0,232000,232000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,0,232000,232000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,0,183000,185000,200,1), TestCase::EXTENSIVE);
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,0,232000,232000,200,1,errorModel));
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,0,232000,232000,200,1,errorModel));
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,0,232000,232000,200,1,errorModel));
+  //AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,0,183000,185000,200,1,errorModel));// simulation time = 1.5, otherwise, ul test will fail
 
-  // DOWNLINK - DISTANCE 3000 -> MCS 24 -> Itbs 20 (from table 7.1.7.2.1-1 of 36.213)
-  // DOWNLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2    13)
+  // DOWNLINK - DISTANCE 4800 -> MCS 16 -> Itbs 15 (from table 7.1.7.2.1-1 of 36.213)
   // Traffic info
   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
-  // Totol bandwidth: 24 PRB at Itbs 20 -> 1383 -> 1383000 byte/sec
-  // 1 user -> 232000 * 1 = 232000 < 1383000 -> throughput = 232000 byte/sec
-  // 3 user -> 232000 * 3 = 696000 < 1383000 -> througphut = 232000 byte/sec
-  // 6 user -> 232000 * 6 = 139200 > 1383000 -> throughput = 1383000 / 6 = 230500 byte/sec
-  // 12 user -> 232000 * 12 = 2784000 > 1383000 -> throughput = 1383000 / 12 = 115250 byte/sec
-  // UPLINK - DISTANCE 3000 -> MCS 20 -> Itbs 18 (from table 7.1.7.2.1-1 of 36.213)
-  // 1 user -> 25 PRB at Itbs 18 -> 1239 -> 1239000 > 232000 -> throughput = 232000 bytes/sec
-  // 3 users -> 8 PRB at Itbs 18 -> 389 -> 389000 > 232000 -> throughput = 232000 bytes/sec
-  // 6 users -> 4 PRB at Itbs 18 -> 193 -> 193000 < 232000 -> throughput = 193000 bytes/sec
-  // 12 users -> 2 PRB at Itbs 18 -> 97 -> 97000 < 232000 -> throughput = 97000 bytes/sec
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,3000,232000,232000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,3000,232000,232000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,3000,230500,193000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,3000,115250,97000,200,1), TestCase::EXTENSIVE);
- 
-  // DOWNLINK - DISTANCE 6000 -> MCS 16 -> Itbs 15 (from table 7.1.7.2.1-1 of 36.213)
+  // Totol bandwidth: 24 PRB at Itbs 15 -> 1383 -> 903000 byte/sec
+  // 1 user -> 903000 * 1 = 232000 < 903000 -> throughput = 232000 byte/sec
+  // 3 user -> 232000 * 3 = 696000 < 903000 -> througphut = 232000 byte/sec
+  // 6 user -> 232000 * 6 = 139200 > 903000 -> throughput = 903000 / 6 = 150500 byte/sec
+  // 12 user -> 232000 * 12 = 2784000 > 903000 -> throughput =  903000 / 12 = 75250 byte/sec
+  // UPLINK - DISTANCE 4800 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213)
+  // 1 user -> 25 PRB at Itbs 13 -> 807 -> 807000 > 232000 -> throughput = 232000 bytes/sec
+  // 3 users -> 8 PRB at Itbs 13 -> 253 -> 253000 > 232000 -> throughput = 232000 bytes/sec
+  // 6 users -> 4 PRB at Itbs 13 -> 125 -> 125000 < 232000 -> throughput = 125000 bytes/sec
+  // after the patch enforcing min 3 PRBs per UE:
+  // 12 users -> 3 PRB at Itbs 13 -> 93  bytes * 8/12 UE/TTI  -> 62000 < 232000 -> throughput = 62000  bytes/sec
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,4800,232000,232000,200,1,errorModel));
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,4800,232000,232000,200,1,errorModel));
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,4800,150500,125000,200,1,errorModel));
+  //AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,4800,75250,62000,200,1,errorModel)); // simulation time = 1.5, otherwise, ul test will fail
+
+  // DOWNLINK - DISTANCE 6000 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213)
   // Traffic info
   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
-  // Totol bandwidth: 24 PRB at Itbs 15 -> 903 -> 903000 byte/sec
-  // 1 user -> 232000 * 1 = 232000 < 903000 -> throughput = 232000 byte/sec
-  // 3 user -> 232000 * 3 = 696000 < 903000 -> througphut = 232000 byte/sec
-  // 6 user -> 232000 * 6 = 139200 > 903000 -> throughput = 903000 / 6 = 150500 byte/sec
-  // 12 user -> 232000 * 12 = 2784000 > 903000 -> throughput = 903000 / 12 = 75250 byte/sec
+  // Totol bandwidth: 24 PRB at Itbs 13 -> 775 -> 775000 byte/sec
+  // 1 user -> 903000 * 1 = 232000 < 775000 -> throughput = 232000 byte/sec
+  // 3 user -> 232000 * 3 = 696000 < 775000 -> througphut = 232000 byte/sec
+  // 6 user -> 232000 * 6 = 139200 > 775000 -> throughput = 775000 / 6 = 129167 byte/sec
+  // 12 user -> 232000 * 12 = 2784000 > 775000 -> throughput =  775000 / 12 = 64583 byte/sec
+
   // UPLINK - DISTANCE 6000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
-  // 1 user -> 25 PRB at Itbs 11 -> 621 -> 621000 > 232000 -> throughput = 232000  bytes/sec
+  // 1 user -> 25 PRB at Itbs 11 -> 621 -> 621000 > 232000 -> throughput = 232000 bytes/sec
   // 3 users -> 8 PRB at Itbs 11 -> 201 -> 201000 < 232000 -> throughput = 201000  bytes/sec
   // 6 users -> 4 PRB at Itbs 11 -> 97 -> 97000 < 232000 -> throughput = 97000 bytes/sec
-  // 12 users -> 2 PRB at Itbs 11 -> 47 -> 47000 < 232000 -> throughput = 47000 bytes/sec
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,6000,232000,232000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,6000,232000,201000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,6000,150500,97000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,6000,75250,47000,200,1), TestCase::EXTENSIVE);
+  // after the patch enforcing min 3 PRBs per UE:
+  // 12 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/12 UE/TTI -> 48667 < 232000 -> throughput = 48667 bytes/sec
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,6000,232000,232000,200,1,errorModel));
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,6000,232000,201000,200,1,errorModel));
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,6000,129167,97000,200,1,errorModel));
+  //AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,6000,64583,48667,200,1, errorModel)); // simulation time = 1.5, otherwise, ul test will fail
 
-  // DOWNLINK - DISTANCE 9000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
+  // DOWNLINK - DISTANCE 10000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213)
   // Traffic info
   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
-  // Totol bandwidth: 24 PRB at Itbs 11 -> 597 -> 597000 byte/sec
-  // 1 user -> 232000 * 1 = 232000 < 597000 -> throughput = 232000 byte/sec
-  // 3 user -> 232000 * 3 = 696000 > 597000 -> througphut = 597000 / 3 = 199000byte/sec
-  // 6 user -> 232000 * 6 = 139200 > 597000 -> throughput = 597000 / 6 = 99500 byte/sec
-  // 12 user -> 232000 * 12 = 2784000 > 597000 -> throughput = 597000 / 12 = 49750 byte/sec
-  // UPLINK - DISTANCE 9000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213)
+  // Totol bandwidth: 24 PRB at Itbs 8 -> 421 -> 421000 byte/sec
+  // 1 user -> 903000 * 1 = 232000 < 421000 -> throughput = 232000 byte/sec
+  // 3 user -> 232000 * 3 = 696000 > 421000 -> througphut = 421000 / 3 = 140333 byte/sec
+  // 6 user -> 232000 * 6 = 139200 > 421000 -> throughput = 421000 / 6 = 70166 byte/sec
+  // 12 user -> 232000 * 12 = 2784000 > 421000 -> throughput =  421000 / 12 = 35083 byte/sec
+  // UPLINK - DISTANCE 10000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213)
   // 1 user -> 24 PRB at Itbs 8 -> 437 -> 437000 > 232000 -> throughput = 232000 bytes/sec
   // 3 users -> 8 PRB at Itbs 8 -> 137 -> 137000 < 232000 -> throughput = 137000 bytes/sec
   // 6 users -> 4 PRB at Itbs 8 -> 67 -> 67000 < 232000 -> throughput = 67000 bytes/sec
-  // 12 users -> 2 PRB at Itbs 8 -> 32 -> 32000 < 232000 -> throughput = 32000 bytes/sec
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,9000,232000,232000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,9000,199000,137000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,9000,99500,67000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,9000,49750,32000,200,1), TestCase::EXTENSIVE);
- 
-  // DONWLINK - DISTANCE 15000 -> MCS 6 -> Itbs 6 (from table 7.1.7.2.1-1 of 36.213)
-  // Traffic info
-  //   UDP traffic: payload size = 200 bytes, interval = 1 ms
-  //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
-  // Totol bandwidth: 24 PRB at Itbs 6 -> 309 -> 309000 byte/sec
-  // 1 user -> 232000 * 1 = 232000 < 309000 -> throughput = 232000 byte/sec
-  // 3 user -> 232000 * 3 = 696000 > 309000 -> througphut = 309000 / 3 = 103000byte/sec
-  // 6 user -> 232000 * 6 = 139200 > 309000 -> throughput = 309000 / 6 = 51500 byte/sec
-  // 12 user -> 232000 * 12 = 2784000 > 309000 -> throughput = 309000 / 12 = 25750 byte/sec
-  // UPLINK - DISTANCE 15000 -> MCS 6 -> Itbs 6 (from table 7.1.7.2.1-1 of 36.213)
-  // 1 user -> 25 PRB at Itbs 6 -> 233 -> 233000 > 232000 -> throughput = 232000 bytes/sec
-  // 3 users -> 8 PRB at Itbs 6 -> 69 -> 69000 < 232000 -> throughput = 69000 bytes/sec
-  // 6 users -> 4 PRB at Itbs 6 -> 32 -> 32000 < 232000 -> throughput = 32000 bytes/sec
-  // 12 users -> 2 PRB at Itbs 6 -> 15 -> 15000 < 232000 -> throughput = 15000 bytes/sec
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,15000,232000,232000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,15000,103000,69000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,15000,51500,32000,200,1), TestCase::EXTENSIVE);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,15000,25750,15000,200,1), TestCase::EXTENSIVE);
+  // after the patch enforcing min 3 PRBs per UE:
+  // 12 users -> 3 PRB at Itbs 8 -> 49 bytes * 8/12 UE/TTI -> 32667 < 232000 -> throughput = 32667  bytes/sec
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (1,0,10000,232000,232000,200,1,errorModel));
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (3,0,10000,140333,137000,200,1,errorModel));
+  AddTestCase (new LenaPssFfMacSchedulerTestCase1 (6,0,10000,70166,67000,200,1,errorModel));
+  //AddTestCase (new LenaPssFfMacSchedulerTestCase1 (12,0,10000,35083,32667,200,1,errorModel));// simulation time = 1.5, otherwise, ul test will fail
 
   // Test Case 2: homogeneous flow test in PSS (different distance)
   // Traffic1 info
   //   UDP traffic: payload size = 100 bytes, interval = 1 ms
   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 132000 byte/rate 
-  // Maximum throughput = 5 / ( 1/2196000 + 1/1383000 + 1/903000 + 1/597000 + 1/309000) = 694720  byte/s
-  // 132000 * 5 = 660000 < 694720 -> estimated throughput in downlink = 694720/5 = 132000 bytes/sec
+  // Maximum throughput = 4 / ( 1/2196000 + 1/903000 + 1/621000 + 1/421000 ) = 720930 byte/s
+  // 132000 * 4 = 528000 < 720930 -> estimated throughput in downlink = 132000 byte/sec
   std::vector<uint16_t> dist1;
-  dist1.push_back (0);    // User 0 distance --> MCS 28
-  dist1.push_back (3000);    // User 1 distance --> MCS 24
-  dist1.push_back (6000);    // User 2 distance --> MCS 16
-  dist1.push_back (9000);    // User 3 distance --> MCS 12
-  dist1.push_back (15000);    // User 4 distance --> MCS 6
+  dist1.push_back (0);       // User 0 distance --> MCS 28
+  dist1.push_back (4800);    // User 1 distance --> MCS 16
+  dist1.push_back (6000);    // User 2 distance --> MCS 14
+  dist1.push_back (10000);   // User 3 distance --> MCS 8
   std::vector<uint16_t> packetSize1;
   packetSize1.push_back (100);
   packetSize1.push_back (100);
   packetSize1.push_back (100);
   packetSize1.push_back (100);
-  packetSize1.push_back (100);
   std::vector<uint32_t> estThrPssDl1;
-  estThrPssDl1.push_back (132000);
-  estThrPssDl1.push_back (132000);
-  estThrPssDl1.push_back (132000);
-  estThrPssDl1.push_back (132000);
-  estThrPssDl1.push_back (132000);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase2 (dist1,estThrPssDl1,packetSize1,1), TestCase::EXTENSIVE);
+  estThrPssDl1.push_back (132000); // User 0 estimated TTI throughput from PSS
+  estThrPssDl1.push_back (132000); // User 1 estimated TTI throughput from PSS
+  estThrPssDl1.push_back (132000); // User 2 estimated TTI throughput from PSS
+  estThrPssDl1.push_back (132000); // User 3 estimated TTI throughput from PSS
+  AddTestCase (new LenaPssFfMacSchedulerTestCase2 (dist1,estThrPssDl1,packetSize1,1,errorModel));
 
   // Traffic2 info
   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
-  //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 132000 byte/rate 
-  // Maximum throughput = 5 / ( 1/2196000 + 1/1383000 + 1/903000 + 1/597000 + 1/309000) = 694720  byte/s
-  // 232000 * 5 = 1160000 > 694720 -> estimated throughput in downlink = 694720/5 = 138944 bytes/sec
+  //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
+  // Maximum throughput = 4 / ( 1/2196000 + 1/903000 + 1/621000 + 1/421000 ) = 720930 byte/s
+  // 232000 * 4 = 928000 > 720930 -> estimated throughput in downlink = 720930 / 4 = 180232 byte/sec 
   std::vector<uint16_t> dist2;
-  dist2.push_back (0);    // User 0 distance --> MCS 28
-  dist2.push_back (3000);    // User 1 distance --> MCS 24
-  dist2.push_back (6000);    // User 2 distance --> MCS 16
-  dist2.push_back (9000);    // User 3 distance --> MCS 12
-  dist2.push_back (15000);    // User 4 distance --> MCS 6
+  dist2.push_back (0);       // User 0 distance --> MCS 28
+  dist2.push_back (4800);    // User 1 distance --> MCS 16
+  dist2.push_back (6000);    // User 2 distance --> MCS 14
+  dist2.push_back (10000);   // User 3 distance --> MCS 8
   std::vector<uint16_t> packetSize2;
   packetSize2.push_back (200);
   packetSize2.push_back (200);
   packetSize2.push_back (200);
   packetSize2.push_back (200);
-  packetSize2.push_back (200);
   std::vector<uint32_t> estThrPssDl2;
-  estThrPssDl2.push_back (138944);
-  estThrPssDl2.push_back (138944);
-  estThrPssDl2.push_back (138944);
-  estThrPssDl2.push_back (138944);
-  estThrPssDl2.push_back (138944);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase2 (dist2,estThrPssDl2,packetSize2,1), TestCase::EXTENSIVE);
-  
-  // Test Case 3: : heterogeneous flow test in PSS (same distance)
-  // Traffic3 info:
-  //   UDP traffic: payload size = [100, 200,300,400,500] bytes, interval = 1 ms
-  //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
-  //   Maximum throughput = 2196000 byte/sec
-  //   132000 + 232000 + 332000 + 432000 + 532000 = 1660000 < 2196000 -> estimated throughput in downlink = [132000, 232000,332000, 432000, 53200] bytes/sec
+  estThrPssDl2.push_back (180232); // User 0 estimated TTI throughput from PSS
+  estThrPssDl2.push_back (180232); // User 1 estimated TTI throughput from PSS
+  estThrPssDl2.push_back (180232); // User 2 estimated TTI throughput from PSS
+  estThrPssDl2.push_back (180232); // User 3 estimated TTI throughput from PSS
+  AddTestCase (new LenaPssFfMacSchedulerTestCase2 (dist2,estThrPssDl2,packetSize2,1,errorModel));
+
+  // Test Case 3: heterogeneous flow test in PSS
+  //   UDP traffic: payload size = [100,200,300] bytes, interval = 1 ms
+  //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> [132000, 232000, 332000] byte/rate 
+  // Maximum throughput = 3 / ( 1/2196000 + 1/903000 + 1/621000 ) = 945450  byte/s
+  // 132000 + 232000 + 332000 = 696000 < 945450 -> estimated throughput in downlink = [132000, 232000, 332000] byte/sec
   std::vector<uint16_t> dist3;
   dist3.push_back (0);    // User 0 distance --> MCS 28
-  dist3.push_back (0);    // User 1 distance --> MCS 24
-  dist3.push_back (0);    // User 2 distance --> MCS 16
-  dist3.push_back (0);    // User 3 distance --> MCS 12
-  dist3.push_back (0);    // User 4 distance --> MCS 6
+  dist3.push_back (4800);    // User 1 distance --> MCS 16
+  dist3.push_back (6000);    // User 2 distance --> MCS 14
   std::vector<uint16_t> packetSize3;
   packetSize3.push_back (100);
   packetSize3.push_back (200);
   packetSize3.push_back (300);
-  packetSize3.push_back (400);
-  packetSize3.push_back (500);
   std::vector<uint32_t> estThrPssDl3;
-  estThrPssDl3.push_back (132000);
-  estThrPssDl3.push_back (232000);
-  estThrPssDl3.push_back (332000);
-  estThrPssDl3.push_back (432000);
-  estThrPssDl3.push_back (532000);
-  AddTestCase (new LenaPssFfMacSchedulerTestCase2 (dist3,estThrPssDl3,packetSize3,1), TestCase::EXTENSIVE);
-  
+  estThrPssDl3.push_back (132000); // User 0 estimated TTI throughput from PSS
+  estThrPssDl3.push_back (232000); // User 1 estimated TTI throughput from PSS
+  estThrPssDl3.push_back (332000); // User 2 estimated TTI throughput from PSS
+  AddTestCase (new LenaPssFfMacSchedulerTestCase2 (dist3,estThrPssDl3,packetSize3,1,errorModel));
 
-  // Test Case 4: heterogeneous flow test in PSS (different distance)
-  // Traffic4 info 
-  //   UDP traffic: payload size = [100,200,300] bytes, interval = 1 ms
-  //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> [132000, 232000, 332000] byte/rate 
-  // Maximum throughput = 5 / ( 1/2196000 + 1/1383000 + 1/903000 ) = 1312417  byte/s
-  // 132000 + 232000 + 332000 = 696000 < 1312417 -> estimated throughput in downlink = [132000, 232000, 332000] byte/sec
-  std::vector<uint16_t> dist4;
-  dist4.push_back (0);    // User 0 distance --> MCS 28
-  dist4.push_back (3000);    // User 1 distance --> MCS 24
-  dist4.push_back (6000);    // User 2 distance --> MCS 16
-  std::vector<uint16_t> packetSize4;
-  packetSize4.push_back (100);
-  packetSize4.push_back (200);
-  packetSize4.push_back (300);
-  std::vector<uint32_t> estThrPssDl4;
-  estThrPssDl4.push_back (132000); // User 0 estimated TTI throughput from PSS
-  estThrPssDl4.push_back (232000); // User 1 estimated TTI throughput from PSS
-  estThrPssDl4.push_back (332000); // User 2 estimated TTI throughput from PSS
-  AddTestCase (new LenaPssFfMacSchedulerTestCase2 (dist4,estThrPssDl4,packetSize4,1), TestCase::QUICK);
 }
 
 static LenaTestPssFfMacSchedulerSuite lenaTestPssFfMacSchedulerSuite;
@@ -285,7 +237,7 @@
 }
 
 
-LenaPssFfMacSchedulerTestCase1::LenaPssFfMacSchedulerTestCase1 (uint16_t nUser, uint16_t nLc, uint16_t dist, double thrRefDl, double thrRefUl, uint16_t packetSize, uint16_t interval)
+LenaPssFfMacSchedulerTestCase1::LenaPssFfMacSchedulerTestCase1 (uint16_t nUser, uint16_t nLc, uint16_t dist, double thrRefDl, double thrRefUl, uint16_t packetSize, uint16_t interval,bool errorModelEnabled)
   : TestCase (BuildNameString (nUser, dist)),
     m_nUser (nUser),
     m_nLc (nLc),
@@ -293,7 +245,8 @@
     m_packetSize (packetSize),
     m_interval (interval),
     m_thrRefDl (thrRefDl),
-    m_thrRefUl (thrRefUl)
+    m_thrRefUl (thrRefUl),
+    m_errorModelEnabled (errorModelEnabled)
 {
 }
 
@@ -304,10 +257,22 @@
 void
 LenaPssFfMacSchedulerTestCase1::DoRun (void)
 {
+  NS_LOG_FUNCTION (this << GetName ());
+
+  if (!m_errorModelEnabled)
+    {
+      Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
+      Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
+    }
+
+  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
+
   Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
   Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
   lteHelper->SetEpcHelper (epcHelper);
 
+  //LogComponentEnable ("PssFfMacScheduler", LOG_DEBUG);
+
   Ptr<Node> pgw = epcHelper->GetPgwNode ();
 
   // Create a single RemoteHost
@@ -333,12 +298,12 @@
   Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
   remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
 
-  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
-  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
-  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
-  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
+  //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
+  //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
+  //Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
+  //Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
 
-  Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteHelper::RLC_UM_ALWAYS));
+  //Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteHelper::RLC_UM_ALWAYS));
 
   LogComponentDisableAll (LOG_LEVEL_ALL);
   //LogComponentEnable ("LenaTestPssFfMacCheduler", LOG_LEVEL_ALL);
@@ -362,7 +327,6 @@
   NetDeviceContainer enbDevs;
   NetDeviceContainer ueDevs;
   lteHelper->SetSchedulerType ("ns3::PssFfMacScheduler");
-  lteHelper->SetSchedulerAttribute("PssFdSchedulerType", StringValue("PFsch"));
   enbDevs = lteHelper->InstallEnbDevice (enbNodes);
   ueDevs = lteHelper->InstallUeDevice (ueNodes);
 
@@ -405,11 +369,11 @@
     {
       Ptr<NetDevice> ueDevice = ueDevs.Get (u);
       GbrQosInformation qos;
-      qos.gbrDl = (m_packetSize + 32) * (1000 / m_interval) * 8 * 1;  // bit/
-      qos.gbrUl = (m_packetSize + 32) * (1000 / m_interval) * 8 * 1;
+      qos.gbrDl = (m_packetSize + 32) * (1000 / m_interval) * 8;  // bit/s, considering IP, UDP, RLC, PDCP header size
+      qos.gbrUl = (m_packetSize + 32) * (1000 / m_interval) * 8;
       qos.mbrDl = 0;
       qos.mbrUl = 0;
-
+      
       enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
       EpsBearer bearer (q, qos);
       lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default ());  
@@ -440,17 +404,18 @@
 
       clientApps.Add (dlClient.Install (remoteHost));
       clientApps.Add (ulClient.Install (ueNodes.Get (u)));
-   }
+    }
 
   serverApps.Start (Seconds (0.001));
   clientApps.Start (Seconds (0.001));
 
-  double statsStartTime = 0.300; // need to allow for RRC connection establishment + SRS
-  double statsDuration = 2.0;
+  double statsStartTime = 0.001; // need to allow for RRC connection establishment + SRS
+  double statsDuration = 1;
   double tolerance = 0.1;
   Simulator::Stop (Seconds (statsStartTime + statsDuration - 0.0001));
 
   lteHelper->EnableRlcTraces ();
+  lteHelper->EnableMacTraces ();
   Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
   rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (statsStartTime)));
   rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (statsDuration)));
@@ -458,7 +423,7 @@
   Simulator::Run ();
 
   /**
-   * Check that the downlink assignation is done in a "priority set scheduler" manner
+   * Check that the downlink assignation is done in a "token bank fair queue" manner
    */
 
   NS_LOG_INFO ("DL - Test with " << m_nUser << " user(s) at distance " << m_dist);
@@ -522,13 +487,14 @@
 }
 
 
-LenaPssFfMacSchedulerTestCase2::LenaPssFfMacSchedulerTestCase2 (std::vector<uint16_t> dist, std::vector<uint32_t> estThrPssDl, std::vector<uint16_t> packetSize, uint16_t interval)
+LenaPssFfMacSchedulerTestCase2::LenaPssFfMacSchedulerTestCase2 (std::vector<uint16_t> dist, std::vector<uint32_t> estThrPssDl, std::vector<uint16_t> packetSize, uint16_t interval,bool errorModelEnabled)
   : TestCase (BuildNameString (dist.size (), dist)),
     m_nUser (dist.size ()),
     m_dist (dist),
     m_packetSize (packetSize),
     m_interval (interval),
-    m_estThrPssDl (estThrPssDl)
+    m_estThrPssDl (estThrPssDl),
+    m_errorModelEnabled (errorModelEnabled)
 {
 }
 
@@ -539,6 +505,16 @@
 void
 LenaPssFfMacSchedulerTestCase2::DoRun (void)
 {
+
+  if (!m_errorModelEnabled)
+    {
+      Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
+      Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
+    }
+
+  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
+
+
   Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
   Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
   lteHelper->SetEpcHelper (epcHelper);
@@ -568,12 +544,6 @@
   Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
   remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
 
-  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
-  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
-  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
-  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));  
-
-  Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteHelper::RLC_UM_ALWAYS));
 
   LogComponentDisableAll (LOG_LEVEL_ALL);
   //LogComponentEnable ("LenaTestPssFfMacCheduler", LOG_LEVEL_ALL);
@@ -597,7 +567,6 @@
   NetDeviceContainer enbDevs;
   NetDeviceContainer ueDevs;
   lteHelper->SetSchedulerType ("ns3::PssFfMacScheduler");
-  lteHelper->SetSchedulerAttribute ("PssFdSchedulerType", StringValue ("PFsch"));
   enbDevs = lteHelper->InstallEnbDevice (enbNodes);
   ueDevs = lteHelper->InstallUeDevice (ueNodes);
 
@@ -635,20 +604,21 @@
   lteHelper->Attach (ueDevs, enbDevs.Get (0));
 
   // Activate an EPS bearer on all UEs
+
   for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
     {
       Ptr<NetDevice> ueDevice = ueDevs.Get (u);
       GbrQosInformation qos;
-      qos.gbrDl = (m_packetSize.at (u) + 32) * (1000 / m_interval) * 8 * 1;  // bit/s, = Target Bit Rate(TBR)
-      qos.gbrUl = (m_packetSize.at (u) + 32) * (1000 / m_interval) * 8 * 1;
+      qos.gbrDl = (m_packetSize.at (u) + 32) * (1000 / m_interval) * 8;  // bit/s, considering IP, UDP, RLC, PDCP header size
+      qos.gbrUl = (m_packetSize.at (u) + 32) * (1000 / m_interval) * 8;
       qos.mbrDl = qos.gbrDl;
       qos.mbrUl = qos.gbrUl;
-
+  
       enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
       EpsBearer bearer (q, qos);
       lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default ());  
+    }
 
-    }
 
   // Install downlind and uplink applications
   uint16_t dlPort = 1234;
@@ -680,7 +650,7 @@
   serverApps.Start (Seconds (0.001));
   clientApps.Start (Seconds (0.001));
 
-  double statsStartTime = 0.300; // need to allow for RRC connection establishment + SRS
+  double statsStartTime = 0.001; // need to allow for RRC connection establishment + SRS
   double statsDuration = 1.0;
   double tolerance = 0.1;
   Simulator::Stop (Seconds (statsStartTime + statsDuration - 0.0001));
@@ -690,10 +660,11 @@
   rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (statsStartTime)));
   rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (statsDuration)));
 
+
   Simulator::Run ();
 
   /**
-   * Check that the downlink assignation is done in a "priority set scheduler" manner
+   * Check that the downlink assignation is done in a "token bank fair queue" manner
    */
 
   NS_LOG_INFO ("DL - Test with " << m_nUser << " user(s)");