author | Vedran Miletić <rivanvx@gmail.com> |
Sat, 01 Sep 2012 20:57:21 +0200 | |
changeset 9063 | 32755d0516f4 |
parent 9047 | 284d30c8dd42 |
child 9266 | d26408b17360 |
child 9653 | 382d27da8905 |
permissions | -rw-r--r-- |
8135 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
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 |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Manuel Requena <manuel.requena@cttc.es> |
|
19 |
* Nicola Baldo <nbaldo@cttc.es> |
|
20 |
*/ |
|
21 |
||
22 |
#include "ns3/simulator.h" |
|
23 |
#include "ns3/log.h" |
|
24 |
#include "ns3/string.h" |
|
25 |
#include "ns3/double.h" |
|
8646
4b341d8f2f61
Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8506
diff
changeset
|
26 |
#include <ns3/enum.h> |
9043
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9042
diff
changeset
|
27 |
#include "ns3/boolean.h" |
8135 | 28 |
#include "ns3/mobility-helper.h" |
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
29 |
#include "ns3/lte-helper.h" |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9035
diff
changeset
|
30 |
#include "ns3/ff-mac-scheduler.h" |
8135 | 31 |
|
32 |
#include "ns3/lte-enb-phy.h" |
|
33 |
#include "ns3/lte-enb-net-device.h" |
|
34 |
||
35 |
#include "ns3/lte-ue-phy.h" |
|
36 |
#include "ns3/lte-ue-net-device.h" |
|
37 |
||
8822
49d3a0979d43
fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents:
8729
diff
changeset
|
38 |
#include "lte-test-interference.h" |
8135 | 39 |
|
40 |
#include "lte-test-sinr-chunk-processor.h" |
|
41 |
||
8136 | 42 |
NS_LOG_COMPONENT_DEFINE ("LteInterferenceTest"); |
8135 | 43 |
|
8822
49d3a0979d43
fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents:
8729
diff
changeset
|
44 |
namespace ns3 { |
8135 | 45 |
|
46 |
||
47 |
void |
|
8136 | 48 |
LteTestDlSchedulingCallback (LteInterferenceTestCase *testcase, std::string path, |
8135 | 49 |
uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, |
50 |
uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2) |
|
51 |
{ |
|
8149 | 52 |
testcase->DlScheduling (frameNo, subframeNo, rnti, mcsTb1, sizeTb1, mcsTb2, sizeTb2); |
8135 | 53 |
} |
54 |
||
55 |
void |
|
8136 | 56 |
LteTestUlSchedulingCallback (LteInterferenceTestCase *testcase, std::string path, |
8149 | 57 |
uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, |
58 |
uint8_t mcs, uint16_t sizeTb) |
|
8135 | 59 |
{ |
8149 | 60 |
testcase->UlScheduling (frameNo, subframeNo, rnti, mcs, sizeTb); |
8135 | 61 |
} |
62 |
||
63 |
||
64 |
/** |
|
65 |
* TestSuite |
|
66 |
*/ |
|
67 |
||
8136 | 68 |
LteInterferenceTestSuite::LteInterferenceTestSuite () |
8135 | 69 |
: TestSuite ("lte-interference", SYSTEM) |
70 |
{ |
|
8136 | 71 |
NS_LOG_INFO ("Creating LteInterferenceTestSuite"); |
8135 | 72 |
|
8149 | 73 |
AddTestCase (new LteInterferenceTestCase ("d1=3000, d2=6000", 3000.000000, 6000.000000, 3.844681, 1.714583, 0.761558, 0.389662, 6, 4)); |
8137
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
74 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=10", 50.000000, 10.000000, 0.040000, 0.040000, 0.010399, 0.010399, 0, 0)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
75 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=20", 50.000000, 20.000000, 0.160000, 0.159998, 0.041154, 0.041153, 0, 0)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
76 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=50", 50.000000, 50.000000, 0.999997, 0.999907, 0.239828, 0.239808, 2, 2)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
77 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=100", 50.000000, 100.000000, 3.999955, 3.998520, 0.785259, 0.785042, 6, 6)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
78 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=200", 50.000000, 200.000000, 15.999282, 15.976339, 1.961072, 1.959533, 14, 14)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
79 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=500", 50.000000, 500.000000, 99.971953, 99.082845, 4.254003, 4.241793, 22, 22)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
80 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=1000", 50.000000, 1000.000000, 399.551632, 385.718468, 6.194952, 6.144825, 28, 28)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
81 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=10000", 50.000000, 10000.000000, 35964.181431, 8505.970614, 12.667381, 10.588084, 28, 28)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
82 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=100000", 50.000000, 100000.000000, 327284.773828, 10774.181090, 15.853097, 10.928917, 28, 28)); |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
83 |
AddTestCase (new LteInterferenceTestCase ("d1=50, d2=1000000", 50.000000, 1000000.000000, 356132.574152, 10802.988445, 15.974963, 10.932767, 28, 28)); |
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
84 |
AddTestCase (new LteInterferenceTestCase ("d1=4500, d2=12600", 4500.000000, 12600.000000, 6.654462, 1.139831, 1.139781, 0.270399, 8, 2)); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
85 |
AddTestCase (new LteInterferenceTestCase ("d1=5400, d2=12600", 5400.000000, 12600.000000, 4.621154, 0.791549, 0.876368, 0.193019, 6, 0)); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
86 |
|
8149 | 87 |
|
8135 | 88 |
} |
89 |
||
8136 | 90 |
static LteInterferenceTestSuite lteLinkAdaptationWithInterferenceTestSuite; |
8135 | 91 |
|
92 |
||
93 |
/** |
|
94 |
* TestCase |
|
95 |
*/ |
|
96 |
||
8136 | 97 |
LteInterferenceTestCase::LteInterferenceTestCase (std::string name, double d1, double d2, double dlSinr, double ulSinr, double dlSe, double ulSe, uint16_t dlMcs, uint16_t ulMcs) |
8135 | 98 |
: TestCase (name), |
99 |
m_d1 (d1), |
|
100 |
m_d2 (d2), |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9047
diff
changeset
|
101 |
m_dlSinrDb (10 * std::log10 (dlSinr)), |
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9047
diff
changeset
|
102 |
m_ulSinrDb (10 * std::log10 (ulSinr)), |
8135 | 103 |
m_dlSe (dlSe), |
104 |
m_ulSe (ulSe), |
|
105 |
m_dlMcs (dlMcs), |
|
106 |
m_ulMcs (ulMcs) |
|
107 |
{ |
|
108 |
} |
|
109 |
||
8136 | 110 |
LteInterferenceTestCase::~LteInterferenceTestCase () |
8135 | 111 |
{ |
112 |
} |
|
113 |
||
114 |
void |
|
8136 | 115 |
LteInterferenceTestCase::DoRun (void) |
8135 | 116 |
{ |
9043
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9042
diff
changeset
|
117 |
Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false)); |
9130e2dbe601
Add PCFICH-PDCCD Error model based on 3GPP R4-081920
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9042
diff
changeset
|
118 |
Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false)); |
8646
4b341d8f2f61
Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8506
diff
changeset
|
119 |
Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010)); |
4b341d8f2f61
Add new UE CQI Measurement and AMC module based on LteMiErrorModel
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8506
diff
changeset
|
120 |
Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005)); |
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
121 |
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); |
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
122 |
// lteHelper->EnableLogComponents (); |
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
123 |
lteHelper->EnableMacTraces (); |
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
124 |
lteHelper->EnableRlcTraces (); |
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
125 |
lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel")); |
8135 | 126 |
|
127 |
// Create Nodes: eNodeB and UE |
|
128 |
NodeContainer enbNodes; |
|
129 |
NodeContainer ueNodes1; |
|
130 |
NodeContainer ueNodes2; |
|
131 |
enbNodes.Create (2); |
|
132 |
ueNodes1.Create (1); |
|
133 |
ueNodes2.Create (1); |
|
134 |
NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2); |
|
135 |
||
8137
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
136 |
// the topology is the following: |
8149 | 137 |
// d2 |
8137
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
138 |
// UE1-----------eNB2 |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
139 |
// | | |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
140 |
// d1| |d1 |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
141 |
// | d2 | |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
142 |
// eNB1----------UE2 |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
143 |
// |
8135 | 144 |
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> (); |
8137
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
145 |
positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1 |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
146 |
positionAlloc->Add (Vector (m_d2, m_d1, 0.0)); // eNB2 |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
147 |
positionAlloc->Add (Vector (0.0, m_d1, 0.0)); // UE1 |
0e8ffd1a5c06
interference test finalized and passing
Nicola Baldo <nicola@baldo.biz>
parents:
8136
diff
changeset
|
148 |
positionAlloc->Add (Vector (m_d2, 0.0, 0.0)); // UE2 |
8135 | 149 |
MobilityHelper mobility; |
150 |
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
|
151 |
mobility.SetPositionAllocator (positionAlloc); |
|
152 |
mobility.Install (allNodes); |
|
153 |
||
154 |
// Create Devices and install them in the Nodes (eNB and UE) |
|
155 |
NetDeviceContainer enbDevs; |
|
156 |
NetDeviceContainer ueDevs1; |
|
157 |
NetDeviceContainer ueDevs2; |
|
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
158 |
lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler"); |
9042
ae924de31cbd
Update SRS-CQI management in RR and PF Schedulers
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9035
diff
changeset
|
159 |
lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI)); |
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
160 |
enbDevs = lteHelper->InstallEnbDevice (enbNodes); |
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
161 |
ueDevs1 = lteHelper->InstallUeDevice (ueNodes1); |
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
162 |
ueDevs2 = lteHelper->InstallUeDevice (ueNodes2); |
8135 | 163 |
|
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
164 |
lteHelper->Attach (ueDevs1, enbDevs.Get (0)); |
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8417
diff
changeset
|
165 |
lteHelper->Attach (ueDevs2, enbDevs.Get (1)); |
8135 | 166 |
|
167 |
// Activate an EPS bearer |
|
168 |
enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE; |
|
169 |
EpsBearer bearer (q); |
|
8463 | 170 |
lteHelper->ActivateEpsBearer (ueDevs1, bearer, EpcTft::Default ()); |
171 |
lteHelper->ActivateEpsBearer (ueDevs2, bearer, EpcTft::Default ()); |
|
8135 | 172 |
|
173 |
// Use testing chunk processor in the PHY layer |
|
174 |
// It will be used to test that the SNR is as intended |
|
175 |
// we plug in two instances, one for DL and one for UL |
|
176 |
||
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
177 |
Ptr<LtePhy> ue1Phy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> (); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
178 |
Ptr<LteTestSinrChunkProcessor> testDlSinr1 = Create<LteTestSinrChunkProcessor> (ue1Phy); |
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:
8729
diff
changeset
|
179 |
ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1); |
8135 | 180 |
|
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
181 |
Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> (); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
182 |
Ptr<LteTestSinrChunkProcessor> testUlSinr1 = Create<LteTestSinrChunkProcessor> (enb1phy); |
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:
8729
diff
changeset
|
183 |
enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1); |
8135 | 184 |
|
185 |
Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/DlScheduling", |
|
8149 | 186 |
MakeBoundCallback (&LteTestDlSchedulingCallback, this)); |
8135 | 187 |
|
188 |
Config::Connect ("/NodeList/0/DeviceList/0/LteEnbMac/UlScheduling", |
|
8149 | 189 |
MakeBoundCallback (&LteTestUlSchedulingCallback, this)); |
8135 | 190 |
|
191 |
||
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
192 |
// same as above for eNB2 and UE2 |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
193 |
|
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
194 |
Ptr<LtePhy> ue2Phy = ueDevs2.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> (); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
195 |
Ptr<LteTestSinrChunkProcessor> testDlSinr2 = Create<LteTestSinrChunkProcessor> (ue2Phy); |
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:
8729
diff
changeset
|
196 |
ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2); |
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
197 |
|
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
198 |
Ptr<LtePhy> enb2phy = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> (); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
199 |
Ptr<LteTestSinrChunkProcessor> testUlSinr2 = Create<LteTestSinrChunkProcessor> (enb2phy); |
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:
8729
diff
changeset
|
200 |
enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2); |
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
201 |
|
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
202 |
Config::Connect ("/NodeList/1/DeviceList/0/LteEnbMac/DlScheduling", |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
203 |
MakeBoundCallback (&LteTestDlSchedulingCallback, this)); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
204 |
|
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
205 |
Config::Connect ("/NodeList/1/DeviceList/0/LteEnbMac/UlScheduling", |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
206 |
MakeBoundCallback (&LteTestUlSchedulingCallback, this)); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
207 |
|
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
208 |
|
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
209 |
Simulator::Stop (Seconds (0.020)); |
8135 | 210 |
Simulator::Run (); |
8417
bd839a0c29c5
Update lte-test-interference according to new constraints in UL due to BSR periodicity
mmiozzo
parents:
8395
diff
changeset
|
211 |
|
8135 | 212 |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9047
diff
changeset
|
213 |
double dlSinr1Db = 10.0 * std::log10 (testDlSinr1->GetSinr ()->operator[] (0)); |
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
214 |
NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_dlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)"); |
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
215 |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9047
diff
changeset
|
216 |
double ulSinr1Db = 10.0 * std::log10 (testUlSinr1->GetSinr ()->operator[] (0)); |
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
217 |
NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr1Db, m_ulSinrDb, 0.01, "Wrong SINR in UL! (UE1 --> eNB1)"); |
8135 | 218 |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9047
diff
changeset
|
219 |
double dlSinr2Db = 10.0 * std::log10 (testDlSinr2->GetSinr ()->operator[] (0)); |
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
220 |
NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2Db, m_dlSinrDb, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)"); |
8417
bd839a0c29c5
Update lte-test-interference according to new constraints in UL due to BSR periodicity
mmiozzo
parents:
8395
diff
changeset
|
221 |
|
9063
32755d0516f4
Bug 1237 - code cleanups related to includes
Vedran Miletić <rivanvx@gmail.com>
parents:
9047
diff
changeset
|
222 |
double ulSinr2Db = 10.0 * std::log10 (testUlSinr2->GetSinr ()->operator[] (0)); |
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
223 |
NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr2Db, m_ulSinrDb, 0.01, "Wrong SINR in UL! (UE2 --> eNB2)"); |
8135 | 224 |
|
225 |
Simulator::Destroy (); |
|
8158
d151999f2879
interference test now testing also eNB2 and UE2
Nicola Baldo <nbaldo@cttc.es>
parents:
8149
diff
changeset
|
226 |
|
8135 | 227 |
} |
228 |
||
229 |
||
230 |
void |
|
8136 | 231 |
LteInterferenceTestCase::DlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, |
8149 | 232 |
uint8_t mcsTb1, uint16_t sizeTb1, uint8_t mcsTb2, uint16_t sizeTb2) |
8135 | 233 |
{ |
234 |
/** |
|
235 |
* Note: |
|
236 |
* For first 4 subframeNo in the first frameNo, the MCS cannot be properly evaluated, |
|
237 |
* because CQI feedback is still not available at the eNB. |
|
238 |
*/ |
|
8729
74de12409ee5
Update m_macChTtiDelay fixed to 4 in UL (standard) and make schedulers unaware of channel delays (tests updated according to new delay)
mmiozzo
parents:
8728
diff
changeset
|
239 |
if ( (frameNo > 1) || (subframeNo > 9) ) |
8135 | 240 |
{ |
241 |
NS_TEST_ASSERT_MSG_EQ ((uint16_t)mcsTb1, m_dlMcs, "Wrong DL MCS "); |
|
242 |
} |
|
243 |
} |
|
244 |
||
245 |
void |
|
8136 | 246 |
LteInterferenceTestCase::UlScheduling (uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, |
8149 | 247 |
uint8_t mcs, uint16_t sizeTb) |
8135 | 248 |
{ |
249 |
/** |
|
250 |
* Note: |
|
8417
bd839a0c29c5
Update lte-test-interference according to new constraints in UL due to BSR periodicity
mmiozzo
parents:
8395
diff
changeset
|
251 |
* For first 5 subframeNo in the first frameNo, the MCS cannot be properly evaluated, |
8135 | 252 |
* because CQI feedback is still not available at the eNB. |
253 |
*/ |
|
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:
8729
diff
changeset
|
254 |
if ( (frameNo > 1) && (subframeNo > 6) ) |
8135 | 255 |
{ |
256 |
NS_TEST_ASSERT_MSG_EQ ((uint16_t)mcs, m_ulMcs, "Wrong UL MCS"); |
|
257 |
} |
|
258 |
} |
|
8822
49d3a0979d43
fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents:
8729
diff
changeset
|
259 |
|
49d3a0979d43
fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents:
8729
diff
changeset
|
260 |
} // namespace ns3 |
49d3a0979d43
fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents:
8729
diff
changeset
|
261 |