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  m_expectedUlSinrDb (10 * std::log10 (ulSinr))
89 {
90  NS_LOG_INFO ("Creating LteInterferenceFrTestCase");
91 }
92 
94 {
95 }
96 
97 void
99 {
100  NS_LOG_INFO (this << GetName ());
101  NS_LOG_DEBUG ("LteInterferenceHardFrTestCase");
102 
103  Config::Reset ();
104  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (false));
105 
106  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
107  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
108  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
109  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
110 
111  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
112  lteHelper->SetFfrAlgorithmType ("ns3::LteFrHardAlgorithm");
113 
114  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
115 
116  // Create Nodes: eNodeB and UE
117  NodeContainer enbNodes;
118  NodeContainer ueNodes1;
119  NodeContainer ueNodes2;
120  enbNodes.Create (2);
121  ueNodes1.Create (1);
122  ueNodes2.Create (1);
123  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
124 
125  // the topology is the following:
126  // d2
127  // UE1-----------eNB2
128  // | |
129  // d1| |d1
130  // | d2 |
131  // eNB1----------UE2
132  //
133  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
134  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
135  positionAlloc->Add (Vector (m_d2, m_d1, 0.0)); // eNB2
136  positionAlloc->Add (Vector (0.0, m_d1, 0.0)); // UE1
137  positionAlloc->Add (Vector (m_d2, 0.0, 0.0)); // UE2
139  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
140  mobility.SetPositionAllocator (positionAlloc);
141  mobility.Install (allNodes);
142 
143  // Create Devices and install them in the Nodes (eNB and UE)
144  NetDeviceContainer enbDevs;
145  NetDeviceContainer ueDevs1;
146  NetDeviceContainer ueDevs2;
147  lteHelper->SetSchedulerType ("ns3::PfFfMacScheduler");
148  lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
149 
150  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandOffset", UintegerValue (0));
151  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandwidth", UintegerValue (12));
152  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandOffset", UintegerValue (0));
153  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandwidth", UintegerValue (25));
154  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0)));
155 
156  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandOffset", UintegerValue (12));
157  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandwidth", UintegerValue (12));
158  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandOffset", UintegerValue (0));
159  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandwidth", UintegerValue (25));
160  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1)));
161 
162  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
163  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
164 
165  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
166  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
167 
168  // Activate an EPS bearer
169  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
170  EpsBearer bearer (q);
171  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
172  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
173 
174  // Use testing chunk processor in the PHY layer
175  // It will be used to test that the SNR is as intended
176  // we plug in two instances, one for DL and one for UL
177 
178  Ptr<LtePhy> ue1Phy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
179  Ptr<LteChunkProcessor> testDlSinr1 = Create<LteChunkProcessor> ();
180  LteSpectrumValueCatcher dlSinr1Catcher;
181  testDlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
182  ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1);
183 
184  Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
185  Ptr<LteChunkProcessor> testUlSinr1 = Create<LteChunkProcessor> ();
186  LteSpectrumValueCatcher ulSinr1Catcher;
187  testUlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
188  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1);
189 
190  // same as above for eNB2 and UE2
191 
192  Ptr<LtePhy> ue2Phy = ueDevs2.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
193  Ptr<LteChunkProcessor> testDlSinr2 = Create<LteChunkProcessor> ();
194  LteSpectrumValueCatcher dlSinr2Catcher;
195  testDlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
196  ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2);
197 
198  Ptr<LtePhy> enb2phy = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
199  Ptr<LteChunkProcessor> testUlSinr2 = Create<LteChunkProcessor> ();
200  LteSpectrumValueCatcher ulSinr2Catcher;
201  testUlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
202  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2);
203 
204 // need to allow for RRC connection establishment + SRS
205  Simulator::Stop (Seconds (0.200));
206  Simulator::Run ();
207 
208 
209  for (uint32_t i = 0; i < 12; i++)
210  {
211  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
212  double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
213  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_expectedDlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
214 
215 
216  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
217  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2, 0, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
218  }
219 
220  for (uint32_t i = 12; i < 24; i++)
221  {
222  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
223  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1, 0, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
224 
225  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
226  double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
227  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2Db, m_expectedDlSinrDb, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
228  }
229 
230  //FR algorithms do not operate in uplink now, so we do not test it
231 // double ulSinr1Db = 10.0 * std::log10 (testUlSinr1->GetValue ()->operator[] (0));
232 // NS_LOG_DEBUG("ulSinr1Db: "<< ulSinr1Db);
233 // NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr1Db, m_expectedUlSinrDb, 0.01, "Wrong SINR in UL! (UE1 --> eNB1)");
234 //
235 // double ulSinr2Db = 10.0 * std::log10 (testUlSinr2->GetValue ()->operator[] (0));
236 // NS_LOG_DEBUG("ulSinr2Db: "<< ulSinr2Db);
237 // NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr2Db, m_expectedUlSinrDb, 0.01, "Wrong SINR in UL! (UE2 --> eNB2)");
238 
239  Simulator::Destroy ();
240 }
241 
243  double commonDlSinr, double commonUlSinr, double edgeDlSinr, double edgeUlSinr,
244  uint32_t rspqThreshold)
245  : TestCase ("Test: " + name),
246  m_d1 (d1),
247  m_d2 (d2),
248  m_commonDlSinrDb (10 * std::log10 (commonDlSinr)),
249  m_commonUlSinrDb (10 * std::log10 (commonUlSinr)),
250  m_edgeDlSinrDb (10 * std::log10 (edgeDlSinr)),
251  m_edgeUlSinrDb (10 * std::log10 (edgeUlSinr)),
252  m_rspqThreshold (rspqThreshold)
253 {
254  NS_LOG_INFO ("Creating LteInterferenceFrTestCase");
255 }
256 
258 {
259 }
260 
261 void
263 {
264  NS_LOG_INFO (this << GetName ());
265  NS_LOG_DEBUG ("LteInterferenceStrictFrTestCase");
266 
267  Config::Reset ();
268  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
269 
270  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
271  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
272  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
273  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
274 
275  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
276  lteHelper->SetFfrAlgorithmType ("ns3::LteFrStrictAlgorithm");
277  lteHelper->SetFfrAlgorithmAttribute ("RsrqThreshold", UintegerValue (m_rspqThreshold));
278  lteHelper->SetFfrAlgorithmAttribute ("CenterPowerOffset",
279  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
280  lteHelper->SetFfrAlgorithmAttribute ("EdgePowerOffset",
281  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
282 
283 
284  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
285 
286  // Create Nodes: eNodeB and UE
287  NodeContainer enbNodes;
288  NodeContainer ueNodes1;
289  NodeContainer ueNodes2;
290  enbNodes.Create (2);
291  ueNodes1.Create (2);
292  ueNodes2.Create (2);
293  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
294 
295  // the topology is the following:
296  // d2
297  // UE1-----------eNB2
298  // | |
299  // d1| |d1
300  // | d2 |
301  // eNB1----------UE2
302  //
303  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
304  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
305  positionAlloc->Add (Vector (m_d2, m_d1, 0.0)); // eNB2
306 
307  positionAlloc->Add (Vector (0.0, m_d1, 0.0)); // UE1-eNB1
308  positionAlloc->Add (Vector (0.5 * m_d2, 0.0, 0.0)); // UE2-eNB1
309 
310  positionAlloc->Add (Vector (m_d2, 0.0, 0.0)); // UE1-eNB2
311  positionAlloc->Add (Vector (0.5 * m_d2, m_d1, 0.0)); // UE2-eNB2
312 
314  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
315  mobility.SetPositionAllocator (positionAlloc);
316  mobility.Install (allNodes);
317 
318  // Create Devices and install them in the Nodes (eNB and UE)
319  NetDeviceContainer enbDevs;
320  NetDeviceContainer ueDevs1;
321  NetDeviceContainer ueDevs2;
322  lteHelper->SetSchedulerType ("ns3::PfFfMacScheduler");
323  lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
324 
325 
326  lteHelper->SetFfrAlgorithmAttribute ("DlCommonSubBandwidth", UintegerValue (12));
327  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandOffset", UintegerValue (0));
328  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandwidth", UintegerValue (6));
329  lteHelper->SetFfrAlgorithmAttribute ("UlCommonSubBandwidth", UintegerValue (25));
330  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandOffset", UintegerValue (0));
331  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandwidth", UintegerValue (0));
332 
333  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0)));
334 
335  lteHelper->SetFfrAlgorithmAttribute ("DlCommonSubBandwidth", UintegerValue (12));
336  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandOffset", UintegerValue (6));
337  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandwidth", UintegerValue (6));
338  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1)));
339 
340  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
341  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
342 
343  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
344  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
345 
346  // Activate an EPS bearer
347  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
348  EpsBearer bearer (q);
349  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
350  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
351 
352  // Use testing chunk processor in the PHY layer
353  // It will be used to test that the SNR is as intended
354  // we plug in two instances, one for DL and one for UL
355 
356  Ptr<LtePhy> ue1Phy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
357  Ptr<LteChunkProcessor> testDlSinr1 = Create<LteChunkProcessor> ();
358  LteSpectrumValueCatcher dlSinr1Catcher;
359  testDlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr1Catcher));
360  ue1Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr1);
361 
362  Ptr<LtePhy> enb1phy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
363  Ptr<LteChunkProcessor> testUlSinr1 = Create<LteChunkProcessor> ();
364  LteSpectrumValueCatcher ulSinr1Catcher;
365  testUlSinr1->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr1Catcher));
366  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr1);
367 
368  // same as above for eNB2 and UE2
369 
370  Ptr<LtePhy> ue2Phy = ueDevs2.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
371  Ptr<LteChunkProcessor> testDlSinr2 = Create<LteChunkProcessor> ();
372  LteSpectrumValueCatcher dlSinr2Catcher;
373  testDlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &dlSinr2Catcher));
374  ue2Phy->GetDownlinkSpectrumPhy ()->AddDataSinrChunkProcessor (testDlSinr2);
375 
376  Ptr<LtePhy> enb2phy = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetObject<LtePhy> ();
377  Ptr<LteChunkProcessor> testUlSinr2 = Create<LteChunkProcessor> ();
378  LteSpectrumValueCatcher ulSinr2Catcher;
379  testUlSinr2->AddCallback (MakeCallback (&LteSpectrumValueCatcher::ReportValue, &ulSinr2Catcher));
380  enb1phy->GetUplinkSpectrumPhy ()->AddDataSinrChunkProcessor (testUlSinr2);
381 
382 // need to allow for UE Measurement report
383  Simulator::Stop (Seconds (2.000));
384  Simulator::Run ();
385 
386 
387  for (uint32_t i = 0; i < 12; i++)
388  {
389  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
390  double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
391  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_commonDlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
392 
393 
394  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
395  double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
396  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2Db, m_commonDlSinrDb, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
397  }
398 
399  for (uint32_t i = 12; i < 18; i++)
400  {
401  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
402  double dlSinr1Db = 10.0 * std::log10 (dlSinr1);
403  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1Db, m_edgeDlSinrDb, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
404 
405 
406  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
407  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2, 0, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
408  }
409 
410  for (uint32_t i = 18; i < 24; i++)
411  {
412  double dlSinr1 = dlSinr1Catcher.GetValue ()->operator[] (i);
413  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr1, 0, 0.01, "Wrong SINR in DL! (eNB1 --> UE1)");
414 
415  double dlSinr2 = dlSinr2Catcher.GetValue ()->operator[] (i);
416  double dlSinr2Db = 10.0 * std::log10 (dlSinr2);
417  NS_TEST_ASSERT_MSG_EQ_TOL (dlSinr2Db, m_edgeDlSinrDb, 0.01, "Wrong SINR in DL! (eNB2 --> UE2)");
418  }
419 
420 
421  //FR algorithms do not operate in uplink now, so we do not test it
422 // double ulSinr1Db = 10.0 * std::log10 (testUlSinr1->GetValue ()->operator[] (0));
423 // NS_LOG_DEBUG("ulSinr1Db: "<< ulSinr1Db);
424 // NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr1Db, m_expectedUlSinrDb, 0.01, "Wrong SINR in UL! (UE1 --> eNB1)");
425 //
426 // double ulSinr2Db = 10.0 * std::log10 (testUlSinr2->GetValue ()->operator[] (0));
427 // NS_LOG_DEBUG("ulSinr2Db: "<< ulSinr2Db);
428 // NS_TEST_ASSERT_MSG_EQ_TOL (ulSinr2Db, m_expectedUlSinrDb, 0.01, "Wrong SINR in UL! (UE2 --> eNB2)");
429 
430  Simulator::Destroy ();
431 }
AttributeValue implementation for Boolean.
Definition: boolean.h:34
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:382
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:455
Hold variables of type string.
Definition: string.h:41
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
A suite of tests to run.
Definition: test.h:1333
LteInterferenceHardFrTestCase(std::string name, double d1, double d2, double dlSinr, double ulSinr)
TestCase Data.
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:716
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:201
Ptr< LteSpectrumPhy > GetUplinkSpectrumPhy()
Definition: lte-phy.cc:110
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:244
LteInterferenceStrictFrTestCase(std::string name, double d1, double d2, double commonDlSinr, double commonUlSinr, double edgeDlSinr, double edgeUlSinr, uint32_t rspqThreshold)
encapsulates test code
Definition: test.h:1147
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
Definition: lte-helper.cc:1046
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:252
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:225
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
tuple mobility
Definition: third.py:101
Hold variables of type enum.
Definition: enum.h:54
void AddTestCase(TestCase *testCase, enum TestDuration duration)
Add an individual child TestCase to this test suite.
Definition: test.cc:297
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:239
holds a vector of ns3::NetDevice pointers
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
Definition: callback.h:1480
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:104
#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:373
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
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:749
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:397
Helper class used to assign positions and mobility models to nodes.
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:236
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:895
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:774
void Add(Vector v)
Add a position to the list of positions.
Test Interference level with FR algorithms.
std::string GetName(void) const
Definition: test.cc:368
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
This class can be used to hold variables of floating point type such as 'double' or 'float'...
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:191
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:260
Qci
QoS Class Indicator.
Definition: eps-bearer.h:77
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.