A Discrete-Event Network Simulator
API
lte-test-ue-measurements.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation;
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  *
18  * Author: Manuel Requena <manuel.requena@cttc.es>
19  * Nicola Baldo <nbaldo@cttc.es>
20  * Marco Miozzo <mmiozzo@cttc.es>
21  * Budiarto Herman <budiarto.herman@magister.fi>
22  */
23 
24 #include <ns3/simulator.h>
25 #include <ns3/log.h>
26 #include <ns3/callback.h>
27 #include <ns3/config.h>
28 #include <ns3/string.h>
29 #include <ns3/double.h>
30 #include <ns3/enum.h>
31 #include <ns3/boolean.h>
32 
33 #include <ns3/mobility-helper.h>
34 #include <ns3/lte-helper.h>
35 #include <ns3/point-to-point-epc-helper.h>
36 #include <ns3/internet-stack-helper.h>
37 #include <ns3/point-to-point-helper.h>
38 #include <ns3/ipv4-address-helper.h>
39 #include <ns3/ipv4-static-routing-helper.h>
40 
41 #include <ns3/node-container.h>
42 #include <ns3/net-device-container.h>
43 #include <ns3/ipv4-interface-container.h>
44 
45 #include <ns3/ff-mac-scheduler.h>
46 #include <ns3/lte-enb-net-device.h>
47 #include <ns3/lte-enb-phy.h>
48 #include <ns3/lte-enb-rrc.h>
49 #include <ns3/lte-ue-net-device.h>
50 #include <ns3/lte-ue-phy.h>
51 #include <ns3/lte-ue-rrc.h>
52 
54 #include <ns3/lte-common.h>
55 
56 using namespace ns3;
57 
58 NS_LOG_COMPONENT_DEFINE ("LteUeMeasurementsTest");
59 
60 // ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== //
61 
62 void
64  std::string path, uint16_t rnti, uint16_t cellId,
65  double rsrp, double rsrq, bool servingCell, uint8_t componentCarrierId)
66 {
67  testcase->ReportUeMeasurements (rnti, cellId, rsrp, rsrq, servingCell);
68 }
69 
70 void
72  std::string path, uint64_t imsi, uint16_t cellId,
73  uint16_t rnti, LteRrcSap::MeasurementReport meas)
74 {
75  testcase->RecvMeasurementReport (imsi, cellId, rnti, meas);
76 }
77 
78 
79 /*
80  * Test Suite
81  */
82 
84  : TestSuite ("lte-ue-measurements", SYSTEM)
85 {
86 
87  AddTestCase (new LteUeMeasurementsTestCase ("d1=10, d2=10000", 10.000000, 10000.000000, -53.739702, -113.739702, -3.010305, -63.010305), TestCase::EXTENSIVE);
88  AddTestCase (new LteUeMeasurementsTestCase ("d1=20, d2=10000", 20.000000, 10000.000000, -59.760302, -113.739702, -3.010319, -56.989719), TestCase::EXTENSIVE);
89  AddTestCase (new LteUeMeasurementsTestCase ("d1=50, d2=10000", 50.000000, 10000.000000, -67.719102, -113.739702, -3.010421, -49.031021), TestCase::EXTENSIVE);
90  AddTestCase (new LteUeMeasurementsTestCase ("d1=100, d2=10000", 100.000000, 10000.000000, -73.739702, -113.739702, -3.010783, -43.010783), TestCase::EXTENSIVE);
91  AddTestCase (new LteUeMeasurementsTestCase ("d1=200, d2=10000", 200.000000, 10000.000000, -79.760302, -113.739702, -3.012232, -36.991632), TestCase::EXTENSIVE);
92  AddTestCase (new LteUeMeasurementsTestCase ("d1=100, d2=10000", 100.000000, 10000.000000, -73.739702, -113.739702, -3.010783, -43.010783), TestCase::EXTENSIVE);
93  AddTestCase (new LteUeMeasurementsTestCase ("d1=200, d2=10000", 200.000000, 10000.000000, -79.760302, -113.739702, -3.012232, -36.991632), TestCase::EXTENSIVE);
94  AddTestCase (new LteUeMeasurementsTestCase ("d1=500, d2=10000", 500.000000, 10000.000000, -87.719102, -113.739702, -3.022359, -29.042959), TestCase::EXTENSIVE);
95  AddTestCase (new LteUeMeasurementsTestCase ("d1=1000, d2=10000", 1000.000000, 10000.000000, -93.739702, -113.739702, -3.058336, -23.058336), TestCase::EXTENSIVE);
96  AddTestCase (new LteUeMeasurementsTestCase ("d1=2000, d2=10000", 2000.000000, 10000.000000, -99.760302, -113.739702, -3.199337, -17.178738), TestCase::EXTENSIVE);
97  AddTestCase (new LteUeMeasurementsTestCase ("d1=5000, d2=10000", 5000.000000, 10000.000000, -107.719102, -113.739702, -4.075793, -10.096393), TestCase::QUICK);
98  AddTestCase (new LteUeMeasurementsTestCase ("d1=10000, d2=10000", 10000.000000, 10000.000000, -113.739702, -113.739702, -6.257687, -6.257687), TestCase::EXTENSIVE);
99  AddTestCase (new LteUeMeasurementsTestCase ("d1=20000, d2=10000", 20000.000000, 10000.000000, -119.760302, -113.739702, -10.373365, -4.352765), TestCase::EXTENSIVE);
100  AddTestCase (new LteUeMeasurementsTestCase ("d1=50000, d2=10000", 50000.000000, 10000.000000, -127.719102, -113.739702, -17.605046, -3.625645), TestCase::EXTENSIVE);
101  AddTestCase (new LteUeMeasurementsTestCase ("d1=100000, d2=10000", 100000.000000, 10000.000000, -133.739702, -113.739702, -23.511071, -3.511071), TestCase::EXTENSIVE);
102  AddTestCase (new LteUeMeasurementsTestCase ("d1=200000, d2=10000", 200000.000000, 10000.000000, -139.760302, -113.739702, -29.502549, -3.481949), TestCase::EXTENSIVE);
103  AddTestCase (new LteUeMeasurementsTestCase ("d1=500000, d2=10000", 500000.000000, 10000.000000, -147.719102, -113.739702, -37.453160, -3.473760), TestCase::EXTENSIVE);
104  AddTestCase (new LteUeMeasurementsTestCase ("d1=1000000, d2=10000", 1000000.000000, 10000.000000, -153.739702, -113.739702, -43.472589, -3.472589), TestCase::EXTENSIVE);
105 }
106 
108 
109 
110 /*
111  * Test Case
112  */
113 
115  double d1, double d2,
116  double rsrpDbmUe1,
117  double rsrpDbmUe2,
118  double rsrqDbUe1,
119  double rsrqDbUe2)
120  : TestCase (name),
121  m_d1 (d1),
122  m_d2 (d2),
123  m_rsrpDbmUeServingCell (rsrpDbmUe1),
124  m_rsrpDbmUeNeighborCell (rsrpDbmUe2),
125  m_rsrqDbUeServingCell (rsrqDbUe1),
126  m_rsrqDbUeNeighborCell (rsrqDbUe2)
127 {
128  NS_LOG_INFO ("Test UE Measurements d1 = " << d1 << " m. and d2 = " << d2 << " m.");
129 }
130 
132 {
133 }
134 
135 void
137 {
138  NS_LOG_INFO (this << " " << GetName ());
139 
140  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (false));
141  Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (false));
142  Config::SetDefault ("ns3::LteAmc::AmcModel", EnumValue (LteAmc::PiroEW2010));
143  Config::SetDefault ("ns3::LteAmc::Ber", DoubleValue (0.00005));
144  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
145  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
146  lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (false));
147 
148  //Disable Uplink Power Control
149  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false));
150 
151  // LogComponentEnable ("LteUeMeasurementsTest", LOG_LEVEL_ALL);
152 
153  // Create Nodes: eNodeB and UE
154  NodeContainer enbNodes;
155  NodeContainer ueNodes1;
156  NodeContainer ueNodes2;
157  enbNodes.Create (2);
158  ueNodes1.Create (1);
159  ueNodes2.Create (1);
160  NodeContainer allNodes = NodeContainer (enbNodes, ueNodes1, ueNodes2);
161 
162  // the topology is the following:
163  // d2
164  // UE1-----------eNB2
165  // | |
166  // d1| |d1
167  // | d2 |
168  // eNB1----------UE2
169  //
170  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
171  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
172  positionAlloc->Add (Vector (m_d2, m_d1, 0.0)); // eNB2
173  positionAlloc->Add (Vector (0.0, m_d1, 0.0)); // UE1
174  positionAlloc->Add (Vector (m_d2, 0.0, 0.0)); // UE2
176  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
177  mobility.SetPositionAllocator (positionAlloc);
178  mobility.Install (allNodes);
179 
180  // Create Devices and install them in the Nodes (eNB and UE)
181  NetDeviceContainer enbDevs;
182  NetDeviceContainer ueDevs1;
183  NetDeviceContainer ueDevs2;
184  lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
185  lteHelper->SetSchedulerAttribute ("UlCqiFilter", EnumValue (FfMacScheduler::PUSCH_UL_CQI));
186  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
187  ueDevs1 = lteHelper->InstallUeDevice (ueNodes1);
188  ueDevs2 = lteHelper->InstallUeDevice (ueNodes2);
189 
190  // Attach UEs to eNodeBs
191  lteHelper->Attach (ueDevs1, enbDevs.Get (0));
192  lteHelper->Attach (ueDevs2, enbDevs.Get (1));
193 
194  // Activate an EPS bearer
195  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
196  EpsBearer bearer (q);
197  lteHelper->ActivateDataRadioBearer (ueDevs1, bearer);
198  lteHelper->ActivateDataRadioBearer (ueDevs2, bearer);
199 
200 
201  Config::Connect ("/NodeList/2/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements",
203  Config::Connect ("/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
205 
206  Config::Connect ("/NodeList/3/DeviceList/0/ComponentCarrierMapUe/0/LteUePhy/ReportUeMeasurements",
208  Config::Connect ("/NodeList/1/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
210 
211  // need to allow for RRC connection establishment + SRS
212  Simulator::Stop (Seconds (0.800));
213  Simulator::Run ();
214 
215  Simulator::Destroy ();
216 
217 }
218 
219 void
220 LteUeMeasurementsTestCase::ReportUeMeasurements (uint16_t rnti, uint16_t cellId,
221  double rsrp, double rsrq,
222  bool servingCell)
223 {
224  // need to allow for RRC connection establishment + CQI feedback reception + UE measurements filtering (200 ms)
225  if (Simulator::Now () > MilliSeconds (400))
226  {
227  if (servingCell)
228  {
229  NS_LOG_DEBUG ("UE serving cellId " << cellId << " Rxed RSRP " << rsrp << " thr " << m_rsrpDbmUeServingCell << " RSRQ " << rsrq << " thr " << m_rsrqDbUeServingCell);
230  NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrpDbmUeServingCell, rsrp, 0.2, "Wrong RSRP UE 1");
231  NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrqDbUeServingCell, rsrq, 0.2, "Wrong RSRQ UE 1");
232  }
233  else
234  {
235  NS_LOG_DEBUG ("UE neighbor cellId " << cellId << " Rxed RSRP " << rsrp << " thr " << m_rsrpDbmUeNeighborCell << " RSRQ " << rsrq << " thr " << m_rsrqDbUeNeighborCell);
236  NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrpDbmUeNeighborCell, rsrp, 0.2, "Wrong RSRP UE 2");
237  NS_TEST_ASSERT_MSG_EQ_TOL (m_rsrqDbUeNeighborCell, rsrq, 0.2, "Wrong RSRQ UE ");
238  }
239  }
240 }
241 
242 void
243 LteUeMeasurementsTestCase::RecvMeasurementReport (uint64_t imsi, uint16_t cellId, uint16_t rnti,
245 {
246  // need to allow for RRC connection establishment + CQI feedback reception + UE measurements filtering (200 ms)
247  if (Simulator::Now () > MilliSeconds (400))
248  {
249  if (cellId == imsi)
250  {
251  NS_LOG_DEBUG (this << "Serving Cell: received IMSI " << imsi << " CellId " << cellId << " RNTI " << rnti
252  << " thr " << (uint16_t) EutranMeasurementMapping::Dbm2RsrpRange (m_rsrpDbmUeServingCell)
253  << " RSRP " << (uint16_t) meas.measResults.rsrpResult
254  << " RSRQ " << (uint16_t)meas.measResults.rsrqResult
255  << " thr " << (uint16_t) EutranMeasurementMapping::Db2RsrqRange (m_rsrqDbUeServingCell));
257  EutranMeasurementMapping::Dbm2RsrpRange (m_rsrpDbmUeServingCell),
258  "Wrong RSRP ");
260  EutranMeasurementMapping::Db2RsrqRange (m_rsrqDbUeServingCell),
261  "Wrong RSRQ ");
262  }
263  else
264  {
265  NS_LOG_DEBUG (this << "Neighbor cell: received IMSI " << imsi << " CellId " << cellId << " RNTI " << rnti
266  << " thr " << (uint16_t) EutranMeasurementMapping::Dbm2RsrpRange (m_rsrpDbmUeNeighborCell)
267  << " RSRP " << (uint16_t) meas.measResults.rsrpResult
268  << " RSRQ " << (uint16_t)meas.measResults.rsrqResult
269  << " thr " << (uint16_t) EutranMeasurementMapping::Db2RsrqRange (m_rsrqDbUeNeighborCell));
271  EutranMeasurementMapping::Dbm2RsrpRange (m_rsrpDbmUeNeighborCell),
272  "Wrong RSRP ");
274  EutranMeasurementMapping::Db2RsrqRange (m_rsrqDbUeNeighborCell),
275  "Wrong RSRQ ");
276  }
277  }
278 }
279 
280 
281 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-1 TEST SUITE ======================== //
282 
283 /*
284  * Overloaded operators, for the convenience of defining test cases
285  */
286 
287 std::vector<Time>&
288 operator<< (std::vector<Time>& v, const uint64_t& ms)
289 {
290  /*
291  * Prior attempt to use seconds as unit of choice resulted in precision lost.
292  * Therefore milliseconds are used now instead.
293  */
294  v.push_back (MilliSeconds (ms) + UE_MEASUREMENT_REPORT_DELAY);
295  return v;
296 }
297 
298 std::vector<uint8_t>&
299 operator<< (std::vector<uint8_t>& v, const uint8_t& range)
300 {
301  v.push_back (range);
302  return v;
303 }
304 
305 
306 /*
307  * Test Suite
308  */
309 
311  : TestSuite ("lte-ue-measurements-piecewise-1", SYSTEM)
312 {
313  std::vector<Time> expectedTime;
314  std::vector<uint8_t> expectedRsrp;
315 
316  // === Event A1 (serving cell becomes better than threshold) ===
317 
318  // With very low threshold
320  config.triggerType = LteRrcSap::ReportConfigEutra::EVENT;
321  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
322  config.threshold1.choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRP;
323  config.threshold1.range = 0;
324  config.triggerQuantity = LteRrcSap::ReportConfigEutra::RSRP;
325  config.reportInterval = LteRrcSap::ReportConfigEutra::MS120;
326  expectedTime.clear ();
327  expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1040 << 1160 << 1280
328  << 1400 << 1520 << 1640 << 1760 << 1880 << 2000 << 2120;
329  expectedRsrp.clear ();
330  expectedRsrp << 67 << 67 << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57
331  << 51 << 51 << 47 << 47 << 51 << 57 << 57;
332  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A1 with very low threshold",
333  config, expectedTime, expectedRsrp),
334  TestCase::EXTENSIVE);
335 
336  // With normal threshold
337  config.threshold1.range = 54;
338  expectedTime.clear ();
339  expectedTime << 200 << 320 << 440 << 560 << 680 << 1000 << 1120 << 1240 << 1360 << 2000
340  << 2120;
341  expectedRsrp.clear ();
342  expectedRsrp << 67 << 67 << 57 << 57 << 66 << 66 << 66 << 57 << 57 << 57
343  << 57;
344  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A1 with normal threshold",
345  config, expectedTime, expectedRsrp),
346  TestCase::EXTENSIVE);
347 
348  // With short time-to-trigger
349  config.timeToTrigger = 64;
350  expectedTime.clear ();
351  expectedTime << 264 << 384 << 504 << 624 << 744 << 1064 << 1184 << 1304 << 1424 << 2064
352  << 2184;
353  expectedRsrp.clear ();
354  expectedRsrp << 67 << 67 << 57 << 66 << 66 << 66 << 66 << 57 << 51 << 57
355  << 57;
356  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A1 with short time-to-trigger",
357  config, expectedTime, expectedRsrp),
358  TestCase::QUICK);
359 
360  // With long time-to-trigger
361  config.timeToTrigger = 128;
362  expectedTime.clear ();
363  expectedTime << 328 << 448 << 568 << 688 << 808 << 1128 << 1248 << 1368 << 1488 << 2128;
364  expectedRsrp.clear ();
365  expectedRsrp << 67 << 57 << 57 << 66 << 47 << 66 << 57 << 57 << 51 << 57;
366  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A1 with long time-to-trigger",
367  config, expectedTime, expectedRsrp),
368  TestCase::EXTENSIVE);
369 
370  // With super time-to-trigger
371  config.timeToTrigger = 256;
372  expectedTime.clear ();
373  expectedTime << 456 << 576 << 696 << 816 << 936 << 1056 << 1176 << 1296 << 1416 << 1536;
374  expectedRsrp.clear ();
375  expectedRsrp << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57 << 51 << 51;
376  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A1 with super time-to-trigger",
377  config, expectedTime, expectedRsrp),
378  TestCase::EXTENSIVE);
379 
380  // With hysteresis
381  config.hysteresis = 8;
382  config.timeToTrigger = 0;
383  expectedTime.clear ();
384  expectedTime << 200 << 320 << 440 << 560 << 680 << 1000 << 1120 << 1240 << 1360 << 1480
385  << 2200;
386  expectedRsrp.clear ();
387  expectedRsrp << 67 << 67 << 57 << 57 << 66 << 66 << 66 << 57 << 57 << 51
388  << 67;
389  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A1 with hysteresis",
390  config, expectedTime, expectedRsrp),
391  TestCase::QUICK);
392 
393  // With very high threshold
394  config.threshold1.range = 97;
395  config.hysteresis = 0;
396  expectedTime.clear ();
397  expectedRsrp.clear ();
398  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A1 with very high threshold",
399  config, expectedTime, expectedRsrp),
400  TestCase::TAKES_FOREVER);
401 
402  // === Event A2 (serving cell becomes worse than threshold) ===
403 
404  // With very low threshold
405  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
406  config.threshold1.range = 0;
407  expectedTime.clear ();
408  expectedRsrp.clear ();
409  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A2 with very low threshold",
410  config, expectedTime, expectedRsrp),
411  TestCase::TAKES_FOREVER);
412 
413  // With normal threshold
414  config.threshold1.range = 54;
415  expectedTime.clear ();
416  expectedTime << 800 << 920 << 1400 << 1520 << 1640 << 1760 << 1880;
417  expectedRsrp.clear ();
418  expectedRsrp << 47 << 47 << 51 << 51 << 47 << 47 << 51;
419  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A2 with normal threshold",
420  config, expectedTime, expectedRsrp),
421  TestCase::QUICK);
422 
423  // With short time-to-trigger
424  config.timeToTrigger = 64;
425  expectedTime.clear ();
426  expectedTime << 864 << 984 << 1464 << 1584 << 1704 << 1824 << 1944;
427  expectedRsrp.clear ();
428  expectedRsrp << 47 << 47 << 51 << 51 << 47 << 51 << 51;
429  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A2 with short time-to-trigger",
430  config, expectedTime, expectedRsrp),
431  TestCase::EXTENSIVE);
432 
433  // With long time-to-trigger
434  config.timeToTrigger = 128;
435  expectedTime.clear ();
436  expectedTime << 928 << 1048 << 1528 << 1648 << 1768 << 1888 << 2008;
437  expectedRsrp.clear ();
438  expectedRsrp << 47 << 66 << 51 << 47 << 47 << 51 << 57;
439  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A2 with long time-to-trigger",
440  config, expectedTime, expectedRsrp),
441  TestCase::TAKES_FOREVER);
442 
443  // With super time-to-trigger
444  config.timeToTrigger = 256;
445  expectedTime.clear ();
446  expectedTime << 1656 << 1776 << 1896 << 2016 << 2136;
447  expectedRsrp.clear ();
448  expectedRsrp << 47 << 47 << 51 << 57 << 57;
449  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A2 with super time-to-trigger",
450  config, expectedTime, expectedRsrp),
451  TestCase::QUICK);
452 
453  // With hysteresis
454  config.hysteresis = 8;
455  config.timeToTrigger = 0;
456  expectedTime.clear ();
457  expectedTime << 800 << 920 << 1600 << 1720 << 1840 << 1960 << 2080;
458  expectedRsrp.clear ();
459  expectedRsrp << 47 << 47 << 47 << 47 << 51 << 51 << 57;
460  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A2 with hysteresis",
461  config, expectedTime, expectedRsrp),
462  TestCase::EXTENSIVE);
463 
464  // With very high threshold
465  config.threshold1.range = 97;
466  config.hysteresis = 0;
467  expectedTime.clear ();
468  expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1040 << 1160 << 1280
469  << 1400 << 1520 << 1640 << 1760 << 1880 << 2000 << 2120;
470  expectedRsrp.clear ();
471  expectedRsrp << 67 << 67 << 57 << 57 << 66 << 47 << 47 << 66 << 66 << 57
472  << 51 << 51 << 47 << 47 << 51 << 57 << 57;
473  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A2 with very high threshold",
474  config, expectedTime, expectedRsrp),
475  TestCase::EXTENSIVE);
476 
477  /*
478  * Event A3, A4, and A5 are not tested intensively here because they depend on
479  * the existence of at least one neighbouring cell, which is not available in
480  * this configuration. Piecewise configuration #2 includes a neighbouring
481  * cell, hence more thorough tests on these events are performed there.
482  */
483 
484  expectedTime.clear ();
485  expectedRsrp.clear ();
486 
487  // === Event A3 (neighbour becomes offset better than PCell) ===
488 
489  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
490  config.a3Offset = 0;
491  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A3",
492  config, expectedTime, expectedRsrp),
493  TestCase::EXTENSIVE);
494 
495  // === Event A4 (neighbour becomes better than threshold) ===
496 
497  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
498  config.threshold1.range = 54;
499  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A4",
500  config, expectedTime, expectedRsrp),
501  TestCase::EXTENSIVE);
502 
503  // === Event A5 (PCell becomes worse than absolute threshold1 AND neighbour becomes better than another absolute threshold2) ===
504 
505  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
506  config.threshold2.range = 58;
507  AddTestCase (new LteUeMeasurementsPiecewiseTestCase1 ("Piecewise test case 1 - Event A5",
508  config, expectedTime, expectedRsrp),
509  TestCase::EXTENSIVE);
510 
511 } // end of LteUeMeasurementsPiecewiseTestSuite1::LteUeMeasurementsPiecewiseTestSuite1
512 
514 
515 
516 /*
517  * Test Case
518  */
519 
521  std::string name, LteRrcSap::ReportConfigEutra config,
522  std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp)
523  : TestCase (name),
524  m_config (config),
525  m_expectedTime (expectedTime),
526  m_expectedRsrp (expectedRsrp)
527 {
528  // input sanity check
529  uint16_t size = m_expectedTime.size ();
530 
531  if (size != m_expectedRsrp.size ())
532  {
533  NS_FATAL_ERROR ("Vectors of expected results are not of the same size");
534  }
535 
536  m_itExpectedTime = m_expectedTime.begin ();
537  m_itExpectedRsrp = m_expectedRsrp.begin ();
538 
539  NS_LOG_INFO (this << " name=" << name);
540 }
541 
543 {
544  NS_LOG_FUNCTION (this);
545 }
546 
547 void
549 {
550  NS_LOG_INFO (this << " " << GetName ());
551 
552  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
553  lteHelper->SetAttribute ("PathlossModel",
554  StringValue ("ns3::FriisSpectrumPropagationLossModel"));
555  lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (true));
556 
557  //Disable Uplink Power Control
558  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false));
559 
560  // Create Nodes: eNodeB and UE
561  NodeContainer enbNodes;
562  NodeContainer ueNodes;
563  enbNodes.Create (1);
564  ueNodes.Create (1);
565 
566  /*
567  * The topology is the following:
568  *
569  * eNodeB UE
570  * | |
571  * x ----- x --------- x --------------- x ------------------- x
572  * 100 m | 200 m | 300 m | 400 m |
573  * | | | |
574  * VeryNear Near Far VeryFar
575  */
576 
577  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
578  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNodeB
579  positionAlloc->Add (Vector (100.0, 0.0, 0.0)); // UE
581  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
582  mobility.SetPositionAllocator (positionAlloc);
583  mobility.Install (enbNodes);
584  mobility.Install (ueNodes);
585  m_ueMobility = ueNodes.Get (0)->GetObject<MobilityModel> ();
586 
587  // Disable layer-3 filtering
588  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
589  UintegerValue (0));
590 
591  // Create Devices and install them in the Nodes (eNB and UE)
592  NetDeviceContainer enbDevs;
593  NetDeviceContainer ueDevs;
594  lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
595  lteHelper->SetSchedulerAttribute ("UlCqiFilter",
596  EnumValue (FfMacScheduler::PUSCH_UL_CQI));
597  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
598  ueDevs = lteHelper->InstallUeDevice (ueNodes);
599 
600  // Setup UE measurement configuration
601  Ptr<LteEnbRrc> enbRrc = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetRrc ();
603 
604  // Attach UE to eNodeB
605  lteHelper->Attach (ueDevs.Get (0), enbDevs.Get (0));
606 
607  // Activate an EPS bearer
608  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
609  EpsBearer bearer (q);
610  lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
611 
612  // Connect to trace sources
613  Config::Connect ("/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
615  this));
616 
617  /*
618  * Schedule "teleports"
619  * 0 1 2
620  * +-------------------+-------------------+---------> time
621  * VeryNear |------ ---- ---- --------
622  * Near | ---- ----
623  * Far | ---- ----
624  * VeryFar | -- ---- ----
625  */
626  Simulator::Schedule (MilliSeconds (301),
628  Simulator::Schedule (MilliSeconds (401),
630  Simulator::Schedule (MilliSeconds (601),
632  Simulator::Schedule (MilliSeconds (801),
634  Simulator::Schedule (MilliSeconds (1001),
636  Simulator::Schedule (MilliSeconds (1201),
638  Simulator::Schedule (MilliSeconds (1401),
640  Simulator::Schedule (MilliSeconds (1601),
642  Simulator::Schedule (MilliSeconds (1801),
644  Simulator::Schedule (MilliSeconds (2001),
646 
647  // Run simulation
648  Simulator::Stop (Seconds (2.201));
649  Simulator::Run ();
650  Simulator::Destroy ();
651 
652 } // end of void LteUeMeasurementsPiecewiseTestCase1::DoRun ()
653 
654 void
656 {
657  NS_LOG_FUNCTION (this);
658  bool hasEnded = m_itExpectedTime == m_expectedTime.end ();
659  NS_TEST_ASSERT_MSG_EQ (hasEnded, true,
660  "Reporting should have occurred at " << m_itExpectedTime->GetSeconds () << "s");
661  hasEnded = m_itExpectedRsrp == m_expectedRsrp.end ();
662  NS_ASSERT (hasEnded);
663 }
664 
665 void
667  std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
669 {
670  NS_LOG_FUNCTION (this << context);
671  NS_ASSERT (rnti == 1);
672  NS_ASSERT (cellId == 1);
673 
674  if (report.measResults.measId == m_expectedMeasId)
675  {
676  // verifying the report completeness
677  LteRrcSap::MeasResults measResults = report.measResults;
678  NS_LOG_DEBUG (this << " rsrp=" << (uint16_t) measResults.rsrpResult
679  << " (" << EutranMeasurementMapping::RsrpRange2Dbm (measResults.rsrpResult) << " dBm)"
680  << " rsrq=" << (uint16_t) measResults.rsrqResult
681  << " (" << EutranMeasurementMapping::RsrqRange2Db (measResults.rsrqResult) << " dB)");
683  "Report should not have neighboring cells information");
684  NS_TEST_ASSERT_MSG_EQ (measResults.measResultListEutra.size (), 0,
685  "Unexpected report size");
686 
687  bool hasEnded = m_itExpectedTime == m_expectedTime.end ();
688  NS_TEST_ASSERT_MSG_EQ (hasEnded, false,
689  "Reporting should not have occurred at "
690  << Simulator::Now ().GetSeconds () << "s");
691  if (!hasEnded)
692  {
693  hasEnded = m_itExpectedRsrp == m_expectedRsrp.end ();
694  NS_ASSERT (!hasEnded);
695 
696  // using milliseconds to avoid floating-point comparison
697  uint64_t timeNowMs = Simulator::Now ().GetMilliSeconds ();
698  uint64_t timeExpectedMs = m_itExpectedTime->GetMilliSeconds ();
700 
701  uint16_t observedRsrp = measResults.rsrpResult;
702  uint16_t referenceRsrp = *m_itExpectedRsrp;
704 
705  NS_TEST_ASSERT_MSG_EQ (timeNowMs, timeExpectedMs,
706  "Reporting should not have occurred at this time");
707  NS_TEST_ASSERT_MSG_EQ (observedRsrp, referenceRsrp,
708  "The RSRP observed differs with the reference RSRP");
709  } // end of if (!hasEnded)
710 
711  } // end of if (measResults.measId == m_expectedMeasId)
712 
713 } // end of LteUeMeasurementsPiecewiseTestCase1::RecvMeasurementReportCallback
714 
715 void
717 {
718  NS_LOG_FUNCTION (this);
719  m_ueMobility->SetPosition (Vector (100.0, 0.0, 0.0));
720 }
721 
722 void
724 {
725  NS_LOG_FUNCTION (this);
726  m_ueMobility->SetPosition (Vector (300.0, 0.0, 0.0));
727 }
728 
729 void
731 {
732  NS_LOG_FUNCTION (this);
733  m_ueMobility->SetPosition (Vector (600.0, 0.0, 0.0));
734 }
735 
736 void
738 {
739  NS_LOG_FUNCTION (this);
740  m_ueMobility->SetPosition (Vector (1000.0, 0.0, 0.0));
741 }
742 
743 
744 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-2 TEST SUITE ======================== //
745 
746 /*
747  * Test Suite
748  */
749 
751  : TestSuite ("lte-ue-measurements-piecewise-2", SYSTEM)
752 {
753  std::vector<Time> expectedTime;
754  std::vector<uint8_t> expectedRsrp;
755 
756  /*
757  * Higher level of fullness/duration are given to Event A1 and A2 because they
758  * are supposed to be more intensively tested in Piecewise configuration #1.
759  */
760 
761  // === Event A1 (serving cell becomes better than threshold) ===
762 
763  // With very low threshold
765  config.triggerType = LteRrcSap::ReportConfigEutra::EVENT;
766  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
767  config.threshold1.choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRP;
768  config.threshold1.range = 0;
769  config.triggerQuantity = LteRrcSap::ReportConfigEutra::RSRP;
770  config.reportInterval = LteRrcSap::ReportConfigEutra::MS240;
771  expectedTime.clear ();
772  expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
773  expectedRsrp.clear ();
774  expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
775  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A1 with very low threshold",
776  config, expectedTime, expectedRsrp),
777  TestCase::EXTENSIVE);
778 
779  // With normal threshold
780  config.threshold1.range = 58;
781  expectedTime.clear ();
782  expectedTime << 200 << 440 << 680 << 1000 << 1240 << 2000;
783  expectedRsrp.clear ();
784  expectedRsrp << 73 << 63 << 72 << 72 << 59 << 59;
785  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A1 with normal threshold",
786  config, expectedTime, expectedRsrp),
787  TestCase::TAKES_FOREVER);
788 
789  // With hysteresis
790  config.hysteresis = 6;
791  expectedTime.clear ();
792  expectedTime << 200 << 440 << 680 << 1000 << 1240 << 1480 << 2200;
793  expectedRsrp.clear ();
794  expectedRsrp << 73 << 63 << 72 << 72 << 59 << 56 << 72;
795  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A1 with hysteresis",
796  config, expectedTime, expectedRsrp),
797  TestCase::EXTENSIVE);
798 
799  // With very high threshold
800  config.threshold1.range = 97;
801  config.hysteresis = 0;
802  expectedTime.clear ();
803  expectedRsrp.clear ();
804  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A1 with very high threshold",
805  config, expectedTime, expectedRsrp),
806  TestCase::TAKES_FOREVER);
807 
808  // === Event A2 (serving cell becomes worse than threshold) ===
809 
810  // With very low threshold
811  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
812  config.threshold1.range = 0;
813  expectedTime.clear ();
814  expectedRsrp.clear ();
815  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A2 with very low threshold",
816  config, expectedTime, expectedRsrp),
817  TestCase::TAKES_FOREVER);
818 
819  // With normal threshold
820  config.threshold1.range = 58;
821  expectedTime.clear ();
822  expectedTime << 800 << 1400 << 1640 << 1880;
823  expectedRsrp.clear ();
824  expectedRsrp << 52 << 56 << 52 << 56;
825  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A2 with normal threshold",
826  config, expectedTime, expectedRsrp),
827  TestCase::TAKES_FOREVER);
828 
829  // With hysteresis
830  config.hysteresis = 6;
831  expectedTime.clear ();
832  expectedTime << 800 << 1600 << 1840 << 2080;
833  expectedRsrp.clear ();
834  expectedRsrp << 52 << 52 << 56 << 59;
835  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A2 with hysteresis",
836  config, expectedTime, expectedRsrp),
837  TestCase::EXTENSIVE);
838 
839  // With very high threshold
840  config.threshold1.range = 97;
841  config.hysteresis = 0;
842  expectedTime.clear ();
843  expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
844  expectedRsrp.clear ();
845  expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
846  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A2 with very high threshold",
847  config, expectedTime, expectedRsrp),
848  TestCase::TAKES_FOREVER);
849 
850  // === Event A3 (neighbour becomes offset better than PCell) ===
851 
852  // With positive offset
853  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
854  config.threshold1.range = 0;
855  config.a3Offset = 7;
856  expectedTime.clear ();
857  expectedTime << 800 << 1600;
858  expectedRsrp.clear ();
859  expectedRsrp << 52 << 52;
860  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A3 with positive offset",
861  config, expectedTime, expectedRsrp),
862  TestCase::QUICK);
863 
864  // With zero offset
865  config.a3Offset = 0;
866  expectedTime.clear ();
867  expectedTime << 800 << 1400 << 1640 << 1880;
868  expectedRsrp.clear ();
869  expectedRsrp << 52 << 56 << 52 << 56;
870  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A3 with zero offset",
871  config, expectedTime, expectedRsrp),
872  TestCase::EXTENSIVE);
873 
874  // With short time-to-trigger
875  config.timeToTrigger = 160;
876  expectedTime.clear ();
877  expectedTime << 960 << 1560 << 1800 << 2040;
878  expectedRsrp.clear ();
879  expectedRsrp << 52 << 56 << 56 << 59;
880  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A3 with short time-to-trigger",
881  config, expectedTime, expectedRsrp),
882  TestCase::EXTENSIVE);
883 
884  // With super time-to-trigger
885  config.timeToTrigger = 320;
886  expectedTime.clear ();
887  expectedTime << 1720 << 1960 << 2200;
888  expectedRsrp.clear ();
889  expectedRsrp << 52 << 56 << 72;
890  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A3 with super time-to-trigger",
891  config, expectedTime, expectedRsrp),
892  TestCase::QUICK);
893 
894  // With hysteresis and reportOnLeave
895  config.hysteresis = 6;
896  config.reportOnLeave = true;
897  config.timeToTrigger = 0;
898  expectedTime.clear ();
899  expectedTime << 800 << 1000 << 1600 << 1840 << 2080 << 2200;
900  expectedRsrp.clear ();
901  expectedRsrp << 52 << 72 << 52 << 56 << 59 << 72;
902  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A3 with hysteresis",
903  config, expectedTime, expectedRsrp),
904  TestCase::QUICK);
905 
906  // With negative offset
907  config.a3Offset = -7;
908  config.hysteresis = 0;
909  config.reportOnLeave = false;
910  expectedTime.clear ();
911  expectedTime << 400 << 800 << 1200 << 1440 << 1680 << 1920 << 2160;
912  expectedRsrp.clear ();
913  expectedRsrp << 63 << 52 << 59 << 56 << 52 << 56 << 59;
914  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A3 with negative offset",
915  config, expectedTime, expectedRsrp),
916  TestCase::EXTENSIVE);
917 
918  // === Event A4 (neighbour becomes better than threshold) ===
919 
920  // With very low threshold
921  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
922  config.threshold1.range = 0;
923  config.a3Offset = 0;
924  expectedTime.clear ();
925  expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
926  expectedRsrp.clear ();
927  expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
928  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A4 with very low threshold",
929  config, expectedTime, expectedRsrp),
930  TestCase::QUICK);
931 
932  // With normal threshold
933  config.threshold1.range = 58;
934  expectedTime.clear ();
935  expectedTime << 400 << 800 << 1400 << 1640 << 1880;
936  expectedRsrp.clear ();
937  expectedRsrp << 63 << 52 << 56 << 52 << 56;
938  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A4 with normal threshold",
939  config, expectedTime, expectedRsrp),
940  TestCase::EXTENSIVE);
941 
942  // With short time-to-trigger
943  config.timeToTrigger = 160;
944  expectedTime.clear ();
945  expectedTime << 560 << 960 << 1560 << 1800 << 2040;
946  expectedRsrp.clear ();
947  expectedRsrp << 63 << 52 << 56 << 56 << 59;
948  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A4 with short time-to-trigger",
949  config, expectedTime, expectedRsrp),
950  TestCase::QUICK);
951 
952  // With super time-to-trigger
953  config.timeToTrigger = 320;
954  expectedTime.clear ();
955  expectedTime << 1720 << 1960 << 2200;
956  expectedRsrp.clear ();
957  expectedRsrp << 52 << 56 << 72;
958  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A4 with super time-to-trigger",
959  config, expectedTime, expectedRsrp),
960  TestCase::TAKES_FOREVER);
961 
962  // With hysteresis
963  config.hysteresis = 6;
964  config.timeToTrigger = 0;
965  expectedTime.clear ();
966  expectedTime << 400 << 800 << 1600 << 1840 << 2080;
967  expectedRsrp.clear ();
968  expectedRsrp << 63 << 52 << 52 << 56 << 59;
969  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A4 with hysteresis",
970  config, expectedTime, expectedRsrp),
971  TestCase::QUICK);
972 
973  // With very high threshold
974  config.threshold1.range = 97;
975  config.hysteresis = 0;
976  expectedTime.clear ();
977  expectedRsrp.clear ();
978  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A4 with very high threshold",
979  config, expectedTime, expectedRsrp),
980  TestCase::TAKES_FOREVER);
981 
982  // === Event A5 (PCell becomes worse than absolute threshold1 AND neighbour becomes better than another absolute threshold2) ===
983 
984  // With low-low threshold
985  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
986  config.threshold1.range = 0;
987  config.threshold2.range = 0;
988  expectedTime.clear ();
989  expectedRsrp.clear ();
990  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with low-low threshold",
991  config, expectedTime, expectedRsrp),
992  TestCase::EXTENSIVE);
993 
994  // With low-normal threshold
995  config.threshold2.range = 58;
996  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with low-normal threshold",
997  config, expectedTime, expectedRsrp),
998  TestCase::TAKES_FOREVER);
999 
1000  // With low-high threshold
1001  config.threshold2.range = 97;
1002  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with low-high threshold",
1003  config, expectedTime, expectedRsrp),
1004  TestCase::TAKES_FOREVER);
1005 
1006  // With normal-low threshold
1007  config.threshold1.range = 58;
1008  config.threshold2.range = 0;
1009  expectedTime.clear ();
1010  expectedTime << 800 << 1400 << 1640 << 1880;
1011  expectedRsrp.clear ();
1012  expectedRsrp << 52 << 56 << 52 << 56;
1013  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with normal-low threshold",
1014  config, expectedTime, expectedRsrp),
1015  TestCase::EXTENSIVE);
1016 
1017  // With normal-normal threshold
1018  config.threshold2.range = 58;
1019  expectedTime.clear ();
1020  expectedTime << 800 << 1400 << 1640 << 1880;
1021  expectedRsrp.clear ();
1022  expectedRsrp << 52 << 56 << 52 << 56;
1023  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with normal-normal threshold",
1024  config, expectedTime, expectedRsrp),
1025  TestCase::EXTENSIVE);
1026 
1027  // With short time-to-trigger
1028  config.timeToTrigger = 160;
1029  expectedTime.clear ();
1030  expectedTime << 960 << 1560 << 1800 << 2040;
1031  expectedRsrp.clear ();
1032  expectedRsrp << 52 << 56 << 56 << 59;
1033  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with short time-to-trigger",
1034  config, expectedTime, expectedRsrp),
1035  TestCase::TAKES_FOREVER);
1036 
1037  // With super time-to-trigger
1038  config.timeToTrigger = 320;
1039  expectedTime.clear ();
1040  expectedTime << 1720 << 1960 << 2200;
1041  expectedRsrp.clear ();
1042  expectedRsrp << 52 << 56 << 72;
1043  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with super time-to-trigger",
1044  config, expectedTime, expectedRsrp),
1045  TestCase::QUICK);
1046 
1047  // With hysteresis
1048  config.hysteresis = 6;
1049  config.timeToTrigger = 0;
1050  expectedTime.clear ();
1051  expectedTime << 800 << 1600 << 1840 << 2080;
1052  expectedRsrp.clear ();
1053  expectedRsrp << 52 << 52 << 56 << 59;
1054  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with hysteresis",
1055  config, expectedTime, expectedRsrp),
1056  TestCase::QUICK);
1057 
1058  // With normal-high threshold
1059  config.threshold2.range = 97;
1060  config.hysteresis = 0;
1061  expectedTime.clear ();
1062  expectedRsrp.clear ();
1063  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with normal-high threshold",
1064  config, expectedTime, expectedRsrp),
1065  TestCase::TAKES_FOREVER);
1066 
1067  // With high-low threshold
1068  config.threshold1.range = 97;
1069  config.threshold2.range = 0;
1070  expectedTime.clear ();
1071  expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1072  expectedRsrp.clear ();
1073  expectedRsrp << 73 << 63 << 72 << 52 << 72 << 56 << 52 << 56 << 59;
1074  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with high-low threshold",
1075  config, expectedTime, expectedRsrp),
1076  TestCase::EXTENSIVE);
1077 
1078  // With high-normal threshold
1079  config.threshold2.range = 58;
1080  expectedTime.clear ();
1081  expectedTime << 400 << 800 << 1400 << 1640 << 1880;
1082  expectedRsrp.clear ();
1083  expectedRsrp << 63 << 52 << 56 << 52 << 56;
1084  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with high-normal threshold",
1085  config, expectedTime, expectedRsrp),
1086  TestCase::TAKES_FOREVER);
1087 
1088  // With high-high threshold
1089  config.threshold2.range = 97;
1090  expectedTime.clear ();
1091  expectedRsrp.clear ();
1092  AddTestCase (new LteUeMeasurementsPiecewiseTestCase2 ("Piecewise test case 2 - Event A5 with high-high threshold",
1093  config, expectedTime, expectedRsrp),
1094  TestCase::EXTENSIVE);
1095 
1096 } // end of LteUeMeasurementsPiecewiseTestSuite2::LteUeMeasurementsPiecewiseTestSuite2
1097 
1099 
1100 
1101 /*
1102  * Test Case
1103  */
1104 
1106  std::string name, LteRrcSap::ReportConfigEutra config,
1107  std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp)
1108  : TestCase (name),
1109  m_config (config),
1110  m_expectedTime (expectedTime),
1111  m_expectedRsrp (expectedRsrp)
1112 {
1113  // input sanity check
1114  uint16_t size = m_expectedTime.size ();
1115 
1116  if (size != m_expectedRsrp.size ())
1117  {
1118  NS_FATAL_ERROR ("Vectors of expected results are not of the same size");
1119  }
1120 
1121  m_itExpectedTime = m_expectedTime.begin ();
1122  m_itExpectedRsrp = m_expectedRsrp.begin ();
1123 
1124  NS_LOG_INFO (this << " name=" << name);
1125 }
1126 
1128 {
1129  NS_LOG_FUNCTION (this);
1130 }
1131 
1132 void
1134 {
1135  NS_LOG_INFO (this << " " << GetName ());
1136 
1137  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
1138  lteHelper->SetAttribute ("PathlossModel",
1139  StringValue ("ns3::FriisSpectrumPropagationLossModel"));
1140  lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (true));
1141 
1142  //Disable Uplink Power Control
1143  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false));
1144 
1145  // Create Nodes: eNodeB and UE
1146  NodeContainer enbNodes;
1147  NodeContainer ueNodes;
1148  enbNodes.Create (2);
1149  ueNodes.Create (1);
1150 
1151  /*
1152  * The topology is the following:
1153  *
1154  * eNodeB UE eNodeB
1155  * | | |
1156  * x ---- x --------------- x ------- x --------------- x ---- x
1157  * 50 m | 200 m | 100 m | 200 m | 50 m
1158  * | | | |
1159  * VeryNear Near Far VeryFar
1160  */
1161 
1162  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
1163  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // Serving eNodeB
1164  positionAlloc->Add (Vector (600.0, 0.0, 0.0)); // Neighbour eNodeB
1165  positionAlloc->Add (Vector (50.0, 0.0, 0.0)); // UE
1167  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
1168  mobility.SetPositionAllocator (positionAlloc);
1169  mobility.Install (enbNodes);
1170  mobility.Install (ueNodes);
1171  m_ueMobility = ueNodes.Get (0)->GetObject<MobilityModel> ();
1172 
1173  // Disable layer-3 filtering
1174  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
1175  UintegerValue (0));
1176 
1177  // Create Devices and install them in the Nodes (eNB and UE)
1178  NetDeviceContainer enbDevs;
1179  NetDeviceContainer ueDevs;
1180  lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
1181  lteHelper->SetSchedulerAttribute ("UlCqiFilter",
1182  EnumValue (FfMacScheduler::PUSCH_UL_CQI));
1183  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
1184  ueDevs = lteHelper->InstallUeDevice (ueNodes);
1185 
1186  // Setup UE measurement configuration in serving cell
1187  Ptr<LteEnbRrc> enbRrc1 = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetRrc ();
1189 
1190  // Disable handover in neighbour cell
1191  Ptr<LteEnbRrc> enbRrc2 = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetRrc ();
1192  enbRrc2->SetAttribute ("AdmitHandoverRequest", BooleanValue (false));
1193 
1194  // Attach UE to serving eNodeB
1195  lteHelper->Attach (ueDevs.Get (0), enbDevs.Get (0));
1196 
1197  // Activate an EPS bearer
1198  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
1199  EpsBearer bearer (q);
1200  lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
1201 
1202  // Connect to trace sources in serving eNodeB
1203  Config::Connect ("/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1205  this));
1206 
1207  /*
1208  * Schedule "teleports"
1209  * 0 1 2
1210  * +-------------------+-------------------+---------> time
1211  * VeryNear |------ ---- ---- --------
1212  * Near | ---- ----
1213  * Far | ---- ----
1214  * VeryFar | -- ---- ----
1215  */
1216  Simulator::Schedule (MilliSeconds (301),
1218  Simulator::Schedule (MilliSeconds (401),
1220  Simulator::Schedule (MilliSeconds (601),
1222  Simulator::Schedule (MilliSeconds (801),
1224  Simulator::Schedule (MilliSeconds (1001),
1226  Simulator::Schedule (MilliSeconds (1201),
1228  Simulator::Schedule (MilliSeconds (1401),
1230  Simulator::Schedule (MilliSeconds (1601),
1232  Simulator::Schedule (MilliSeconds (1801),
1234  Simulator::Schedule (MilliSeconds (2001),
1236 
1237  // Run simulation
1238  Simulator::Stop (Seconds (2.201));
1239  Simulator::Run ();
1240  Simulator::Destroy ();
1241 
1242 } // end of void LteUeMeasurementsPiecewiseTestCase2::DoRun ()
1243 
1244 void
1246 {
1247  NS_LOG_FUNCTION (this);
1248  bool hasEnded = m_itExpectedTime == m_expectedTime.end ();
1249  NS_TEST_ASSERT_MSG_EQ (hasEnded, true,
1250  "Reporting should have occurred at " << m_itExpectedTime->GetSeconds () << "s");
1251  hasEnded = m_itExpectedRsrp == m_expectedRsrp.end ();
1252  NS_ASSERT (hasEnded);
1253 }
1254 
1255 void
1257  std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
1259 {
1260  NS_LOG_FUNCTION (this << context);
1261  NS_ASSERT (rnti == 1);
1262  NS_ASSERT (cellId == 1);
1263 
1264  if (report.measResults.measId == m_expectedMeasId)
1265  {
1266  // verifying the report completeness
1267  LteRrcSap::MeasResults measResults = report.measResults;
1268  NS_LOG_DEBUG (this << " Serving cellId=" << cellId
1269  << " rsrp=" << (uint16_t) measResults.rsrpResult
1270  << " (" << EutranMeasurementMapping::RsrpRange2Dbm (measResults.rsrpResult) << " dBm)"
1271  << " rsrq=" << (uint16_t) measResults.rsrqResult
1272  << " (" << EutranMeasurementMapping::RsrqRange2Db (measResults.rsrqResult) << " dB)");
1273 
1274  // verifying reported best cells
1275  if (measResults.measResultListEutra.size () == 0)
1276  {
1277  NS_TEST_ASSERT_MSG_EQ (measResults.haveMeasResultNeighCells, false,
1278  "Unexpected report content");
1279  }
1280  else
1281  {
1283  "Unexpected report content");
1284  std::list<LteRrcSap::MeasResultEutra>::iterator it = measResults.measResultListEutra.begin ();
1285  NS_ASSERT (it != measResults.measResultListEutra.end ());
1286  NS_ASSERT (it->physCellId == 2);
1287  NS_TEST_ASSERT_MSG_EQ (it->haveCgiInfo, false,
1288  "Report contains cgi-info, which is not supported");
1289  NS_TEST_ASSERT_MSG_EQ (it->haveRsrpResult, true,
1290  "Report does not contain measured RSRP result");
1291  NS_TEST_ASSERT_MSG_EQ (it->haveRsrqResult, true,
1292  "Report does not contain measured RSRQ result");
1293  NS_LOG_DEBUG (this << " Neighbour cellId=" << it->physCellId
1294  << " rsrp=" << (uint16_t) it->rsrpResult
1295  << " (" << EutranMeasurementMapping::RsrpRange2Dbm (it->rsrpResult) << " dBm)"
1296  << " rsrq=" << (uint16_t) it->rsrqResult
1297  << " (" << EutranMeasurementMapping::RsrqRange2Db (it->rsrqResult) << " dB)");
1298 
1299  } // end of else of if (measResults.measResultListEutra.size () == 0)
1300 
1301  // verifying the report timing
1302  bool hasEnded = m_itExpectedTime == m_expectedTime.end ();
1303  NS_TEST_ASSERT_MSG_EQ (hasEnded, false,
1304  "Reporting should not have occurred at "
1305  << Simulator::Now ().GetSeconds () << "s");
1306  if (!hasEnded)
1307  {
1308  hasEnded = m_itExpectedRsrp == m_expectedRsrp.end ();
1309  NS_ASSERT (!hasEnded);
1310 
1311  // using milliseconds to avoid floating-point comparison
1312  uint64_t timeNowMs = Simulator::Now ().GetMilliSeconds ();
1313  uint64_t timeExpectedMs = m_itExpectedTime->GetMilliSeconds ();
1314  m_itExpectedTime++;
1315 
1316  uint16_t observedRsrp = measResults.rsrpResult;
1317  uint16_t referenceRsrp = *m_itExpectedRsrp;
1318  m_itExpectedRsrp++;
1319 
1320  NS_TEST_ASSERT_MSG_EQ (timeNowMs, timeExpectedMs,
1321  "Reporting should not have occurred at this time");
1322  NS_TEST_ASSERT_MSG_EQ (observedRsrp, referenceRsrp,
1323  "The RSRP observed differs with the reference RSRP");
1324 
1325  } // end of if (!hasEnded)
1326 
1327  } // end of if (report.measResults.measId == m_expectedMeasId)
1328 
1329 } // end of void LteUeMeasurementsPiecewiseTestCase2::RecvMeasurementReportCallback
1330 
1331 void
1333 {
1334  NS_LOG_FUNCTION (this);
1335  m_ueMobility->SetPosition (Vector (50.0, 0.0, 0.0));
1336 }
1337 
1338 void
1340 {
1341  NS_LOG_FUNCTION (this);
1342  m_ueMobility->SetPosition (Vector (250.0, 0.0, 0.0));
1343 }
1344 
1345 void
1347 {
1348  NS_LOG_FUNCTION (this);
1349  m_ueMobility->SetPosition (Vector (350.0, 0.0, 0.0));
1350 }
1351 
1352 void
1354 {
1355  NS_LOG_FUNCTION (this);
1356  m_ueMobility->SetPosition (Vector (550.0, 0.0, 0.0));
1357 }
1358 
1359 
1360 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-3 TEST SUITE ======================== //
1361 
1362 /*
1363  * Test Suite
1364  */
1365 
1367  : TestSuite ("lte-ue-measurements-piecewise-3", SYSTEM)
1368 {
1369  std::vector<Time> expectedTime;
1370 
1371  // === Event A4 (neighbor becomes better than threshold) ===
1372 
1373  //The threshold value was chosen to achieve the following:
1374  //1. Neighbor 1 (eNB2) RSRP would be above the chosen threshold, hence,
1375  //the UE will include it in its reports to its eNB (eNB1) from the beginning
1376  //of the simulation.
1377  //2. When neighbor 2 (eNB3) is placed at a very far position, its RSRP would
1378  //be less than the chosen threshold, hence, UE will not include it in its
1379  //initial report(s) to its eNB.
1380  //3. When neighbor 2 (eNB3) is placed at a near position, its RSRP would
1381  //always be above the chosen threshold, hence, the UE will include it in its
1382  //reports to its eNB (eNB1).
1384  config.triggerType = LteRrcSap::ReportConfigEutra::EVENT;
1385  config.eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1386  config.threshold1.choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRP;
1387  config.threshold1.range = 6;
1388  config.triggerQuantity = LteRrcSap::ReportConfigEutra::RSRP;
1389  config.reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1390  expectedTime.clear ();
1391  expectedTime << 200 << 440 << 680 << 920 << 1160 << 1400 << 1640 << 1880 << 2120;
1392 
1393  AddTestCase (new LteUeMeasurementsPiecewiseTestCase3 ("Piecewise test case 3 - Event A4",
1394  config, expectedTime),TestCase::QUICK);
1395 } // end of LteUeMeasurementsPiecewiseTestSuite3::LteUeMeasurementsPiecewiseTestSuite3
1396 
1398 
1399 
1400 /*
1401  * Test Case
1402  */
1403 
1405  std::string name, LteRrcSap::ReportConfigEutra config,
1406  std::vector<Time> expectedTime)
1407  : TestCase (name),
1408  m_config (config),
1409  m_expectedTime (expectedTime)
1410 {
1412 
1413  m_itExpectedTime = m_expectedTime.begin ();
1414 
1415  NS_LOG_INFO (this << " name=" << name);
1416 }
1417 
1419 {
1420  NS_LOG_FUNCTION (this);
1421 }
1422 
1423 void
1425 {
1426  NS_LOG_INFO (this << " " << GetName ());
1427 
1428  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
1429  lteHelper->SetAttribute ("PathlossModel",
1430  StringValue ("ns3::FriisSpectrumPropagationLossModel"));
1431  lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (true));
1432 
1433  //Disable Uplink Power Control
1434  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false));
1435 
1436  // Create Nodes: eNodeB and UE
1437  NodeContainer enbNodes;
1438  NodeContainer ueNodes;
1439  enbNodes.Create (3);
1440  ueNodes.Create (1);
1441 
1442  /*
1443  * The topology is the following:
1444  *
1445  * We place the 3rd eNB initially very far so it does not fulfills
1446  * the entry condition to be reported.
1447  *
1448  * eNodeB UE eNodeB eNodeB
1449  * | | | |
1450  * x ---- x --------------- x -------------- x ---------------------x
1451  * 50 m 100 m 500 | 1000000
1452  * Near
1453  */
1454 
1455  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
1456  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // Serving eNodeB
1457  positionAlloc->Add (Vector (200.0, 0.0, 0.0)); // Neighbour eNodeB1
1458  positionAlloc->Add (Vector (1000700.0, 0.0, 0.0)); // Neighbour eNodeB2
1459  positionAlloc->Add (Vector (50.0, 0.0, 0.0)); // UE
1461  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
1462  mobility.SetPositionAllocator (positionAlloc);
1463  mobility.Install (enbNodes);
1464  mobility.Install (ueNodes);
1465  m_enbMobility = enbNodes.Get (2)->GetObject<MobilityModel> ();
1466 
1467  // Disable layer-3 filtering
1468  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
1469  UintegerValue (0));
1470 
1471  // Create Devices and install them in the Nodes (eNB and UE)
1472  NetDeviceContainer enbDevs;
1473  NetDeviceContainer ueDevs;
1474  lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler");
1475  lteHelper->SetSchedulerAttribute ("UlCqiFilter",
1476  EnumValue (FfMacScheduler::PUSCH_UL_CQI));
1477  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
1478  ueDevs = lteHelper->InstallUeDevice (ueNodes);
1479 
1480  // Setup UE measurement configuration in serving cell
1481  Ptr<LteEnbRrc> enbRrc1 = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetRrc ();
1483 
1484  // Disable handover in neighbour cells
1485  Ptr<LteEnbRrc> enbRrc2 = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetRrc ();
1486  enbRrc2->SetAttribute ("AdmitHandoverRequest", BooleanValue (false));
1487  Ptr<LteEnbRrc> enbRrc3 = enbDevs.Get (2)->GetObject<LteEnbNetDevice> ()->GetRrc ();
1488  enbRrc3->SetAttribute ("AdmitHandoverRequest", BooleanValue (false));
1489 
1490  // Attach UE to serving eNodeB
1491  lteHelper->Attach (ueDevs.Get (0), enbDevs.Get (0));
1492 
1493  // Activate an EPS bearer
1494  enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE;
1495  EpsBearer bearer (q);
1496  lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
1497 
1498  // Connect to trace sources in serving eNodeB
1499  Config::Connect ("/NodeList/0/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
1501  this));
1502  /*
1503  * Schedule "teleport" for the 2nd neighbour
1504  *
1505  * We bring the 2nd neighbour near once the UE has already scheduled the periodic
1506  * reporting after detecting the 1st neighbour, which ideally should be at
1507  * 200 ms.
1508  */
1509  Simulator::Schedule (MilliSeconds (301),
1511 
1512  // Run simulation
1513  Simulator::Stop (Seconds (2.201));
1514  Simulator::Run ();
1515  Simulator::Destroy ();
1516 
1517 } // end of void LteUeMeasurementsPiecewiseTestCase3::DoRun ()
1518 
1519 void
1521 {
1522  NS_LOG_FUNCTION (this);
1523  bool hasEnded = m_itExpectedTime == m_expectedTime.end ();
1524  NS_TEST_ASSERT_MSG_EQ (hasEnded, true,
1525  "Reporting should have occurred at " << m_itExpectedTime->GetSeconds () << "s");
1526 }
1527 
1528 void
1530  std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
1532 {
1533  NS_LOG_FUNCTION (this << context);
1534  NS_ASSERT (rnti == 1);
1535  NS_ASSERT (cellId == 1);
1536 
1537  if (report.measResults.measId == m_expectedMeasId)
1538  {
1539  // verifying the report completeness
1540  LteRrcSap::MeasResults measResults = report.measResults;
1541  NS_LOG_DEBUG (this << " Serving cellId=" << cellId
1542  << " rsrp=" << (uint16_t) measResults.rsrpResult
1543  << " (" << EutranMeasurementMapping::RsrpRange2Dbm (measResults.rsrpResult) << " dBm)"
1544  << " rsrq=" << (uint16_t) measResults.rsrqResult
1545  << " (" << EutranMeasurementMapping::RsrqRange2Db (measResults.rsrqResult) << " dB)");
1546 
1547  // verifying reported best cells
1548  if (measResults.measResultListEutra.size () == 0)
1549  {
1550  NS_TEST_ASSERT_MSG_EQ (measResults.haveMeasResultNeighCells, false,
1551  "Unexpected report content");
1552  }
1553  else
1554  {
1556  "Unexpected report content");
1557  std::list<LteRrcSap::MeasResultEutra>::iterator it = measResults.measResultListEutra.begin ();
1558  NS_ASSERT (it != measResults.measResultListEutra.end ());
1559  for (const auto &it:measResults.measResultListEutra)
1560  {
1561  NS_ASSERT (it.physCellId == 2 || it.physCellId == 3);
1562  NS_TEST_ASSERT_MSG_EQ (it.haveCgiInfo, false,
1563  "Report contains cgi-info, which is not supported");
1564  NS_TEST_ASSERT_MSG_EQ (it.haveRsrpResult, true,
1565  "Report does not contain measured RSRP result");
1566  NS_TEST_ASSERT_MSG_EQ (it.haveRsrqResult, true,
1567  "Report does not contain measured RSRQ result");
1568  NS_LOG_DEBUG (this << " Neighbour cellId=" << it.physCellId
1569  << " rsrp=" << (uint16_t) it.rsrpResult
1570  << " (" << EutranMeasurementMapping::RsrpRange2Dbm (it.rsrpResult) << " dBm)"
1571  << " rsrq=" << (uint16_t) it.rsrqResult
1572  << " (" << EutranMeasurementMapping::RsrqRange2Db (it.rsrqResult) << " dB)");
1573  }
1574 
1575  } // end of else of if (measResults.measResultListEutra.size () == 0)
1576 
1577  // verifying the report timing
1578  bool hasEnded = m_itExpectedTime == m_expectedTime.end ();
1579  NS_TEST_ASSERT_MSG_EQ (hasEnded, false,
1580  "Reporting should not have occurred at "
1581  << Simulator::Now ().GetSeconds () << "s");
1582  if (!hasEnded)
1583  {
1584  // using milliseconds to avoid floating-point comparison
1585  uint64_t timeNowMs = Simulator::Now ().GetMilliSeconds ();
1586  uint64_t timeExpectedMs = m_itExpectedTime->GetMilliSeconds ();
1587  m_itExpectedTime++;
1588 
1589 
1590  NS_TEST_ASSERT_MSG_EQ (timeNowMs, timeExpectedMs,
1591  "Reporting should not have occurred at this time");
1592 
1593  } // end of if (!hasEnded)
1594 
1595  } // end of if (report.measResults.measId == m_expectedMeasId)
1596 
1597 } // end of void LteUeMeasurementsPiecewiseTestCase3::RecvMeasurementReportCallback
1598 
1599 void
1601 {
1602  NS_LOG_FUNCTION (this);
1603  m_enbMobility->SetPosition (Vector (700.0, 0.0, 0.0));
1604 }
1605 
1606 
1607 // ===== LTE-UE-MEASUREMENTS-HANDOVER TEST SUITE =========================== //
1608 
1609 /*
1610  * Test Suite
1611  */
1612 
1614  : TestSuite ("lte-ue-measurements-handover", SYSTEM)
1615 {
1616  std::list<LteRrcSap::ReportConfigEutra> sourceConfigList;
1617  std::list<LteRrcSap::ReportConfigEutra> targetConfigList;
1618  std::vector<Time> expectedTime;
1619  std::vector<uint8_t> expectedRsrp;
1620 
1621  LteRrcSap::ReportConfigEutra sourceConfig;
1622  sourceConfig.triggerType = LteRrcSap::ReportConfigEutra::EVENT;
1623  sourceConfig.eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1624  sourceConfig.threshold1.choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRP;
1625  sourceConfig.threshold1.range = 0;
1626  sourceConfig.triggerQuantity = LteRrcSap::ReportConfigEutra::RSRP;
1627  sourceConfig.reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1628  sourceConfigList.push_back (sourceConfig);
1629 
1630  LteRrcSap::ReportConfigEutra targetConfig;
1631  targetConfig.triggerType = LteRrcSap::ReportConfigEutra::EVENT;
1632  targetConfig.eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1633  targetConfig.threshold1.choice = LteRrcSap::ThresholdEutra::THRESHOLD_RSRP;
1634  targetConfig.threshold1.range = 0;
1635  targetConfig.triggerQuantity = LteRrcSap::ReportConfigEutra::RSRP;
1636  targetConfig.reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1637  targetConfigList.push_back (targetConfig);
1638 
1639  // === Report interval difference ===
1640 
1641  // decreasing report interval
1642  sourceConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS480;
1643  targetConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1644  expectedTime.clear ();
1645  expectedTime << 200 << 680 << 1200 << 1440 << 1680 << 1920;
1646  expectedRsrp.clear ();
1647  expectedRsrp << 55 << 55 << 53 << 53 << 53 << 53;
1648  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - decreasing report interval",
1649  sourceConfigList, targetConfigList,
1650  expectedTime, expectedRsrp,
1651  Seconds (2)),
1652  TestCase::TAKES_FOREVER);
1653 
1654  // increasing report interval
1655  sourceConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS120;
1656  targetConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS640;
1657  expectedTime.clear ();
1658  expectedTime << 200 << 320 << 440 << 560 << 680 << 800 << 920 << 1200 << 1840;
1659  expectedRsrp.clear ();
1660  expectedRsrp << 55 << 55 << 55 << 55 << 55 << 55 << 55 << 53 << 53;
1661  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - increasing report interval",
1662  sourceConfigList, targetConfigList,
1663  expectedTime, expectedRsrp,
1664  Seconds (2)),
1665  TestCase::QUICK);
1666 
1667  // === Event difference ===
1668 
1669  sourceConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1670  targetConfigList.front ().reportInterval = LteRrcSap::ReportConfigEutra::MS240;
1671  sourceConfigList.front ().threshold1.range = 54;
1672  sourceConfigList.front ().threshold2.range = 54;
1673  sourceConfigList.front ().a3Offset = 1;
1674  targetConfigList.front ().threshold1.range = 54;
1675  targetConfigList.front ().threshold2.range = 54;
1676  targetConfigList.front ().a3Offset = 1;
1677 
1678  // Event A1 to Event A2
1679  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1680  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1681  expectedTime.clear ();
1682  expectedTime << 200 << 440 << 680 << 920 << 1200 << 1440 << 1680 << 1920;
1683  expectedRsrp.clear ();
1684  expectedRsrp << 55 << 55 << 55 << 55 << 53 << 53 << 53 << 53;
1685  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A1 to Event A2",
1686  sourceConfigList, targetConfigList,
1687  expectedTime, expectedRsrp,
1688  Seconds (2)),
1689  TestCase::EXTENSIVE);
1690 
1691  // Event A2 to Event A1
1692  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1693  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1694  expectedTime.clear ();
1695  expectedRsrp.clear ();
1696  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A2 to Event A1",
1697  sourceConfigList, targetConfigList,
1698  expectedTime, expectedRsrp,
1699  Seconds (2)),
1700  TestCase::TAKES_FOREVER);
1701 
1702  // Event A3 to Event A4
1703  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1704  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1705  expectedTime.clear ();
1706  expectedTime << 1200 << 1440 << 1680 << 1920;
1707  expectedRsrp.clear ();
1708  expectedRsrp << 53 << 53 << 53 << 53;
1709  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A3 to Event A4",
1710  sourceConfigList, targetConfigList,
1711  expectedTime, expectedRsrp,
1712  Seconds (2)),
1713  TestCase::TAKES_FOREVER);
1714 
1715  // Event A4 to Event A3
1716  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1717  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1718  expectedTime.clear ();
1719  expectedTime << 1200 << 1440 << 1680 << 1920;
1720  expectedRsrp.clear ();
1721  expectedRsrp << 53 << 53 << 53 << 53;
1722  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A4 to Event A3",
1723  sourceConfigList, targetConfigList,
1724  expectedTime, expectedRsrp,
1725  Seconds (2)),
1726  TestCase::QUICK);
1727 
1728  // Event A2 to Event A3
1729  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1730  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1731  expectedTime.clear ();
1732  expectedTime << 1200 << 1440 << 1680 << 1920;
1733  expectedRsrp.clear ();
1734  expectedRsrp << 53 << 53 << 53 << 53;
1735  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A2 to Event A3",
1736  sourceConfigList, targetConfigList,
1737  expectedTime, expectedRsrp,
1738  Seconds (2)),
1739  TestCase::EXTENSIVE);
1740 
1741  // Event A3 to Event A2
1742  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1743  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1744  expectedTime.clear ();
1745  expectedTime << 1200 << 1440 << 1680 << 1920;
1746  expectedRsrp.clear ();
1747  expectedRsrp << 53 << 53 << 53 << 53;
1748  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A3 to Event A2",
1749  sourceConfigList, targetConfigList,
1750  expectedTime, expectedRsrp,
1751  Seconds (2)),
1752  TestCase::TAKES_FOREVER);
1753 
1754  // Event A4 to Event A5
1755  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1756  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
1757  expectedTime.clear ();
1758  expectedTime << 1200 << 1440 << 1680 << 1920;
1759  expectedRsrp.clear ();
1760  expectedRsrp << 53 << 53 << 53 << 53;
1761  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A4 to Event A5",
1762  sourceConfigList, targetConfigList,
1763  expectedTime, expectedRsrp,
1764  Seconds (2)),
1765  TestCase::TAKES_FOREVER);
1766 
1767  // Event A5 to Event A4
1768  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
1769  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1770  expectedTime.clear ();
1771  expectedTime << 1200 << 1440 << 1680 << 1920;
1772  expectedRsrp.clear ();
1773  expectedRsrp << 53 << 53 << 53 << 53;
1774  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A5 to Event A4",
1775  sourceConfigList, targetConfigList,
1776  expectedTime, expectedRsrp,
1777  Seconds (2)),
1778  TestCase::EXTENSIVE);
1779 
1780  // === Threshold/offset difference ===
1781 
1782  sourceConfigList.front ().threshold1.range = 52;
1783  targetConfigList.front ().threshold1.range = 56;
1784 
1785  // Event A1
1786  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1787  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1788  expectedTime.clear ();
1789  expectedTime << 200 << 440 << 680 << 920;
1790  expectedRsrp.clear ();
1791  expectedRsrp << 55 << 55 << 55 << 55;
1792  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A1 threshold difference",
1793  sourceConfigList, targetConfigList,
1794  expectedTime, expectedRsrp,
1795  Seconds (2)),
1796  TestCase::EXTENSIVE);
1797 
1798  // Event A2
1799  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1800  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A2;
1801  expectedTime.clear ();
1802  expectedTime << 1200 << 1440 << 1680 << 1920;
1803  expectedRsrp.clear ();
1804  expectedRsrp << 53 << 53 << 53 << 53;
1805  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A2 threshold difference",
1806  sourceConfigList, targetConfigList,
1807  expectedTime, expectedRsrp,
1808  Seconds (2)),
1809  TestCase::QUICK);
1810 
1811  // Event A3
1812  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1813  sourceConfigList.front ().a3Offset = -30;
1814  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A3;
1815  targetConfigList.front ().a3Offset = 30;
1816  expectedTime.clear ();
1817  expectedTime << 200 << 440 << 680 << 920;
1818  expectedRsrp.clear ();
1819  expectedRsrp << 55 << 55 << 55 << 55;
1820  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A3 offset difference",
1821  sourceConfigList, targetConfigList,
1822  expectedTime, expectedRsrp,
1823  Seconds (2)),
1824  TestCase::QUICK);
1825 
1826  // Event A4
1827  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1828  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A4;
1829  expectedTime.clear ();
1830  expectedTime << 200 << 440 << 680 << 920;
1831  expectedRsrp.clear ();
1832  expectedRsrp << 55 << 55 << 55 << 55;
1833  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A4 threshold difference",
1834  sourceConfigList, targetConfigList,
1835  expectedTime, expectedRsrp,
1836  Seconds (2)),
1837  TestCase::EXTENSIVE);
1838 
1839  // Event A5
1840  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
1841  sourceConfigList.front ().threshold2.range = 52;
1842  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A5;
1843  targetConfigList.front ().threshold2.range = 56;
1844  expectedTime.clear ();
1845  expectedRsrp.clear ();
1846  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - Event A5 threshold difference",
1847  sourceConfigList, targetConfigList,
1848  expectedTime, expectedRsrp,
1849  Seconds (2)),
1850  TestCase::EXTENSIVE);
1851 
1852  // === Time-to-trigger (TTT) difference ===
1853 
1854  sourceConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1855  sourceConfigList.front ().a3Offset = 1;
1856  sourceConfigList.front ().threshold1.range = 0;
1857  sourceConfigList.front ().threshold2.range = 0;
1858  targetConfigList.front ().eventId = LteRrcSap::ReportConfigEutra::EVENT_A1;
1859  targetConfigList.front ().a3Offset = 1;
1860  targetConfigList.front ().threshold1.range = 0;
1861  targetConfigList.front ().threshold2.range = 0;
1862 
1863  // decreasing time-to-trigger (short duration)
1864  sourceConfigList.front ().timeToTrigger = 1024;
1865  targetConfigList.front ().timeToTrigger = 100;
1866  expectedTime.clear ();
1867  expectedTime << 1300 << 1540 << 1780;
1868  expectedRsrp.clear ();
1869  expectedRsrp << 53 << 53 << 53;
1870  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - decreasing TTT (short)",
1871  sourceConfigList, targetConfigList,
1872  expectedTime, expectedRsrp,
1873  Seconds (2)),
1874  TestCase::QUICK);
1875 
1876  // decreasing time-to-trigger (longer duration)
1877  sourceConfigList.front ().timeToTrigger = 1024;
1878  targetConfigList.front ().timeToTrigger = 640;
1879  expectedTime.clear ();
1880  expectedTime << 1224 << 1464 << 1704 << 1944 << 2840 << 3080 << 3320 << 3560 << 3800 << 4040;
1881  expectedRsrp.clear ();
1882  expectedRsrp << 55 << 55 << 55 << 55 << 53 << 53 << 53 << 53 << 53 << 53;
1883  AddTestCase (new LteUeMeasurementsHandoverTestCase ("Handover test case - decreasing TTT (long)",
1884  sourceConfigList, targetConfigList,
1885  expectedTime, expectedRsrp,
1886  Seconds (4.2)),
1887  TestCase::EXTENSIVE);
1888 
1889 } // end of LteUeMeasurementsHandoverTestSuite::LteUeMeasurementsHandoverTestSuite
1890 
1892 
1893 
1894 /*
1895  * Test Case
1896  */
1897 
1899  std::string name,
1900  std::list<LteRrcSap::ReportConfigEutra> sourceConfigList,
1901  std::list<LteRrcSap::ReportConfigEutra> targetConfigList,
1902  std::vector<Time> expectedTime, std::vector<uint8_t> expectedRsrp,
1903  Time duration)
1904  : TestCase (name),
1905  m_sourceConfigList (sourceConfigList),
1906  m_targetConfigList (targetConfigList),
1907  m_expectedTime (expectedTime),
1908  m_expectedRsrp (expectedRsrp),
1909  m_duration (duration)
1910 {
1911  // input sanity check
1912  uint16_t size = m_expectedTime.size ();
1913 
1914  if (size != m_expectedRsrp.size ())
1915  {
1916  NS_FATAL_ERROR ("Vectors of expected results are not of the same size");
1917  }
1918 
1919  m_itExpectedTime = m_expectedTime.begin ();
1920  m_itExpectedRsrp = m_expectedRsrp.begin ();
1921 
1922  NS_LOG_INFO (this << " name=" << name);
1923 }
1924 
1926 {
1927  NS_LOG_FUNCTION (this);
1928 }
1929 
1930 void
1932 {
1933  NS_LOG_INFO (this << " " << GetName ());
1934 
1935  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
1936  Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
1937  lteHelper->SetEpcHelper (epcHelper);
1938  lteHelper->SetAttribute ("PathlossModel",
1939  StringValue ("ns3::FriisSpectrumPropagationLossModel"));
1940  lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (true));
1941 
1942  //Disable Uplink Power Control
1943  Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (false));
1944 
1945 
1946  // Create Nodes: eNodeB and UE
1947  NodeContainer enbNodes;
1948  NodeContainer ueNodes;
1949  enbNodes.Create (2);
1950  ueNodes.Create (1);
1951 
1952  /*
1953  * The topology is the following:
1954  *
1955  * eNodeB UE eNodeB
1956  * | | |
1957  * x ------------------- x ----------------------- x
1958  * 400 m 500 m
1959  */
1960 
1961  Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
1962  positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // Source eNodeB
1963  positionAlloc->Add (Vector (900.0, 0.0, 0.0)); // Target eNodeB
1964  positionAlloc->Add (Vector (400.0, 0.0, 0.0)); // UE
1966  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
1967  mobility.SetPositionAllocator (positionAlloc);
1968  mobility.Install (enbNodes);
1969  mobility.Install (ueNodes);
1970 
1971  // Create P-GW node
1972  Ptr<Node> pgw = epcHelper->GetPgwNode ();
1973 
1974  // Create a single RemoteHost
1975  NodeContainer remoteHostContainer;
1976  remoteHostContainer.Create (1);
1977  Ptr<Node> remoteHost = remoteHostContainer.Get (0);
1978  InternetStackHelper internet;
1979  internet.Install (remoteHostContainer);
1980 
1981  // Create the Internet
1982  PointToPointHelper p2ph;
1983  p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
1984  p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
1985  p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
1986  NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
1987  Ipv4AddressHelper ipv4h;
1988  ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
1989  Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
1990 
1991  // Routing of the Internet Host (towards the LTE network)
1992  Ipv4StaticRoutingHelper ipv4RoutingHelper;
1993  Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
1994  remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
1995 
1996  // Enable layer-3 filtering
1997  Config::SetDefault ("ns3::LteEnbRrc::RsrpFilterCoefficient",
1998  UintegerValue (4));
1999 
2000  // Disable control channel error model
2001  Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled",
2002  BooleanValue (false));
2003 
2004  // Create Devices and install them in the Nodes (eNB and UE)
2005  NetDeviceContainer enbDevs;
2006  NetDeviceContainer ueDevs;
2007  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
2008  ueDevs = lteHelper->InstallUeDevice (ueNodes);
2009 
2010  // Setup UE measurement configuration in eNodeBs
2011  uint8_t measId;
2012  std::list<LteRrcSap::ReportConfigEutra>::const_iterator itReportConfig;
2013  Ptr<LteEnbRrc> enbRrc1 = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetRrc ();
2014  Ptr<LteEnbRrc> enbRrc2 = enbDevs.Get (1)->GetObject<LteEnbNetDevice> ()->GetRrc ();
2015 
2016  for (itReportConfig = m_sourceConfigList.begin ();
2017  itReportConfig != m_sourceConfigList.end (); itReportConfig++)
2018  {
2019  measId = enbRrc1->AddUeMeasReportConfig (*itReportConfig);
2020  m_expectedSourceCellMeasId.insert (measId);
2021  }
2022 
2023  for (itReportConfig = m_targetConfigList.begin ();
2024  itReportConfig != m_targetConfigList.end (); itReportConfig++)
2025  {
2026  measId = enbRrc2->AddUeMeasReportConfig (*itReportConfig);
2027  m_expectedTargetCellMeasId.insert (measId);
2028  }
2029 
2030  // Install the IP stack on the UEs
2031  internet.Install (ueNodes);
2032  Ipv4InterfaceContainer ueIpIfaces;
2033  ueIpIfaces = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueDevs));
2034 
2035  // Assign IP address to UEs
2036  for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
2037  {
2038  Ptr<Node> ueNode = ueNodes.Get (u);
2039  // Set the default gateway for the UE
2040  Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ());
2041  ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
2042  }
2043 
2044  // Attach UE to serving eNodeB
2045  lteHelper->Attach (ueDevs.Get (0), enbDevs.Get (0));
2046 
2047  // Add X2 interface
2048  lteHelper->AddX2Interface (enbNodes);
2049 
2050  // Connect to trace sources in source eNodeB
2051  Config::Connect ("/NodeList/3/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
2053  this));
2054 
2055  // Connect to trace sources in target eNodeB
2056  Config::Connect ("/NodeList/4/DeviceList/0/LteEnbRrc/RecvMeasurementReport",
2058  this));
2059 
2060  // Schedule handover
2062  ueDevs.Get (0), enbDevs.Get (0), enbDevs.Get (1));
2063 
2064  // Run simulation
2065  Simulator::Stop (m_duration);
2066  Simulator::Run ();
2067  Simulator::Destroy ();
2068 
2069 } // end of void LteUeMeasurementsHandoverTestCase::DoRun ()
2070 
2071 void
2073 {
2074  NS_LOG_FUNCTION (this);
2075  bool hasEnded = m_itExpectedTime == m_expectedTime.end ();
2076  NS_TEST_ASSERT_MSG_EQ (hasEnded, true,
2077  "Reporting should have occurred at " << m_itExpectedTime->GetSeconds () << "s");
2078  hasEnded = m_itExpectedRsrp == m_expectedRsrp.end ();
2079  NS_ASSERT (hasEnded);
2080 }
2081 
2082 void
2084  std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti,
2086 {
2087  uint8_t measId = report.measResults.measId;
2088  NS_LOG_FUNCTION (this << context << (uint16_t) measId);
2089 
2090  bool isCorrectMeasId;
2091  if (cellId == 1)
2092  {
2093  std::set<uint8_t>::iterator itMeasId = m_expectedSourceCellMeasId.find (measId);
2094  isCorrectMeasId = (itMeasId != m_expectedSourceCellMeasId.end ());
2095  }
2096  else if (cellId == 2)
2097  {
2098  std::set<uint8_t>::iterator itMeasId = m_expectedTargetCellMeasId.find (measId);
2099  isCorrectMeasId = (itMeasId != m_expectedTargetCellMeasId.end ());
2100  }
2101  else
2102  {
2103  NS_FATAL_ERROR ("Invalid cell ID " << cellId);
2104  }
2105 
2106  if (isCorrectMeasId)
2107  {
2108  // verifying the report completeness
2109  LteRrcSap::MeasResults measResults = report.measResults;
2110  NS_LOG_DEBUG (this << " Serving cellId=" << cellId
2111  << " rsrp=" << (uint16_t) measResults.rsrpResult
2112  << " (" << EutranMeasurementMapping::RsrpRange2Dbm (measResults.rsrpResult) << " dBm)"
2113  << " rsrq=" << (uint16_t) measResults.rsrqResult
2114  << " (" << EutranMeasurementMapping::RsrqRange2Db (measResults.rsrqResult) << " dB)");
2115 
2116  // verifying reported best cells
2117  if (measResults.measResultListEutra.size () == 0)
2118  {
2119  NS_TEST_ASSERT_MSG_EQ (measResults.haveMeasResultNeighCells, false,
2120  "Unexpected report content");
2121  }
2122  else
2123  {
2125  "Unexpected report content");
2126  std::list<LteRrcSap::MeasResultEutra>::iterator it = measResults.measResultListEutra.begin ();
2127  NS_ASSERT (it != measResults.measResultListEutra.end ());
2128  NS_ASSERT (it->physCellId != cellId);
2129  NS_ASSERT (it->physCellId <= 2);
2130  NS_TEST_ASSERT_MSG_EQ (it->haveCgiInfo, false,
2131  "Report contains cgi-info, which is not supported");
2132  NS_TEST_ASSERT_MSG_EQ (it->haveRsrpResult, true,
2133  "Report does not contain measured RSRP result");
2134  NS_TEST_ASSERT_MSG_EQ (it->haveRsrqResult, true,
2135  "Report does not contain measured RSRQ result");
2136  NS_LOG_DEBUG (this << " Neighbour cellId=" << it->physCellId
2137  << " rsrp=" << (uint16_t) it->rsrpResult
2138  << " (" << EutranMeasurementMapping::RsrpRange2Dbm (it->rsrpResult) << " dBm)"
2139  << " rsrq=" << (uint16_t) it->rsrqResult
2140  << " (" << EutranMeasurementMapping::RsrqRange2Db (it->rsrqResult) << " dB)");
2141 
2142  } // end of else of if (measResults.measResultListEutra.size () == 0)
2143 
2144  // verifying the report timing
2145  bool hasEnded = m_itExpectedTime == m_expectedTime.end ();
2146  NS_TEST_ASSERT_MSG_EQ (hasEnded, false,
2147  "Reporting should not have occurred at "
2148  << Simulator::Now ().GetSeconds () << "s");
2149  if (!hasEnded)
2150  {
2151  hasEnded = m_itExpectedRsrp == m_expectedRsrp.end ();
2152  NS_ASSERT (!hasEnded);
2153 
2154  // using milliseconds to avoid floating-point comparison
2155  uint64_t timeNowMs = Simulator::Now ().GetMilliSeconds ();
2156  uint64_t timeExpectedMs = m_itExpectedTime->GetMilliSeconds ();
2157  m_itExpectedTime++;
2158 
2159  uint16_t observedRsrp = measResults.rsrpResult;
2160  uint16_t referenceRsrp = *m_itExpectedRsrp;
2161  m_itExpectedRsrp++;
2162 
2163  NS_TEST_ASSERT_MSG_EQ (timeNowMs, timeExpectedMs,
2164  "Reporting should not have occurred at this time");
2165  NS_TEST_ASSERT_MSG_EQ (observedRsrp, referenceRsrp,
2166  "The RSRP observed differs with the reference RSRP");
2167 
2168  } // end of if (!hasEnded)
2169 
2170  } // end of if (report.measResults.measId == correctMeasId)
2171 
2172 } // end of void LteUeMeasurementsHandoverTestCase::RecvMeasurementReportCallback
void TeleportVeryNear()
Teleport very near function.
void TeleportNear()
Teleport near function.
enum ns3::LteRrcSap::ThresholdEutra::@63 choice
Threshold enumeration.
Ptr< MobilityModel > m_ueMobility
the mobility model
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint8_t m_expectedMeasId
The measurement identity being tested.
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in piecewise configuration and 24...
MeasurementReport structure.
Definition: lte-rrc-sap.h:901
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
AttributeValue implementation for Boolean.
Definition: boolean.h:36
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:474
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
Triggers when either one of the eNodeBs receives measurement report from UE, then perform verificatio...
holds a vector of std::pair of Ptr<Ipv4> and interface index.
void SetDefaultRoute(Ipv4Address nextHop, uint32_t interface, uint32_t metric=0)
Add a default route to the static routing table.
std::list< LteRrcSap::ReportConfigEutra > m_sourceConfigList
The list of active report triggering configuration for the source eNodeB.
Hold variables of type string.
Definition: string.h:41
uint8_t hysteresis
Parameter used within the entry and leave condition of an event triggered reporting condition...
Definition: lte-rrc-sap.h:391
void HandoverRequest(Time hoTime, Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
Manually trigger an X2-based handover.
Definition: lte-helper.cc:1246
NetDeviceContainer Install(NodeContainer c)
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:269
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
Definition: lte-rrc-sap.h:684
A suite of tests to run.
Definition: test.h:1343
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
Definition: callback.h:1703
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
Definition: lte-rrc-sap.h:381
void ReportUeMeasurementsCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell, uint8_t componentCarrierId)
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:361
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
Definition: assert.h:67
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
Definition: lte-helper.cc:961
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1286
aggregate IP/TCP/UDP functionality to existing Nodes.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
Build a set of PointToPointNetDevice objects.
enum ns3::LteRrcSap::ReportConfigEutra::@66 triggerQuantity
Trigger type enumeration.
encapsulates test code
Definition: test.h:1153
Ptr< MobilityModel > m_enbMobility
the mobility model
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
Definition: lte-helper.cc:1314
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
static LteUeMeasurementsPiecewiseTestSuite2 lteUeMeasurementsPiecewiseTestSuite2
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
Testing UE measurements in LTE with simulation of 1 eNodeB and 1 UE in piecewise configuration and 12...
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it...
Test that UE Measurements (see 36.214) calculation works fine in a multi-cell interference scenario...
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:279
mobility
Definition: third.py:108
void TeleportVeryFar()
Teleport very far function.
Class for representing data rates.
Definition: data-rate.h:88
uint8_t rsrpResult
RSRP result.
Definition: lte-rrc-sap.h:681
Keep track of the current position and velocity of an object.
std::set< uint8_t > m_expectedTargetCellMeasId
The list of measurement identities being tested in the target cell.
uint8_t AddUeMeasReportConfig(LteRrcSap::ReportConfigEutra config)
Add a new UE measurement reporting configuration.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
Test that UE measurements calculation works properly in a scenario with 2 eNodeBs and 2UEs...
double m_rsrpDbmUeNeighborCell
RSRP in dBm UE 2.
static const Time UE_MEASUREMENT_REPORT_DELAY
Artificial delay of UE measurements procedure.
Definition: lte-ue-rrc.h:67
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
static LteUeMeasurementsTestSuite lteUeMeasurementsTestSuite
Hold variables of type enum.
Definition: enum.h:54
#define max(a, b)
Definition: 80211b.c:43
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsHandoverTestCase.
MeasResults measResults
measure results
Definition: lte-rrc-sap.h:903
AttributeValue implementation for Time.
Definition: nstime.h:1342
MeasResults structure.
Definition: lte-rrc-sap.h:678
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
Hold an unsigned integer type.
Definition: uinteger.h:44
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Definition: lte-helper.cc:293
#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:166
holds a vector of ns3::NetDevice pointers
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
enum ns3::LteRrcSap::ReportConfigEutra::@68 reportInterval
Report interval enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@65 eventId
Event enumeration.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
double m_rsrqDbUeServingCell
RSRQ in dBm UE 1.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
void TeleportNear()
Teleport near function.
#define NS_TEST_ASSERT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report and...
Definition: test.h:378
void Connect(std::string path, const CallbackBase &cb)
Definition: config.cc:918
void TeleportVeryFar()
Teleport far function.
LteUeMeasurementsPiecewiseTestCase1(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
Constructor.
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:76
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
Time m_duration
Duration of simulation.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
void RecvMeasurementReport(uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Reeive measurement report function.
bool reportOnLeave
Indicates whether or not the UE shall initiate the measurement reporting procedure when the leaving c...
Definition: lte-rrc-sap.h:385
Every class exported by the ns3 library is enclosed in the ns3 namespace.
keep track of a set of node pointers.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
static LteUeMeasurementsPiecewiseTestSuite3 lteUeMeasurementsPiecewiseTestSuite3
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
bool haveMeasResultNeighCells
have measure result neighbor cells
Definition: lte-rrc-sap.h:683
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
Definition: lte-helper.cc:1221
double m_d2
distance between UE and other ENB node
uint8_t range
Value range used in RSRP/RSRQ threshold.
Definition: lte-rrc-sap.h:357
LteUeMeasurementsHandoverTestCase(std::string name, std::list< LteRrcSap::ReportConfigEutra > sourceConfigList, std::list< LteRrcSap::ReportConfigEutra > targetConfigList, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp, Time duration)
Constructor.
double m_rsrqDbUeNeighborCell
RSRQ in dBm UE 2.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase1...
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:91
virtual void DoRun(void)
Implementation to actually run this TestCase.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
void TeleportVeryNear()
Teleport very near function.
void SetPosition(const Vector &position)
std::list< LteRrcSap::ReportConfigEutra > m_targetConfigList
The list of active report triggering configuration for the target eNodeB.
LteUeMeasurementsTestCase(std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2)
Constructor.
int8_t a3Offset
Offset value for Event A3. An integer between -30 and 30. The actual value is (value * 0...
Definition: lte-rrc-sap.h:388
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
uint8_t measId
measure ID
Definition: lte-rrc-sap.h:680
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:489
static LteUeMeasurementsPiecewiseTestSuite1 lteUeMeasurementsPiecewiseTestSuite1
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.
double m_rsrpDbmUeServingCell
RSRP in dBm UE 1.
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration...
Ptr< MobilityModel > m_ueMobility
the mobility model
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
std::set< uint8_t > m_expectedSourceCellMeasId
The list of measurement identities being tested in the source cell.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
std::string GetName(void) const
Definition: test.cc:370
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:272
uint8_t m_expectedMeasId
The measurement identity being tested.
Helper class that adds ns3::Ipv4StaticRouting objects.
AttributeValue implementation for DataRate.
Definition: data-rate.h:229
int64_t GetMilliSeconds(void) const
Get an approximation of the time stored in this instance in the indicated unit.
Definition: nstime.h:383
LteUeMeasurementsPiecewiseTestCase3(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime)
Constructor.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:273
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
void TeleportEnbNear()
Teleport the eNb near function.
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1278
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase3...
double m_d1
distance between UE and ENB node pair
void Add(Vector v)
Add a position to the list of positions.
void ReportUeMeasurements(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
Report UE measurements function.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
void RecvMeasurementReportCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Testing UE measurements in LTE with simulation of 3 eNodeB and 1 UE in piecewise configuration and 24...
Qci
QoS Class Indicator.
Definition: eps-bearer.h:106
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase2...
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:287
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it...
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void TeleportFar()
Teleport far function.
uint8_t rsrqResult
RSRQ result.
Definition: lte-rrc-sap.h:682
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
uint8_t m_expectedMeasId
The measurement identity being tested.
This class can be used to hold variables of floating point type such as &#39;double&#39; or &#39;float&#39;...
Definition: double.h:41
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
uint16_t timeToTrigger
Time during which specific criteria for the event needs to be met in order to trigger a measurement r...
Definition: lte-rrc-sap.h:394
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:185
The eNodeB device implementation.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
void RecvMeasurementReportCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport report)
Triggers when eNodeB receives measurement report from UE, then perform verification on it...
static LteUeMeasurementsHandoverTestSuite lteUeMeasurementsHandoverTestSuite
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Definition: callback.h:1642
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 SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
LteUeMeasurementsPiecewiseTestCase2(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
Constructor.
enum ns3::LteRrcSap::ReportConfigEutra::@64 triggerType
Trigger enumeration.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
ThresholdEutra threshold2
Threshold for event A5.
Definition: lte-rrc-sap.h:382