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
35namespace ns3
36{
37
38class MobilityModel;
39
40}
41
42using namespace ns3;
43
44// ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== //
45
54{
55 public:
57};
58
68{
69 public:
81 LteUeMeasurementsTestCase(std::string name,
82 double d1,
83 double d2,
84 double rsrpDbmUe1,
85 double rsrpDbmUe2,
86 double rsrqDbUe1,
87 double rsrqDbUe2);
89
98 void ReportUeMeasurements(uint16_t rnti,
99 uint16_t cellId,
100 double rsrp,
101 double rsrq,
102 bool servingCell);
103
111 void RecvMeasurementReport(uint64_t imsi,
112 uint16_t cellId,
113 uint16_t rnti,
115
116 private:
117 void DoRun() override;
118
119 double m_d1;
120 double m_d2;
125};
126
127// ===== LTE-UE-MEASUREMENTS-PIECEWISE-1 TEST SUITE ======================== //
128
137{
138 public:
140};
141
161{
162 public:
173 std::vector<Time> expectedTime,
174 std::vector<uint8_t> expectedRsrp);
175
177
194 void RecvMeasurementReportCallback(std::string context,
195 uint64_t imsi,
196 uint16_t cellId,
197 uint16_t rnti,
199
200 private:
207 void DoRun() override;
208
213 void DoTeardown() override;
214
216 void TeleportVeryNear();
218 void TeleportNear();
220 void TeleportFar();
222 void TeleportVeryFar();
223
228
233 std::vector<Time> m_expectedTime;
234
239 std::vector<uint8_t> m_expectedRsrp;
240
245 std::vector<Time>::iterator m_itExpectedTime;
246
251 std::vector<uint8_t>::iterator m_itExpectedRsrp;
252
259
261
262}; // end of class LteUeMeasurementsPiecewiseTestCase1
263
264// ===== LTE-UE-MEASUREMENTS-PIECEWISE-2 TEST SUITE ======================== //
265
274{
275 public:
277};
278
298{
299 public:
310 std::vector<Time> expectedTime,
311 std::vector<uint8_t> expectedRsrp);
312
314
331 void RecvMeasurementReportCallback(std::string context,
332 uint64_t imsi,
333 uint16_t cellId,
334 uint16_t rnti,
336
337 private:
344 void DoRun() override;
345
350 void DoTeardown() override;
351
353 void TeleportVeryNear();
355 void TeleportNear();
357 void TeleportFar();
359 void TeleportVeryFar();
360
365
370 std::vector<Time> m_expectedTime;
371
376 std::vector<uint8_t> m_expectedRsrp;
377
382 std::vector<Time>::iterator m_itExpectedTime;
383
388 std::vector<uint8_t>::iterator m_itExpectedRsrp;
389
396
398
399}; // end of class LteUeMeasurementsPiecewiseTestCase2
400
401// ===== LTE-UE-MEASUREMENTS-PIECEWISE-3 TEST SUITE ======================== //
402
411{
412 public:
414};
415
453{
454 public:
464 std::vector<Time> expectedTime);
465
467
484 void RecvMeasurementReportCallback(std::string context,
485 uint64_t imsi,
486 uint16_t cellId,
487 uint16_t rnti,
489
490 private:
497 void DoRun() override;
498
503 void DoTeardown() override;
504
506 void TeleportEnbNear();
507
512
517 std::vector<Time> m_expectedTime;
518
523 std::vector<Time>::iterator m_itExpectedTime;
524
531
533
534}; // end of class LteUeMeasurementsPiecewiseTestCase3
535
536// ===== LTE-UE-MEASUREMENTS-HANDOVER TEST SUITE =========================== //
537
546{
547 public:
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,
608 uint64_t imsi,
609 uint16_t cellId,
610 uint16_t rnti,
612
613 private:
620 void DoRun() override;
621
626 void DoTeardown() override;
627
632 std::list<LteRrcSap::ReportConfigEutra> m_sourceConfigList;
633
638 std::list<LteRrcSap::ReportConfigEutra> m_targetConfigList;
639
644 std::vector<Time> m_expectedTime;
645
650 std::vector<uint8_t> m_expectedRsrp;
651
656 std::vector<Time>::iterator m_itExpectedTime;
657
662 std::vector<uint8_t>::iterator m_itExpectedRsrp;
663
668
674 std::set<uint8_t> m_expectedSourceCellMeasId;
675
681 std::set<uint8_t> m_expectedTargetCellMeasId;
682
683}; // end of class LteUeMeasurementsHandoverTestCase
684
685#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.
void DoRun() override
Setup the simulation with the intended UE measurement reporting configuration, run it,...
std::set< uint8_t > m_expectedTargetCellMeasId
The list of measurement identities being tested in the target cell.
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)
Constructor.
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...
void DoTeardown() override
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
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.
void TeleportVeryFar()
Teleport far function.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
uint8_t m_expectedMeasId
The measurement identity being tested.
LteUeMeasurementsPiecewiseTestCase1(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
Constructor.
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
void TeleportVeryNear()
Teleport very near function.
void TeleportNear()
Teleport near function.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
void DoTeardown() override
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.
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.
void DoRun() override
Setup the simulation with the intended UE measurement reporting configuration, run it,...
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.
void TeleportVeryNear()
Teleport very near function.
std::vector< uint8_t > m_expectedRsrp
The list of expected values of RSRP (in 3GPP range unit) from the measurement reports received.
void DoTeardown() override
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
LteUeMeasurementsPiecewiseTestCase2(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime, std::vector< uint8_t > expectedRsrp)
Constructor.
LteRrcSap::ReportConfigEutra m_config
The active report triggering configuration.
void DoRun() override
Setup the simulation with the intended UE measurement reporting configuration, run it,...
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.
void TeleportVeryFar()
Teleport very far function.
void TeleportNear()
Teleport near function.
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
LteUeMeasurementsPiecewiseTestCase3(std::string name, LteRrcSap::ReportConfigEutra config, std::vector< Time > expectedTime)
Constructor.
void DoTeardown() override
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
void DoRun() override
Setup the simulation with the intended UE measurement reporting configuration, run it,...
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.
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.
void TeleportEnbNear()
Teleport the eNb near function.
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.
LteUeMeasurementsTestCase(std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2)
Constructor.
void ReportUeMeasurements(uint16_t rnti, uint16_t cellId, double rsrp, double rsrq, bool servingCell)
Report UE measurements function.
void DoRun() override
Implementation to actually run this TestCase.
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.
void RecvMeasurementReport(uint64_t imsi, uint16_t cellId, uint16_t rnti, LteRrcSap::MeasurementReport meas)
Reeive measurement report function.
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
Every class exported by the ns3 library is enclosed in the ns3 namespace.
MeasurementReport structure.
Definition: lte-rrc-sap.h:934
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Definition: lte-rrc-sap.h:367