A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 
38 class MobilityModel;
39 
40 
41 // ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== //
42 
43 
49 {
50 public:
52 };
53 
54 
56 {
57 public:
58  LteUeMeasurementsTestCase (std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2);
59  virtual ~LteUeMeasurementsTestCase ();
60 
61  void ReportUeMeasurements (uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell);
62 
63  void RecvMeasurementReport (uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas);
64 
65 private:
66  virtual void DoRun (void);
67 
68  double m_d1;
69  double m_d2;
74 
75 };
76 
77 
78 
79 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-1 TEST SUITE ======================== //
80 
81 
87 {
88 public:
90 };
91 
92 
98 {
99 public:
100  LteUeMeasurementsPiecewiseTestCase1 (std::string name,
102  std::vector<Time> expectedTime,
103  std::vector<uint8_t> expectedRsrp);
104 
106 
117  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
118  uint16_t cellId, uint16_t rnti,
120 
121 private:
128  virtual void DoRun ();
129 
134  virtual void DoTeardown ();
135 
136  void TeleportVeryNear ();
137  void TeleportNear ();
138  void TeleportFar ();
139  void TeleportVeryFar ();
140 
145 
150  std::vector<Time> m_expectedTime;
151 
156  std::vector<uint8_t> m_expectedRsrp;
157 
162  std::vector<Time>::iterator m_itExpectedTime;
163 
168  std::vector<uint8_t>::iterator m_itExpectedRsrp;
169 
176 
178 
179 }; // end of class LteUeMeasurementsPiecewiseTestCase1
180 
181 
182 
183 // ===== LTE-UE-MEASUREMENTS-PIECEWISE-2 TEST SUITE ======================== //
184 
185 
191 {
192 public:
194 };
195 
196 
202 {
203 public:
204  LteUeMeasurementsPiecewiseTestCase2 (std::string name,
206  std::vector<Time> expectedTime,
207  std::vector<uint8_t> expectedRsrp);
208 
210 
221  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
222  uint16_t cellId, uint16_t rnti,
224 
225 private:
232  virtual void DoRun ();
233 
238  virtual void DoTeardown ();
239 
240  void TeleportVeryNear ();
241  void TeleportNear ();
242  void TeleportFar ();
243  void TeleportVeryFar ();
244 
249 
254  std::vector<Time> m_expectedTime;
255 
260  std::vector<uint8_t> m_expectedRsrp;
261 
266  std::vector<Time>::iterator m_itExpectedTime;
267 
272  std::vector<uint8_t>::iterator m_itExpectedRsrp;
273 
280 
282 
283 }; // end of class LteUeMeasurementsPiecewiseTestCase2
284 
285 
286 
287 // ===== LTE-UE-MEASUREMENTS-HANDOVER TEST SUITE =========================== //
288 
289 
295 {
296 public:
298 };
299 
300 
309 {
310 public:
311  LteUeMeasurementsHandoverTestCase (std::string name,
312  std::list<LteRrcSap::ReportConfigEutra> sourceConfigList,
313  std::list<LteRrcSap::ReportConfigEutra> targetConfigList,
314  std::vector<Time> expectedTime,
315  std::vector<uint8_t> expectedRsrp,
316  Time duration);
317 
319 
330  void RecvMeasurementReportCallback (std::string context, uint64_t imsi,
331  uint16_t cellId, uint16_t rnti,
333 
334 private:
341  virtual void DoRun ();
342 
347  virtual void DoTeardown ();
348 
353  std::list<LteRrcSap::ReportConfigEutra> m_sourceConfigList;
354 
359  std::list<LteRrcSap::ReportConfigEutra> m_targetConfigList;
360 
365  std::vector<Time> m_expectedTime;
366 
371  std::vector<uint8_t> m_expectedRsrp;
372 
377  std::vector<Time>::iterator m_itExpectedTime;
378 
383  std::vector<uint8_t>::iterator m_itExpectedRsrp;
384 
389 
395  std::set<uint8_t> m_expectedSourceCellMeasId;
396 
402  std::set<uint8_t> m_expectedTargetCellMeasId;
403 
404 }; // end of class LteUeMeasurementsHandoverTestCase
405 
406 
407 
408 } // namespace ns3
409 
410 
411 #endif /* LTE_TEST_UE_MEASUREMENTS_H */
std::list< LteRrcSap::ReportConfigEutra > m_sourceConfigList
The list of active report triggering configuration for the source eNodeB.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in a handover configuration...
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)
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...
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime which is expected to occur next in the simulation.
A suite of tests to run.
Definition: test.h:1025
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:258
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
Test that UE Measurements (see 36.214) calculation works fine in a multi-cell interference scenario...
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...
encapsulates test code
Definition: test.h:849
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received...
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< 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.
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.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
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.
void ReportUeMeasurements(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
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...
std::vector< Time >::iterator m_itExpectedTime
Pointer to the element of m_expectedTime 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...
Testing UE measurements in LTE with simulation of 2 eNodeB and 1 UE in piecewise configuration and 24...
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase2...
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
uint8_t m_expectedMeasId
The measurement identity being tested.
std::set< uint8_t > m_expectedTargetCellMeasId
The list of measurement identities being tested in the target cell.
LteUeMeasurementsPiecewiseTestCase1(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
LteUeMeasurementsTestCase(std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2)
Testing UE measurements in LTE with simulation of 1 eNodeB and 1 UE in piecewise configuration and 12...
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsPiecewiseTestCase1...
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it...
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.
virtual void DoRun(void)
Implementation to actually run this TestCase.
void RecvMeasurementReport(uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Test suite for generating calls to UE measurements test case ns3::LteUeMeasurementsHandoverTestCase.
LteUeMeasurementsPiecewiseTestCase2(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
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...
std::vector< Time > m_expectedTime
The list of expected time when measurement reports are received by eNodeB.