A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lte-test-frequency-reuse.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  *
20  */
21 
22 #include <ns3/simulator.h>
23 #include <ns3/log.h>
24 #include <ns3/callback.h>
25 #include <ns3/config.h>
26 #include <ns3/string.h>
27 #include <ns3/double.h>
28 #include <ns3/enum.h>
29 #include <ns3/boolean.h>
30 #include <ns3/pointer.h>
31 
32 #include "ns3/mobility-helper.h"
33 #include "ns3/lte-helper.h"
34 #include "ns3/point-to-point-epc-helper.h"
35 #include "ns3/internet-module.h"
36 #include "ns3/point-to-point-module.h"
37 #include "ns3/applications-module.h"
38 
39 #include <ns3/ff-mac-scheduler.h>
40 #include <ns3/lte-enb-net-device.h>
41 #include <ns3/lte-enb-phy.h>
42 #include <ns3/lte-enb-rrc.h>
43 #include <ns3/lte-ue-net-device.h>
44 #include <ns3/lte-ue-phy.h>
45 #include <ns3/lte-ue-rrc.h>
46 
47 #include "lte-ffr-simple.h"
50 #include <ns3/lte-common.h>
51 
53 
54 
55 NS_LOG_COMPONENT_DEFINE ("LteFrequencyReuseTest");
56 
57 using namespace ns3;
58 
64  : TestSuite ("lte-frequency-reuse", SYSTEM)
65 {
66 // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_DEBUG);
67 // LogComponentEnable ("LteFrequencyReuseTest", logLevel);
68 
69  std::vector<bool> availableDlRb;
70  std::vector<bool> availableUlRb;
71  for (uint32_t i = 0; i < 12; i++)
72  {
73  availableDlRb.push_back (true);
74  availableUlRb.push_back (true);
75  }
76  for (uint32_t i = 12; i < 25; i++)
77  {
78  availableDlRb.push_back (false);
79  availableUlRb.push_back (false);
80  }
81 
82  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrPf1", 1, "ns3::PfFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
83  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrPf2", 5, "ns3::PfFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
84  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrPss1", 1, "ns3::PssFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
85  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrPss2", 5, "ns3::PssFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
86  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrCqa1", 1, "ns3::CqaFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
87  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrCqa2", 5, "ns3::CqaFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
88  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrFdTbfq1", 1, "ns3::FdTbfqFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
89  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrFdTbfq2", 5, "ns3::FdTbfqFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
90  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrTdTbfq1", 1, "ns3::TdTbfqFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
91  AddTestCase (new LteHardFrTestCase ("DownlinkHardFrTdTbfq2", 5, "ns3::TdTbfqFfMacScheduler", 25, 25, 0, 12, 0, 12, availableDlRb, availableUlRb), TestCase::QUICK);
92 
93  availableDlRb.clear ();
94  availableUlRb.clear ();
95  for (uint32_t i = 0; i < 6; i++)
96  {
97  availableDlRb.push_back (true);
98  availableUlRb.push_back (true);
99  }
100  for (uint32_t i = 6; i < 12; i++)
101  {
102  availableDlRb.push_back (false);
103  availableUlRb.push_back (false);
104  }
105  for (uint32_t i = 12; i < 18; i++)
106  {
107  availableDlRb.push_back (true);
108  availableUlRb.push_back (true);
109  }
110  for (uint32_t i = 18; i < 25; i++)
111  {
112  availableDlRb.push_back (false);
113  availableUlRb.push_back (false);
114  }
115 
116  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrPf1", 1, "ns3::PfFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
117  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrPf2", 5, "ns3::PfFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
118  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrPss1", 1, "ns3::PssFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
119  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrPss2", 5, "ns3::PssFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
120  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrCqa1", 1, "ns3::CqaFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
121  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrCqa2", 5, "ns3::CqaFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
122  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrCqaFdTbfq1", 1, "ns3::FdTbfqFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
123  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrCqaFdTbfq2", 5, "ns3::FdTbfqFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
124  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrCqaTdTbfq1", 1, "ns3::TdTbfqFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
125  AddTestCase (new LteStrictFrTestCase ("DownlinkStrictFrCqaTdTbfq2", 5, "ns3::TdTbfqFfMacScheduler", 25, 25, 6, 6, 6, 6, 6, 6, availableDlRb, availableUlRb), TestCase::QUICK);
126 
127  AddTestCase (new LteStrictFrAreaTestCase ("LteStrictFrAreaTestCasePf1", "ns3::PfFfMacScheduler"), TestCase::QUICK);
128  AddTestCase (new LteStrictFrAreaTestCase ("LteStrictFrAreaTestCasePss1", "ns3::PssFfMacScheduler"), TestCase::QUICK);
129  AddTestCase (new LteStrictFrAreaTestCase ("LteStrictFrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"), TestCase::QUICK);
130  AddTestCase (new LteStrictFrAreaTestCase ("LteStrictFrAreaTestCaseFdTbfq1", "ns3::FdTbfqFfMacScheduler"), TestCase::QUICK);
131  AddTestCase (new LteStrictFrAreaTestCase ("LteStrictFrAreaTestCaseTdTbfq1", "ns3::TdTbfqFfMacScheduler"), TestCase::QUICK);
132 
133  AddTestCase (new LteSoftFrAreaTestCase ("LteSoftFrAreaTestCasePf1", "ns3::PfFfMacScheduler"), TestCase::QUICK);
134  AddTestCase (new LteSoftFrAreaTestCase ("LteSoftFrAreaTestCasePss1", "ns3::PssFfMacScheduler"), TestCase::QUICK);
135  AddTestCase (new LteSoftFrAreaTestCase ("LteSoftFrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"), TestCase::QUICK);
136  AddTestCase (new LteSoftFrAreaTestCase ("LteSoftFrAreaTestCaseFdTbfq1", "ns3::FdTbfqFfMacScheduler"), TestCase::QUICK);
137  AddTestCase (new LteSoftFrAreaTestCase ("LteSoftFrAreaTestCaseTdTbfq1", "ns3::TdTbfqFfMacScheduler"), TestCase::QUICK);
138 
139  AddTestCase (new LteSoftFfrAreaTestCase ("LteSoftFfrAreaTestCasePf1", "ns3::PfFfMacScheduler"), TestCase::QUICK);
140  AddTestCase (new LteSoftFfrAreaTestCase ("LteSoftFfrAreaTestCasePss1", "ns3::PssFfMacScheduler"), TestCase::QUICK);
141  AddTestCase (new LteSoftFfrAreaTestCase ("LteSoftFfrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"), TestCase::QUICK);
142  AddTestCase (new LteSoftFfrAreaTestCase ("LteSoftFfrAreaTestCaseFdTbfq1", "ns3::FdTbfqFfMacScheduler"), TestCase::QUICK);
143  AddTestCase (new LteSoftFfrAreaTestCase ("LteSoftFfrAreaTestCaseTdTbfq1", "ns3::TdTbfqFfMacScheduler"), TestCase::QUICK);
144 
145  AddTestCase (new LteEnhancedFfrAreaTestCase ("LteEnhancedFfrAreaTestCasePf1", "ns3::PfFfMacScheduler"), TestCase::QUICK);
146  AddTestCase (new LteEnhancedFfrAreaTestCase ("LteEnhancedFfrAreaTestCasePss1", "ns3::PssFfMacScheduler"), TestCase::QUICK);
147  AddTestCase (new LteEnhancedFfrAreaTestCase ("LteEnhancedFfrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"), TestCase::QUICK);
148  AddTestCase (new LteEnhancedFfrAreaTestCase ("LteEnhancedFfrAreaTestCaseFdTbfq1", "ns3::FdTbfqFfMacScheduler"), TestCase::QUICK);
149  AddTestCase (new LteEnhancedFfrAreaTestCase ("LteEnhancedFfrAreaTestCaseTdTbfq1", "ns3::TdTbfqFfMacScheduler"), TestCase::QUICK);
150 
151  AddTestCase (new LteDistributedFfrAreaTestCase ("LteDistributedFfrAreaTestCasePf1", "ns3::PfFfMacScheduler"), TestCase::QUICK);
152  AddTestCase (new LteDistributedFfrAreaTestCase ("LteDistributedFfrAreaTestCasePss1", "ns3::PssFfMacScheduler"), TestCase::QUICK);
153  AddTestCase (new LteDistributedFfrAreaTestCase ("LteDistributedFfrAreaTestCaseCqa1", "ns3::CqaFfMacScheduler"), TestCase::QUICK);
154  AddTestCase (new LteDistributedFfrAreaTestCase ("LteDistributedFfrAreaTestCaseFdTbfq1", "ns3::FdTbfqFfMacScheduler"), TestCase::QUICK);
155  AddTestCase (new LteDistributedFfrAreaTestCase ("LteDistributedFfrAreaTestCaseTdTbfq1", "ns3::TdTbfqFfMacScheduler"), TestCase::QUICK);
156 }
157 
159 
160 
164 void
166  Ptr<const SpectrumValue> spectrumValue)
167 {
168  testcase->DlDataRxStart (spectrumValue);
169 }
170 
171 void
173  Ptr<const SpectrumValue> spectrumValue)
174 {
175  testcase->UlDataRxStart (spectrumValue);
176 }
177 
179  uint32_t userNum,uint8_t dlBandwidth,uint8_t ulBandwidth,
180  std::vector<bool> availableDlRb, std::vector<bool> availableUlRb)
181  : TestCase ("Test: " + name),
182  m_userNum (userNum),
183  m_dlBandwidth (dlBandwidth),
184  m_ulBandwidth (ulBandwidth),
185  m_availableDlRb (availableDlRb),
186  m_usedMutedDlRbg (false),
187  m_availableUlRb (availableUlRb),
188  m_usedMutedUlRbg (false)
189 {
190 }
191 
193 {
194 }
195 
196 
197 
198 void
200 {
201  NS_LOG_DEBUG ("DL DATA Power allocation :");
202  Values::const_iterator it;
203  uint32_t i = 0;
204  for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
205  {
206  double power = (*it) * (m_dlBandwidth * 180000);
207  NS_LOG_DEBUG ("RB " << i << " POWER: " << " " << power << " isAvailable: " << m_availableDlRb[i]);
208 
209  if (m_availableDlRb[i] == false && power > 0)
210  {
211  m_usedMutedDlRbg = true;
212  }
213  i++;
214  }
215 }
216 
217 void
219 {
220  NS_LOG_DEBUG ("UL DATA Power allocation :");
221  Values::const_iterator it;
222  uint32_t i = 0;
223  for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
224  {
225  double power = (*it) * (m_ulBandwidth * 180000);
226  NS_LOG_DEBUG ("RB " << i << " POWER: " << " " << power << " isAvailable: " << m_availableUlRb[i]);
227 
228  if (m_availableUlRb[i] == false && power > 0)
229  {
230  m_usedMutedUlRbg = true;
231  }
232  i++;
233  }
234 }
235 
236 
237 void
239 {
240 
241 }
242 
243 
244 LteHardFrTestCase::LteHardFrTestCase (std::string name, uint32_t userNum,
245  std::string schedulerType,
246  uint8_t dlBandwidth, uint8_t ulBandwidth,
247  uint8_t dlSubBandOffset, uint8_t dlSubBandwidth,
248  uint8_t ulSubBandOffset, uint8_t ulSubBandwidth,
249  std::vector<bool> availableDlRb, std::vector<bool> availableUlRb)
250  : LteFrTestCase (name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
251  m_schedulerType (schedulerType),
252  m_dlSubBandOffset (dlSubBandOffset),
253  m_dlSubBandwidth (dlSubBandwidth),
254  m_ulSubBandOffset (ulSubBandOffset),
255  m_ulSubBandwidth (ulSubBandwidth)
256 {
257  NS_LOG_INFO ("Creating LteDownlinkFrTestCase");
258 }
259 
261 {
262 }
263 
264 void
266 {
267  NS_LOG_DEBUG ("LteFrTestCase");
268 
269  Config::Reset ();
270  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (false));
271 
276  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
277  lteHelper->SetFfrAlgorithmType ("ns3::LteFrHardAlgorithm");
278 
279  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandOffset", UintegerValue (m_dlSubBandOffset));
280  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandwidth", UintegerValue (m_dlSubBandwidth));
281 
282  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandOffset", UintegerValue (m_ulSubBandOffset));
283  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandwidth", UintegerValue (m_ulSubBandwidth));
284 
285 
286  // Create Nodes: eNodeB and UE
287  NodeContainer enbNodes;
288  NodeContainer ueNodes;
289  enbNodes.Create (1);
290  ueNodes.Create (m_userNum);
291  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes );
292 
293  // Install Mobility Model
294  MobilityHelper mobility;
295  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
296  mobility.Install (allNodes);
297 
298  // Create Devices and install them in the Nodes (eNB and UE)
299  NetDeviceContainer enbDevs;
300  NetDeviceContainer ueDevs;
301  lteHelper->SetSchedulerType (m_schedulerType);
302  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
303  ueDevs = lteHelper->InstallUeDevice (ueNodes);
304 
305  // Attach a UE to a eNB
306  lteHelper->Attach (ueDevs, enbDevs.Get (0));
307 
308  // Activate the default EPS bearer
309  enum EpsBearer::Qci q = EpsBearer::NGBR_VIDEO_TCP_DEFAULT;
310  EpsBearer bearer (q);
311  lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
312 
313  //Test SpectrumPhy to get signals form DL channel
314  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
315  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
316 
317  Ptr<LteSimpleSpectrumPhy> testDlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
318  Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
319  testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetDlEarfcn (), m_dlBandwidth));
320  dlChannel->AddRx (testDlSpectrumPhy);
321 
322  testDlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
324 
325  //Test SpectrumPhy to get signals form UL channel
326  Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetUplinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
327  Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel ();
328 
329  Ptr<LteSimpleSpectrumPhy> testUlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
330  testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetUlEarfcn (), m_ulBandwidth));
331  ulChannel->AddRx (testUlSpectrumPhy);
332 
333  testUlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
335 
336  Simulator::Stop (Seconds (0.500));
337  Simulator::Run ();
338 
340  "Scheduler used DL RBG muted by FFR Algorithm");
341 
343  "Scheduler used UL RBG muted by FFR Algorithm");
344 
345  Simulator::Destroy ();
346 }
347 
348 
349 
350 LteStrictFrTestCase::LteStrictFrTestCase (std::string name, uint32_t userNum,
351  std::string schedulerType,
352  uint8_t dlBandwidth, uint8_t ulBandwidth,
353  uint8_t dlCommonSubBandwidth, uint8_t dlEdgeSubBandOffset, uint8_t dlEdgeSubBandwidth,
354  uint8_t ulCommonSubBandwidth, uint8_t ulEdgeSubBandOffset, uint8_t ulEdgeSubBandwidth,
355  std::vector<bool> availableDlRb, std::vector<bool> availableUlRb)
356  : LteFrTestCase (name, userNum, dlBandwidth, ulBandwidth, availableDlRb, availableUlRb),
357  m_schedulerType (schedulerType),
358  m_dlCommonSubBandwidth (dlCommonSubBandwidth),
359  m_dlEdgeSubBandOffset (dlEdgeSubBandOffset),
360  m_dlEdgeSubBandwidth (dlEdgeSubBandwidth),
361  m_ulCommonSubBandwidth (ulCommonSubBandwidth),
362  m_ulEdgeSubBandOffset (ulEdgeSubBandOffset),
363  m_ulEdgeSubBandwidth (ulEdgeSubBandwidth)
364 {
365  NS_LOG_INFO ("Creating LteFrTestCase");
366 }
367 
369 {
370 }
371 
372 void
374 {
375  NS_LOG_DEBUG ("LteFrTestCase");
376 
377  Config::Reset ();
378  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (false));
379 
384  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
385  lteHelper->SetFfrAlgorithmType ("ns3::LteFrStrictAlgorithm");
386 
387  lteHelper->SetFfrAlgorithmAttribute ("DlCommonSubBandwidth", UintegerValue (m_dlCommonSubBandwidth));
388  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandOffset", UintegerValue (m_dlEdgeSubBandOffset));
389  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandwidth", UintegerValue (m_dlEdgeSubBandwidth));
390 
391  lteHelper->SetFfrAlgorithmAttribute ("UlCommonSubBandwidth", UintegerValue (m_ulCommonSubBandwidth));
392  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandOffset", UintegerValue (m_ulEdgeSubBandOffset));
393  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandwidth", UintegerValue (m_ulEdgeSubBandwidth));
394 
395  // Create Nodes: eNodeB and UE
396  NodeContainer enbNodes;
397  NodeContainer ueNodes;
398  enbNodes.Create (1);
399  ueNodes.Create (m_userNum);
400  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes );
401 
402  // Install Mobility Model
403  MobilityHelper mobility;
404  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
405  mobility.Install (allNodes);
406 
407  // Create Devices and install them in the Nodes (eNB and UE)
408  NetDeviceContainer enbDevs;
409  NetDeviceContainer ueDevs;
410  lteHelper->SetSchedulerType (m_schedulerType);
411  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
412  ueDevs = lteHelper->InstallUeDevice (ueNodes);
413 
414  // Attach a UE to a eNB
415  lteHelper->Attach (ueDevs, enbDevs.Get (0));
416 
417  // Activate the default EPS bearer
418  enum EpsBearer::Qci q = EpsBearer::NGBR_VIDEO_TCP_DEFAULT;
419  EpsBearer bearer (q);
420  lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
421 
422  //Test SpectrumPhy to get signals form DL channel
423  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
424  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
425 
426  Ptr<LteSimpleSpectrumPhy> testDlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
427  Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
428  testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetDlEarfcn (), m_dlBandwidth));
429  dlChannel->AddRx (testDlSpectrumPhy);
430 
431  testDlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
433 
434  //Test SpectrumPhy to get signals form UL channel
435  Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetUplinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
436  Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel ();
437 
438  Ptr<LteSimpleSpectrumPhy> testUlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
439  testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetUlEarfcn (), m_ulBandwidth));
440  ulChannel->AddRx (testUlSpectrumPhy);
441 
442  testUlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
444 
445  Simulator::Stop (Seconds (0.500));
446  Simulator::Run ();
447 
449  "Scheduler used DL RBG muted by FFR Algorithm");
450 
452  "Scheduler used UL RBG muted by FFR Algorithm");
453 
454  Simulator::Destroy ();
455 }
456 
457 void
459  Ptr<const SpectrumValue> spectrumValue)
460 {
461  testcase->DlDataRxStart (spectrumValue);
462 }
463 
464 void
466  Ptr<const SpectrumValue> spectrumValue)
467 {
468  testcase->UlDataRxStart (spectrumValue);
469 }
470 
471 LteFrAreaTestCase::LteFrAreaTestCase (std::string name, std::string schedulerType)
472  : TestCase ("Test: " + name),
473  m_schedulerType (schedulerType)
474 {
475  m_dlBandwidth = 25;
476  m_ulBandwidth = 25;
477  m_usedWrongDlRbg = false;
478  m_usedWrongUlRbg = false;
479 }
481 {
482 }
483 
484 void
486 {
487  //need time to report new UE measurements, and wait because of filtering
488  if ( (Simulator::Now () - m_teleportTime ) < MilliSeconds (400))
489  {
490  return;
491  }
492 
493  NS_LOG_DEBUG ("DL DATA Power allocation :");
494  Values::const_iterator it;
495  uint32_t i = 0;
496  for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
497  {
498  double power = (*it) * (m_dlBandwidth * 180000);
499  NS_LOG_DEBUG ("RB " << i << " POWER: " << " " << power);
500  NS_LOG_DEBUG ("RB " << i << " POWER: " << " " << power
501  << " Available: " << m_expectedDlRb[i] << " Expected Power: " << m_expectedDlPower );
502 
503  if (m_expectedDlRb[i] == false && power > 0)
504  {
505  m_usedWrongDlRbg = true;
506  }
507  else if (m_expectedDlRb[i] == true && power > 0)
508  {
510  "Wrong Data Channel DL Power level");
511  }
512  i++;
513  }
514 }
515 
516 void
518 {
519  //need time to report new UE measurements, and wait because of filtering
520  if ( (Simulator::Now () - m_teleportTime ) < MilliSeconds (400))
521  {
522  return;
523  }
524 
525  NS_LOG_DEBUG ("UL DATA Power allocation :");
526  Values::const_iterator it;
527  uint32_t i = 0;
528  for (it = spectrumValue->ConstValuesBegin (); it != spectrumValue->ConstValuesEnd (); it++)
529  {
530  double power = (*it) * (m_ulBandwidth * 180000);
531  NS_LOG_DEBUG ("RB " << i << " POWER: " << power << " expectedUlPower: " << m_expectedUlPower);
532  if (m_expectedUlRb[i] == false && power > 0)
533  {
534  m_usedWrongUlRbg = true;
535  }
536  else if (m_expectedUlRb[i] == true && power > 0)
537  {
539  "Wrong Data Channel UL Power level" << Simulator::Now ().GetSeconds ());
540  }
541  i++;
542  }
543 }
544 
545 void
547 {
548  NS_LOG_FUNCTION (this);
549  NS_LOG_DEBUG ("Teleport UE to : (" << x << ", " << y << ", 0)");
551  m_ueMobility->SetPosition (Vector (x, y, 0.0));
552 }
553 
554 void
555 LteFrAreaTestCase::TeleportUe (uint32_t x, uint32_t y, double expectedPower,
556  std::vector<bool> expectedDlRb)
557 {
558  NS_LOG_FUNCTION (this);
559  NS_LOG_DEBUG ("Teleport UE to : (" << x << ", " << y << ", 0)");
561  m_ueMobility->SetPosition (Vector (x, y, 0.0));
562  m_expectedDlPower = expectedPower;
563  m_expectedDlRb = expectedDlRb;
564 }
565 
566 void
567 LteFrAreaTestCase::TeleportUe2 (Ptr<Node> ueNode, uint32_t x, uint32_t y, double expectedPower,
568  std::vector<bool> expectedDlRb)
569 {
570  NS_LOG_FUNCTION (this);
571  NS_LOG_DEBUG ("Teleport UE to : (" << x << ", " << y << ", 0)");
572 
573  Ptr<MobilityModel> ueMobility = ueNode->GetObject<MobilityModel> ();
574  ueMobility->SetPosition (Vector (x, y, 0.0));
576  m_expectedDlPower = expectedPower;
577  m_expectedDlRb = expectedDlRb;
578 }
579 
580 void
581 LteFrAreaTestCase::SetDlExpectedValues (double expectedDlPower, std::vector<bool> expectedDlRb)
582 {
583  NS_LOG_FUNCTION (this);
584  m_expectedDlPower = expectedDlPower;
585  m_expectedDlRb = expectedDlRb;
586 }
587 
588 void
589 LteFrAreaTestCase::SetUlExpectedValues (double expectedUlPower, std::vector<bool> expectedUlRb)
590 {
591  NS_LOG_FUNCTION (this);
592  m_expectedUlPower = expectedUlPower;
593  m_expectedUlRb = expectedUlRb;
594 }
595 
596 void
598 {
599 }
600 
601 LteStrictFrAreaTestCase::LteStrictFrAreaTestCase (std::string name, std::string schedulerType)
602  : LteFrAreaTestCase (name, schedulerType)
603 {
604  NS_LOG_INFO ("Creating LteFrTestCase");
605 }
606 
608 {
609 }
610 
611 void
613 {
614  NS_LOG_DEBUG ("LteStrictFrAreaTestCase");
615 
616  Config::Reset ();
617  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
618  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
619  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
620 
621  double eNbTxPower = 30;
622  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (eNbTxPower));
623  Config::SetDefault ("ns3::LteUePhy::TxPower", DoubleValue (10.0));
624  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (true));
625 
626  Config::SetDefault ("ns3::LteUePowerControl::ClosedLoop", BooleanValue (true));
627  Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
628 
629  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
630 
631  // Create Nodes: eNodeB and UE
632  NodeContainer enbNodes;
633  NodeContainer ueNodes1;
634  NodeContainer ueNodes2;
635  enbNodes.Create (2);
636  ueNodes1.Create (1);
637  ueNodes2.Create (1);
638  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
639 
640  /*
641  * The topology is the following:
642  *
643  * eNB1 UE1 eNB2
644  * | | |
645  * x ------------ x ------------------------ x ------------ x----UE2
646  * 200 m 600 m 200 m 20 m
647  *
648  */
649 
650  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
651  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
652  positionAlloc->Add (Vector (1000, 0.0, 0.0)); // eNB2
653  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // UE1
654  positionAlloc->Add (Vector (1020, 0.0, 0.0)); // UE2
655  MobilityHelper mobility;
656  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
657  mobility.SetPositionAllocator (positionAlloc);
658  mobility.Install (allNodes);
659  m_ueMobility = ueNodes1.Get (0)->GetObject<MobilityModel> ();
660 
661  // Disable layer-3 filtering
662  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
663  UintegerValue (0));
664  Config::SetDefault ("ns3::LteEnbRrc::RsrqFilterCoefficient",
665  UintegerValue (0));
666 
667  // Create Devices and install them in the Nodes (eNB and UE)
668  NetDeviceContainer enbDevs;
669  NetDeviceContainer ueDevs1;
670  NetDeviceContainer ueDevs2;
671  lteHelper->SetSchedulerType (m_schedulerType);
672 
673  lteHelper->SetFfrAlgorithmType ("ns3::LteFrStrictAlgorithm");
674  lteHelper->SetFfrAlgorithmAttribute ("RsrqThreshold", UintegerValue (25));
675  lteHelper->SetFfrAlgorithmAttribute ("CenterPowerOffset",
676  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
677  lteHelper->SetFfrAlgorithmAttribute ("EdgePowerOffset",
678  UintegerValue (LteRrcSap::PdschConfigDedicated::dB3));
679 
680  lteHelper->SetFfrAlgorithmAttribute ("DlCommonSubBandwidth", UintegerValue (6));
681  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandOffset", UintegerValue (6));
682  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandwidth", UintegerValue (6));
683 
684  lteHelper->SetFfrAlgorithmAttribute ("UlCommonSubBandwidth", UintegerValue (6));
685  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandOffset", UintegerValue (6));
686  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandwidth", UintegerValue (6));
687  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0)));
688 
689  lteHelper->SetFfrAlgorithmType ("ns3::LteFrNoOpAlgorithm");
690  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1)));
691 
692  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
693  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
694 
695  // Attach a UE to a eNB
696  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
697  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
698 
699  // Activate an EPS bearer
700  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
701  EpsBearer bearer (q);
702  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
703  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
704 
705  //Test SpectrumPhy to get signals form DL channel
706  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
707  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
708 
709  Ptr<LteSimpleSpectrumPhy> testDlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
710  Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
711  testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetDlEarfcn (), m_dlBandwidth));
712  dlChannel->AddRx (testDlSpectrumPhy);
713 
714  testDlSpectrumPhy->SetCellId (1);
715 
716  testDlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
718 
719  //Test SpectrumPhy to get signals form UL channel
720  Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetUplinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
721  Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel ();
722 
723  Ptr<LteSimpleSpectrumPhy> testUlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
724  testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetUlEarfcn (), m_ulBandwidth));
725  ulChannel->AddRx (testUlSpectrumPhy);
726 
727  testUlSpectrumPhy->SetCellId (1);
728 
729  testUlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
731 
732  std::vector<bool> expectedDlRbCenterArea;
733  expectedDlRbCenterArea.resize (m_dlBandwidth, false);
734  std::vector<bool> expectedUlRbCenterArea;
735  expectedUlRbCenterArea.resize (m_ulBandwidth, false);
736  for (uint32_t i = 0; i < 6; i++)
737  {
738  expectedDlRbCenterArea[i] = true;
739  expectedUlRbCenterArea[i] = true;
740  }
741 
742  std::vector<bool> expectedDlRbEdgeArea;
743  expectedDlRbEdgeArea.resize (m_dlBandwidth, false);
744  std::vector<bool> expectedUlRbEdgeArea;
745  expectedUlRbEdgeArea.resize (m_ulBandwidth, false);
746  for (uint32_t i = 12; i < 18; i++)
747  {
748  expectedDlRbEdgeArea[i] = true;
749  expectedUlRbEdgeArea[i] = true;
750  }
751 
752  Simulator::Schedule (MilliSeconds (1),
753  &LteFrAreaTestCase::TeleportUe, this, 200, 0, 1, expectedDlRbCenterArea );
754  Simulator::Schedule (MilliSeconds (1),
755  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0150543, expectedUlRbCenterArea );
756 
757  Simulator::Schedule (MilliSeconds (501),
758  &LteFrAreaTestCase::TeleportUe, this, 800, 0, 2, expectedDlRbEdgeArea );
759  Simulator::Schedule (MilliSeconds (501),
760  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.199526, expectedUlRbEdgeArea );
761 
762  Simulator::Schedule (MilliSeconds (1001),
763  &LteFrAreaTestCase::TeleportUe, this, 200, 0, 1, expectedDlRbCenterArea );
764  Simulator::Schedule (MilliSeconds (1001),
765  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0150543, expectedUlRbCenterArea );
766 
767  Simulator::Stop (Seconds (1.500));
768  Simulator::Run ();
769 
771  "Scheduler used DL RB muted by FFR Algorithm");
773  "Scheduler used UL RB muted by FFR Algorithm");
774 
775  Simulator::Destroy ();
776 }
777 
778 LteSoftFrAreaTestCase::LteSoftFrAreaTestCase (std::string name, std::string schedulerType)
779  : LteFrAreaTestCase (name, schedulerType)
780 {
781  NS_LOG_INFO ("Creating LteSoftFrAreaTestCase");
782 }
783 
785 {
786 }
787 
788 void
790 {
791  NS_LOG_DEBUG ("LteSoftFrAreaTestCase");
792 
793  Config::Reset ();
794  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
795  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
796  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
797 
798  double eNbTxPower = 30;
799  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (eNbTxPower));
800  Config::SetDefault ("ns3::LteUePhy::TxPower", DoubleValue (10.0));
801  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (true));
802 
803  Config::SetDefault ("ns3::LteUePowerControl::ClosedLoop", BooleanValue (true));
804  Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
805 
806  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
807 
808  // Create Nodes: eNodeB and UE
809  NodeContainer enbNodes;
810  NodeContainer ueNodes1;
811  NodeContainer ueNodes2;
812  enbNodes.Create (2);
813  ueNodes1.Create (1);
814  ueNodes2.Create (1);
815  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
816 
817  /*
818  * The topology is the following:
819  *
820  * eNB1 UE1 eNB2
821  * | | |
822  * x ------------ x ------------------------ x ------------ x----UE2
823  * 200 m 600 m 200 m 20 m
824  *
825  */
826 
827  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
828  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
829  positionAlloc->Add (Vector (1000, 0.0, 0.0)); // eNB2
830  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // UE1
831  positionAlloc->Add (Vector (1020, 0.0, 0.0)); // UE2
832  MobilityHelper mobility;
833  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
834  mobility.SetPositionAllocator (positionAlloc);
835  mobility.Install (allNodes);
836  m_ueMobility = ueNodes1.Get (0)->GetObject<MobilityModel> ();
837 
838  // Disable layer-3 filtering
839  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
840  UintegerValue (0));
841  Config::SetDefault ("ns3::LteEnbRrc::RsrqFilterCoefficient",
842  UintegerValue (0));
843 
844  // Create Devices and install them in the Nodes (eNB and UE)
845  NetDeviceContainer enbDevs;
846  NetDeviceContainer ueDevs1;
847  NetDeviceContainer ueDevs2;
848  lteHelper->SetSchedulerType (m_schedulerType);
849 
850  lteHelper->SetFfrAlgorithmType ("ns3::LteFrSoftAlgorithm");
851  lteHelper->SetFfrAlgorithmAttribute ("AllowCenterUeUseEdgeSubBand", BooleanValue (false));
852  lteHelper->SetFfrAlgorithmAttribute ("RsrqThreshold", UintegerValue (25));
853  lteHelper->SetFfrAlgorithmAttribute ("CenterPowerOffset",
854  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
855  lteHelper->SetFfrAlgorithmAttribute ("EdgePowerOffset",
856  UintegerValue (LteRrcSap::PdschConfigDedicated::dB3));
857 
858  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandOffset", UintegerValue (8));
859  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandwidth", UintegerValue (8));
860  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandOffset", UintegerValue (8));
861  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandwidth", UintegerValue (8));
862  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0)));
863 
864  lteHelper->SetFfrAlgorithmType ("ns3::LteFrNoOpAlgorithm");
865  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1)));
866 
867  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
868  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
869 
870  // Attach a UE to a eNB
871  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
872  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
873 
874  // Activate an EPS bearer
875  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
876  EpsBearer bearer (q);
877  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
878  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
879 
880  //Test SpectrumPhy to get signals form DL channel
881  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
882  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
883 
884  Ptr<LteSimpleSpectrumPhy> testDlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
885  Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
886  testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetDlEarfcn (), m_dlBandwidth));
887  dlChannel->AddRx (testDlSpectrumPhy);
888 
889  testDlSpectrumPhy->SetCellId (1);
890 
891  testDlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
893 
894  //Test SpectrumPhy to get signals form UL channel
895  Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetUplinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
896  Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel ();
897 
898  Ptr<LteSimpleSpectrumPhy> testUlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
899  testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetUlEarfcn (), m_ulBandwidth));
900  ulChannel->AddRx (testUlSpectrumPhy);
901 
902  testUlSpectrumPhy->SetCellId (1);
903 
904  testUlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
906 
907 
908  std::vector<bool> expectedDlRbCenterArea;
909  expectedDlRbCenterArea.resize (m_dlBandwidth, false);
910  std::vector<bool> expectedUlRbCenterArea;
911  expectedUlRbCenterArea.resize (m_ulBandwidth, false);
912  for (uint32_t i = 0; i < 8; i++)
913  {
914  expectedDlRbCenterArea[i] = true;
915  expectedUlRbCenterArea[i] = true;
916  }
917  for (uint32_t i = 16; i < 25; i++)
918  {
919  expectedDlRbCenterArea[i] = true;
920  }
921 
922  std::vector<bool> expectedDlRbEdgeArea;
923  expectedDlRbEdgeArea.resize (m_dlBandwidth, false);
924  std::vector<bool> expectedUlRbEdgeArea;
925  expectedUlRbEdgeArea.resize (m_ulBandwidth, false);
926  for (uint32_t i = 8; i < 16; i++)
927  {
928  expectedDlRbEdgeArea[i] = true;
929  expectedUlRbEdgeArea[i] = true;
930  }
931 
932  Simulator::Schedule (MilliSeconds (1),
933  &LteFrAreaTestCase::TeleportUe, this, 200, 0, 1, expectedDlRbCenterArea );
934  Simulator::Schedule (MilliSeconds (1),
935  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0150543, expectedUlRbCenterArea );
936 
937  Simulator::Schedule (MilliSeconds (501),
938  &LteFrAreaTestCase::TeleportUe, this, 800, 0, 2, expectedDlRbEdgeArea );
939  Simulator::Schedule (MilliSeconds (501),
940  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.199526, expectedUlRbEdgeArea );
941 
942  Simulator::Schedule (MilliSeconds (1001),
943  &LteFrAreaTestCase::TeleportUe, this, 200, 0, 1, expectedDlRbCenterArea );
944  Simulator::Schedule (MilliSeconds (1001),
945  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0150543, expectedUlRbCenterArea );
946 
947  Simulator::Stop (Seconds (1.500));
948  Simulator::Run ();
949 
950 #if 0
952  "Scheduler used DL RBG muted by FFR Algorithm");
953 
954 #endif
956  "Scheduler used UL RB muted by FFR Algorithm");
957 
958  Simulator::Destroy ();
959 }
960 
961 LteSoftFfrAreaTestCase::LteSoftFfrAreaTestCase (std::string name, std::string schedulerType)
962  : LteFrAreaTestCase (name, schedulerType)
963 {
964  NS_LOG_INFO ("Creating LteSoftFfrAreaTestCase");
965 }
966 
968 {
969 }
970 
971 void
973 {
974  NS_LOG_DEBUG ("LteSoftFfrAreaTestCase");
975 
976  Config::Reset ();
977  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
978  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
979  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
980 
981  double eNbTxPower = 30;
982  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (eNbTxPower));
983  Config::SetDefault ("ns3::LteUePhy::TxPower", DoubleValue (10.0));
984  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (true));
985 
986  Config::SetDefault ("ns3::LteUePowerControl::ClosedLoop", BooleanValue (true));
987  Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
988 
989  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
990 
991  // Create Nodes: eNodeB and UE
992  NodeContainer enbNodes;
993  NodeContainer ueNodes1;
994  NodeContainer ueNodes2;
995  enbNodes.Create (2);
996  ueNodes1.Create (1);
997  ueNodes2.Create (1);
998  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
999 
1000  /*
1001  * The topology is the following:
1002  *
1003  * eNB1 UE1 eNB2
1004  * | | |
1005  * x ------------ x ------------------------ x ------------ x----UE2
1006  * 200 m 600 m 200 m 20 m
1007  *
1008  */
1009 
1010  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
1011  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
1012  positionAlloc->Add (Vector (1000, 0.0, 0.0)); // eNB2
1013  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // UE1
1014  positionAlloc->Add (Vector (1020, 0.0, 0.0)); // UE2
1015  MobilityHelper mobility;
1016  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
1017  mobility.SetPositionAllocator (positionAlloc);
1018  mobility.Install (allNodes);
1019  m_ueMobility = ueNodes1.Get (0)->GetObject<MobilityModel> ();
1020 
1021  // Disable layer-3 filtering
1022  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
1023  UintegerValue (0));
1024  Config::SetDefault ("ns3::LteEnbRrc::RsrqFilterCoefficient",
1025  UintegerValue (0));
1026 
1027  // Create Devices and install them in the Nodes (eNB and UE)
1028  NetDeviceContainer enbDevs;
1029  NetDeviceContainer ueDevs1;
1030  NetDeviceContainer ueDevs2;
1031  lteHelper->SetSchedulerType (m_schedulerType);
1032 
1033  lteHelper->SetFfrAlgorithmType ("ns3::LteFfrSoftAlgorithm");
1034  lteHelper->SetFfrAlgorithmAttribute ("CenterRsrqThreshold", UintegerValue (28));
1035  lteHelper->SetFfrAlgorithmAttribute ("EdgeRsrqThreshold", UintegerValue (18));
1036  lteHelper->SetFfrAlgorithmAttribute ("CenterAreaPowerOffset",
1037  UintegerValue (LteRrcSap::PdschConfigDedicated::dB_3));
1038  lteHelper->SetFfrAlgorithmAttribute ("MediumAreaPowerOffset",
1039  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
1040  lteHelper->SetFfrAlgorithmAttribute ("EdgeAreaPowerOffset",
1041  UintegerValue (LteRrcSap::PdschConfigDedicated::dB3));
1042 
1043  lteHelper->SetFfrAlgorithmAttribute ("UlCommonSubBandwidth", UintegerValue (6));
1044  lteHelper->SetFfrAlgorithmAttribute ("DlCommonSubBandwidth", UintegerValue (6));
1045 
1046  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandOffset", UintegerValue (6));
1047  lteHelper->SetFfrAlgorithmAttribute ("DlEdgeSubBandwidth", UintegerValue (6));
1048  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandOffset", UintegerValue (6));
1049  lteHelper->SetFfrAlgorithmAttribute ("UlEdgeSubBandwidth", UintegerValue (6));
1050  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0)));
1051 
1052  lteHelper->SetFfrAlgorithmType ("ns3::LteFrNoOpAlgorithm");
1053  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1)));
1054 
1055  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
1056  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
1057 
1058  // Attach a UE to a eNB
1059  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
1060  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
1061 
1062  // Activate an EPS bearer
1063  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
1064  EpsBearer bearer (q);
1065  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
1066  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
1067 
1068  //Test SpectrumPhy to get signals form DL channel
1069  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
1070  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
1071 
1072  Ptr<LteSimpleSpectrumPhy> testDlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
1073  Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
1074  testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetDlEarfcn (), m_dlBandwidth));
1075  dlChannel->AddRx (testDlSpectrumPhy);
1076 
1077  testDlSpectrumPhy->SetCellId (1);
1078 
1079  testDlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
1081 
1082  //Test SpectrumPhy to get signals form UL channel
1083  Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetUplinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
1084  Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel ();
1085 
1086  Ptr<LteSimpleSpectrumPhy> testUlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
1087  testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetUlEarfcn (), m_ulBandwidth));
1088  ulChannel->AddRx (testUlSpectrumPhy);
1089 
1090  testUlSpectrumPhy->SetCellId (1);
1091 
1092  testUlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
1094 
1095  double expectedDlPowerCenterArea = 0.5;
1096  std::vector<bool> expectedDlRbCenterArea;
1097  expectedDlRbCenterArea.resize (m_dlBandwidth, false);
1098  std::vector<bool> expectedUlRbCenterArea;
1099  expectedUlRbCenterArea.resize (m_ulBandwidth, false);
1100  for (uint32_t i = 6; i < 12; i++)
1101  {
1102  expectedDlRbCenterArea[i] = true;
1103  expectedUlRbCenterArea[i] = true;
1104  }
1105  for (uint32_t i = 18; i < 25; i++)
1106  {
1107  expectedDlRbCenterArea[i] = true;
1108  expectedUlRbCenterArea[i] = true;
1109  }
1110 
1111  double expectedDlPowerMiddleArea = 1.0;
1112  std::vector<bool> expectedDlRbMiddleArea;
1113  expectedDlRbMiddleArea.resize (m_dlBandwidth, false);
1114  std::vector<bool> expectedUlRbMiddleArea;
1115  expectedUlRbMiddleArea.resize (m_ulBandwidth, false);
1116  for (uint32_t i = 0; i < 6; i++)
1117  {
1118  expectedDlRbMiddleArea[i] = true;
1119  expectedUlRbMiddleArea[i] = true;
1120  }
1121 
1122  double expectedDlPowerEdgeArea = 2.0;
1123  std::vector<bool> expectedDlRbEdgeArea;
1124  expectedDlRbEdgeArea.resize (m_dlBandwidth, false);
1125  std::vector<bool> expectedUlRbEdgeArea;
1126  expectedUlRbEdgeArea.resize (m_ulBandwidth, false);
1127  for (uint32_t i = 12; i < 18; i++)
1128  {
1129  expectedDlRbEdgeArea[i] = true;
1130  expectedUlRbEdgeArea[i] = true;
1131  }
1132 
1133  Simulator::Schedule (MilliSeconds (1),
1134  &LteFrAreaTestCase::TeleportUe, this, 200, 0,
1135  expectedDlPowerCenterArea, expectedDlRbCenterArea );
1136  Simulator::Schedule (MilliSeconds (1),
1137  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0150543, expectedUlRbCenterArea );
1138 
1139  Simulator::Schedule (MilliSeconds (501),
1140  &LteFrAreaTestCase::TeleportUe, this, 600, 0,
1141  expectedDlPowerMiddleArea, expectedDlRbMiddleArea );
1142  Simulator::Schedule (MilliSeconds (501),
1143  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.135489, expectedUlRbMiddleArea );
1144 
1145  Simulator::Schedule (MilliSeconds (1001),
1146  &LteFrAreaTestCase::TeleportUe, this, 800, 0,
1147  expectedDlPowerEdgeArea, expectedDlRbEdgeArea );
1148  Simulator::Schedule (MilliSeconds (1001),
1149  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.199526, expectedUlRbEdgeArea );
1150 
1151  Simulator::Schedule (MilliSeconds (1501),
1152  &LteFrAreaTestCase::TeleportUe, this, 600, 0,
1153  expectedDlPowerMiddleArea, expectedDlRbMiddleArea );
1154  Simulator::Schedule (MilliSeconds (1501),
1155  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.135489, expectedUlRbMiddleArea );
1156 
1157  Simulator::Schedule (MilliSeconds (2001),
1158  &LteFrAreaTestCase::TeleportUe, this, 200, 0,
1159  expectedDlPowerCenterArea, expectedDlRbCenterArea );
1160  Simulator::Schedule (MilliSeconds (2001),
1161  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0150543, expectedUlRbCenterArea );
1162 
1163  Simulator::Stop (Seconds (2.500));
1164  Simulator::Run ();
1165 
1167  "Scheduler used DL RBG muted by FFR Algorithm");
1168 
1170  "Scheduler used UL RB muted by FFR Algorithm");
1171 
1172  Simulator::Destroy ();
1173 }
1174 
1175 
1176 LteEnhancedFfrAreaTestCase::LteEnhancedFfrAreaTestCase (std::string name, std::string schedulerType)
1177  : LteFrAreaTestCase (name, schedulerType)
1178 {
1179  NS_LOG_INFO ("Creating LteEnhancedFfrAreaTestCase");
1180 }
1181 
1183 {
1184 }
1185 
1186 void
1188 {
1189  NS_LOG_DEBUG ("LteEnhancedFfrAreaTestCase");
1190 
1191  Config::Reset ();
1192  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
1193  Config::SetDefault ("ns3::LteHelper::UsePdschForCqiGeneration", BooleanValue (true));
1194  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
1195  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
1196 
1197  double eNbTxPower = 30;
1198  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (eNbTxPower));
1199  Config::SetDefault ("ns3::LteUePhy::TxPower", DoubleValue (10.0));
1200  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (true));
1201 
1202  Config::SetDefault ("ns3::LteUePowerControl::ClosedLoop", BooleanValue (true));
1203  Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
1204 
1205 
1206  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
1207 
1208  // Create Nodes: eNodeB and UE
1209  NodeContainer enbNodes;
1210  NodeContainer ueNodes1;
1211  NodeContainer ueNodes2;
1212  enbNodes.Create (2);
1213  ueNodes1.Create (1);
1214  ueNodes2.Create (1);
1215  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
1216 
1217  /*
1218  * The topology is the following:
1219  *
1220  * eNB1 UE1 eNB2
1221  * | | |
1222  * x ------------ x ------------------------ x ------------ x----UE2
1223  * 200 m 600 m 200 m 20 m
1224  *
1225  */
1226 
1227  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
1228  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
1229  positionAlloc->Add (Vector (1000, 0.0, 0.0)); // eNB2
1230  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // UE1
1231  positionAlloc->Add (Vector (1020, 0.0, 0.0)); // UE2
1232  MobilityHelper mobility;
1233  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
1234  mobility.SetPositionAllocator (positionAlloc);
1235  mobility.Install (allNodes);
1236  m_ueMobility = ueNodes1.Get (0)->GetObject<MobilityModel> ();
1237 
1238  // Disable layer-3 filtering
1239  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
1240  UintegerValue (0));
1241  Config::SetDefault ("ns3::LteEnbRrc::RsrqFilterCoefficient",
1242  UintegerValue (0));
1243 
1244  // Create Devices and install them in the Nodes (eNB and UE)
1245  NetDeviceContainer enbDevs;
1246  NetDeviceContainer ueDevs1;
1247  NetDeviceContainer ueDevs2;
1248  lteHelper->SetSchedulerType (m_schedulerType);
1249  lteHelper->SetSchedulerAttribute ("HarqEnabled", BooleanValue (true));
1250 
1251  lteHelper->SetEnbDeviceAttribute ("DlBandwidth", UintegerValue (m_dlBandwidth));
1252  lteHelper->SetEnbDeviceAttribute ("UlBandwidth", UintegerValue (m_ulBandwidth));
1253 
1254  lteHelper->SetFfrAlgorithmType ("ns3::LteFfrEnhancedAlgorithm");
1255  lteHelper->SetFfrAlgorithmAttribute ("RsrqThreshold", UintegerValue (25));
1256  lteHelper->SetFfrAlgorithmAttribute ("DlCqiThreshold", UintegerValue (10));
1257  lteHelper->SetFfrAlgorithmAttribute ("UlCqiThreshold", UintegerValue (15));
1258  lteHelper->SetFfrAlgorithmAttribute ("CenterAreaPowerOffset",
1259  UintegerValue (LteRrcSap::PdschConfigDedicated::dB_6));
1260  lteHelper->SetFfrAlgorithmAttribute ("EdgeAreaPowerOffset",
1261  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
1262 
1263  lteHelper->SetFfrAlgorithmAttribute ("UlSubBandOffset", UintegerValue (0));
1264  lteHelper->SetFfrAlgorithmAttribute ("UlReuse3SubBandwidth", UintegerValue (4));
1265  lteHelper->SetFfrAlgorithmAttribute ("UlReuse1SubBandwidth", UintegerValue (4));
1266 
1267  lteHelper->SetFfrAlgorithmAttribute ("DlSubBandOffset", UintegerValue (0));
1268  lteHelper->SetFfrAlgorithmAttribute ("DlReuse3SubBandwidth", UintegerValue (4));
1269  lteHelper->SetFfrAlgorithmAttribute ("DlReuse1SubBandwidth", UintegerValue (4));
1270 
1271  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (0)));
1272 
1273  lteHelper->SetFfrAlgorithmType ("ns3::LteFrNoOpAlgorithm");
1274  enbDevs.Add (lteHelper->InstallEnbDevice (enbNodes.Get (1)));
1275 
1276  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
1277  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
1278 
1279  // Attach a UE to a eNB
1280  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
1281  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
1282 
1283  // Activate an EPS bearer
1284  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
1285  EpsBearer bearer (q);
1286  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
1287  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
1288 
1289  //Test SpectrumPhy to get signals form DL channel
1290  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
1291  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
1292 
1293  Ptr<LteSimpleSpectrumPhy> testDlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
1294  Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
1295  testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetDlEarfcn (), m_dlBandwidth));
1296  dlChannel->AddRx (testDlSpectrumPhy);
1297 
1298  testDlSpectrumPhy->SetCellId (1);
1299 
1300  testDlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
1302 
1303  //Test SpectrumPhy to get signals form UL channel
1304  Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetUplinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
1305  Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel ();
1306 
1307  Ptr<LteSimpleSpectrumPhy> testUlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
1308  testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetUlEarfcn (), m_ulBandwidth));
1309  ulChannel->AddRx (testUlSpectrumPhy);
1310 
1311  testUlSpectrumPhy->SetCellId (1);
1312 
1313  testUlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
1315 
1316  double expectedDlPowerCenterArea = 0.251189;
1317  std::vector<bool> expectedDlRbCenterArea;
1318  expectedDlRbCenterArea.resize (m_dlBandwidth, false);
1319  std::vector<bool> expectedUlRbCenterArea;
1320  expectedUlRbCenterArea.resize (m_ulBandwidth, false);
1321  for (uint32_t i = 0; i < 8; i++)
1322  {
1323  expectedDlRbCenterArea[i] = true;
1324  expectedUlRbCenterArea[i] = true;
1325  }
1326  for (uint32_t i = 12; i < 16; i++)
1327  {
1328  expectedDlRbCenterArea[i] = true;
1329  expectedUlRbCenterArea[i] = true;
1330  }
1331  for (uint32_t i = 20; i < 24; i++)
1332  {
1333  expectedDlRbCenterArea[i] = true;
1334  expectedUlRbCenterArea[i] = true;
1335  }
1336 
1337  double expectedDlPowerMiddleArea = 0.251189;
1338  std::vector<bool> expectedDlRbMiddleArea;
1339  expectedDlRbMiddleArea.resize (m_dlBandwidth, false);
1340  std::vector<bool> expectedUlRbMiddleArea;
1341  expectedUlRbMiddleArea.resize (m_ulBandwidth, false);
1342  for (uint32_t i = 4; i < 8; i++)
1343  {
1344  expectedDlRbMiddleArea[i] = true;
1345  expectedUlRbMiddleArea[i] = true;
1346  }
1347 
1348  double expectedDlPowerEdgeArea = 1.0;
1349  std::vector<bool> expectedDlRbEdgeArea;
1350  expectedDlRbEdgeArea.resize (m_dlBandwidth, false);
1351  std::vector<bool> expectedUlRbEdgeArea;
1352  expectedUlRbEdgeArea.resize (m_ulBandwidth, false);
1353  for (uint32_t i = 0; i < 4; i++)
1354  {
1355  expectedDlRbEdgeArea[i] = true;
1356  expectedUlRbEdgeArea[i] = true;
1357  }
1358 
1359  Simulator::Schedule (MilliSeconds (1),
1361  expectedDlPowerCenterArea, expectedDlRbCenterArea );
1362  Simulator::Schedule (MilliSeconds (1),
1363  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.00250905, expectedUlRbCenterArea );
1364 
1365  Simulator::Schedule (MilliSeconds (501),
1367  expectedDlPowerMiddleArea, expectedDlRbMiddleArea );
1368  Simulator::Schedule (MilliSeconds (501),
1369  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0225815, expectedUlRbMiddleArea );
1370 
1371  Simulator::Schedule (MilliSeconds (1001),
1373  expectedDlPowerEdgeArea, expectedDlRbEdgeArea );
1374  Simulator::Schedule (MilliSeconds (1001),
1375  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0903259, expectedUlRbEdgeArea );
1376 
1377  Simulator::Schedule (MilliSeconds (1501),
1379  expectedDlPowerCenterArea, expectedDlRbCenterArea );
1380  Simulator::Schedule (MilliSeconds (1501),
1381  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.00250905, expectedUlRbCenterArea );
1382 
1383  Simulator::Schedule (MilliSeconds (2001),
1385  expectedDlPowerMiddleArea, expectedDlRbMiddleArea );
1386  Simulator::Schedule (MilliSeconds (2001),
1387  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0225815, expectedUlRbCenterArea );
1388 
1389  Simulator::Stop (Seconds (2.500));
1390  Simulator::Run ();
1391 
1393  "Scheduler used DL RBG muted by FFR Algorithm");
1394 
1396  "Scheduler used UL RB muted by FFR Algorithm");
1397 
1398  Simulator::Destroy ();
1399 }
1400 
1401 
1402 LteDistributedFfrAreaTestCase::LteDistributedFfrAreaTestCase (std::string name, std::string schedulerType)
1403  : LteFrAreaTestCase (name, schedulerType)
1404 {
1405  NS_LOG_INFO ("Creating LteDistributedFfrAreaTestCase");
1406 }
1407 
1409 {
1410 }
1411 
1412 void
1414 {
1415  NS_LOG_DEBUG ("LteDistributedFfrAreaTestCase");
1416 
1417  Config::Reset ();
1418  Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
1419  Config::SetDefault ("ns3::LteHelper::UsePdschForCqiGeneration", BooleanValue (true));
1420  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
1421  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
1422 
1423  double eNbTxPower = 30;
1424  Config::SetDefault ("ns3::LteEnbPhy::TxPower", DoubleValue (eNbTxPower));
1425  Config::SetDefault ("ns3::LteUePhy::TxPower", DoubleValue (10.0));
1426  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (true));
1427 
1428  Config::SetDefault ("ns3::LteUePowerControl::ClosedLoop", BooleanValue (true));
1429  Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
1430 
1431  // Disable layer-3 filtering
1432  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
1433  UintegerValue (0));
1434  Config::SetDefault ("ns3::LteEnbRrc::RsrqFilterCoefficient",
1435  UintegerValue (0));
1436 
1437  uint8_t bandwidth = 25;
1438 
1439  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
1440  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
1441  lteHelper->SetEpcHelper (epcHelper);
1442  lteHelper->SetHandoverAlgorithmType ("ns3::NoOpHandoverAlgorithm"); // disable automatic handover
1443 
1444  Ptr<Node> pgw = epcHelper->GetPgwNode ();
1445 
1446  // Create a single RemoteHost
1447  NodeContainer remoteHostContainer;
1448  remoteHostContainer.Create (1);
1449  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
1450  InternetStackHelper internet;
1451  internet.Install (remoteHostContainer);
1452 
1453  // Create the Internet
1454  PointToPointHelper p2ph;
1455  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
1456  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
1457  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
1458  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
1459  Ipv4AddressHelper ipv4h;
1460  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
1461  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
1462  Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
1463 
1464  // Routing of the Internet Host (towards the LTE network)
1465  Ipv4StaticRoutingHelper ipv4RoutingHelper;
1466  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
1467  // interface 0 is localhost, 1 is the p2p device
1468  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
1469 
1470  // Create Nodes: eNodeB and UE
1471  NodeContainer enbNodes;
1472  NodeContainer ueNodes1;
1473  NodeContainer ueNodes2;
1474  enbNodes.Create (2);
1475  ueNodes1.Create (2);
1476  ueNodes2.Create (1);
1477  NodeContainer ueNodes = NodeContainer ( ueNodes1, ueNodes2);
1478  NodeContainer allNodes = NodeContainer ( enbNodes, ueNodes1, ueNodes2);
1479 
1480  /*
1481  * The topology is the following:
1482  *
1483  * eNB1 UE1 UE2 eNB2
1484  * | | | |
1485  * x ------------ x ------------------------ x ------------ x
1486  * 200 m 600 m 200 m
1487  *
1488  */
1489 
1490  // Install Mobility Model
1491  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
1492  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
1493  positionAlloc->Add (Vector (1000, 0.0, 0.0)); // eNB2
1494 
1495  positionAlloc->Add (Vector (200, 0.0, 0.0)); // UE1
1496  positionAlloc->Add (Vector (200, 0.0, 0.0)); // UE1
1497  positionAlloc->Add (Vector (800, 0.0, 0.0)); // UE2
1498 
1499  MobilityHelper mobility;
1500  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
1501  mobility.SetPositionAllocator (positionAlloc);
1502  mobility.Install (allNodes);
1503  m_ueMobility = ueNodes2.Get (0)->GetObject<MobilityModel> ();
1504 
1505  // Create Devices and install them in the Nodes (eNB and UE)
1506  NetDeviceContainer enbDevs;
1507  NetDeviceContainer ueDevs1;
1508  NetDeviceContainer ueDevs2;
1509  lteHelper->SetSchedulerType (m_schedulerType);
1510 
1511  lteHelper->SetEnbDeviceAttribute ("DlBandwidth", UintegerValue (bandwidth));
1512  lteHelper->SetEnbDeviceAttribute ("UlBandwidth", UintegerValue (bandwidth));
1513 
1514  lteHelper->SetFfrAlgorithmType ("ns3::LteFfrDistributedAlgorithm");
1515  lteHelper->SetFfrAlgorithmAttribute ("CalculationInterval", TimeValue (MilliSeconds (10)));
1516  lteHelper->SetFfrAlgorithmAttribute ("RsrqThreshold", UintegerValue (25));
1517  lteHelper->SetFfrAlgorithmAttribute ("RsrpDifferenceThreshold", UintegerValue (5));
1518  lteHelper->SetFfrAlgorithmAttribute ("EdgeRbNum", UintegerValue (6));
1519  lteHelper->SetFfrAlgorithmAttribute ("CenterPowerOffset",
1520  UintegerValue (LteRrcSap::PdschConfigDedicated::dB0));
1521  lteHelper->SetFfrAlgorithmAttribute ("EdgePowerOffset",
1522  UintegerValue (LteRrcSap::PdschConfigDedicated::dB3));
1523 
1524  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
1525  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
1526  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
1527 
1528  NetDeviceContainer ueLteDevs;
1529  ueLteDevs.Add (ueDevs1);
1530  ueLteDevs.Add (ueDevs2);
1531 
1532  // Add X2 inteface
1533  lteHelper->AddX2Interface (enbNodes);
1534 
1535  // Install the IP stack on the UEs
1536  internet.Install (ueNodes);
1537  Ipv4InterfaceContainer ueIpIfaces;
1538  ueIpIfaces = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueLteDevs));
1539  // Assign IP address to UEs, and install applications
1540  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
1541  {
1542  Ptr<Node> ueNode = ueNodes.Get (u);
1543  // Set the default gateway for the UE
1544  Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
1545  ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
1546  }
1547 
1548  // Attach a UE to a eNB
1549  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
1550  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
1551 
1552 
1553  // Install and start applications on UEs and remote host
1554  uint16_t dlPort = 10000;
1555  uint16_t ulPort = 20000;
1556 
1557  // randomize a bit start times to avoid simulation artifacts
1558  // (e.g., buffer overflows due to packet transmissions happening
1559  // exactly at the same time)
1560  Ptr<UniformRandomVariable> startTimeSeconds = CreateObject<UniformRandomVariable> ();
1561  startTimeSeconds->SetAttribute ("Min", DoubleValue (0));
1562  startTimeSeconds->SetAttribute ("Max", DoubleValue (0.010));
1563 
1564  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
1565  {
1566  Ptr<Node> ue = ueNodes.Get (u);
1567  // Set the default gateway for the UE
1568  Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ue->GetObject<Ipv4> ());
1569  ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
1570 
1571  for (uint32_t b = 0; b < 1; ++b)
1572  {
1573  ++dlPort;
1574  ++ulPort;
1575 
1578 
1579  NS_LOG_LOGIC ("installing UDP DL app for UE " << u);
1580  UdpClientHelper dlClientHelper (ueIpIfaces.GetAddress (u), dlPort);
1581  dlClientHelper.SetAttribute ("MaxPackets", UintegerValue (1000000));
1582  dlClientHelper.SetAttribute ("Interval", TimeValue (MilliSeconds (1.0)));
1583  clientApps.Add (dlClientHelper.Install (remoteHost));
1584  PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory",
1585  InetSocketAddress (Ipv4Address::GetAny (), dlPort));
1586  serverApps.Add (dlPacketSinkHelper.Install (ue));
1587 
1588  NS_LOG_LOGIC ("installing UDP UL app for UE " << u);
1589  UdpClientHelper ulClientHelper (remoteHostAddr, ulPort);
1590  ulClientHelper.SetAttribute ("MaxPackets", UintegerValue (1000000));
1591  ulClientHelper.SetAttribute ("Interval", TimeValue (MilliSeconds (1.0)));
1592  clientApps.Add (ulClientHelper.Install (ue));
1593  PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory",
1594  InetSocketAddress (Ipv4Address::GetAny (), ulPort));
1595  serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
1596 
1597  Ptr<EpcTft> tft = Create<EpcTft> ();
1598  EpcTft::PacketFilter dlpf;
1599  dlpf.localPortStart = dlPort;
1600  dlpf.localPortEnd = dlPort;
1601  tft->Add (dlpf);
1602  EpcTft::PacketFilter ulpf;
1603  ulpf.remotePortStart = ulPort;
1604  ulpf.remotePortEnd = ulPort;
1605  tft->Add (ulpf);
1606  EpsBearer bearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT);
1607  lteHelper->ActivateDedicatedEpsBearer (ueLteDevs.Get (u), bearer, tft);
1608 
1609  Time startTime = Seconds (startTimeSeconds->GetValue ());
1610  serverApps.Start (startTime);
1611  clientApps.Start (startTime);
1612  }
1613  }
1614 
1615  //Test SpectrumPhy to get signals form DL channel
1616  Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
1617  Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
1618 
1619  Ptr<LteSimpleSpectrumPhy> testDlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
1620  Ptr<LteEnbNetDevice> eNbDev = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ();
1621  testDlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetDlEarfcn (), m_dlBandwidth));
1622  dlChannel->AddRx (testDlSpectrumPhy);
1623 
1624  testDlSpectrumPhy->SetCellId (2);
1625 
1626  testDlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
1628 
1629  //Test SpectrumPhy to get signals form UL channel
1630  Ptr<LteSpectrumPhy> ueUlSpectrumPhy = ueDevs1.Get (0)->GetObject<LteUeNetDevice> ()->GetPhy ()->GetUplinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
1631  Ptr<SpectrumChannel> ulChannel = ueUlSpectrumPhy->GetChannel ();
1632 
1633  Ptr<LteSimpleSpectrumPhy> testUlSpectrumPhy = CreateObject<LteSimpleSpectrumPhy> ();
1634  testUlSpectrumPhy->SetRxSpectrumModel (LteSpectrumValueHelper::GetSpectrumModel (eNbDev->GetUlEarfcn (), m_ulBandwidth));
1635  ulChannel->AddRx (testUlSpectrumPhy);
1636 
1637  testUlSpectrumPhy->SetCellId (2);
1638 
1639  testUlSpectrumPhy->TraceConnectWithoutContext ("RxStart",
1641 
1642  double expectedDlPowerCenterArea = 1.0;
1643  std::vector<bool> expectedDlRbCenterArea;
1644  expectedDlRbCenterArea.resize (m_dlBandwidth, false);
1645  std::vector<bool> expectedUlRbCenterArea;
1646  expectedUlRbCenterArea.resize (m_ulBandwidth, false);
1647  for (uint32_t i = 0; i < m_dlBandwidth; i++)
1648  {
1649  expectedDlRbCenterArea[i] = true;
1650  expectedUlRbCenterArea[i] = true;
1651  }
1652 
1653  double expectedDlPowerEdgeArea = 2.0;
1654  std::vector<bool> expectedDlRbEdgeArea;
1655  expectedDlRbEdgeArea.resize (m_dlBandwidth, false);
1656  std::vector<bool> expectedUlRbEdgeArea;
1657  expectedUlRbEdgeArea.resize (m_ulBandwidth, false);
1658  for (uint32_t i = 0; i < 6; i++)
1659  {
1660  expectedDlRbEdgeArea[i] = true;
1661  expectedUlRbEdgeArea[i] = true;
1662  }
1663 
1664  std::vector<bool> expectedDlRbEdgeArea2;
1665  expectedDlRbEdgeArea2.resize (m_dlBandwidth, false);
1666  std::vector<bool> expectedUlRbEdgeArea2;
1667  expectedUlRbEdgeArea2.resize (m_dlBandwidth, false);
1668  for (uint32_t i = 6; i < 12; i++)
1669  {
1670  expectedDlRbEdgeArea2[i] = true;
1671  expectedUlRbEdgeArea2[i] = true;
1672  }
1673 
1674 
1675  Simulator::Schedule (MilliSeconds (1),
1676  &LteFrAreaTestCase::TeleportUe, this, 800, 0,
1677  expectedDlPowerCenterArea, expectedDlRbCenterArea );
1678  Simulator::Schedule (MilliSeconds (1),
1679  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0225815, expectedUlRbCenterArea );
1680 
1681  Simulator::Schedule (MilliSeconds (501),
1682  &LteFrAreaTestCase::TeleportUe, this, 400, 0,
1683  expectedDlPowerEdgeArea, expectedDlRbEdgeArea );
1684  Simulator::Schedule (MilliSeconds (501),
1685  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.135489, expectedUlRbEdgeArea );
1686 
1687  Simulator::Schedule (MilliSeconds (1001),
1688  &LteFrAreaTestCase::TeleportUe2, this, ueNodes1.Get (0), 600, 0,
1689  expectedDlPowerEdgeArea, expectedDlRbEdgeArea2 );
1690  Simulator::Schedule (MilliSeconds (1001),
1691  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.135489, expectedUlRbEdgeArea2 );
1692 
1693  Simulator::Schedule (MilliSeconds (1501),
1694  &LteFrAreaTestCase::TeleportUe2, this, ueNodes1.Get (0), 200, 0,
1695  expectedDlPowerEdgeArea, expectedDlRbEdgeArea );
1696  Simulator::Schedule (MilliSeconds (1501),
1697  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.135489, expectedUlRbEdgeArea );
1698 
1699  Simulator::Schedule (MilliSeconds (2001),
1700  &LteFrAreaTestCase::TeleportUe, this, 800, 0,
1701  expectedDlPowerCenterArea, expectedDlRbCenterArea );
1702  Simulator::Schedule (MilliSeconds (2001),
1703  &LteFrAreaTestCase::SetUlExpectedValues, this, 0.0225815, expectedUlRbCenterArea );
1704 
1705  Simulator::Stop (Seconds (2.500));
1706  Simulator::Run ();
1707 
1708 #if 0
1710  "Scheduler used DL RBG muted by FFR Algorithm");
1711 #endif
1712 
1714  "Scheduler used UL RB muted by FFR Algorithm");
1715 
1716  Simulator::Destroy ();
1717 
1718 }
Values::const_iterator ConstValuesEnd() const
holds a vector of ns3::Application pointers.
uint8_t Add(PacketFilter f)
add a PacketFilter to the Traffic Flow Template
Definition: epc-tft.cc:157
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:95
Test Downlink FFR algorithms.
an Inet address class
virtual void DoRun(void)
Implementation to actually run this TestCase.
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:60
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
std::vector< bool > m_expectedDlRb
Hold a bool native type.
Definition: boolean.h:38
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
Definition: lte-helper.cc:382
holds a vector of std::pair of Ptr and interface index.
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
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:652
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
void UlDataRxStartNofitication(LteFrTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
NetDeviceContainer Install(NodeContainer c)
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:222
void Add(ApplicationContainer other)
Append the contents of another ApplicationContainer to the end of this container. ...
void SetRxSpectrumModel(Ptr< const SpectrumModel > model)
A suite of tests to run.
Definition: test.h:1289
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Definition: callback.h:1480
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
LteStrictFrTestCase(std::string name, uint32_t userNum, std::string schedulerType, uint8_t dlBandwidth, uint8_t ulBandwidth, uint8_t dlCommonSubBandwidth, uint8_t dlEdgeSubBandOffset, uint8_t dlEdgeSubBandwidth, uint8_t ulCommonSubBandwidth, uint8_t ulEdgeSubBandOffset, uint8_t ulEdgeSubBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
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:709
std::vector< bool > m_expectedUlRb
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:170
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:853
aggregate IP/TCP/UDP functionality to existing Nodes.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:223
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes...
Build a set of PointToPointNetDevice objects.
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
encapsulates test code
Definition: test.h:1113
Ptr< SpectrumChannel > GetChannel()
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Call ActivateDataRadioBearer (ueDevice, bearer) for each UE device in a given set.
Definition: lte-helper.cc:963
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
a 3d vector
Definition: vector.h:31
void SetHandoverAlgorithmType(std::string type)
Definition: lte-helper.cc:273
ApplicationContainer Install(NodeContainer c)
void SetFfrAlgorithmType(std::string type)
Definition: lte-helper.cc:252
tuple clientApps
Definition: first.py:53
void SetSchedulerType(std::string type)
Definition: lte-helper.cc:225
uint32_t GetN(void) const
Get the number of Ptr stored in this container.
void TeleportUe(uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
Class for representing data rates.
Definition: data-rate.h:71
Keep track of the current position and velocity of an object.
LteFrTestCase(std::string name, uint32_t userNum, uint8_t dlBandwidth, uint8_t ulBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
void DlDataRxStartNofitication(LteFrTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
TestCase Data.
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
LteStrictFrAreaTestCase(std::string name, std::string schedulerType)
Attribute for objects of type ns3::Time.
Definition: nstime.h:912
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Hold an unsigned integer type.
Definition: uinteger.h:46
double startTime
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
set an attribute for the scheduler to be created
Definition: lte-helper.cc:239
#define NS_TEST_ASSERT_MSG_EQ(actual, limit, msg)
Test that an actual and expected (limit) value are equal and report and abort if not.
Definition: test.h:148
holds a vector of ns3::NetDevice pointers
LteDistributedFfrAreaTestCase(std::string name, std::string schedulerType)
LteSoftFfrAreaTestCase(std::string name, std::string schedulerType)
LteFrAreaTestCase(std::string name, std::string schedulerType)
void Start(Time start)
Arrange for all of the Applications in this container to Start() at the Time given as a parameter...
virtual void DoRun(void)
Implementation to actually run this TestCase.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:233
#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:355
virtual void DoRun(void)
Implementation to actually run this TestCase.
virtual void DoRun(void)
Implementation to actually run this TestCase.
std::vector< bool > m_availableDlRb
tuple serverApps
Definition: first.py:44
Access to the Ipv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:76
void SetAttribute(std::string name, const AttributeValue &value)
Record an attribute to be set in each Application after it is is created.
Ptr< MobilityModel > m_ueMobility
bool TraceConnectWithoutContext(std::string name, const CallbackBase &cb)
Definition: object-base.cc:284
uint16_t remotePortEnd
end of the port number range of the remote host
Definition: epc-tft.h:113
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:677
void ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
Definition: lte-helper.cc:817
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())
double GetValue(double min, double max)
Returns a random double from the uniform distribution with the specified range.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
Definition: lte-helper.cc:915
void AddTestCase(TestCase *testCase) NS_DEPRECATED
Add an individual child TestCase case to this TestCase.
Definition: test.cc:184
void SetDlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
void SetPosition(const Vector &position)
void UlDataRxStartNofiticationArea(LteFrAreaTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
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.
void AddNetworkRouteTo(Ipv4Address network, Ipv4Mask networkMask, Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a network route to the static routing table.
virtual void DoRun(void)
Implementation to actually run this TestCase.
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:38
virtual void DoRun(void)
Implementation to actually run this TestCase.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
void SetEpcHelper(Ptr< EpcHelper > h)
Set the EpcHelper to be used to setup the EPC network in conjunction with the setup of the LTE radio ...
Definition: lte-helper.cc:218
Helper class that adds ns3::Ipv4StaticRouting objects.
hold objects of type ns3::DataRate
LteSoftFrAreaTestCase(std::string name, std::string schedulerType)
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
LteEnhancedFfrAreaTestCase(std::string name, std::string schedulerType)
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:213
static LteFrequencyReuseTestSuite lteFrequencyReuseTestSuite
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:845
void TeleportUe2(Ptr< Node > ueNode, uint32_t x, uint32_t y, double expectedPower, std::vector< bool > expectedDlRb)
void DlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
ApplicationContainer Install(NodeContainer c) const
Install an ns3::PacketSinkApplication on each node of the input container configured with all the att...
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Values::const_iterator ConstValuesBegin() const
LteHardFrTestCase(std::string name, uint32_t userNum, std::string schedulerType, uint8_t dlBandwidth, uint8_t ulBandwidth, uint8_t dlSubBandOffset, uint8_t dlSubBandwidth, uint8_t ulSubBandOffset, uint8_t ulSubBandwidth, std::vector< bool > availableDlRb, std::vector< bool > availableUlRb)
void SetPositionAllocator(Ptr< PositionAllocator > allocator)
Set the position allocator which will be used to allocate the initial position of every node initiali...
std::vector< bool > m_availableUlRb
Hold a floating point type.
Definition: double.h:41
void DlDataRxStartNofiticationArea(LteFrAreaTestCase *testcase, Ptr< const SpectrumValue > spectrumValue)
void SetAttribute(std::string name, const AttributeValue &value)
Definition: object-base.cc:176
The eNodeB device implementation.
void UlDataRxStart(Ptr< const SpectrumValue > spectrumValue)
Ptr< T > GetObject(void) const
Definition: object.h:362
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
void SetUlExpectedValues(double expectedPower, std::vector< bool > expectedDlRb)
Qci
QoS Class Indicator.
Definition: eps-bearer.h:77
uint16_t remotePortStart
start of the port number range of the remote host
Definition: epc-tft.h:112
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
void SimpleTeleportUe(uint32_t x, uint32_t y)
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition: epc-tft.h:73
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
set an attribute for the LteEnbNetDevice to be created
Definition: lte-helper.cc:307
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
uint16_t localPortStart
start of the port number range of the UE
Definition: epc-tft.h:114
The LteSpectrumPhy models the physical layer of LTE.
The LteUeNetDevice class implements the UE net device.
virtual void DoRun(void)
Implementation to actually run this TestCase.