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