src/lte/test/lte-test-phy-error-model.cc
author Marco Miozzo <marco.miozzo@cttc.es>
Fri, 02 Nov 2012 17:12:55 +0100
changeset 9367 b4fcfc26791f
parent 9351 6e074e67a1ad
child 9414 7b0db3dbf19b
permissions -rw-r--r--
Add lte-harq test suite and polishing of code
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     2
/*
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     3
 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     4
 *
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     8
 *
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    12
 * GNU General Public License for more details.
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    13
 *
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    17
 *
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    18
 * Author: Marco Miozzo <marco.miozzo@cttc.es>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    19
 */
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    20
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    21
#include <ns3/object.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    22
#include <ns3/spectrum-interference.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    23
#include <ns3/spectrum-error-model.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    24
#include <ns3/log.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    25
#include <ns3/test.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    26
#include <ns3/simulator.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    27
#include <ns3/packet.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    28
#include <ns3/ptr.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    29
#include <iostream>
8543
3651d1eb508a Merge-bug-fix: Update PHY Error Model test with Radio Bearer Stats Calculator
mmiozzo
parents: 8538
diff changeset
    30
#include <ns3/radio-bearer-stats-calculator.h>
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    31
#include <ns3/buildings-mobility-model.h>
8643
3c7d21485f21 Update BuildingPropagationLossModel for working in Hybrid and Simple modes
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8543
diff changeset
    32
#include <ns3/hybrid-buildings-propagation-loss-model.h>
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    33
#include <ns3/eps-bearer.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    34
#include <ns3/node-container.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    35
#include <ns3/mobility-helper.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    36
#include <ns3/net-device-container.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    37
#include <ns3/lte-ue-net-device.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    38
#include <ns3/lte-enb-net-device.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    39
#include <ns3/lte-ue-rrc.h>
8538
fbd322b7d863 merge with PEM and solve merge errors
mmiozzo
parents: 8535
diff changeset
    40
#include <ns3/lte-helper.h>
8526
3530c874134f Update tests for error model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8521
diff changeset
    41
#include <ns3/string.h>
3530c874134f Update tests for error model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8521
diff changeset
    42
#include <ns3/double.h>
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    43
#include <ns3/lte-enb-phy.h>
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    44
#include <ns3/lte-ue-phy.h>
8526
3530c874134f Update tests for error model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8521
diff changeset
    45
#include <ns3/config.h>
8535
59e657930195 Update PEM and RR/PF Scheduler tests with PemEnabled flag
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8531
diff changeset
    46
#include <ns3/boolean.h>
8646
4b341d8f2f61 Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8643
diff changeset
    47
#include <ns3/enum.h>
8785
5b5cb5261865 fix some unused variable warnings in optimized mode
Tom Henderson <tomh@tomh.org>
parents: 8646
diff changeset
    48
#include <ns3/unused.h>
9042
ae924de31cbd Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
    49
#include <ns3/ff-mac-scheduler.h>
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    50
8822
49d3a0979d43 fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents: 8795
diff changeset
    51
#include "lte-test-phy-error-model.h"
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    52
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    53
NS_LOG_COMPONENT_DEFINE ("LenaTestPhyErrorModel");
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    54
8822
49d3a0979d43 fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents: 8795
diff changeset
    55
namespace ns3 {
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    56
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    57
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    58
LenaTestPhyErrorModelrSuite::LenaTestPhyErrorModelrSuite ()
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    59
  : TestSuite ("lte-phy-error-model", SYSTEM)
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    60
{
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    61
  NS_LOG_INFO ("creating LenaTestPhyErrorModelTestCase");
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    62
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    63
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    64
  // Tests on DL Control Channels (PCFICH+PDDCH)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    65
  // 1 interfering eNB SINR -2.0 BER 0.007 TB size 217
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    66
  AddTestCase (new LenaDlCtrlPhyErrorModelTestCase (2, 1078, 217, 0.007));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    67
  // 2 interfering eNBs SINR -4.0 BER 0.037 TB size 217
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    68
  AddTestCase (new LenaDlCtrlPhyErrorModelTestCase (3, 1040, 217, 0.045));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    69
  // 3 interfering eNBs SINR -6.0 BER 0.21 TB size 133
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    70
  AddTestCase (new LenaDlCtrlPhyErrorModelTestCase (4, 1250, 133, 0.206));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    71
  // 4 interfering eNBs SINR -7.0 BER 0.34 TB size 133
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    72
  AddTestCase (new LenaDlCtrlPhyErrorModelTestCase (5, 1260, 81, 0.343));
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    73
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    74
  // Tests on DL/UL Data channels (PDSCH, PUSCH)
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
    75
  // MCS 2 TB size of 256 bits BER 0.33 SINR -5.51
9367
b4fcfc26791f Add lte-harq test suite and polishing of code
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9351
diff changeset
    76
  AddTestCase (new LenaDataPhyErrorModelTestCase (4, 1800, 32, 0.33, 50));
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
    77
// MCS 2 TB size of 528 bits BER 0.11 SINR -5.51
9047
284d30c8dd42 Merge with lena-pem changeset 8812:eab4c6514af0 (Ctrl and Ref Signaling)
mmiozzo
parents: 8890 9044
diff changeset
    78
  AddTestCase (new LenaDataPhyErrorModelTestCase (2, 1800, 66, 0.11, 34));
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
    79
// MCS 2 TB size of 1088 bits BER 0.02 SINR -5.51
9047
284d30c8dd42 Merge with lena-pem changeset 8812:eab4c6514af0 (Ctrl and Ref Signaling)
mmiozzo
parents: 8890 9044
diff changeset
    80
  AddTestCase (new LenaDataPhyErrorModelTestCase (1, 1800, 136, 0.02, 16));
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
    81
  // MCS 12 TB size of 4800 bits  BER 0.3  SINR 4.43
9047
284d30c8dd42 Merge with lena-pem changeset 8812:eab4c6514af0 (Ctrl and Ref Signaling)
mmiozzo
parents: 8890 9044
diff changeset
    82
  AddTestCase (new LenaDataPhyErrorModelTestCase (1, 600, 600, 0.3, 48));
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
    83
// MCS 12 TB size of 1632 bits  BER 0.55  SINR 4.43
9047
284d30c8dd42 Merge with lena-pem changeset 8812:eab4c6514af0 (Ctrl and Ref Signaling)
mmiozzo
parents: 8890 9044
diff changeset
    84
  AddTestCase (new LenaDataPhyErrorModelTestCase (3, 600, 204, 0.55, 52));
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
    85
// MCS 16 TB size of 7272 bits (3648 x 3584) BER 0.14 SINR 8.48
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
    86
// BER 0.14 = 1 - ((1-0.075)*(1-0.075))
9047
284d30c8dd42 Merge with lena-pem changeset 8812:eab4c6514af0 (Ctrl and Ref Signaling)
mmiozzo
parents: 8890 9044
diff changeset
    87
  AddTestCase (new LenaDataPhyErrorModelTestCase (1, 470, 781, 0.14, 29));
8526
3530c874134f Update tests for error model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8521
diff changeset
    88
3530c874134f Update tests for error model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8521
diff changeset
    89
 
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    90
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    91
}
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    92
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    93
static LenaTestPhyErrorModelrSuite lenaTestPhyErrorModelrSuite;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    94
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    95
std::string 
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
    96
LenaDataPhyErrorModelTestCase::BuildNameString (uint16_t nUser, uint16_t dist)
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    97
{
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    98
  std::ostringstream oss;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    99
  oss << nUser << " UEs, distance " << dist << " m";
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   100
  return oss.str ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   101
}
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   102
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   103
LenaDataPhyErrorModelTestCase::LenaDataPhyErrorModelTestCase (uint16_t nUser, uint16_t dist, uint16_t tbSize, double berRef, uint16_t bernQuantile)
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   104
  : TestCase (BuildNameString (nUser, dist)),              
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   105
    m_nUser (nUser),
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   106
    m_dist (dist),
8531
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   107
    m_tbSize (tbSize),
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   108
    m_berRef (berRef),
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   109
    m_bernQuantile (bernQuantile)
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   110
{
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   111
}
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   112
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   113
LenaDataPhyErrorModelTestCase::~LenaDataPhyErrorModelTestCase ()
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   114
{
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   115
}
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   116
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   117
void
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   118
LenaDataPhyErrorModelTestCase::DoRun (void)
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   119
{
8526
3530c874134f Update tests for error model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8521
diff changeset
   120
  
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
   121
   double ber = 0.03;
8526
3530c874134f Update tests for error model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8521
diff changeset
   122
  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (ber));
8646
4b341d8f2f61 Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8643
diff changeset
   123
  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
9043
9130e2dbe601 Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9042
diff changeset
   124
  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   125
  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (true));
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   126
  Config::SetDefault ("ns3::RrFfMacScheduler::HarqEnabled", BooleanValue (false));
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   127
//   LogComponentEnable ("LteEnbRrc", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   128
//   LogComponentEnable ("LteUeRrc", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   129
//   LogComponentEnable ("LteEnbMac", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   130
//   LogComponentEnable ("LteUeMac", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   131
//   LogComponentEnable ("LteRlc", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   132
// 
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   133
//   LogComponentEnable ("LtePhy", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   134
//   LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   135
//   LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   136
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   137
//   LogComponentEnable ("LteSpectrumPhy", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   138
//   LogComponentEnable ("LteInterference", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   139
//   LogComponentEnable ("LteSinrChunkProcessor", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   140
// 
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   141
//   LogComponentEnable ("LtePropagationLossModel", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   142
//   LogComponentEnable ("LossModel", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   143
//   LogComponentEnable ("ShadowingLossModel", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   144
//   LogComponentEnable ("PenetrationLossModel", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   145
//   LogComponentEnable ("MultipathLossModel", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   146
//   LogComponentEnable ("PathLossModel", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   147
// 
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   148
//   LogComponentEnable ("LteNetDevice", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   149
//   LogComponentEnable ("LteUeNetDevice", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   150
//   LogComponentEnable ("LteEnbNetDevice", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   151
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   152
//   LogComponentEnable ("RrFfMacScheduler", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   153
//   LogComponentEnable ("LenaHelper", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   154
//   LogComponentEnable ("RlcStatsCalculator", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   155
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   156
8527
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   157
//   LogComponentEnable ("LteSpectrumPhy", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   158
//   LogComponentEnable ("LteEnbMac", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   159
//   LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   160
//   LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   161
//   LogComponentEnable ("RrFfMacScheduler", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   162
//   LogComponentEnable ("LenaHelper", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   163
//   LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   164
//   LogComponentEnable ("LteMiErrorModel", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   165
//   LogComponentEnable ("LteAmc", LOG_LEVEL_ALL);
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   166
//   
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   167
//   LogComponentDisableAll (LOG_LEVEL_ALL);
9036
5e09b29d4af5 Add SRS signaling
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9035
diff changeset
   168
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   169
  LogComponentEnable ("LenaTestPhyErrorModel", LOG_LEVEL_ALL);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   170
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   171
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   172
  /**
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   173
   * Initialize Simulation Scenario: 1 eNB and m_nUser UEs
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   174
   */
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   175
8538
fbd322b7d863 merge with PEM and solve merge errors
mmiozzo
parents: 8535
diff changeset
   176
  Ptr<LteHelper> lena = CreateObject<LteHelper> ();
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   177
  
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   178
  // Create Nodes: eNodeB and UE
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   179
  NodeContainer enbNodes;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   180
  NodeContainer ueNodes;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   181
  enbNodes.Create (1);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   182
  ueNodes.Create (m_nUser);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   183
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   184
  // Install Mobility Model
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   185
  MobilityHelper mobility;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   186
  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   187
  mobility.Install (enbNodes);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   188
  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   189
  mobility.Install (ueNodes);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   190
  
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   191
  // remove random shadowing component
8643
3c7d21485f21 Update BuildingPropagationLossModel for working in Hybrid and Simple modes
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8543
diff changeset
   192
  lena->SetAttribute ("PathlossModel", StringValue ("ns3::HybridBuildingsPropagationLossModel"));
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   193
  lena->SetPathlossModelAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   194
  lena->SetPathlossModelAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   195
  lena->SetPathlossModelAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   196
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   197
  // Create Devices and install them in the Nodes (eNB and UE)
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   198
  NetDeviceContainer enbDevs;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   199
  NetDeviceContainer ueDevs;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   200
  lena->SetSchedulerType ("ns3::RrFfMacScheduler");
9042
ae924de31cbd Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9036
diff changeset
   201
  lena->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   202
  
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   203
  enbDevs = lena->InstallEnbDevice (enbNodes);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   204
  ueDevs = lena->InstallUeDevice (ueNodes);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   205
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   206
  // Attach a UE to a eNB
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   207
  lena->Attach (ueDevs, enbDevs.Get (0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   208
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   209
  // Activate an EPS bearer
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   210
  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   211
  EpsBearer bearer (q);
9337
ae7126b266ce revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
   212
  lena->ActivateDataRadioBearer (ueDevs, bearer);
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   213
  
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   214
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   215
  Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   216
  Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   217
  enbPhy->SetAttribute ("TxPower", DoubleValue (43.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   218
  enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   219
  // place the HeNB over the default rooftop level (20 mt.)
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   220
  Ptr<BuildingsMobilityModel> mm = enbNodes.Get (0)->GetObject<BuildingsMobilityModel> ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   221
  mm->SetPosition (Vector (0.0, 0.0, 30.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   222
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   223
  // Set UEs' position and power
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   224
  for (int i = 0; i < m_nUser; i++)
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   225
    {
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   226
      Ptr<BuildingsMobilityModel> mm = ueNodes.Get (i)->GetObject<BuildingsMobilityModel> ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   227
      mm->SetPosition (Vector (m_dist, 0.0, 1.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   228
      Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get (i)->GetObject<LteUeNetDevice> ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   229
      Ptr<LteUePhy> uePhy = lteUeDev->GetPhy ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   230
      uePhy->SetAttribute ("TxPower", DoubleValue (23.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   231
      uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   232
    }
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   233
    
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   234
  lena->EnableRlcTraces ();
8527
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   235
  double simulationTime = 1.000;
9035
e40974228d94 Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8795
diff changeset
   236
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   237
  Simulator::Stop (Seconds (simulationTime));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   238
8538
fbd322b7d863 merge with PEM and solve merge errors
mmiozzo
parents: 8535
diff changeset
   239
  Ptr<RadioBearerStatsCalculator> rlcStats = lena->GetRlcStats ();
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   240
  rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (simulationTime)));
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   241
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   242
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   243
  Simulator::Run ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   244
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   245
  /**
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   246
   * Check that the assignation is done in a RR fashion
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   247
   */
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   248
  NS_LOG_INFO ("\tTest downlink/uplink data shared channels (PDSCH and PUSCH)");
8527
9bb44160cec3 Update PEM test, working
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8526
diff changeset
   249
  NS_LOG_INFO ("Test with " << m_nUser << " user(s) at distance " << m_dist << " expected BER " << m_berRef);
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   250
  std::vector <uint64_t> dlDataRxed;
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   251
  for (int i = 0; i < m_nUser; i++)
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   252
    {
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   253
      // get the imsi
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   254
      uint64_t imsi = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetImsi ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   255
      // get the lcId
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   256
      uint8_t lcId = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetRrc ()->GetLcIdVector ().at (0);
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   257
      dlDataRxed.push_back (rlcStats->GetDlRxData (imsi, lcId));
8526
3530c874134f Update tests for error model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8521
diff changeset
   258
      double txed = rlcStats->GetDlTxData (imsi, lcId);
8531
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   259
      int n = txed / m_tbSize;
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   260
      int lambda = (double)dlDataRxed.at (i) / m_tbSize;
8794
a68aeda2d85b Update PEM model with new BLER curves based on standard ECR
mmiozzo
parents: 8646
diff changeset
   261
      double ber = 1.0 - ((double)dlDataRxed.at (i)/txed);
8531
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   262
      double np = n-n*m_berRef;
8785
5b5cb5261865 fix some unused variable warnings in optimized mode
Tom Henderson <tomh@tomh.org>
parents: 8646
diff changeset
   263
      NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " bytes rxed " << (double)dlDataRxed.at (i) << " txed " << txed 
5b5cb5261865 fix some unused variable warnings in optimized mode
Tom Henderson <tomh@tomh.org>
parents: 8646
diff changeset
   264
        << " BER " << ber << " Err " << fabs (m_berRef - ber) << " lambda " << lambda 
5b5cb5261865 fix some unused variable warnings in optimized mode
Tom Henderson <tomh@tomh.org>
parents: 8646
diff changeset
   265
        << " np " << np << " difference " << abs(lambda - np) << " quantile " << m_bernQuantile);
5b5cb5261865 fix some unused variable warnings in optimized mode
Tom Henderson <tomh@tomh.org>
parents: 8646
diff changeset
   266
      NS_UNUSED (ber);
8531
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   267
      // the quantiles are evaluated offline according to a Bernoulli 
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   268
      // ditribution with n equal to the number of packet sent and p equal 
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   269
      // to the BER (see /reference/bernuolliDistribution.m for details)
d01bbb476ecb Update PEM tests with condition on Bernoulli quantiles
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8530
diff changeset
   270
      NS_TEST_ASSERT_MSG_EQ_TOL (lambda, np, m_bernQuantile, " Unexpected BER distribution!");
8521
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   271
    }
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   272
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   273
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   274
  Simulator::Destroy ();
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   275
}
05b373fc3061 Add LteMiErrorModel and update LteSpectrumPhy for managing the error model
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   276
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   277
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   278
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   279
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   280
std::string 
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   281
LenaDlCtrlPhyErrorModelTestCase::BuildNameString (uint16_t nEnb, uint16_t dist)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   282
{
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   283
  std::ostringstream oss;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   284
  oss << nEnb << " eNBs, distance " << dist << " m";
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   285
  return oss.str ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   286
}
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   287
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   288
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   289
LenaDlCtrlPhyErrorModelTestCase::LenaDlCtrlPhyErrorModelTestCase (uint16_t nEnb, uint16_t dist, uint16_t tbSize, double berRef)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   290
: TestCase (BuildNameString (nEnb, dist)),              
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   291
m_nEnb (nEnb),
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   292
m_dist (dist),
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   293
m_tbSize (tbSize),
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   294
m_berRef (berRef)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   295
{
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   296
}
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   297
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   298
LenaDlCtrlPhyErrorModelTestCase::~LenaDlCtrlPhyErrorModelTestCase ()
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   299
{
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   300
}
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   301
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   302
void
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   303
LenaDlCtrlPhyErrorModelTestCase::DoRun (void)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   304
{
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   305
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   306
  double ber = 0.03;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   307
  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (ber));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   308
  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   309
  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (true));
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   310
  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   311
  Config::SetDefault ("ns3::RrFfMacScheduler::HarqEnabled", BooleanValue (false));
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   312
  //   LogComponentEnable ("LteEnbRrc", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   313
  //   LogComponentEnable ("LteUeRrc", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   314
  //   LogComponentEnable ("LteEnbMac", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   315
  //   LogComponentEnable ("LteUeMac", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   316
  //   LogComponentEnable ("LteRlc", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   317
  // 
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   318
  //   LogComponentEnable ("LtePhy", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   319
  //   LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   320
  //   LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   321
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   322
  //   LogComponentEnable ("LteSpectrumPhy", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   323
  //   LogComponentEnable ("LteInterference", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   324
  //   LogComponentEnable ("LteSinrChunkProcessor", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   325
  // 
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   326
  //   LogComponentEnable ("LtePropagationLossModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   327
  //   LogComponentEnable ("LossModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   328
  //   LogComponentEnable ("ShadowingLossModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   329
  //   LogComponentEnable ("PenetrationLossModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   330
  //   LogComponentEnable ("MultipathLossModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   331
  //   LogComponentEnable ("PathLossModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   332
  // 
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   333
  //   LogComponentEnable ("LteNetDevice", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   334
  //   LogComponentEnable ("LteUeNetDevice", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   335
  //   LogComponentEnable ("LteEnbNetDevice", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   336
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   337
//     LogComponentEnable ("RrFfMacScheduler", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   338
  //   LogComponentEnable ("LenaHelper", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   339
  //   LogComponentEnable ("RlcStatsCalculator", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   340
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   341
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   342
  //   LogComponentEnable ("LteSpectrumPhy", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   343
  //   LogComponentEnable ("LteEnbMac", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   344
  //   LogComponentEnable ("LteEnbPhy", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   345
  //   LogComponentEnable ("LteUePhy", LOG_LEVEL_ALL);
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   346
//     LogComponentEnable ("RrFfMacScheduler", LOG_LEVEL_ALL);
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   347
  //   LogComponentEnable ("LenaHelper", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   348
  //   LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   349
//     LogComponentEnable ("LteMiErrorModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   350
  //   LogComponentEnable ("LteAmc", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   351
  //   
9351
6e074e67a1ad HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents: 9346
diff changeset
   352
//   LogComponentDisableAll (LOG_LEVEL_ALL);
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   353
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   354
  LogComponentEnable ("LenaTestPhyErrorModel", LOG_LEVEL_ALL);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   355
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   356
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   357
  /**
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   358
  * Initialize Simulation Scenario: 1 eNB and m_nUser UEs
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   359
  */
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   360
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   361
  Ptr<LteHelper> lena = CreateObject<LteHelper> ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   362
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   363
  // Create Nodes: eNodeB and UE
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   364
  NodeContainer enbNodes;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   365
  NodeContainer ueNodes;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   366
  enbNodes.Create (m_nEnb);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   367
  ueNodes.Create (1);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   368
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   369
  // Install Mobility Model
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   370
  MobilityHelper mobility;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   371
  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   372
  mobility.Install (enbNodes);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   373
  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   374
  mobility.Install (ueNodes);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   375
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   376
  // remove random shadowing component
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   377
  lena->SetAttribute ("PathlossModel", StringValue ("ns3::HybridBuildingsPropagationLossModel"));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   378
  lena->SetPathlossModelAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   379
  lena->SetPathlossModelAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   380
  lena->SetPathlossModelAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   381
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   382
  // Create Devices and install them in the Nodes (eNB and UE)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   383
  NetDeviceContainer enbDevs;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   384
  NetDeviceContainer ueDevs;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   385
  lena->SetSchedulerType ("ns3::RrFfMacScheduler");
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   386
  lena->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   387
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   388
  enbDevs = lena->InstallEnbDevice (enbNodes);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   389
  ueDevs = lena->InstallUeDevice (ueNodes);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   390
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   391
  // Attach a UE to one eNB (the others are interfering ones)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   392
  lena->Attach (ueDevs, enbDevs.Get (0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   393
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   394
  // Activate an EPS bearer
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   395
  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   396
  EpsBearer bearer (q);
9346
00e674a0d567 merge lena-dev and lena-epc
Nicola Baldo <nbaldo@cttc.es>
parents: 9337 9047
diff changeset
   397
  lena->ActivateDataRadioBearer (ueDevs, bearer);
9044
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   398
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   399
  // Set UEs' position and power
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   400
  for (int i = 0; i < m_nEnb; i++)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   401
    {
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   402
      // place the HeNB over the default rooftop level (20 mt.)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   403
      Ptr<BuildingsMobilityModel> mm = enbNodes.Get (i)->GetObject<BuildingsMobilityModel> ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   404
      mm->SetPosition (Vector (0.0, 0.0, 30.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   405
      Ptr<LteEnbNetDevice> lteEnbDev = enbDevs.Get (i)->GetObject<LteEnbNetDevice> ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   406
      Ptr<LteEnbPhy> enbPhy = lteEnbDev->GetPhy ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   407
      enbPhy->SetAttribute ("TxPower", DoubleValue (43.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   408
      enbPhy->SetAttribute ("NoiseFigure", DoubleValue (5.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   409
    }
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   410
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   411
  // Set UEs' position and power
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   412
  Ptr<BuildingsMobilityModel> mm = ueNodes.Get (0)->GetObject<BuildingsMobilityModel> ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   413
  mm->SetPosition (Vector (m_dist, 0.0, 1.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   414
  Ptr<LteUeNetDevice> lteUeDev = ueDevs.Get (0)->GetObject<LteUeNetDevice> ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   415
  Ptr<LteUePhy> uePhy = lteUeDev->GetPhy ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   416
  uePhy->SetAttribute ("TxPower", DoubleValue (23.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   417
  uePhy->SetAttribute ("NoiseFigure", DoubleValue (9.0));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   418
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   419
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   420
  lena->EnableRlcTraces ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   421
  double simulationTime = 1.000;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   422
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   423
  Simulator::Stop (Seconds (simulationTime));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   424
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   425
  Ptr<RadioBearerStatsCalculator> rlcStats = lena->GetRlcStats ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   426
  rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (simulationTime)));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   427
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   428
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   429
  Simulator::Run ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   430
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   431
  /**
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   432
  * Check that the assignation is done in a RR fashion
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   433
  */
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   434
  NS_LOG_INFO ("\tTest downlink control channels (PCFICH+PDCCH)");
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   435
  NS_LOG_INFO ("Test with " << m_nEnb << " eNB(s) at distance " << m_dist << " expected BER " << m_berRef);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   436
  std::vector <uint64_t> dlDataRxed;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   437
  int nUser = 1;
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   438
  for (int i = 0; i < nUser; i++)
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   439
  {
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   440
    // get the imsi
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   441
    uint64_t imsi = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetImsi ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   442
    // get the lcId
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   443
    uint8_t lcId = ueDevs.Get (i)->GetObject<LteUeNetDevice> ()->GetRrc ()->GetLcIdVector ().at (0);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   444
    dlDataRxed.push_back (rlcStats->GetDlRxData (imsi, lcId));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   445
    double txed = rlcStats->GetDlTxData (imsi, lcId);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   446
    double ber = 1.0 - ((double)dlDataRxed.at (i)/txed);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   447
    NS_LOG_INFO ("\tUser " << i << " imsi " << imsi << " bytes rxed " << (double)dlDataRxed.at (i) << " txed " << txed 
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   448
    << " BER " << ber << " Err " << fabs (m_berRef - ber));
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   449
    NS_UNUSED (ber);
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   450
    NS_TEST_ASSERT_MSG_EQ_TOL (ber, m_berRef, 0.1, " Unexpected BER distribution!");
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   451
  }
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   452
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   453
  
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   454
  Simulator::Destroy ();
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   455
}
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   456
e8595c3ac95b Add testcase for DL control channels (PCFICH+PDCCH) to lte-phy-error-model test suite
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9043
diff changeset
   457
9047
284d30c8dd42 Merge with lena-pem changeset 8812:eab4c6514af0 (Ctrl and Ref Signaling)
mmiozzo
parents: 8890 9044
diff changeset
   458
} // namespace