A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 namespace ns3 {
33 
34 
42 {
43 public:
45 };
46 
47 
48 
49 class LteUeNetDevice;
50 
56 {
57 public:
61  struct UeSetup_t
62  {
64  bool isCsgMember;
66  uint16_t expectedCellId1;
67  uint16_t expectedCellId2;
68  UeSetup_t (double relPosX, double relPosY, bool isCsgMember, Time checkPoint,
69  uint16_t expectedCellId1, uint16_t expectedCellId2);
70  };
71 
83  LteCellSelectionTestCase (std::string name, bool isEpcMode, bool isIdealRrc,
84  double interSiteDistance,
85  std::vector<UeSetup_t> ueSetupList,
86  int64_t rngRun);
87 
88  virtual ~LteCellSelectionTestCase ();
89 
90 private:
95  virtual void DoRun ();
96 
101  void CheckPoint (Ptr<LteUeNetDevice> ueDev, uint16_t expectedCellId1,
102  uint16_t expectedCellId2);
103 
104  void StateTransitionCallback (std::string context, uint64_t imsi,
105  uint16_t cellId, uint16_t rnti,
106  LteUeRrc::State oldState, LteUeRrc::State newState);
107  void InitialCellSelectionEndOkCallback (std::string context, uint64_t imsi,
108  uint16_t cellId);
109  void InitialCellSelectionEndErrorCallback (std::string context, uint64_t imsi,
110  uint16_t cellId);
111  void ConnectionEstablishedCallback (std::string context, uint64_t imsi,
112  uint16_t cellId, uint16_t rnti);
113 
117  std::vector<UeSetup_t> m_ueSetupList;
118  int64_t m_rngRun;
119 
121  std::vector<LteUeRrc::State> m_lastState;
122 
123 }; // end of class LteCellSelectionTestCase
124 
125 
126 
127 } // end of namespace ns3
128 
129 
130 #endif /* LTE_TEST_CELL_SELECTION_H */
keep track of time values and allow control of global simulation resolution
Definition: nstime.h:81
void StateTransitionCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, LteUeRrc::State oldState, LteUeRrc::State newState)
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
std::vector< LteUeRrc::State > m_lastState
The current UE RRC state.
A suite of tests to run.
Definition: test.h:1025
UeSetup_t(double relPosX, double relPosY, bool isCsgMember, Time checkPoint, uint16_t expectedCellId1, uint16_t expectedCellId2)
encapsulates test code
Definition: test.h:849
Testing the initial cell selection procedure by UE at IDLE state in the beginning of simulation...
uint16_t expectedCellId2
An alternative cell ID that the UE is expected to attach to (0 means that this no alternative cell is...
a 3d vector
Definition: vector.h:31
void ConnectionEstablishedCallback(std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
LteCellSelectionTestCase(std::string name, bool isEpcMode, bool isIdealRrc, double interSiteDistance, std::vector< UeSetup_t > ueSetupList, int64_t rngRun)
Creates an instance of the initial cell selection test case.
void CheckPoint(Ptr< LteUeNetDevice > ueDev, uint16_t expectedCellId1, uint16_t expectedCellId2)
Verifies if the given UE is attached to either of the given two cells and in a CONNECTED_NORMALLY sta...
void InitialCellSelectionEndOkCallback(std::string context, uint64_t imsi, uint16_t cellId)
void InitialCellSelectionEndErrorCallback(std::string context, uint64_t imsi, uint16_t cellId)
std::vector< UeSetup_t > m_ueSetupList
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)...
State
The states of the UE RRC entity.
Definition: lte-ue-rrc.h:86
A set of input parameters for setting up a UE in the simulation.
Test suite for executing the cell selection test cases in without-EPC and with-EPC scenarios...
Time checkPoint
The time in simulation when the UE is verified by the test script.
bool isCsgMember
Whether UE is allowed access to CSG cell.
Vector position
The position, relative to the inter site distance, where the UE will be spawned in the simulation...
virtual void DoRun()
Setup the simulation according to the configuration set by the class constructor, run it...
The LteUeNetDevice class implements the UE net device.