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
35namespace ns3 {
36
37class MobilityModel;
38
39}
40
41using namespace ns3;
42
43
44// ===== LTE-UE-MEASUREMENTS TEST SUITE ==================================== //
45
46
55{
56public:
58};
59
60
70{
71public:
83 LteUeMeasurementsTestCase (std::string name, double d1, double d2, double rsrpDbmUe1, double rsrpDbmUe2, double rsrqDbUe1, double rsrqDbUe2);
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
105private:
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{
131public:
133};
134
135
155{
156public:
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
192private:
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{
270public:
272};
273
274
294{
295public:
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
331private:
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{
407public:
409};
410
411
449{
450public:
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
484private:
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{
546public:
548};
549
550
570{
571public:
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
611private:
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.
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...
virtual void DoTeardown()
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.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it,...
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.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run it,...
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
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.
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.
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.
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.
virtual void DoRun()
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.
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.
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 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.
virtual void DoRun()
Setup the simulation with the intended UE measurement reporting configuration, run 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.
virtual void DoTeardown()
Runs at the end of the simulation, verifying that all expected measurement reports have been examined...
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.
virtual void DoRun(void)
Implementation to actually run this TestCase.
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.
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:994
A suite of tests to run.
Definition: test.h:1188
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
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