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 
52 {
53 public:
55 };
56 
57 
59 {
60 public:
61  LteUeMeasurementsTestCase (std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2);
62  virtual ~LteUeMeasurementsTestCase ();
63 
64  void ReportUeMeasurements (uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell);
65 
66  void RecvMeasurementReport (uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas);
67 
68 private:
69  virtual void DoRun (void);
70 
71  double m_d1;
72  double m_d2;
77 
78 };
79 
80 
81 
82 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-1 TEST SUITE ======================== //
83 
84 
90 {
91 public:
93 };
94 
95 
101 {
102 public:
103  LteUeMeasurementsPiecewiseTestCase1 (std::string name,
105  std::vector<Time> expectedTime,
106  std::vector<uint8_t> expectedRsrp);
107 
109 
120  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
121  uint16_t cellId, uint16_t rnti,
123 
124 private:
131  virtual void DoRun ();
132 
137  virtual void DoTeardown ();
138 
139  void TeleportVeryNear ();
140  void TeleportNear ();
141  void TeleportFar ();
142  void TeleportVeryFar ();
143 
148 
153  std::vector<Time> m_expectedTime;
154 
159  std::vector<uint8_t> m_expectedRsrp;
160 
165  std::vector<Time>::iterator m_itExpectedTime;
166 
171  std::vector<uint8_t>::iterator m_itExpectedRsrp;
172 
179 
181 
182 }; // end of class LteUeMeasurementsPiecewiseTestCase1
183 
184 
185 
186 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-2 TEST SUITE ======================== //
187 
188 
194 {
195 public:
197 };
198 
199 
205 {
206 public:
207  LteUeMeasurementsPiecewiseTestCase2 (std::string name,
209  std::vector<Time> expectedTime,
210  std::vector<uint8_t> expectedRsrp);
211 
213 
224  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
225  uint16_t cellId, uint16_t rnti,
227 
228 private:
235  virtual void DoRun ();
236 
241  virtual void DoTeardown ();
242 
243  void TeleportVeryNear ();
244  void TeleportNear ();
245  void TeleportFar ();
246  void TeleportVeryFar ();
247 
252 
257  std::vector<Time> m_expectedTime;
258 
263  std::vector<uint8_t> m_expectedRsrp;
264 
269  std::vector<Time>::iterator m_itExpectedTime;
270 
275  std::vector<uint8_t>::iterator m_itExpectedRsrp;
276 
283 
285 
286 }; // end of class LteUeMeasurementsPiecewiseTestCase2
287 
288 
289 
290 // ===== LTE-UE-MEASUREMENTS-HANDOVER TEST SUITE =========================== //
291 
292 
298 {
299 public:
301 };
302 
303 
312 {
313 public:
314  LteUeMeasurementsHandoverTestCase (std::string name,
315  std::list<LteRrcSap::ReportConfigEutra> sourceConfigList,
316  std::list<LteRrcSap::ReportConfigEutra> targetConfigList,
317  std::vector<Time> expectedTime,
318  std::vector<uint8_t> expectedRsrp,
319  Time duration);
320 
322 
333  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
334  uint16_t cellId, uint16_t rnti,
336 
337 private:
344  virtual void DoRun ();
345 
350  virtual void DoTeardown ();
351 
356  std::list<LteRrcSap::ReportConfigEutra> m_sourceConfigList;
357 
362  std::list<LteRrcSap::ReportConfigEutra> m_targetConfigList;
363 
368  std::vector<Time> m_expectedTime;
369 
374  std::vector<uint8_t> m_expectedRsrp;
375 
380  std::vector<Time>::iterator m_itExpectedTime;
381 
386  std::vector<uint8_t>::iterator m_itExpectedRsrp;
387 
392 
398  std::set<uint8_t> m_expectedSourceCellMeasId;
399 
405  std::set<uint8_t> m_expectedTargetCellMeasId;
406 
407 }; // end of class LteUeMeasurementsHandoverTestCase
408 
409 #endif /* LTE_TEST_UE_MEASUREMENTS_H */
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...
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:1333
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:321
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.
encapsulates test code
Definition: test.h:1147
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.
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.
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.
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.
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration...
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.
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.