A Discrete-Event Network Simulator
API
lte-test-ue-measurements.h
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  * adapt lte-test-interference.cc to lte-ue-measurements.cc
22  * Budiarto Herman <budiarto.herman@magister.fi>
23  */
24 
25 #ifndef LTE_TEST_UE_MEASUREMENTS_H
26 #define LTE_TEST_UE_MEASUREMENTS_H
27 
28 #include <ns3/test.h>
29 #include <ns3/lte-rrc-sap.h>
30 #include <ns3/nstime.h>
31 #include <list>
32 #include <set>
33 #include <vector>
34 
35 namespace ns3 {
36 
37 class MobilityModel;
38 
39 }
40 
41 using namespace ns3;
42 
43 
44 // ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== //
45 
46 
55 {
56 public:
58 };
59 
60 
70 {
71 public:
83  LteUeMeasurementsTestCase (std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2);
84  virtual ~LteUeMeasurementsTestCase ();
85 
94  void ReportUeMeasurements (uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell);
95 
103  void RecvMeasurementReport (uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas);
104 
105 private:
106  virtual void DoRun (void);
107 
108  double m_d1;
109  double m_d2;
114 
115 };
116 
117 
118 
119 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-1 TEST SUITE ======================== //
120 
121 
130 {
131 public:
133 };
134 
135 
155 {
156 public:
165  LteUeMeasurementsPiecewiseTestCase1 (std::string name,
167  std::vector<Time> expectedTime,
168  std::vector<uint8_t> expectedRsrp);
169 
171 
188  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
189  uint16_t cellId, uint16_t rnti,
191 
192 private:
199  virtual void DoRun ();
200 
205  virtual void DoTeardown ();
206 
208  void TeleportVeryNear ();
210  void TeleportNear ();
212  void TeleportFar ();
214  void TeleportVeryFar ();
215 
220 
225  std::vector<Time> m_expectedTime;
226 
231  std::vector<uint8_t> m_expectedRsrp;
232 
237  std::vector<Time>::iterator m_itExpectedTime;
238 
243  std::vector<uint8_t>::iterator m_itExpectedRsrp;
244 
251 
253 
254 }; // end of class LteUeMeasurementsPiecewiseTestCase1
255 
256 
257 
258 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-2 TEST SUITE ======================== //
259 
260 
269 {
270 public:
272 };
273 
274 
294 {
295 public:
304  LteUeMeasurementsPiecewiseTestCase2 (std::string name,
306  std::vector<Time> expectedTime,
307  std::vector<uint8_t> expectedRsrp);
308 
310 
327  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
328  uint16_t cellId, uint16_t rnti,
330 
331 private:
338  virtual void DoRun ();
339 
344  virtual void DoTeardown ();
345 
347  void TeleportVeryNear ();
349  void TeleportNear ();
351  void TeleportFar ();
353  void TeleportVeryFar ();
354 
359 
364  std::vector<Time> m_expectedTime;
365 
370  std::vector<uint8_t> m_expectedRsrp;
371 
376  std::vector<Time>::iterator m_itExpectedTime;
377 
382  std::vector<uint8_t>::iterator m_itExpectedRsrp;
383 
390 
392 
393 }; // end of class LteUeMeasurementsPiecewiseTestCase2
394 
395 
396 
397 // ===== LTE-UE-MEASUREMENTS-HANDOVER TEST SUITE =========================== //
398 
399 
408 {
409 public:
411 };
412 
413 
433 {
434 public:
445  LteUeMeasurementsHandoverTestCase (std::string name,
446  std::list<LteRrcSap::ReportConfigEutra> sourceConfigList,
447  std::list<LteRrcSap::ReportConfigEutra> targetConfigList,
448  std::vector<Time> expectedTime,
449  std::vector<uint8_t> expectedRsrp,
450  Time duration);
451 
453 
470  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
471  uint16_t cellId, uint16_t rnti,
473 
474 private:
481  virtual void DoRun ();
482 
487  virtual void DoTeardown ();
488 
493  std::list<LteRrcSap::ReportConfigEutra> m_sourceConfigList;
494 
499  std::list<LteRrcSap::ReportConfigEutra> m_targetConfigList;
500 
505  std::vector<Time> m_expectedTime;
506 
511  std::vector<uint8_t> m_expectedRsrp;
512 
517  std::vector<Time>::iterator m_itExpectedTime;
518 
523  std::vector<uint8_t>::iterator m_itExpectedRsrp;
524 
529 
535  std::set<uint8_t> m_expectedSourceCellMeasId;
536 
542  std::set<uint8_t> m_expectedTargetCellMeasId;
543 
544 }; // end of class LteUeMeasurementsHandoverTestCase
545 
546 #endif /* LTE_TEST_UE_MEASUREMENTS_H */
Ptr< MobilityModel > m_ueMobility
the mobility model
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:102
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:894
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
std::list< LteRrcSap::ReportConfigEutra > m_sourceConfigList
The list of active report triggering configuration for the source eNodeB.
A suite of tests to run.
Definition: test.h:1342
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:354
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
encapsulates test code
Definition: test.h:1155
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...
Test that UE Measurements (see 36.214) calculation works fine in a multi-cell interference scenario...
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.
Test that UE measurements calculation works properly in a scenario with 2 eNodeBs and 2UEs...
double m_rsrpDbmUeNeighborCell
RSRP in dBm UE 2.
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsHandoverTestCase.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
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.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
Time m_duration
Duration of simulation.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
double m_d2
distance between UE and other ENB node
double m_rsrqDbUeNeighborCell
RSRQ in dBm UE 2.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase1...
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
std::list< LteRrcSap::ReportConfigEutra > m_targetConfigList
The list of active report triggering configuration for the target eNodeB.
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
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.
uint8_t m_expectedMeasId
The measurement identity being tested.
double m_d1
distance between UE and ENB node pair
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)
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase2...
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.