A Discrete-Event Network Simulator
API
lte-test-cell-selection.h
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2013 Budiarto Herman
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: Budiarto Herman <budiarto.herman@magister.fi>
19  *
20  */
21 
22 #ifndef LTE_TEST_CELL_SELECTION_H
23 #define LTE_TEST_CELL_SELECTION_H
24 
25 #include <ns3/test.h>
26 #include <ns3/nstime.h>
27 #include <ns3/node-container.h>
28 #include <ns3/vector.h>
29 #include <ns3/lte-ue-rrc.h>
30 #include <vector>
31 
32 
33 namespace ns3 {
34 
35 class LteUeNetDevice;
36 
37 }
38 
39 using namespace ns3;
40 
41 
49 {
50 public:
52 };
53 
54 
55 
56 
64 {
65 public:
69  struct UeSetup_t
70  {
71  Vector position;
72  bool isCsgMember;
74  uint16_t expectedCellId1;
75  uint16_t expectedCellId2;
76 
85  UeSetup_t (double relPosX, double relPosY, bool isCsgMember, Time checkPoint,
86  uint16_t expectedCellId1, uint16_t expectedCellId2);
87  };
88 
100  LteCellSelectionTestCase (std::string name, bool isEpcMode, bool isIdealRrc,
101  double interSiteDistance,
102  std::vector<UeSetup_t> ueSetupList,
103  uint64_t rngRun);
104 
105  virtual ~LteCellSelectionTestCase ();
106 
107 private:
112  virtual void DoRun ();
113 
121  void CheckPoint (Ptr<LteUeNetDevice> ueDev, uint16_t expectedCellId1,
122  uint16_t expectedCellId2);
123 
133  void StateTransitionCallback (std::string context, uint64_t imsi,
134  uint16_t cellId, uint16_t rnti,
135  LteUeRrc::State oldState, LteUeRrc::State newState);
142  void InitialCellSelectionEndOkCallback (std::string context, uint64_t imsi,
143  uint16_t cellId);
150  void InitialCellSelectionEndErrorCallback (std::string context, uint64_t imsi,
151  uint16_t cellId);
159  void ConnectionEstablishedCallback (std::string context, uint64_t imsi,
160  uint16_t cellId, uint16_t rnti);
161 
162  bool m_isEpcMode;
165  std::vector<UeSetup_t> m_ueSetupList;
166  uint64_t m_rngRun;
167 
169  std::vector<LteUeRrc::State> m_lastState;
170 
171 }; // end of class LteCellSelectionTestCase
172 
173 #endif /* LTE_TEST_CELL_SELECTION_H */
LteCellSelectionTestSuite
Test suite for executing the cell selection test cases in without-EPC and with-EPC scenarios.
Definition: lte-test-cell-selection.h:49
LteCellSelectionTestCase
Testing the initial cell selection procedure by UE at IDLE state in the beginning of simulation.
Definition: lte-test-cell-selection.h:64
LteCellSelectionTestCase::UeSetup_t::expectedCellId1
uint16_t expectedCellId1
The cell ID that the UE is expected to attach to (0 means that the UE should not attach to any cell).
Definition: lte-test-cell-selection.h:74
ns3::LteUeRrc::State
State
The states of the UE RRC entity.
Definition: lte-ue-rrc.h:106
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
LteCellSelectionTestCase::m_interSiteDistance
double m_interSiteDistance
inter site distance
Definition: lte-test-cell-selection.h:164
LteCellSelectionTestCase::UeSetup_t::checkPoint
Time checkPoint
The time in simulation when the UE is verified by the test script.
Definition: lte-test-cell-selection.h:73
ns3::TestCase
encapsulates test code
Definition: test.h:1154
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition: ptr.h:74
LteCellSelectionTestCase::UeSetup_t::expectedCellId2
uint16_t expectedCellId2
An alternative cell ID that the UE is expected to attach to (0 means that this no alternative cell is...
Definition: lte-test-cell-selection.h:75
LteCellSelectionTestCase::UeSetup_t::position
Vector position
The position, relative to the inter site distance, where the UE will be spawned in the simulation.
Definition: lte-test-cell-selection.h:71
LteCellSelectionTestCase::UeSetup_t
A set of input parameters for setting up a UE in the simulation.
Definition: lte-test-cell-selection.h:70
LteCellSelectionTestCase::m_rngRun
uint64_t m_rngRun
rng run
Definition: lte-test-cell-selection.h:166
ns3::LteUeNetDevice
The LteUeNetDevice class implements the UE net device.
Definition: lte-ue-net-device.h:57
ns3::Time
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:104
ns3::TestSuite
A suite of tests to run.
Definition: test.h:1344
LteCellSelectionTestCase::m_isEpcMode
bool m_isEpcMode
whether the LTE configuration in test is using EPC
Definition: lte-test-cell-selection.h:162
LteCellSelectionTestCase::m_ueSetupList
std::vector< UeSetup_t > m_ueSetupList
UE setup list.
Definition: lte-test-cell-selection.h:165
LteCellSelectionTestCase::UeSetup_t::isCsgMember
bool isCsgMember
Whether UE is allowed access to CSG cell.
Definition: lte-test-cell-selection.h:72
LteCellSelectionTestCase::m_lastState
std::vector< LteUeRrc::State > m_lastState
The current UE RRC state.
Definition: lte-test-cell-selection.h:169
LteCellSelectionTestCase::m_isIdealRrc
bool m_isIdealRrc
whether the LTE is configured to use ideal RRC
Definition: lte-test-cell-selection.h:163