author | Budiarto Herman <budiarto.herman@magister.fi> |
Sun, 15 Sep 2013 20:54:03 +0300 | |
changeset 10360 | b3d6acea639c |
parent 10357 | 74fc0fdda26b |
child 10361 | 858da9c4d11b |
permissions | -rw-r--r-- |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
2 |
/* |
10353
938b6e44ab95
Updated GPL header of GSoC files
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10340
diff
changeset
|
3 |
* Copyright (c) 2013 Budiarto Herman |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
4 |
* |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License version 2 as |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
8 |
* |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
13 |
* |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
17 |
* |
10353
938b6e44ab95
Updated GPL header of GSoC files
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10340
diff
changeset
|
18 |
* Author: Budiarto Herman <budiarto.herman@magister.fi> |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
19 |
* |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
20 |
*/ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
21 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
22 |
#include "lte-test-cell-selection.h" |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
23 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
24 |
#include <ns3/simulator.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
25 |
#include <ns3/log.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
26 |
#include <ns3/boolean.h> |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
27 |
#include <ns3/double.h> |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
28 |
#include <ns3/integer.h> |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
29 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
30 |
#include <ns3/mobility-helper.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
31 |
#include <ns3/lte-helper.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
32 |
#include <ns3/epc-helper.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
33 |
#include <ns3/internet-stack-helper.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
34 |
#include <ns3/point-to-point-helper.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
35 |
#include <ns3/ipv4-address-helper.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
36 |
#include <ns3/ipv4-static-routing-helper.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
37 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
38 |
#include <ns3/node-container.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
39 |
#include <ns3/net-device-container.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
40 |
#include <ns3/ipv4-interface-container.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
41 |
|
10300
792cecb6cf2d
Evaluation of cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10297
diff
changeset
|
42 |
#include <ns3/lte-ue-net-device.h> |
10337
fefe62359afd
Extended UE RRC state model, e.g. with Idle mode cell selection and RRC Connection Re-establishment
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10310
diff
changeset
|
43 |
#include <ns3/lte-ue-rrc.h> |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
44 |
#include <ns3/lte-enb-net-device.h> |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
45 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
46 |
NS_LOG_COMPONENT_DEFINE ("LteCellSelectionTest"); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
47 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
48 |
namespace ns3 { |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
49 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
50 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
51 |
/* |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
52 |
* Test Suite |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
53 |
*/ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
54 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
55 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
56 |
LteCellSelectionTestSuite::LteCellSelectionTestSuite () |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
57 |
: TestSuite ("lte-cell-selection", SYSTEM) |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
58 |
{ |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
59 |
//LogComponentEnable ("LteCellSelectionTest", LOG_PREFIX_ALL); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
60 |
//LogComponentEnable ("LteCellSelectionTest", LOG_FUNCTION); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
61 |
//LogComponentEnable ("LteCellSelectionTest", LOG_INFO); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
62 |
//LogComponentEnable ("LteSpectrumPhy", LOG_PREFIX_ALL); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
63 |
//LogComponentEnable ("LteSpectrumPhy", LOG_DEBUG); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
64 |
|
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
65 |
std::ostringstream oss; |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
66 |
std::vector<LteCellSelectionTestCase::UeSetup_t> w; |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
67 |
|
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
68 |
w.clear (); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
69 |
// x y csgMember |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
70 |
// checkPoint cell1, cell2 |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
71 |
w.push_back (LteCellSelectionTestCase::UeSetup_t (0.0, 1.55, false, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
72 |
MilliSeconds (266), 1, 0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
73 |
w.push_back (LteCellSelectionTestCase::UeSetup_t (0.0, 1.45, false, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
74 |
MilliSeconds (266), 1, 0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
75 |
w.push_back (LteCellSelectionTestCase::UeSetup_t (0.5, 2.0, false, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
76 |
MilliSeconds (266), 1, 4)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
77 |
w.push_back (LteCellSelectionTestCase::UeSetup_t (0.5, 1.45, false, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
78 |
MilliSeconds (341), 1, 4)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
79 |
w.push_back (LteCellSelectionTestCase::UeSetup_t (0.5, 0.55, true, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
80 |
MilliSeconds (266), 2, 5)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
81 |
w.push_back (LteCellSelectionTestCase::UeSetup_t (0.5, 0.0, true, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
82 |
MilliSeconds (266), 3, 6)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
83 |
w.push_back (LteCellSelectionTestCase::UeSetup_t (1.0, 0.55, true, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
84 |
MilliSeconds (266), 5, 0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
85 |
w.push_back (LteCellSelectionTestCase::UeSetup_t (1.0, 0.45, true, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
86 |
MilliSeconds (266), 6, 0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
87 |
|
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
88 |
AddTestCase (new LteCellSelectionTestCase ("EPC, ideal RRC, RngNum=1", |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
89 |
true, true, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
90 |
60.0, 20.0, w, 1), |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
91 |
// isd txpow rngrun |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
92 |
TestCase::QUICK); |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
93 |
|
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
94 |
for (int64_t i = 2; i <= 4; i++) |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
95 |
{ |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
96 |
oss.str (""); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
97 |
oss << "EPC, ideal RRC, RngNum=" << i; |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
98 |
AddTestCase (new LteCellSelectionTestCase (oss.str (), true, true, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
99 |
60.0, 20.0, w, 1), |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
100 |
// isd txpow rngrun |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
101 |
TestCase::TAKES_FOREVER); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
102 |
} |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
103 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
104 |
} // end of LteCellSelectionTestSuite::LteCellSelectionTestSuite () |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
105 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
106 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
107 |
static LteCellSelectionTestSuite g_lteCellSelectionTestSuite; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
108 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
109 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
110 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
111 |
/* |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
112 |
* 6-cell Test Case |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
113 |
*/ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
114 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
115 |
|
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
116 |
LteCellSelectionTestCase::UeSetup_t::UeSetup_t ( |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
117 |
double relPosX, double relPosY, bool isCsgMember, Time checkPoint, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
118 |
uint16_t expectedCellId1, uint16_t expectedCellId2) |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
119 |
: position (Vector (relPosX, relPosY, 0.0)), |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
120 |
isCsgMember (isCsgMember), |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
121 |
checkPoint (checkPoint), |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
122 |
expectedCellId1 (expectedCellId1), |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
123 |
expectedCellId2 (expectedCellId2) |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
124 |
{ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
125 |
} |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
126 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
127 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
128 |
LteCellSelectionTestCase::LteCellSelectionTestCase ( |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
129 |
std::string name, bool isEpcMode, bool isIdealRrc, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
130 |
double interSiteDistance, double enbTxPower, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
131 |
std::vector<UeSetup_t> ueSetupList, int64_t rngRun) |
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
132 |
: TestCase (name), |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
133 |
m_isEpcMode (isEpcMode), |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
134 |
m_isIdealRrc (isIdealRrc), |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
135 |
m_interSiteDistance (interSiteDistance), |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
136 |
m_enbTxPower (enbTxPower), |
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
137 |
m_ueSetupList (ueSetupList), |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
138 |
m_rngRun (rngRun) |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
139 |
{ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
140 |
NS_LOG_FUNCTION (this << GetName ()); |
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
141 |
m_lastState.resize (m_ueSetupList.size (), LteUeRrc::NUM_STATES); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
142 |
} |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
143 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
144 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
145 |
LteCellSelectionTestCase::~LteCellSelectionTestCase () |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
146 |
{ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
147 |
NS_LOG_FUNCTION (this << GetName ()); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
148 |
} |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
149 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
150 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
151 |
void |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
152 |
LteCellSelectionTestCase::DoRun () |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
153 |
{ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
154 |
NS_LOG_FUNCTION (this << GetName ()); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
155 |
|
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
156 |
Config::SetGlobal ("RngRun", IntegerValue (m_rngRun)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
157 |
|
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
158 |
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
159 |
lteHelper->SetAttribute ("PathlossModel", |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
160 |
StringValue ("ns3::FriisSpectrumPropagationLossModel")); |
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
161 |
lteHelper->SetAttribute ("UseIdealRrc", BooleanValue (m_isIdealRrc)); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
162 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
163 |
Ptr<EpcHelper> epcHelper; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
164 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
165 |
if (m_isEpcMode) |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
166 |
{ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
167 |
epcHelper = CreateObject<EpcHelper> (); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
168 |
lteHelper->SetEpcHelper (epcHelper); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
169 |
} |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
170 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
171 |
/* |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
172 |
* The topology is the following: |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
173 |
* |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
174 |
* TODO |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
175 |
*/ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
176 |
|
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
177 |
// Create Nodes |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
178 |
NodeContainer enbNodes; |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
179 |
enbNodes.Create (6); |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
180 |
NodeContainer ueNodes; |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
181 |
uint16_t nUe = m_ueSetupList.size (); |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
182 |
ueNodes.Create (nUe); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
183 |
|
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
184 |
// Assign nodes to position |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
185 |
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> (); |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
186 |
// eNodeB |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
187 |
positionAlloc->Add (Vector ( 0.0, 2 * m_interSiteDistance, 0.0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
188 |
positionAlloc->Add (Vector ( 0.0, m_interSiteDistance, 0.0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
189 |
positionAlloc->Add (Vector ( 0.0, 0.0, 0.0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
190 |
positionAlloc->Add (Vector (m_interSiteDistance, 2 * m_interSiteDistance, 0.0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
191 |
positionAlloc->Add (Vector (m_interSiteDistance, m_interSiteDistance, 0.0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
192 |
positionAlloc->Add (Vector (m_interSiteDistance, 0.0, 0.0)); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
193 |
// UE |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
194 |
std::vector<UeSetup_t>::const_iterator itSetup; |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
195 |
for (itSetup = m_ueSetupList.begin (); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
196 |
itSetup != m_ueSetupList.end (); itSetup++) |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
197 |
{ |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
198 |
Vector uePos (m_interSiteDistance * itSetup->position.x, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
199 |
m_interSiteDistance * itSetup->position.y, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
200 |
m_interSiteDistance * itSetup->position.z); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
201 |
NS_LOG_INFO ("UE position " << uePos); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
202 |
positionAlloc->Add (uePos); |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
203 |
} |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
204 |
|
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
205 |
MobilityHelper mobility; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
206 |
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
207 |
mobility.SetPositionAllocator (positionAlloc); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
208 |
mobility.Install (enbNodes); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
209 |
mobility.Install (ueNodes); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
210 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
211 |
// Create Devices and install them in the Nodes (eNB and UE) |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
212 |
int64_t stream = 1; |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
213 |
NetDeviceContainer enbDevs; |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
214 |
enbDevs = lteHelper->InstallEnbDevice (enbNodes); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
215 |
stream += lteHelper->AssignStreams (enbDevs, stream); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
216 |
|
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
217 |
lteHelper->SetEnbCsgId (enbDevs.Get (1), 1, true); // cell ID 2 |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
218 |
lteHelper->SetEnbCsgId (enbDevs.Get (4), 1, true); // cell ID 5 |
10300
792cecb6cf2d
Evaluation of cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10297
diff
changeset
|
219 |
|
10301
d527fc67106d
Removed PLMN from LTE cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10300
diff
changeset
|
220 |
NetDeviceContainer ueDevs; |
d527fc67106d
Removed PLMN from LTE cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10300
diff
changeset
|
221 |
ueDevs = lteHelper->InstallUeDevice (ueNodes); |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
222 |
stream += lteHelper->AssignStreams (ueDevs, stream); |
10300
792cecb6cf2d
Evaluation of cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10297
diff
changeset
|
223 |
|
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
224 |
Time lastCheckPoint = MilliSeconds (0); |
10300
792cecb6cf2d
Evaluation of cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10297
diff
changeset
|
225 |
NS_ASSERT (m_ueSetupList.size () == ueDevs.GetN ()); |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
226 |
NetDeviceContainer::Iterator itDev; |
10300
792cecb6cf2d
Evaluation of cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10297
diff
changeset
|
227 |
for (itSetup = m_ueSetupList.begin (), itDev = ueDevs.Begin (); |
792cecb6cf2d
Evaluation of cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10297
diff
changeset
|
228 |
itSetup != m_ueSetupList.end () || itDev != ueDevs.End (); |
792cecb6cf2d
Evaluation of cell selection criteria
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10297
diff
changeset
|
229 |
itSetup++, itDev++) |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
230 |
{ |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
231 |
if (itSetup->isCsgMember) |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
232 |
{ |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
233 |
lteHelper->SetUeCsgId (*itDev, 1); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
234 |
} |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
235 |
|
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
236 |
Ptr<LteUeNetDevice> ueDev = (*itDev)->GetObject<LteUeNetDevice> (); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
237 |
NS_ASSERT (ueDev != 0); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
238 |
Simulator::Schedule (itSetup->checkPoint, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
239 |
&LteCellSelectionTestCase::CheckPoint, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
240 |
this, ueDev, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
241 |
itSetup->expectedCellId1, itSetup->expectedCellId2); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
242 |
|
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
243 |
if (lastCheckPoint < itSetup->checkPoint) |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
244 |
{ |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
245 |
lastCheckPoint = itSetup->checkPoint; |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
246 |
} |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
247 |
} |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
248 |
|
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
249 |
// Tests |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
250 |
NS_ASSERT (m_ueSetupList.size () == ueDevs.GetN ()); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
251 |
for (itSetup = m_ueSetupList.begin (), itDev = ueDevs.Begin (); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
252 |
itSetup != m_ueSetupList.end () || itDev != ueDevs.End (); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
253 |
itSetup++, itDev++) |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
254 |
{ |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
255 |
Ptr<LteUeNetDevice> ueDev = (*itDev)->GetObject<LteUeNetDevice> (); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
256 |
} |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
257 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
258 |
if (m_isEpcMode) |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
259 |
{ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
260 |
// Create P-GW node |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
261 |
Ptr<Node> pgw = epcHelper->GetPgwNode (); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
262 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
263 |
// Create a single RemoteHost |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
264 |
NodeContainer remoteHostContainer; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
265 |
remoteHostContainer.Create (1); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
266 |
Ptr<Node> remoteHost = remoteHostContainer.Get (0); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
267 |
InternetStackHelper internet; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
268 |
internet.Install (remoteHostContainer); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
269 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
270 |
// Create the Internet |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
271 |
PointToPointHelper p2ph; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
272 |
p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s"))); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
273 |
p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500)); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
274 |
p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010))); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
275 |
NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
276 |
Ipv4AddressHelper ipv4h; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
277 |
ipv4h.SetBase ("1.0.0.0", "255.0.0.0"); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
278 |
Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
279 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
280 |
// Routing of the Internet Host (towards the LTE network) |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
281 |
Ipv4StaticRoutingHelper ipv4RoutingHelper; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
282 |
Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ()); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
283 |
remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
284 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
285 |
// Install the IP stack on the UEs |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
286 |
internet.Install (ueNodes); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
287 |
Ipv4InterfaceContainer ueIpIfaces; |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
288 |
ueIpIfaces = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueDevs)); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
289 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
290 |
// Assign IP address to UEs |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
291 |
for (uint32_t u = 0; u < ueNodes.GetN (); ++u) |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
292 |
{ |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
293 |
Ptr<Node> ueNode = ueNodes.Get (u); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
294 |
// Set the default gateway for the UE |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
295 |
Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ueNode->GetObject<Ipv4> ()); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
296 |
ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
297 |
} |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
298 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
299 |
} // end of if (m_isEpcMode) |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
300 |
else |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
301 |
{ |
10304
4c147dfa87cd
Testing documentation for LTE cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10302
diff
changeset
|
302 |
NS_FATAL_ERROR ("No support yet for LTE_only simulations"); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
303 |
} |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
304 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
305 |
// Connect to trace sources in UEs |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
306 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/StateTransition", |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
307 |
MakeCallback (&LteCellSelectionTestCase::StateTransitionCallback, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
308 |
this)); |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
309 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/InitialCellSelectionEndOk", |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
310 |
MakeCallback (&LteCellSelectionTestCase::InitialCellSelectionEndOkCallback, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
311 |
this)); |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
312 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/InitialCellSelectionEndError", |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
313 |
MakeCallback (&LteCellSelectionTestCase::InitialCellSelectionEndErrorCallback, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
314 |
this)); |
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
315 |
Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/ConnectionEstablished", |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
316 |
MakeCallback (&LteCellSelectionTestCase::ConnectionEstablishedCallback, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
317 |
this)); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
318 |
|
10340
181e32dc8cf3
Updated documentation based on the new UE RRC state model
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10337
diff
changeset
|
319 |
// Enable Idle mode cell selection |
181e32dc8cf3
Updated documentation based on the new UE RRC state model
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10337
diff
changeset
|
320 |
lteHelper->Attach (ueDevs); |
181e32dc8cf3
Updated documentation based on the new UE RRC state model
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10337
diff
changeset
|
321 |
|
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
322 |
// Run simulation |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
323 |
Simulator::Stop (lastCheckPoint); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
324 |
Simulator::Run (); |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
325 |
|
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
326 |
NS_LOG_INFO ("Simulation ends"); |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
327 |
Simulator::Destroy (); |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
328 |
|
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
329 |
} // end of void LteCellSelection6CellTestCase::DoRun () |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
330 |
|
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
331 |
|
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
332 |
void |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
333 |
LteCellSelectionTestCase::CheckPoint (Ptr<LteUeNetDevice> ueDev, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
334 |
uint16_t expectedCellId1, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
335 |
uint16_t expectedCellId2) |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
336 |
{ |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
337 |
uint16_t actualCellId = ueDev->GetRrc ()->GetCellId (); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
338 |
|
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
339 |
if (expectedCellId2 == 0) |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
340 |
{ |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
341 |
NS_TEST_ASSERT_MSG_EQ (actualCellId, expectedCellId1, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
342 |
"IMSI " << ueDev->GetImsi () |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
343 |
<< " has attached to an unexpected cell"); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
344 |
} |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
345 |
else |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
346 |
{ |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
347 |
bool pass = (actualCellId == expectedCellId1) || |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
348 |
(actualCellId == expectedCellId2); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
349 |
NS_TEST_ASSERT_MSG_EQ (pass, true, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
350 |
"IMSI " << ueDev->GetImsi () |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
351 |
<< " has attached to an unexpected cell" |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
352 |
<< " (actual: " << actualCellId << "," |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
353 |
<< " expected: " << expectedCellId1 |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
354 |
<< " or " << expectedCellId2 << ")"); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
355 |
} |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
356 |
|
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
357 |
if (expectedCellId1 > 0) |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
358 |
{ |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
359 |
NS_TEST_ASSERT_MSG_EQ (m_lastState.at (ueDev->GetImsi () - 1), |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
360 |
LteUeRrc::CONNECTED_NORMALLY, |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
361 |
"UE " << ueDev->GetImsi () |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
362 |
<< " is not at CONNECTED_NORMALLY state"); |
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
363 |
} |
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
364 |
} |
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
365 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
366 |
|
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
367 |
void |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
368 |
LteCellSelectionTestCase::StateTransitionCallback ( |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
369 |
std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti, |
10360
b3d6acea639c
Revamped lte-cell-selection test suite with better success probability
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10357
diff
changeset
|
370 |
LteUeRrc::State oldState, LteUeRrc::State newState) |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
371 |
{ |
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
372 |
NS_LOG_FUNCTION (this << imsi << cellId << rnti << oldState << newState); |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
373 |
m_lastState.at (imsi - 1) = newState; |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
374 |
} |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
375 |
|
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
376 |
|
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
377 |
void |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
378 |
LteCellSelectionTestCase::InitialCellSelectionEndOkCallback ( |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
379 |
std::string context, uint64_t imsi, uint16_t cellId) |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
380 |
{ |
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
381 |
NS_LOG_FUNCTION (this << imsi << cellId); |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
382 |
} |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
383 |
|
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
384 |
|
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
385 |
void |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
386 |
LteCellSelectionTestCase::InitialCellSelectionEndErrorCallback ( |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
387 |
std::string context, uint64_t imsi, uint16_t cellId) |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
388 |
{ |
10357
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
389 |
NS_LOG_FUNCTION (this << imsi << cellId); |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
390 |
} |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
391 |
|
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
392 |
|
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
393 |
void |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
394 |
LteCellSelectionTestCase::ConnectionEstablishedCallback ( |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
395 |
std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
396 |
{ |
74fc0fdda26b
Revised lte-cell-selection test vector
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10353
diff
changeset
|
397 |
NS_LOG_FUNCTION (this << imsi << cellId << rnti); |
10291
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
398 |
} |
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
399 |
|
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
400 |
|
e7b10263462c
Several fixed to LTE initial cell selection
Budiarto Herman <budiarto.herman@magister.fi>
parents:
10288
diff
changeset
|
401 |
|
10288
ea6c9b15169c
Attempt to initial synchronization, cell search, MIB and SIB1
Budiarto Herman <budiarto.herman@magister.fi>
parents:
diff
changeset
|
402 |
} // end of namespace ns3 |