A Discrete-Event Network Simulator
API
lte-test-ue-measurements.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation;
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program; if not, write to the Free Software
15  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16  *
17  * Author: Manuel Requena <manuel.requena@cttc.es>
18  * Nicola Baldo <nbaldo@cttc.es>
19  * Marco Miozzo <mmiozzo@cttc.es>
20  * adapt lte-test-interference.cc to lte-ue-measurements.cc
21  * Budiarto Herman <budiarto.herman@magister.fi>
22  */
23 
24 #ifndef LTE_TEST_UE_MEASUREMENTS_H
25 #define LTE_TEST_UE_MEASUREMENTS_H
26 
27 #include <ns3/lte-rrc-sap.h>
28 #include <ns3/nstime.h>
29 #include <ns3/test.h>
30 
31 #include <list>
32 #include <set>
33 #include <vector>
34 
35 namespace ns3
36 {
37 
38 class MobilityModel;
39 
40 }
41 
42 using namespace ns3;
43 
44 // ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== //
45 
53 {
54  public:
56 };
57 
66 {
67  public:
79  LteUeMeasurementsTestCase(std::string name,
80  double d1,
81  double d2,
82  double rsrpDbmUe1,
83  double rsrpDbmUe2,
84  double rsrqDbUe1,
85  double rsrqDbUe2);
86  ~LteUeMeasurementsTestCase() override;
87 
96  void ReportUeMeasurements(uint16_t rnti,
97  uint16_t cellId,
98  double rsrp,
99  double rsrq,
100  bool servingCell);
101 
109  void RecvMeasurementReport(uint64_t imsi,
110  uint16_t cellId,
111  uint16_t rnti,
113 
114  private:
115  void DoRun() override;
116 
117  double m_d1;
118  double m_d2;
123 };
124 
125 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-1 TEST SUITE ======================== //
126 
134 {
135  public:
137 };
138 
157 {
158  public:
167  LteUeMeasurementsPiecewiseTestCase1(std::string name,
169  std::vector<Time> expectedTime,
170  std::vector<uint8_t> expectedRsrp);
171 
173 
190  void RecvMeasurementReportCallback(std::string context,
191  uint64_t imsi,
192  uint16_t cellId,
193  uint16_t rnti,
195 
196  private:
203  void DoRun() override;
204 
209  void DoTeardown() override;
210 
212  void TeleportVeryNear();
214  void TeleportNear();
216  void TeleportFar();
218  void TeleportVeryFar();
219 
224 
229  std::vector<Time> m_expectedTime;
230 
235  std::vector<uint8_t> m_expectedRsrp;
236 
241  std::vector<Time>::iterator m_itExpectedTime;
242 
247  std::vector<uint8_t>::iterator m_itExpectedRsrp;
248 
255 
257 
258 }; // end of class LteUeMeasurementsPiecewiseTestCase1
259 
260 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-2 TEST SUITE ======================== //
261 
269 {
270  public:
272 };
273 
292 {
293  public:
302  LteUeMeasurementsPiecewiseTestCase2(std::string name,
304  std::vector<Time> expectedTime,
305  std::vector<uint8_t> expectedRsrp);
306 
308 
325  void RecvMeasurementReportCallback(std::string context,
326  uint64_t imsi,
327  uint16_t cellId,
328  uint16_t rnti,
330 
331  private:
338  void DoRun() override;
339 
344  void DoTeardown() override;
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 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-3 TEST SUITE ======================== //
396 
404 {
405  public:
407 };
408 
445 {
446  public:
454  LteUeMeasurementsPiecewiseTestCase3(std::string name,
456  std::vector<Time> expectedTime);
457 
459 
476  void RecvMeasurementReportCallback(std::string context,
477  uint64_t imsi,
478  uint16_t cellId,
479  uint16_t rnti,
481 
482  private:
489  void DoRun() override;
490 
495  void DoTeardown() override;
496 
498  void TeleportEnbNear();
499 
504 
509  std::vector<Time> m_expectedTime;
510 
515  std::vector<Time>::iterator m_itExpectedTime;
516 
523 
525 
526 }; // end of class LteUeMeasurementsPiecewiseTestCase3
527 
528 // ===== LTE-UE-MEASUREMENTS-HANDOVER TEST SUITE =========================== //
529 
537 {
538  public:
540 };
541 
560 {
561  public:
572  LteUeMeasurementsHandoverTestCase(std::string name,
573  std::list<LteRrcSap::ReportConfigEutra> sourceConfigList,
574  std::list<LteRrcSap::ReportConfigEutra> targetConfigList,
575  std::vector<Time> expectedTime,
576  std::vector<uint8_t> expectedRsrp,
577  Time duration);
578 
580 
597  void RecvMeasurementReportCallback(std::string context,
598  uint64_t imsi,
599  uint16_t cellId,
600  uint16_t rnti,
602 
603  private:
610  void DoRun() override;
611 
616  void DoTeardown() override;
617 
622  std::list<LteRrcSap::ReportConfigEutra> m_sourceConfigList;
623 
628  std::list<LteRrcSap::ReportConfigEutra> m_targetConfigList;
629 
634  std::vector<Time> m_expectedTime;
635 
640  std::vector<uint8_t> m_expectedRsrp;
641 
646  std::vector<Time>::iterator m_itExpectedTime;
647 
652  std::vector<uint8_t>::iterator m_itExpectedRsrp;
653 
658 
664  std::set<uint8_t> m_expectedSourceCellMeasId;
665 
671  std::set<uint8_t> m_expectedTargetCellMeasId;
672 
673 }; // end of class LteUeMeasurementsHandoverTestCase
674 
675 #endif /* LTE_TEST_UE_MEASUREMENTS_H */
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration.
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 > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
std::list< LteRrcSap::ReportConfigEutra > m_sourceConfigList
The list of active report triggering configuration for the source eNodeB.
std::set< uint8_t > m_expectedTargetCellMeasId
The list of measurement identities being tested in the target cell.
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.
std::list< LteRrcSap::ReportConfigEutra > m_targetConfigList
The list of active report triggering configuration for the target eNodeB.
std::set< uint8_t > m_expectedSourceCellMeasId
The list of measurement identities being tested in the source cell.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsHandoverTestCase.
Testing UE measurements in LTE with simulation of 1 eNodeB and 1 UE in piecewise configuration and 12...
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
uint8_t m_expectedMeasId
The measurement identity being tested.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
Ptr< MobilityModel > m_ueMobility
the mobility model
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in piecewise configuration and 24...
Ptr< MobilityModel > m_ueMobility
the mobility model
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
std::vector< uint8_t >::iterator m_itExpectedRsrp
Pointer to the element of m_expectedRsrp which is expected to occur next in the simulation.
uint8_t m_expectedMeasId
The measurement identity being tested.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
Testing UE measurements in LTE with simulation of 3 eNodeB and 1 UE in piecewise configuration and 24...
Ptr< MobilityModel > m_enbMobility
the mobility model
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
uint8_t m_expectedMeasId
The measurement identity being tested.
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase1...
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase2...
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase3...
Test that UE measurements calculation works properly in a scenario with 2 eNodeBs and 2UEs.
double m_d1
distance between UE and ENB node pair
double m_rsrqDbUeServingCell
RSRQ in dBm UE 1.
double m_rsrpDbmUeServingCell
RSRP in dBm UE 1.
double m_rsrqDbUeNeighborCell
RSRQ in dBm UE 2.
double m_d2
distance between UE and other ENB node
double m_rsrpDbmUeNeighborCell
RSRP in dBm UE 2.
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.
encapsulates test code
Definition: test.h:1060
A suite of tests to run.
Definition: test.h:1256
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:105
void RecvMeasurementReportCallback(LteUeMeasurementsTestCase *testcase, std::string path, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MeasurementReport structure.
Definition: lte-rrc-sap.h:948
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:373