A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-test-radio-link-failure.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Fraunhofer ESK
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: Vignesh Babu <ns3-dev@esk.fraunhofer.de>
18 */
19
20#ifndef LTE_TEST_RADIO_LINK_FAILURE_H
21#define LTE_TEST_RADIO_LINK_FAILURE_H
22
23#include <ns3/lte-ue-rrc.h>
24#include <ns3/mobility-model.h>
25#include <ns3/net-device-container.h>
26#include <ns3/node-container.h>
27#include <ns3/nstime.h>
28#include <ns3/test.h>
29#include <ns3/vector.h>
30
31#include <vector>
32
33namespace ns3
34{
35
36class LteUeNetDevice;
37
38}
39
40using namespace ns3;
41
42/**
43 * \brief Test suite for
44 *
45 * \sa ns3::LteRadioLinkFailureTestCase
46 */
48{
49 public:
51};
52
53/**
54 * \ingroup lte
55 *
56 * \brief Testing the cell reselection procedure by UE at IDLE state
57 */
59{
60 public:
61 /**
62 * \brief Creates an instance of the radio link failure test case.
63 *
64 * \param numEnbs number of eNodeBs
65 * \param numUes number of UEs
66 * \param simTime the simulation time
67 * \param isIdealRrc if true, simulation uses Ideal RRC protocol, otherwise
68 * simulation uses Real RRC protocol
69 * \param uePositionList Position of the UEs
70 * \param enbPositionList Position of the eNodeBs
71 * \param ueJumpAwayPosition Vector holding the UE jump away coordinates
72 * \param checkConnectedList the time at which UEs should have an active RRC connection
73 */
75 uint32_t numUes,
76 Time simTime,
77 bool isIdealRrc,
78 std::vector<Vector> uePositionList,
79 std::vector<Vector> enbPositionList,
80 Vector ueJumpAwayPosition,
81 std::vector<Time> checkConnectedList);
82
84
85 private:
86 /**
87 * Builds the test name string based on provided parameter values
88 * \param numEnbs the number of eNB nodes
89 * \param numUes the number of UE nodes
90 * \param isIdealRrc True if the Ideal RRC protocol is used
91 * \returns the name string
92 */
93 std::string BuildNameString(uint32_t numEnbs, uint32_t numUes, bool isIdealRrc);
94 /**
95 * \brief Setup the simulation according to the configuration set by the
96 * class constructor, run it, and verify the result.
97 */
98 void DoRun() override;
99
100 /**
101 * Check connected function
102 * \param ueDevice the UE device
103 * \param enbDevices the ENB devices
104 */
105 void CheckConnected(Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
106
107 /**
108 * Check if the UE is in idle state
109 * \param ueDevice the UE device
110 * \param enbDevices the ENB devices
111 */
112 void CheckIdle(Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
113
114 /**
115 * \brief Check if the UE exist at the eNB
116 * \param rnti the RNTI of the UE
117 * \param enbDevice the eNB device
118 * \return true if the UE exist at the eNB, otherwise false
119 */
120 bool CheckUeExistAtEnb(uint16_t rnti, Ptr<NetDevice> enbDevice);
121
122 /**
123 * \brief State transition callback function
124 * \param context the context string
125 * \param imsi the IMSI
126 * \param cellId the cell ID
127 * \param rnti the RNTI
128 * \param oldState the old state
129 * \param newState the new state
130 */
131 void UeStateTransitionCallback(std::string context,
132 uint64_t imsi,
133 uint16_t cellId,
134 uint16_t rnti,
135 LteUeRrc::State oldState,
136 LteUeRrc::State newState);
137
138 /**
139 * \brief Connection established at UE callback function
140 * \param context the context string
141 * \param imsi the IMSI
142 * \param cellId the cell ID
143 * \param rnti the RNTI
144 */
145 void ConnectionEstablishedUeCallback(std::string context,
146 uint64_t imsi,
147 uint16_t cellId,
148 uint16_t rnti);
149
150 /**
151 * \brief Connection established at eNodeB callback function
152 * \param context the context string
153 * \param imsi the IMSI
154 * \param cellId the cell ID
155 * \param rnti the RNTI
156 */
157 void ConnectionEstablishedEnbCallback(std::string context,
158 uint64_t imsi,
159 uint16_t cellId,
160 uint16_t rnti);
161
162 /**
163 * \brief This callback function is executed when UE context is removed at eNodeB
164 * \param context the context string
165 * \param imsi the IMSI
166 * \param cellId the cell ID
167 * \param rnti the RNTI
168 */
169 void ConnectionReleaseAtEnbCallback(std::string context,
170 uint64_t imsi,
171 uint16_t cellId,
172 uint16_t rnti);
173
174 /**
175 * \brief This callback function is executed when UE RRC receives an in-sync or out-of-sync
176 * indication
177 * \param context the context string
178 * \param imsi the IMSI
179 * \param rnti the RNTI
180 * \param cellId the cell ID
181 * \param type in-sync or out-of-sync indication
182 * \param count the number of in-sync or out-of-sync indications
183 */
184 void PhySyncDetectionCallback(std::string context,
185 uint64_t imsi,
186 uint16_t rnti,
187 uint16_t cellId,
188 std::string type,
189 uint8_t count);
190
191 /**
192 * \brief This callback function is executed when radio link failure is detected
193 * \param context the context string
194 * \param imsi the IMSI
195 * \param rnti the RNTI
196 * \param cellId the cell ID
197 */
198 void RadioLinkFailureCallback(std::string context,
199 uint64_t imsi,
200 uint16_t cellId,
201 uint16_t rnti);
202
203 /**
204 * \brief Jump away function
205 *
206 * \param UeJumpAwayPositionList A list of positions where UE would jump
207 */
208 void JumpAway(Vector UeJumpAwayPositionList);
209
210 uint32_t m_numEnbs; ///< number of eNodeBs
211 uint32_t m_numUes; ///< number of UEs
212 Time m_simTime; ///< simulation time
213 bool m_isIdealRrc; ///< whether the LTE is configured to use ideal RRC
214 std::vector<Vector> m_uePositionList; ///< Position of the UEs
215 std::vector<Vector> m_enbPositionList; ///< Position of the eNodeBs
216 std::vector<Time>
217 m_checkConnectedList; ///< the time at which UEs should have an active RRC connection
218 Vector m_ueJumpAwayPosition; ///< Position where the UE(s) would jump
219
220 /// The current UE RRC state.
222
223 bool m_radioLinkFailureDetected; ///< true if radio link fails
224 uint32_t m_numOfInSyncIndications; ///< number of in-sync indications detected
225 uint32_t m_numOfOutOfSyncIndications; ///< number of out-of-sync indications detected
226 Ptr<MobilityModel> m_ueMobility; ///< UE mobility model
227
228}; // end of class LteRadioLinkFailureTestCase
229
230#endif /* LTE_TEST_RADIO_LINK_FAILURE_H */
The LteUeNetDevice class implements the UE net device.
State
The states of the UE RRC entity.
Definition: lte-ue-rrc.h:99
holds a vector of ns3::NetDevice pointers
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:77
encapsulates test code
Definition: test.h:1061
A suite of tests to run.
Definition: test.h:1268
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.