A Discrete-Event Network Simulator
API
lte-test-interference-fr.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Piotr Gawlowicz
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: Piotr Gawlowicz <gawlowicz.p@gmail.com>
19  * Based on lte-test-interference.{h,cc} by Manuel Requena <manuel.requena@cttc.es>
20  * Nicola Baldo <nbaldo@cttc.es>
21  */
22 
23 #include "ns3/simulator.h"
24 #include "ns3/log.h"
25 #include "ns3/string.h"
26 #include "ns3/double.h"
27 #include <ns3/enum.h>
28 #include "ns3/boolean.h"
29 #include <ns3/pointer.h>
30 #include "ns3/mobility-helper.h"
31 #include "ns3/lte-helper.h"
32 #include "ns3/ff-mac-scheduler.h"
33 
34 #include "ns3/lte-enb-phy.h"
35 #include "ns3/lte-enb-net-device.h"
36 
37 #include "ns3/lte-ue-phy.h"
38 #include "ns3/lte-ue-net-device.h"
39 
41 
42 #include <ns3/lte-chunk-processor.h>
43 
45 #include "ns3/spectrum-value.h"
46 #include "ns3/lte-spectrum-value-helper.h"
47 
48 
49 using namespace ns3;
50 
51 NS_LOG_COMPONENT_DEFINE ("LteInterferenceFrTest");
52 
53 
54 
60  : TestSuite ("lte-interference-fr", SYSTEM)
61 {
62 // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_DEBUG);
63 // LogComponentEnable ("LteInterferenceFrTest", logLevel);
64 
65  AddTestCase (new LteInterferenceHardFrTestCase ("d1=50, d2=20", 50.000000, 20.000000, 356449.932732, 10803.280215), TestCase::QUICK);
66  AddTestCase (new LteInterferenceHardFrTestCase ("d1=50, d2=50", 50.000000, 50.000000, 356449.932732, 10803.280215), TestCase::QUICK);
67  AddTestCase (new LteInterferenceHardFrTestCase ("d1=50, d2=200", 50.000000, 200.000000, 356449.932732, 10803.280215), TestCase::QUICK);
68  AddTestCase (new LteInterferenceHardFrTestCase ("d1=50, d2=500", 50.000000, 500.000000, 356449.932732, 10803.280215), TestCase::QUICK);
69 
70  AddTestCase (new LteInterferenceStrictFrTestCase ("d1=50, d2=20", 50.000000, 20.000000, 0.160000, 0.159998, 356449.932732, 10803.280215, 18), TestCase::QUICK);
71  AddTestCase (new LteInterferenceStrictFrTestCase ("d1=50, d2=50", 50.000000, 50.000000, 0.999997, 0.999907, 356449.932732, 10803.280215, 28), TestCase::QUICK);
72  AddTestCase (new LteInterferenceStrictFrTestCase ("d1=50, d2=200", 50.000000, 200.000000, 15.999282, 15.976339, 356449.932732, 10803.280215, 30), TestCase::QUICK);
73  AddTestCase (new LteInterferenceStrictFrTestCase ("d1=50, d2=500", 50.000000, 500.000000, 99.971953, 99.082845, 356449.932732, 10803.280215, 30), TestCase::QUICK);
74 
75 }
76 
78 
79 
83 LteInterferenceHardFrTestCase::LteInterferenceHardFrTestCase (std::string name, double d1, double d2, double dlSinr, double ulSinr)
84  : TestCase ("Test: " + name),
85  m_d1 (d1),
86  m_d2 (d2),
87  m_expectedDlSinrDb (10 * std::log10 (dlSinr))
88 {
89  NS_LOG_INFO ("Creating LteInterferenceFrTestCase");
90 }
91 
93 {
94 }
95 
96 void
98 {
99  NS_LOG_INFO (this << GetName ());
100  NS_LOG_DEBUG ("LteInterferenceHardFrTestCase");
101 
102  Config::Reset ();
103  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (false));
104 
105  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
106  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
107  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
108  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
109 
110  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
111  lteHelper->SetFfrAlgorithmType ("ns3::LteFrHardAlgorithm");
112 
113  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
114 
115  // Create Nodes: eNodeB and UE
116  NodeContainer enbNodes;
117  NodeContainer ueNodes1;
118  NodeContainer ueNodes2;
119  enbNodes.Create (2);
120  ueNodes1.Create (1);
121  ueNodes2.Create (1);
122  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
123 
124  // the topology is the following:
125  // d2
126  // UE1-----------eNB2
127  // | |
128  // d1| |d1
129  // | d2 |
130  // eNB1----------UE2
131  //
132  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
133  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
134  positionAlloc->Add (Vector (m_d2, m_d1, 0.0)); // eNB2
135  positionAlloc->Add (Vector (0.0, m_d1, 0.0)); // UE1
136  positionAlloc->Add (Vector (m_d2, 0.0, 0.0)); // UE2
138  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
139  mobility.SetPositionAllocator (positionAlloc);
140  mobility.Install (allNodes);
141 
142  // Create Devices and install them in the Nodes (eNB and UE)
143  NetDeviceContainer enbDevs;
144  NetDeviceContainer ueDevs1;
145  NetDeviceContainer ueDevs2;
146  lteHelper->SetSchedulerType ("ns3::PfFfMacScheduler");
147  lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
148 
149  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandOffset", UintegerValue (0));
150  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandwidth", UintegerValue (12));
151  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandOffset", UintegerValue (0));
152  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandwidth", UintegerValue (25));
153  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0)));
154 
155  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandOffset", UintegerValue (12));
156  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandwidth", UintegerValue (12));
157  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandOffset", UintegerValue (0));
158  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandwidth", UintegerValue (25));
159  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1)));
160 
161  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
162  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
163 
164  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
165  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
166 
167  // Activate an EPS bearer
168  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
169  EpsBearer bearer (q);
170  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
171  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
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 
177  Ptr<LtePhy> ue1Phy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
178  Ptr<LteChunkProcessor> testDlSinr1 = Create<LteChunkProcessor> ();
179  LteSpectrumValueCatcher dlSinr1Catcher;
180  testDlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
181  ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1);
182 
183  Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
184  Ptr<LteChunkProcessor> testUlSinr1 = Create<LteChunkProcessor> ();
185  LteSpectrumValueCatcher ulSinr1Catcher;
186  testUlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
187  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1);
188 
189  // same as above for eNB2 and UE2
190 
191  Ptr<LtePhy> ue2Phy = ueDevs2.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
192  Ptr<LteChunkProcessor> testDlSinr2 = Create<LteChunkProcessor> ();
193  LteSpectrumValueCatcher dlSinr2Catcher;
194  testDlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
195  ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2);
196 
197  Ptr<LtePhy> enb2phy = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
198  Ptr<LteChunkProcessor> testUlSinr2 = Create<LteChunkProcessor> ();
199  LteSpectrumValueCatcher ulSinr2Catcher;
200  testUlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
201  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2);
202 
203 // need to allow for RRC connection establishment + SRS
204  Simulator::Stop (Seconds (0.200));
205  Simulator::Run ();
206 
207 
208  for (uint32_t i = 0; i < 12; i++)
209  {
210  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
211  double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
212  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_expectedDlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
213 
214 
215  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
216  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2, 0, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
217  }
218 
219  for (uint32_t i = 12; i < 24; i++)
220  {
221  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
222  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1, 0, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
223 
224  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
225  double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
226  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2Db, m_expectedDlSinrDb, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
227  }
228 
229  //FR algorithms do not operate in uplink now, so we do not test it
230 // double ulSinr1Db = 10.0 * std::log10 (testUlSinr1->GetValue ()->operator[] (0));
231 // NS_LOG_DEBUG("ulSinr1Db: "<< ulSinr1Db);
232 // NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr1Db, m_expectedUlSinrDb, 0.01, "Wrong SINR in UL! (UE1 --> eNB1)");
233 //
234 // double ulSinr2Db = 10.0 * std::log10 (testUlSinr2->GetValue ()->operator[] (0));
235 // NS_LOG_DEBUG("ulSinr2Db: "<< ulSinr2Db);
236 // NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr2Db, m_expectedUlSinrDb, 0.01, "Wrong SINR in UL! (UE2 --> eNB2)");
237 
238  Simulator::Destroy ();
239 }
240 
242  double commonDlSinr, double commonUlSinr, double edgeDlSinr, double edgeUlSinr,
243  uint32_t rspqThreshold)
244  : TestCase ("Test: " + name),
245  m_d1 (d1),
246  m_d2 (d2),
247  m_commonDlSinrDb (10 * std::log10 (commonDlSinr)),
248  m_edgeDlSinrDb (10 * std::log10 (edgeDlSinr)),
249  m_rspqThreshold (rspqThreshold)
250 {
251  NS_LOG_INFO ("Creating LteInterferenceFrTestCase");
252 }
253 
255 {
256 }
257 
258 void
260 {
261  NS_LOG_INFO (this << GetName ());
262  NS_LOG_DEBUG ("LteInterferenceStrictFrTestCase");
263 
264  Config::Reset ();
265  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
266 
267  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
268  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
269  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
270  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
271 
272  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
273  lteHelper->SetFfrAlgorithmType ("ns3::LteFrStrictAlgorithm");
274  lteHelper->SetFfrAlgorithmAttribute ("RsrqThreshold", UintegerValue (m_rspqThreshold));
275  lteHelper->SetFfrAlgorithmAttribute ("CenterPowerOffset",
276  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
277  lteHelper->SetFfrAlgorithmAttribute ("EdgePowerOffset",
278  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
279 
280 
281  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
282 
283  // Create Nodes: eNodeB and UE
284  NodeContainer enbNodes;
285  NodeContainer ueNodes1;
286  NodeContainer ueNodes2;
287  enbNodes.Create (2);
288  ueNodes1.Create (2);
289  ueNodes2.Create (2);
290  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
291 
292  // the topology is the following:
293  // d2
294  // UE1-----------eNB2
295  // | |
296  // d1| |d1
297  // | d2 |
298  // eNB1----------UE2
299  //
300  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
301  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
302  positionAlloc->Add (Vector (m_d2, m_d1, 0.0)); // eNB2
303 
304  positionAlloc->Add (Vector (0.0, m_d1, 0.0)); // UE1-eNB1
305  positionAlloc->Add (Vector (0.5 * m_d2, 0.0, 0.0)); // UE2-eNB1
306 
307  positionAlloc->Add (Vector (m_d2, 0.0, 0.0)); // UE1-eNB2
308  positionAlloc->Add (Vector (0.5 * m_d2, m_d1, 0.0)); // UE2-eNB2
309 
311  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
312  mobility.SetPositionAllocator (positionAlloc);
313  mobility.Install (allNodes);
314 
315  // Create Devices and install them in the Nodes (eNB and UE)
316  NetDeviceContainer enbDevs;
317  NetDeviceContainer ueDevs1;
318  NetDeviceContainer ueDevs2;
319  lteHelper->SetSchedulerType ("ns3::PfFfMacScheduler");
320  lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
321 
322 
323  lteHelper->SetFfrAlgorithmAttribute ("DlCommonSubBandwidth", UintegerValue (12));
324  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandOffset", UintegerValue (0));
325  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandwidth", UintegerValue (6));
326  lteHelper->SetFfrAlgorithmAttribute ("UlCommonSubBandwidth", UintegerValue (25));
327  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandOffset", UintegerValue (0));
328  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandwidth", UintegerValue (0));
329 
330  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0)));
331 
332  lteHelper->SetFfrAlgorithmAttribute ("DlCommonSubBandwidth", UintegerValue (12));
333  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandOffset", UintegerValue (6));
334  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandwidth", UintegerValue (6));
335  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1)));
336 
337  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
338  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
339 
340  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
341  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
342 
343  // Activate an EPS bearer
344  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
345  EpsBearer bearer (q);
346  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
347  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
348 
349  // Use testing chunk processor in the PHY layer
350  // It will be used to test that the SNR is as intended
351  // we plug in two instances, one for DL and one for UL
352 
353  Ptr<LtePhy> ue1Phy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
354  Ptr<LteChunkProcessor> testDlSinr1 = Create<LteChunkProcessor> ();
355  LteSpectrumValueCatcher dlSinr1Catcher;
356  testDlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
357  ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1);
358 
359  Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
360  Ptr<LteChunkProcessor> testUlSinr1 = Create<LteChunkProcessor> ();
361  LteSpectrumValueCatcher ulSinr1Catcher;
362  testUlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
363  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1);
364 
365  // same as above for eNB2 and UE2
366 
367  Ptr<LtePhy> ue2Phy = ueDevs2.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
368  Ptr<LteChunkProcessor> testDlSinr2 = Create<LteChunkProcessor> ();
369  LteSpectrumValueCatcher dlSinr2Catcher;
370  testDlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
371  ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2);
372 
373  Ptr<LtePhy> enb2phy = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
374  Ptr<LteChunkProcessor> testUlSinr2 = Create<LteChunkProcessor> ();
375  LteSpectrumValueCatcher ulSinr2Catcher;
376  testUlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
377  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2);
378 
379 // need to allow for UE Measurement report
380  Simulator::Stop (Seconds (2.000));
381  Simulator::Run ();
382 
383 
384  for (uint32_t i = 0; i < 12; i++)
385  {
386  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
387  double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
388  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_commonDlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
389 
390 
391  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
392  double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
393  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2Db, m_commonDlSinrDb, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
394  }
395 
396  for (uint32_t i = 12; i < 18; i++)
397  {
398  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
399  double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
400  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_edgeDlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
401 
402 
403  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
404  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2, 0, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
405  }
406 
407  for (uint32_t i = 18; i < 24; i++)
408  {
409  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
410  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1, 0, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
411 
412  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
413  double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
414  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2Db, m_edgeDlSinrDb, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
415  }
416 
417 
418  //FR algorithms do not operate in uplink now, so we do not test it
419 // double ulSinr1Db = 10.0 * std::log10 (testUlSinr1->GetValue ()->operator[] (0));
420 // NS_LOG_DEBUG("ulSinr1Db: "<< ulSinr1Db);
421 // NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr1Db, m_expectedUlSinrDb, 0.01, "Wrong SINR in UL! (UE1 --> eNB1)");
422 //
423 // double ulSinr2Db = 10.0 * std::log10 (testUlSinr2->GetValue ()->operator[] (0));
424 // NS_LOG_DEBUG("ulSinr2Db: "<< ulSinr2Db);
425 // NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr2Db, m_expectedUlSinrDb, 0.01, "Wrong SINR in UL! (UE2 --> eNB2)");
426 
427  Simulator::Destroy ();
428 }
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
AttributeValue implementation for Boolean.
Definition: boolean.h:36
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:474
double m_d2
distance between UE and other ENB
Hold variables of type string.
Definition: string.h:41
A suite of tests to run.
Definition: test.h:1343
double m_commonDlSinrDb
expected common DL SINR in dB
LteInterferenceHardFrTestCase(std::string name, double d1, double d2, double dlSinr, double ulSinr)
Constructor.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
Definition: lte-helper.cc:961
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Ptr< LteSpectrumPhy > GetUplinkSpectrumPhy()
Definition: lte-phy.cc:113
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
double m_d1
distance between UE and ENB
LteInterferenceStrictFrTestCase(std::string name, double d1, double d2, double commonDlSinr, double commonUlSinr, double edgeDlSinr, double edgeUlSinr, uint32_t rspqThreshold)
Constructor.
encapsulates test code
Definition: test.h:1153
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
Definition: lte-helper.cc:1314
STL namespace.
static LteInterferenceFrTestSuite LteInterferenceFrTestSuite
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:306
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:279
mobility
Definition: third.py:108
Hold variables of type enum.
Definition: enum.h:54
double m_expectedDlSinrDb
expected DL SINR in dB
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Hold an unsigned integer type.
Definition: uinteger.h:44
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Definition: lte-helper.cc:293
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1610
A sink to be plugged to the callback of LteChunkProcessor allowing to save and later retrieve the lat...
Ptr< LteSpectrumPhy > GetDownlinkSpectrumPhy()
Definition: lte-phy.cc:107
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Definition: test.h:378
double m_d2
distance between UE and other ENB
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:464
double m_edgeDlSinrDb
expected edge DL SINR in dB
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
void Reset(void)
Reset the initial value of every attribute as well as the value of every global to what they were bef...
Definition: config.cc:787
uint32_t m_rspqThreshold
RSPQ threshold.
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:489
Helper class used to assign positions and mobility models to nodes.
std::string GetName(void) const
Definition: test.cc:370
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1070
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:812
void Add(Vector v)
Add a position to the list of positions.
Test suite for the interference test when using different frequency reuse algorithms.Check if the interfence values correspond to theoretical values.
Lte interference test when using hard frequency reuse algorithm.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
Lte interference test when using strict frequency reuse algorithm.
Qci
QoS Class Indicator.
Definition: eps-bearer.h:106
double m_d1
distance between UE and ENB
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
Definition: double.h:41
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:187
The eNodeB device implementation.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
Definition: lte-helper.cc:314
virtual void DoRun(void)
Implementation to actually run this TestCase.
The LtePhy models the physical layer of LTE.
Definition: lte-phy.h:52
The LteUeNetDevice class implements the UE net device.