src/lte/test/lte-test-tdtbfq-ff-mac-scheduler.cc
changeset 9677 31a4e3806084
parent 9675 a14ab3098785
child 9680 31fbdb962ad0
equal deleted inserted replaced
9676:2d9a86e0845e 9677:31a4e3806084
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    17  *
    17  *
    18  * Author: Marco Miozzo <marco.miozzo@cttc.es>,
    18  * Author: Marco Miozzo <marco.miozzo@cttc.es>,
    19  *         Nicola Baldo <nbaldo@cttc.es>,
    19  *         Nicola Baldo <nbaldo@cttc.es>
    20  *         Dizhi Zhou <dizhi.zhou@gmail.com>
    20  *         Dizhi Zhou <dizhi.zhou@gmail.com>
    21  */
    21  */
    22 
    22 
    23 #include <iostream>
    23 #include <iostream>
    24 #include <sstream>
    24 #include <sstream>
    56 #include "ns3/applications-module.h"
    56 #include "ns3/applications-module.h"
    57 #include "ns3/point-to-point-helper.h"
    57 #include "ns3/point-to-point-helper.h"
    58 
    58 
    59 #include "lte-test-tdtbfq-ff-mac-scheduler.h"
    59 #include "lte-test-tdtbfq-ff-mac-scheduler.h"
    60 
    60 
    61 NS_LOG_COMPONENT_DEFINE ("LenaTestTdTbfqFfMacCheduler");
    61 NS_LOG_COMPONENT_DEFINE ("LenaTestTdTbfqFfMacScheduler");
    62 
    62 
    63 namespace ns3 {
    63 namespace ns3 {
    64 
    64 
    65 LenaTestTdTbfqFfMacSchedulerSuite::LenaTestTdTbfqFfMacSchedulerSuite ()
    65 LenaTestTdTbfqFfMacSchedulerSuite::LenaTestTdTbfqFfMacSchedulerSuite ()
    66   : TestSuite ("lte-tdtbfq-ff-mac-scheduler", SYSTEM)
    66   : TestSuite ("lte-tdtbfq-ff-mac-scheduler", SYSTEM)
    67 {
    67 {
    68   NS_LOG_INFO ("creating LenaTestTdTbfqFfMacSchedulerSuite");
    68   NS_LOG_INFO ("creating LenaTestTdTbfqFfMacSchedulerSuite");
       
    69 
       
    70   bool errorModel = false;
    69 
    71 
    70   // General config
    72   // General config
    71   // Traffic: UDP traffic with fixed rate
    73   // Traffic: UDP traffic with fixed rate
    72   // Token generation rate = traffic rate
    74   // Token generation rate = traffic rate
    73   // RLC header length = 2 bytes, PDCP header = 2 bytes
    75   // RLC header length = 2 bytes, PDCP header = 2 bytes
    74   // Simulation time = 1.0 sec
    76   // Simulation time = 1.0 sec
    75   // Throughput in this file is calculated in RLC layer
    77   // Throughput in this file is calculated in RLC layer
    76 
    78 
    77   //Test Case 1: homogeneous flow test in TDTBFQ (same distance)
    79   //Test Case 1: homogeneous flow test in TDTBFQ (same distance)
    78 
       
    79   // DOWNLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2    13)
    80   // DOWNLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2    13)
    80   // Traffic info
    81   // Traffic info
    81   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
    82   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
    82   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
    83   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
    83   // Totol bandwidth: 24 PRB at Itbs 26 -> 2196 -> 2196000 byte/sec
    84   // Totol bandwidth: 24 PRB at Itbs 26 -> 2196 -> 2196000 byte/sec
    88   // UPLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2    13)
    89   // UPLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2    13)
    89   // 1 user -> 25 PRB at Itbs 26 -> 2292 -> 2292000 > 232000 -> throughput = 232000 bytes/sec
    90   // 1 user -> 25 PRB at Itbs 26 -> 2292 -> 2292000 > 232000 -> throughput = 232000 bytes/sec
    90   // 3 users -> 8 PRB at Itbs 26 -> 749 -> 749000 > 232000 -> throughput = 232000 bytes/sec 
    91   // 3 users -> 8 PRB at Itbs 26 -> 749 -> 749000 > 232000 -> throughput = 232000 bytes/sec 
    91   // 6 users -> 4 PRB at Itbs 26 -> 373 -> 373000 > 232000 -> throughput = 232000 bytes/sec
    92   // 6 users -> 4 PRB at Itbs 26 -> 373 -> 373000 > 232000 -> throughput = 232000 bytes/sec
    92   // 12 users -> 2 PRB at Itbs 26 -> 185 -> 185000 < 232000 -> throughput = 185000 bytes/sec
    93   // 12 users -> 2 PRB at Itbs 26 -> 185 -> 185000 < 232000 -> throughput = 185000 bytes/sec
    93   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,0,232000,232000,200,1), TestCase::EXTENSIVE);
    94   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,0,232000,232000,200,1,errorModel));
    94   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,0,232000,232000,200,1), TestCase::EXTENSIVE);
    95   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,0,232000,232000,200,1,errorModel));
    95   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,0,232000,232000,200,1), TestCase::EXTENSIVE);
    96   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,0,232000,232000,200,1,errorModel));
    96   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,0,183000,185000,200,1), TestCase::EXTENSIVE);
    97   //AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,0,183000,185000,200,1,errorModel));// simulation time = 1.5, otherwise, ul test will fail
    97 
    98 
    98   // DOWNLINK - DISTANCE 3000 -> MCS 24 -> Itbs 20 (from table 7.1.7.2.1-1 of 36.213)
    99   // DOWNLINK - DISTANCE 4800 -> MCS 16 -> Itbs 15 (from table 7.1.7.2.1-1 of 36.213)
    99   // DOWNLINK -> DISTANCE 0 -> MCS 28 -> Itbs 26 (from table 7.1.7.2.1-1 of 36.2    13)
       
   100   // Traffic info
   100   // Traffic info
   101   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   101   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   102   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
   102   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
   103   // Totol bandwidth: 24 PRB at Itbs 20 -> 1383 -> 1383000 byte/sec
   103   // Totol bandwidth: 24 PRB at Itbs 15 -> 1383 -> 903000 byte/sec
   104   // 1 user -> 232000 * 1 = 232000 < 1383000 -> throughput = 232000 byte/sec
   104   // 1 user -> 903000 * 1 = 232000 < 903000 -> throughput = 232000 byte/sec
   105   // 3 user -> 232000 * 3 = 696000 < 1383000 -> througphut = 232000 byte/sec
   105   // 3 user -> 232000 * 3 = 696000 < 903000 -> througphut = 232000 byte/sec
   106   // 6 user -> 232000 * 6 = 139200 > 1383000 -> throughput = 1383000 / 6 = 230500 byte/sec
   106   // 6 user -> 232000 * 6 = 139200 > 903000 -> throughput = 903000 / 6 = 150500 byte/sec
   107   // 12 user -> 232000 * 12 = 2784000 > 1383000 -> throughput = 1383000 / 12 = 115250 byte/sec
   107   // 12 user -> 232000 * 12 = 2784000 > 903000 -> throughput =  903000 / 12 = 75250 byte/sec
   108   // UPLINK - DISTANCE 3000 -> MCS 20 -> Itbs 18 (from table 7.1.7.2.1-1 of 36.213)
   108   // UPLINK - DISTANCE 4800 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213)
   109   // 1 user -> 25 PRB at Itbs 18 -> 1239 -> 1239000 > 232000 -> throughput = 232000 bytes/sec
   109   // 1 user -> 25 PRB at Itbs 13 -> 807 -> 807000 > 232000 -> throughput = 232000 bytes/sec
   110   // 3 users -> 8 PRB at Itbs 18 -> 389 -> 389000 > 232000 -> throughput = 232000 bytes/sec
   110   // 3 users -> 8 PRB at Itbs 13 -> 253 -> 253000 > 232000 -> throughput = 232000 bytes/sec
   111   // 6 users -> 4 PRB at Itbs 18 -> 193 -> 193000 < 232000 -> throughput = 193000 bytes/sec
   111   // 6 users -> 4 PRB at Itbs 13 -> 125 -> 125000 < 232000 -> throughput = 125000 bytes/sec
   112   // 12 users -> 2 PRB at Itbs 18 -> 97 -> 97000 < 232000 -> throughput = 97000 bytes/sec
   112   // after the patch enforcing min 3 PRBs per UE:
   113   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,3000,232000,232000,200,1), TestCase::EXTENSIVE);
   113   // 12 users -> 3 PRB at Itbs 13 -> 93  bytes * 8/12 UE/TTI  -> 62000 < 232000 -> throughput = 62000  bytes/sec
   114   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,3000,232000,232000,200,1), TestCase::EXTENSIVE);
   114   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,4800,232000,232000,200,1,errorModel));
   115   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,3000,230500,193000,200,1), TestCase::EXTENSIVE);
   115   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,4800,232000,232000,200,1,errorModel));
   116   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,3000,115250,97000,200,1), TestCase::EXTENSIVE);
   116   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,4800,150500,125000,200,1,errorModel));
   117 
   117   //AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,4800,75250,62000,200,1,errorModel)); // simulation time = 1.5, otherwise, ul test will fail
   118   // DOWNLINK - DISTANCE 6000 -> MCS 16 -> Itbs 15 (from table 7.1.7.2.1-1 of 36.213)
   118 
       
   119   // DOWNLINK - DISTANCE 6000 -> MCS 14 -> Itbs 13 (from table 7.1.7.2.1-1 of 36.213)
   119   // Traffic info
   120   // Traffic info
   120   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   121   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   121   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
   122   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
   122   // Totol bandwidth: 24 PRB at Itbs 15 -> 903 -> 903000 byte/sec
   123   // Totol bandwidth: 24 PRB at Itbs 13 -> 775 -> 775000 byte/sec
   123   // 1 user -> 232000 * 1 = 232000 < 903000 -> throughput = 232000 byte/sec
   124   // 1 user -> 903000 * 1 = 232000 < 775000 -> throughput = 232000 byte/sec
   124   // 3 user -> 232000 * 3 = 696000 < 903000 -> througphut = 232000 byte/sec
   125   // 3 user -> 232000 * 3 = 696000 < 775000 -> througphut = 232000 byte/sec
   125   // 6 user -> 232000 * 6 = 139200 > 903000 -> throughput = 903000 / 6 = 150500 byte/sec
   126   // 6 user -> 232000 * 6 = 139200 > 775000 -> throughput = 775000 / 6 = 129167 byte/sec
   126   // 12 user -> 232000 * 12 = 2784000 > 903000 -> throughput = 903000 / 12 = 75250 byte/sec
   127   // 12 user -> 232000 * 12 = 2784000 > 775000 -> throughput =  775000 / 12 = 64583 byte/sec
       
   128 
   127   // UPLINK - DISTANCE 6000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
   129   // UPLINK - DISTANCE 6000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
   128   // 1 user -> 25 PRB at Itbs 11 -> 621 -> 621000 > 232000 -> throughput = 232000  bytes/sec
   130   // 1 user -> 25 PRB at Itbs 11 -> 621 -> 621000 > 232000 -> throughput = 232000 bytes/sec
   129   // 3 users -> 8 PRB at Itbs 11 -> 201 -> 201000 < 232000 -> throughput = 201000  bytes/sec
   131   // 3 users -> 8 PRB at Itbs 11 -> 201 -> 201000 < 232000 -> throughput = 201000  bytes/sec
   130   // 6 users -> 4 PRB at Itbs 11 -> 97 -> 97000 < 232000 -> throughput = 97000 bytes/sec
   132   // 6 users -> 4 PRB at Itbs 11 -> 97 -> 97000 < 232000 -> throughput = 97000 bytes/sec
   131   // 12 users -> 2 PRB at Itbs 11 -> 47 -> 47000 < 232000 -> throughput = 47000 bytes/sec
   133   // after the patch enforcing min 3 PRBs per UE:
   132   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,6000,232000,232000,200,1), TestCase::EXTENSIVE);
   134   // 12 users -> 3 PRB at Itbs 11 -> 73 bytes * 8/12 UE/TTI -> 48667 < 232000 -> throughput = 48667 bytes/sec
   133   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,6000,232000,201000,200,1), TestCase::EXTENSIVE);
   135   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,6000,232000,232000,200,1,errorModel));
   134   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,6000,150500,97000,200,1), TestCase::EXTENSIVE);
   136   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,6000,232000,201000,200,1,errorModel));
   135   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,6000,75250,47000,200,1), TestCase::EXTENSIVE);
   137   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,6000,129167,97000,200,1,errorModel));
   136 
   138   //AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,6000,64583,48667,200,1, errorModel)); // simulation time = 1.5, otherwise, ul test will fail
   137   // DOWNLINK - DISTANCE 9000 -> MCS 12 -> Itbs 11 (from table 7.1.7.2.1-1 of 36.213)
   139 
       
   140   // DOWNLINK - DISTANCE 10000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213)
   138   // Traffic info
   141   // Traffic info
   139   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   142   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   140   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
   143   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
   141   // Totol bandwidth: 24 PRB at Itbs 11 -> 597 -> 597000 byte/sec
   144   // Totol bandwidth: 24 PRB at Itbs 8 -> 421 -> 421000 byte/sec
   142   // 1 user -> 232000 * 1 = 232000 < 597000 -> throughput = 232000 byte/sec
   145   // 1 user -> 903000 * 1 = 232000 < 421000 -> throughput = 232000 byte/sec
   143   // 3 user -> 232000 * 3 = 696000 > 597000 -> througphut = 597000 / 3 = 199000byte/sec
   146   // 3 user -> 232000 * 3 = 696000 > 421000 -> througphut = 421000 / 3 = 140333 byte/sec
   144   // 6 user -> 232000 * 6 = 139200 > 597000 -> throughput = 597000 / 6 = 99500 byte/sec
   147   // 6 user -> 232000 * 6 = 139200 > 421000 -> throughput = 421000 / 6 = 70166 byte/sec
   145   // 12 user -> 232000 * 12 = 2784000 > 597000 -> throughput = 597000 / 12 = 49750 byte/sec
   148   // 12 user -> 232000 * 12 = 2784000 > 421000 -> throughput =  421000 / 12 = 35083 byte/sec
   146   // UPLINK - DISTANCE 9000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213)
   149   // UPLINK - DISTANCE 10000 -> MCS 8 -> Itbs 8 (from table 7.1.7.2.1-1 of 36.213)
   147   // 1 user -> 24 PRB at Itbs 8 -> 437 -> 437000 > 232000 -> throughput = 232000 bytes/sec
   150   // 1 user -> 24 PRB at Itbs 8 -> 437 -> 437000 > 232000 -> throughput = 232000 bytes/sec
   148   // 3 users -> 8 PRB at Itbs 8 -> 137 -> 137000 < 232000 -> throughput = 137000 bytes/sec
   151   // 3 users -> 8 PRB at Itbs 8 -> 137 -> 137000 < 232000 -> throughput = 137000 bytes/sec
   149   // 6 users -> 4 PRB at Itbs 8 -> 67 -> 67000 < 232000 -> throughput = 67000 bytes/sec
   152   // 6 users -> 4 PRB at Itbs 8 -> 67 -> 67000 < 232000 -> throughput = 67000 bytes/sec
   150   // 12 users -> 2 PRB at Itbs 8 -> 32 -> 32000 < 232000 -> throughput = 32000 bytes/sec
   153   // after the patch enforcing min 3 PRBs per UE:
   151   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,9000,232000,232000,200,1), TestCase::EXTENSIVE);
   154   // 12 users -> 3 PRB at Itbs 8 -> 49 bytes * 8/12 UE/TTI -> 32667 < 232000 -> throughput = 32667  bytes/sec
   152   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,9000,199000,137000,200,1), TestCase::EXTENSIVE);
   155   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,10000,232000,232000,200,1,errorModel));
   153   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,9000,99500,67000,200,1), TestCase::EXTENSIVE);
   156   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,10000,140333,137000,200,1,errorModel));
   154   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,9000,49750,32000,200,1), TestCase::EXTENSIVE);
   157   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,10000,70166,67000,200,1,errorModel));
   155  
   158   //AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,10000,35083,32667,200,1,errorModel));// simulation time = 1.5, otherwise, ul test will fail
   156   // DONWLINK - DISTANCE 15000 -> MCS 6 -> Itbs 6 (from table 7.1.7.2.1-1 of 36.213)
       
   157   // Traffic info
       
   158   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
       
   159   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
       
   160   // Totol bandwidth: 24 PRB at Itbs 6 -> 309 -> 309000 byte/sec
       
   161   // 1 user -> 232000 * 1 = 232000 < 309000 -> throughput = 232000 byte/sec
       
   162   // 3 user -> 232000 * 3 = 696000 > 309000 -> througphut = 309000 / 3 = 103000byte/sec
       
   163   // 6 user -> 232000 * 6 = 139200 > 309000 -> throughput = 309000 / 6 = 51500 byte/sec
       
   164   // 12 user -> 232000 * 12 = 2784000 > 309000 -> throughput = 309000 / 12 = 25750 byte/sec
       
   165   // UPLINK - DISTANCE 15000 -> MCS 6 -> Itbs 6 (from table 7.1.7.2.1-1 of 36.213)
       
   166   // 1 user -> 25 PRB at Itbs 6 -> 233 -> 233000 > 232000 -> throughput = 232000 bytes/sec
       
   167   // 3 users -> 8 PRB at Itbs 6 -> 69 -> 69000 < 232000 -> throughput = 69000 bytes/sec
       
   168   // 6 users -> 4 PRB at Itbs 6 -> 32 -> 32000 < 232000 -> throughput = 32000 bytes/sec
       
   169   // 12 users -> 2 PRB at Itbs 6 -> 15 -> 15000 < 232000 -> throughput = 15000 bytes/sec
       
   170   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (1,0,15000,232000,232000,200,1), TestCase::EXTENSIVE);
       
   171   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (3,0,15000,103000,69000,200,1), TestCase::EXTENSIVE);
       
   172   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (6,0,15000,51500,32000,200,1), TestCase::EXTENSIVE);
       
   173   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase1 (12,0,15000,25750,15000,200,1), TestCase::EXTENSIVE);
       
   174 
   159 
   175   // Test Case 2: homogeneous flow test in TDTBFQ (different distance)
   160   // Test Case 2: homogeneous flow test in TDTBFQ (different distance)
   176   // Traffic1 info
   161   // Traffic1 info
   177   //   UDP traffic: payload size = 100 bytes, interval = 1 ms
   162   //   UDP traffic: payload size = 100 bytes, interval = 1 ms
   178   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 132000 byte/rate 
   163   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 132000 byte/rate 
   179   // Maximum throughput = 5 / ( 1/2196000 + 1/1383000 + 1/903000 + 1/597000 + 1/309000) = 694720  byte/s
   164   // Maximum throughput = 4 / ( 1/2196000 + 1/903000 + 1/621000 + 1/421000 ) = 720930 byte/s
   180   // 132000 * 5 = 660000 < 694720 -> estimated throughput in downlink = 132000 byte/sec
   165   // 132000 * 4 = 528000 < 720930 -> estimated throughput in downlink = 132000 byte/sec
   181   std::vector<uint16_t> dist1;
   166   std::vector<uint16_t> dist1;
   182   dist1.push_back (0);    // User 0 distance --> MCS 28
   167   dist1.push_back (0);       // User 0 distance --> MCS 28
   183   dist1.push_back (3000);    // User 1 distance --> MCS 24
   168   dist1.push_back (4800);    // User 1 distance --> MCS 16
   184   dist1.push_back (6000);    // User 2 distance --> MCS 16
   169   dist1.push_back (6000);    // User 2 distance --> MCS 14
   185   dist1.push_back (9000);    // User 3 distance --> MCS 12
   170   dist1.push_back (10000);   // User 3 distance --> MCS 8
   186   dist1.push_back (15000);    // User 4 distance --> MCS 6
       
   187   std::vector<uint16_t> packetSize1;
   171   std::vector<uint16_t> packetSize1;
   188   packetSize1.push_back (100);
       
   189   packetSize1.push_back (100);
   172   packetSize1.push_back (100);
   190   packetSize1.push_back (100);
   173   packetSize1.push_back (100);
   191   packetSize1.push_back (100);
   174   packetSize1.push_back (100);
   192   packetSize1.push_back (100);
   175   packetSize1.push_back (100);
   193   std::vector<uint32_t> estThrTdTbfqDl1;
   176   std::vector<uint32_t> estThrTdTbfqDl1;
   194   estThrTdTbfqDl1.push_back (132000); // User 0 estimated TTI throughput from TDTBFQ
   177   estThrTdTbfqDl1.push_back (132000); // User 0 estimated TTI throughput from TDTBFQ
   195   estThrTdTbfqDl1.push_back (132000); // User 1 estimated TTI throughput from TDTBFQ
   178   estThrTdTbfqDl1.push_back (132000); // User 1 estimated TTI throughput from TDTBFQ
   196   estThrTdTbfqDl1.push_back (132000); // User 2 estimated TTI throughput from TDTBFQ
   179   estThrTdTbfqDl1.push_back (132000); // User 2 estimated TTI throughput from TDTBFQ
   197   estThrTdTbfqDl1.push_back (132000); // User 3 estimated TTI throughput from TDTBFQ
   180   estThrTdTbfqDl1.push_back (132000); // User 3 estimated TTI throughput from TDTBFQ
   198   estThrTdTbfqDl1.push_back (132000); // User 4 estimated TTI throughput from TDTBFQ
   181   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist1,estThrTdTbfqDl1,packetSize1,1,errorModel));
   199   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist1,estThrTdTbfqDl1,packetSize1,1), TestCase::EXTENSIVE);
       
   200 
   182 
   201   // Traffic2 info
   183   // Traffic2 info
   202   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   184   //   UDP traffic: payload size = 200 bytes, interval = 1 ms
   203   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
   185   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> 232000 byte/rate 
   204   // Maximum throughput = 5 / ( 1/2196000 + 1/1383000 + 1/903000 + 1/597000 + 1/309000) = 694720  byte/s
   186   // Maximum throughput = 4 / ( 1/2196000 + 1/903000 + 1/621000 + 1/421000 ) = 720930 byte/s
   205   // 232000 * 5 = 1160000 > 694720 -> estimated throughput in downlink = 694720 / 5 = 138944 byte/sec
   187   // 232000 * 4 = 928000 > 720930 -> estimated throughput in downlink = 720930 / 4 = 180232 byte/sec 
   206   std::vector<uint16_t> dist2;
   188   std::vector<uint16_t> dist2;
   207   dist2.push_back (0);    // User 0 distance --> MCS 28
   189   dist2.push_back (0);       // User 0 distance --> MCS 28
   208   dist2.push_back (3000);    // User 1 distance --> MCS 24
   190   dist2.push_back (4800);    // User 1 distance --> MCS 16
   209   dist2.push_back (6000);    // User 2 distance --> MCS 16
   191   dist2.push_back (6000);    // User 2 distance --> MCS 14
   210   dist2.push_back (9000);    // User 3 distance --> MCS 12
   192   dist2.push_back (10000);   // User 3 distance --> MCS 8
   211   dist2.push_back (15000);    // User 4 distance --> MCS 6
       
   212   std::vector<uint16_t> packetSize2;
   193   std::vector<uint16_t> packetSize2;
   213   packetSize2.push_back (200);
   194   packetSize2.push_back (200);
   214   packetSize2.push_back (200);
   195   packetSize2.push_back (200);
   215   packetSize2.push_back (200);
   196   packetSize2.push_back (200);
   216   packetSize2.push_back (200);
   197   packetSize2.push_back (200);
   217   packetSize2.push_back (200);
       
   218   std::vector<uint32_t> estThrTdTbfqDl2;
   198   std::vector<uint32_t> estThrTdTbfqDl2;
   219   estThrTdTbfqDl2.push_back (138944); // User 0 estimated TTI throughput from TDTBFQ
   199   estThrTdTbfqDl2.push_back (180232); // User 0 estimated TTI throughput from TDTBFQ
   220   estThrTdTbfqDl2.push_back (138944); // User 1 estimated TTI throughput from TDTBFQ
   200   estThrTdTbfqDl2.push_back (180232); // User 1 estimated TTI throughput from TDTBFQ
   221   estThrTdTbfqDl2.push_back (138944); // User 2 estimated TTI throughput from TDTBFQ
   201   estThrTdTbfqDl2.push_back (180232); // User 2 estimated TTI throughput from TDTBFQ
   222   estThrTdTbfqDl2.push_back (138944); // User 3 estimated TTI throughput from TDTBFQ
   202   estThrTdTbfqDl2.push_back (180232); // User 3 estimated TTI throughput from TDTBFQ
   223   estThrTdTbfqDl2.push_back (138944); // User 4 estimated TTI throughput from TDTBFQ
   203   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist2,estThrTdTbfqDl2,packetSize2,1,errorModel));
   224   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist2,estThrTdTbfqDl2,packetSize2,1), TestCase::EXTENSIVE);
       
   225 
   204 
   226   // Test Case 3: heterogeneous flow test in TDTBFQ
   205   // Test Case 3: heterogeneous flow test in TDTBFQ
   227   //   UDP traffic: payload size = [100,200,300] bytes, interval = 1 ms
   206   //   UDP traffic: payload size = [100,200,300] bytes, interval = 1 ms
   228   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> [132000, 232000, 332000] byte/rate 
   207   //   UDP rate in scheduler: (payload + RLC header + PDCP header + IP header + UDP header) * 1000 byte/sec -> [132000, 232000, 332000] byte/rate 
   229   // Maximum throughput = 5 / ( 1/2196000 + 1/1383000 + 1/903000 ) = 1312417  byte/s
   208   // Maximum throughput = 3 / ( 1/2196000 + 1/903000 + 1/621000 ) = 945450  byte/s
   230   // 132000 + 232000 + 332000 = 696000 < 1312417 -> estimated throughput in downlink = [132000, 232000, 332000] byte/sec
   209   // 132000 + 232000 + 332000 = 696000 < 945450 -> estimated throughput in downlink = [132000, 232000, 332000] byte/sec
   231   std::vector<uint16_t> dist3;
   210   std::vector<uint16_t> dist3;
   232   dist3.push_back (0);    // User 0 distance --> MCS 28
   211   dist3.push_back (0);    // User 0 distance --> MCS 28
   233   dist3.push_back (3000);    // User 1 distance --> MCS 24
   212   dist3.push_back (4800);    // User 1 distance --> MCS 16
   234   dist3.push_back (6000);    // User 2 distance --> MCS 16
   213   dist3.push_back (6000);    // User 2 distance --> MCS 14
   235   std::vector<uint16_t> packetSize3;
   214   std::vector<uint16_t> packetSize3;
   236   packetSize3.push_back (100);
   215   packetSize3.push_back (100);
   237   packetSize3.push_back (200);
   216   packetSize3.push_back (200);
   238   packetSize3.push_back (300);
   217   packetSize3.push_back (300);
   239   std::vector<uint32_t> estThrTdTbfqDl3;
   218   std::vector<uint32_t> estThrTdTbfqDl3;
   240   estThrTdTbfqDl3.push_back (132000); // User 0 estimated TTI throughput from TDTBFQ
   219   estThrTdTbfqDl3.push_back (132000); // User 0 estimated TTI throughput from TDTBFQ
   241   estThrTdTbfqDl3.push_back (232000); // User 1 estimated TTI throughput from TDTBFQ
   220   estThrTdTbfqDl3.push_back (232000); // User 1 estimated TTI throughput from TDTBFQ
   242   estThrTdTbfqDl3.push_back (332000); // User 2 estimated TTI throughput from TDTBFQ
   221   estThrTdTbfqDl3.push_back (332000); // User 2 estimated TTI throughput from TDTBFQ
   243   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist3,estThrTdTbfqDl3,packetSize3,1), TestCase::QUICK);
   222   AddTestCase (new LenaTdTbfqFfMacSchedulerTestCase2 (dist3,estThrTdTbfqDl3,packetSize3,1,errorModel));
   244 
   223 
   245 }
   224 }
   246 
   225 
   247 static LenaTestTdTbfqFfMacSchedulerSuite lenaTestTdTbfqFfMacSchedulerSuite;
   226 static LenaTestTdTbfqFfMacSchedulerSuite lenaTestTdTbfqFfMacSchedulerSuite;
   248 
   227 
   256   oss << nUser << " UEs, distance " << dist << " m";
   235   oss << nUser << " UEs, distance " << dist << " m";
   257   return oss.str ();
   236   return oss.str ();
   258 }
   237 }
   259 
   238 
   260 
   239 
   261 LenaTdTbfqFfMacSchedulerTestCase1::LenaTdTbfqFfMacSchedulerTestCase1 (uint16_t nUser, uint16_t nLc, uint16_t dist, double thrRefDl, double thrRefUl, uint16_t packetSize, uint16_t interval)
   240 LenaTdTbfqFfMacSchedulerTestCase1::LenaTdTbfqFfMacSchedulerTestCase1 (uint16_t nUser, uint16_t nLc, uint16_t dist, double thrRefDl, double thrRefUl, uint16_t packetSize, uint16_t interval,bool errorModelEnabled)
   262   : TestCase (BuildNameString (nUser, dist)),
   241   : TestCase (BuildNameString (nUser, dist)),
   263     m_nUser (nUser),
   242     m_nUser (nUser),
   264     m_nLc (nLc),
   243     m_nLc (nLc),
   265     m_dist (dist),
   244     m_dist (dist),
   266     m_packetSize (packetSize),
   245     m_packetSize (packetSize),
   267     m_interval (interval),
   246     m_interval (interval),
   268     m_thrRefDl (thrRefDl),
   247     m_thrRefDl (thrRefDl),
   269     m_thrRefUl (thrRefUl)
   248     m_thrRefUl (thrRefUl),
       
   249     m_errorModelEnabled (errorModelEnabled)
   270 {
   250 {
   271 }
   251 }
   272 
   252 
   273 LenaTdTbfqFfMacSchedulerTestCase1::~LenaTdTbfqFfMacSchedulerTestCase1 ()
   253 LenaTdTbfqFfMacSchedulerTestCase1::~LenaTdTbfqFfMacSchedulerTestCase1 ()
   274 {
   254 {
   276 
   256 
   277 void
   257 void
   278 LenaTdTbfqFfMacSchedulerTestCase1::DoRun (void)
   258 LenaTdTbfqFfMacSchedulerTestCase1::DoRun (void)
   279 {
   259 {
   280   NS_LOG_FUNCTION (this << GetName ());
   260   NS_LOG_FUNCTION (this << GetName ());
       
   261 
       
   262   if (!m_errorModelEnabled)
       
   263     {
       
   264       Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
       
   265       Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
       
   266     }
       
   267 
       
   268   Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
   281 
   269 
   282   Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
   270   Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
   283   Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
   271   Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
   284   lteHelper->SetEpcHelper (epcHelper);
   272   lteHelper->SetEpcHelper (epcHelper);
       
   273 
       
   274   //LogComponentEnable ("TdTbfqFfMacScheduler", LOG_DEBUG);
   285 
   275 
   286   Ptr<Node> pgw = epcHelper->GetPgwNode ();
   276   Ptr<Node> pgw = epcHelper->GetPgwNode ();
   287 
   277 
   288   // Create a single RemoteHost
   278   // Create a single RemoteHost
   289   NodeContainer remoteHostContainer;
   279   NodeContainer remoteHostContainer;
   306 
   296 
   307   Ipv4StaticRoutingHelper ipv4RoutingHelper;
   297   Ipv4StaticRoutingHelper ipv4RoutingHelper;
   308   Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
   298   Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
   309   remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
   299   remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
   310 
   300 
   311   Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
   301   //Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
   312   Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
   302   //Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
   313   Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
   303   //Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
   314   Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));  
   304   //Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
   315 
   305 
   316   Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteHelper::RLC_UM_ALWAYS));
   306   //Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteHelper::RLC_UM_ALWAYS));
   317 
   307 
   318   LogComponentDisableAll (LOG_LEVEL_ALL);
   308   LogComponentDisableAll (LOG_LEVEL_ALL);
   319   //LogComponentEnable ("LenaTestTdTbfqFfMacCheduler", LOG_LEVEL_ALL);
   309   //LogComponentEnable ("LenaTestTdTbfqFfMacCheduler", LOG_LEVEL_ALL);
   320    
   310    
   321   lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
   311   lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
   417     }
   407     }
   418 
   408 
   419   serverApps.Start (Seconds (0.001));
   409   serverApps.Start (Seconds (0.001));
   420   clientApps.Start (Seconds (0.001));
   410   clientApps.Start (Seconds (0.001));
   421 
   411 
   422   double statsStartTime = 0.300; // need to allow for RRC connection establishment + SRS
   412   double statsStartTime = 0.001; // need to allow for RRC connection establishment + SRS
   423   double statsDuration = 2.0;
   413   double statsDuration = 1;
   424   double tolerance = 0.1;
   414   double tolerance = 0.1;
   425   Simulator::Stop (Seconds (statsStartTime + statsDuration - 0.0001));
   415   Simulator::Stop (Seconds (statsStartTime + statsDuration - 0.0001));
   426 
   416 
   427   lteHelper->EnableRlcTraces ();
   417   lteHelper->EnableRlcTraces ();
       
   418   lteHelper->EnableMacTraces ();
   428   Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
   419   Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
   429   rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (statsStartTime)));
   420   rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (statsStartTime)));
   430   rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (statsDuration)));
   421   rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (statsDuration)));
   431 
   422 
   432   Simulator::Run ();
   423   Simulator::Run ();
   494   oss << "]";
   485   oss << "]";
   495   return oss.str ();
   486   return oss.str ();
   496 }
   487 }
   497 
   488 
   498 
   489 
   499 LenaTdTbfqFfMacSchedulerTestCase2::LenaTdTbfqFfMacSchedulerTestCase2 (std::vector<uint16_t> dist, std::vector<uint32_t> estThrTdTbfqDl, std::vector<uint16_t> packetSize, uint16_t interval)
   490 LenaTdTbfqFfMacSchedulerTestCase2::LenaTdTbfqFfMacSchedulerTestCase2 (std::vector<uint16_t> dist, std::vector<uint32_t> estThrTdTbfqDl, std::vector<uint16_t> packetSize, uint16_t interval,bool errorModelEnabled)
   500   : TestCase (BuildNameString (dist.size (), dist)),
   491   : TestCase (BuildNameString (dist.size (), dist)),
   501     m_nUser (dist.size ()),
   492     m_nUser (dist.size ()),
   502     m_dist (dist),
   493     m_dist (dist),
   503     m_packetSize (packetSize),
   494     m_packetSize (packetSize),
   504     m_interval (interval),
   495     m_interval (interval),
   505     m_estThrTdTbfqDl (estThrTdTbfqDl)
   496     m_estThrTdTbfqDl (estThrTdTbfqDl),
       
   497     m_errorModelEnabled (errorModelEnabled)
   506 {
   498 {
   507 }
   499 }
   508 
   500 
   509 LenaTdTbfqFfMacSchedulerTestCase2::~LenaTdTbfqFfMacSchedulerTestCase2 ()
   501 LenaTdTbfqFfMacSchedulerTestCase2::~LenaTdTbfqFfMacSchedulerTestCase2 ()
   510 {
   502 {
   511 }
   503 }
   512 
   504 
   513 void
   505 void
   514 LenaTdTbfqFfMacSchedulerTestCase2::DoRun (void)
   506 LenaTdTbfqFfMacSchedulerTestCase2::DoRun (void)
   515 {
   507 {
       
   508 
       
   509   if (!m_errorModelEnabled)
       
   510     {
       
   511       Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
       
   512       Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
       
   513     }
       
   514 
       
   515   Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
       
   516 
       
   517 
   516   Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
   518   Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
   517   Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
   519   Ptr<EpcHelper>  epcHelper = CreateObject<EpcHelper> ();
   518   lteHelper->SetEpcHelper (epcHelper);
   520   lteHelper->SetEpcHelper (epcHelper);
   519 
   521 
   520   Ptr<Node> pgw = epcHelper->GetPgwNode ();
   522   Ptr<Node> pgw = epcHelper->GetPgwNode ();
   540 
   542 
   541   Ipv4StaticRoutingHelper ipv4RoutingHelper;
   543   Ipv4StaticRoutingHelper ipv4RoutingHelper;
   542   Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
   544   Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
   543   remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
   545   remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
   544 
   546 
   545   Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
       
   546   Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
       
   547   Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
       
   548   Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
       
   549 
       
   550   Config::SetDefault ("ns3::LteEnbRrc::EpsBearerToRlcMapping", EnumValue (LteHelper::RLC_UM_ALWAYS));
       
   551 
   547 
   552   LogComponentDisableAll (LOG_LEVEL_ALL);
   548   LogComponentDisableAll (LOG_LEVEL_ALL);
   553   //LogComponentEnable ("LenaTestTdTbfqFfMacCheduler", LOG_LEVEL_ALL);
   549   //LogComponentEnable ("LenaTestTdTbfqFfMacCheduler", LOG_LEVEL_ALL);
   554    
   550    
   555   lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
   551   lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
   628       enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
   624       enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
   629       EpsBearer bearer (q, qos);
   625       EpsBearer bearer (q, qos);
   630       lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default ());  
   626       lteHelper->ActivateDedicatedEpsBearer (ueDevice, bearer, EpcTft::Default ());  
   631     }
   627     }
   632 
   628 
       
   629 
   633   // Install downlind and uplink applications
   630   // Install downlind and uplink applications
   634   uint16_t dlPort = 1234;
   631   uint16_t dlPort = 1234;
   635   uint16_t ulPort = 2000;
   632   uint16_t ulPort = 2000;
   636   PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
   633   PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), dlPort));
   637   PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
   634   PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory", InetSocketAddress (Ipv4Address::GetAny (), ulPort));
   658    }
   655    }
   659 
   656 
   660   serverApps.Start (Seconds (0.001));
   657   serverApps.Start (Seconds (0.001));
   661   clientApps.Start (Seconds (0.001));
   658   clientApps.Start (Seconds (0.001));
   662 
   659 
   663   double statsStartTime = 0.300; // need to allow for RRC connection establishment + SRS
   660   double statsStartTime = 0.001; // need to allow for RRC connection establishment + SRS
   664   double statsDuration = 1.0;
   661   double statsDuration = 1.0;
   665   double tolerance = 0.1;
   662   double tolerance = 0.1;
   666   Simulator::Stop (Seconds (statsStartTime + statsDuration - 0.0001));
   663   Simulator::Stop (Seconds (statsStartTime + statsDuration - 0.0001));
   667 
   664 
   668   lteHelper->EnableRlcTraces ();
   665   lteHelper->EnableRlcTraces ();
   669   Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
   666   Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats ();
   670   rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (statsStartTime)));
   667   rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (statsStartTime)));
   671   rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (statsDuration)));
   668   rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (statsDuration)));
   672 
   669 
       
   670 
   673   Simulator::Run ();
   671   Simulator::Run ();
   674  
   672 
   675   /**
   673   /**
   676   * Check that the assignation is done in a "token bank fair queue" manner
   674    * Check that the downlink assignation is done in a "token bank fair queue" manner
   677   */
   675    */
       
   676 
   678   NS_LOG_INFO ("DL - Test with " << m_nUser << " user(s)");
   677   NS_LOG_INFO ("DL - Test with " << m_nUser << " user(s)");
   679   std::vector <uint64_t> dlDataRxed;
   678   std::vector <uint64_t> dlDataRxed;
   680   for (int i = 0; i < m_nUser; i++)
   679   for (int i = 0; i < m_nUser; i++)
   681     {
   680     {
   682       // get the imsi
   681       // get the imsi