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 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-3 TEST SUITE ======================== //
396 
397 
406 {
407 public:
409 };
410 
411 
449 {
450 public:
458  LteUeMeasurementsPiecewiseTestCase3 (std::string name,
460  std::vector<Time> expectedTime);
461 
463 
480  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
481  uint16_t cellId, uint16_t rnti,
483 
484 private:
491  virtual void DoRun ();
492 
497  virtual void DoTeardown ();
498 
499 
501  void TeleportEnbNear ();
502 
507 
512  std::vector<Time> m_expectedTime;
513 
518  std::vector<Time>::iterator m_itExpectedTime;
519 
526 
528 
529 }; // end of class LteUeMeasurementsPiecewiseTestCase3
530 
531 
532 
533 
534 // ===== LTE-UE-MEASUREMENTS-HANDOVER TEST SUITE =========================== //
535 
536 
545 {
546 public:
548 };
549 
550 
570 {
571 public:
582  LteUeMeasurementsHandoverTestCase (std::string name,
583  std::list<LteRrcSap::ReportConfigEutra> sourceConfigList,
584  std::list<LteRrcSap::ReportConfigEutra> targetConfigList,
585  std::vector<Time> expectedTime,
586  std::vector<uint8_t> expectedRsrp,
587  Time duration);
588 
590 
607  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
608  uint16_t cellId, uint16_t rnti,
610 
611 private:
618  virtual void DoRun ();
619 
624  virtual void DoTeardown ();
625 
630  std::list<LteRrcSap::ReportConfigEutra> m_sourceConfigList;
631 
636  std::list<LteRrcSap::ReportConfigEutra> m_targetConfigList;
637 
642  std::vector<Time> m_expectedTime;
643 
648  std::vector<uint8_t> m_expectedRsrp;
649 
654  std::vector<Time>::iterator m_itExpectedTime;
655 
660  std::vector<uint8_t>::iterator m_itExpectedRsrp;
661 
666 
672  std::set<uint8_t> m_expectedSourceCellMeasId;
673 
679  std::set<uint8_t> m_expectedTargetCellMeasId;
680 
681 }; // end of class LteUeMeasurementsHandoverTestCase
682 
683 #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:994
A suite of tests to run.
Definition: test.h:1188
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
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:902
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:362