author | Manuel Requena <manuel.requena@cttc.es> |
Tue, 26 Mar 2013 10:41:49 +0100 | |
changeset 10019 | 6efd95740e39 |
parent 10011 | 6853962462ca |
child 10022 | 4942b556f517 |
permissions | -rw-r--r-- |
7886 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
|
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: Nicola Baldo <nbaldo@cttc.es> |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
19 |
* Marco Miozzo <mmiozzo@cttc.es> |
9323
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
20 |
* Manuel Requena <manuel.requena@cttc.es> |
7886 | 21 |
*/ |
22 |
||
9323
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
23 |
#include "ns3/fatal-error.h" |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
24 |
#include "ns3/log.h" |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
25 |
#include "ns3/abort.h" |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
26 |
#include "ns3/pointer.h" |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
27 |
#include "ns3/object-map.h" |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
28 |
#include "ns3/object-factory.h" |
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
29 |
#include "ns3/simulator.h" |
7886 | 30 |
|
9406 | 31 |
#include "lte-enb-rrc.h" |
32 |
||
33 |
#include "lte-enb-net-device.h" |
|
34 |
#include "lte-radio-bearer-info.h" |
|
35 |
#include "eps-bearer-tag.h" |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
36 |
#include "ff-mac-csched-sap.h" |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
37 |
#include "epc-enb-s1-sap.h" |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
38 |
|
7886 | 39 |
#include "lte-rlc.h" |
9406 | 40 |
#include "lte-rlc-tm.h" |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
41 |
#include "lte-rlc-um.h" |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
42 |
#include "lte-rlc-am.h" |
9406 | 43 |
#include "lte-pdcp.h" |
44 |
#include "lte-pdcp-sap.h" |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
45 |
|
9036 | 46 |
#include <ns3/simulator.h> |
47 |
||
7886 | 48 |
|
49 |
||
9036 | 50 |
|
7886 | 51 |
NS_LOG_COMPONENT_DEFINE ("LteEnbRrc"); |
52 |
||
9406 | 53 |
|
7886 | 54 |
namespace ns3 { |
55 |
||
56 |
||
57 |
// /////////////////////////// |
|
58 |
// CMAC SAP forwarder |
|
59 |
// /////////////////////////// |
|
60 |
||
7888 | 61 |
class EnbRrcMemberLteEnbCmacSapUser : public LteEnbCmacSapUser |
7886 | 62 |
{ |
63 |
public: |
|
7888 | 64 |
EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc); |
7886 | 65 |
|
9406 | 66 |
virtual uint16_t AllocateTemporaryCellRnti (); |
7886 | 67 |
virtual void NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success); |
9346 | 68 |
virtual void RrcConfigurationUpdateInd (UeConfig params); |
7886 | 69 |
|
70 |
private: |
|
71 |
LteEnbRrc* m_rrc; |
|
72 |
}; |
|
73 |
||
7888 | 74 |
EnbRrcMemberLteEnbCmacSapUser::EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc) |
7886 | 75 |
: m_rrc (rrc) |
76 |
{ |
|
77 |
} |
|
78 |
||
9406 | 79 |
uint16_t |
80 |
EnbRrcMemberLteEnbCmacSapUser::AllocateTemporaryCellRnti () |
|
81 |
{ |
|
82 |
return m_rrc->DoAllocateTemporaryCellRnti (); |
|
83 |
} |
|
84 |
||
7886 | 85 |
void |
7888 | 86 |
EnbRrcMemberLteEnbCmacSapUser::NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success) |
7886 | 87 |
{ |
88 |
m_rrc->DoNotifyLcConfigResult (rnti, lcid, success); |
|
89 |
} |
|
90 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
91 |
void |
9346 | 92 |
EnbRrcMemberLteEnbCmacSapUser::RrcConfigurationUpdateInd (UeConfig params) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
93 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
94 |
m_rrc->DoRrcConfigurationUpdateInd (params); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
95 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
96 |
|
7886 | 97 |
|
9406 | 98 |
const char* g_ueManagerStateName[UeManager::NUM_STATES] = |
99 |
{ |
|
100 |
"INITIAL_RANDOM_ACCESS", |
|
101 |
"CONNECTION_SETUP", |
|
9593
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
102 |
"CONNECTION_REJECTED", |
9406 | 103 |
"CONNECTED_NORMALLY", |
104 |
"CONNECTION_RECONFIGURATION", |
|
105 |
"CONNECTION_REESTABLISHMENT", |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
106 |
"HANDOVER_PREPARATION", |
9406 | 107 |
"HANDOVER_JOINING", |
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
108 |
"HANDOVER_PATH_SWITCH", |
9406 | 109 |
"HANDOVER_LEAVING", |
110 |
}; |
|
111 |
||
112 |
std::string ToString (UeManager::State s) |
|
113 |
{ |
|
114 |
return std::string (g_ueManagerStateName[s]); |
|
115 |
} |
|
116 |
||
117 |
||
118 |
||
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
119 |
/////////////////////////////////////////// |
9406 | 120 |
// UeManager |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
121 |
/////////////////////////////////////////// |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
122 |
|
7886 | 123 |
|
9406 | 124 |
NS_OBJECT_ENSURE_REGISTERED (UeManager); |
125 |
||
7905
80557b09aa7f
Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
7903
diff
changeset
|
126 |
|
9406 | 127 |
UeManager::UeManager () |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
128 |
{ |
9406 | 129 |
NS_FATAL_ERROR ("this constructor is not espected to be used"); |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
130 |
} |
7886 | 131 |
|
8007 | 132 |
|
9406 | 133 |
UeManager::UeManager (Ptr<LteEnbRrc> rrc, uint16_t rnti, State s) |
134 |
: m_lastAllocatedDrbid (0), |
|
135 |
m_rnti (rnti), |
|
136 |
m_imsi (0), |
|
137 |
m_lastRrcTransactionIdentifier (0), |
|
138 |
m_rrc (rrc), |
|
139 |
m_state (s), |
|
9407 | 140 |
m_pendingRrcConnectionReconfiguration (false), |
141 |
m_sourceX2apId (0), |
|
9541
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
142 |
m_sourceCellId (0), |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
143 |
m_needTransmissionModeConfiguration (false) |
9406 | 144 |
{ |
145 |
NS_LOG_FUNCTION (this); |
|
9471
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
146 |
} |
9406 | 147 |
|
9471
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
148 |
void |
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
149 |
UeManager::DoStart () |
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
150 |
{ |
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
151 |
NS_LOG_FUNCTION (this); |
9447
f836d3a3b71a
added LteUeRrcSapProvider::CompleteSetup ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9445
diff
changeset
|
152 |
m_drbPdcpSapUser = new LtePdcpSpecificLtePdcpSapUser<UeManager> (this); |
9406 | 153 |
|
154 |
m_physicalConfigDedicated.haveAntennaInfoDedicated = true; |
|
155 |
m_physicalConfigDedicated.antennaInfo.transmissionMode = m_rrc->m_defaultTransmissionMode; |
|
156 |
m_physicalConfigDedicated.haveSoundingRsUlConfigDedicated = true; |
|
157 |
m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex = m_rrc->GetNewSrsConfigurationIndex (); |
|
9507
b3ae0b546cc4
Fix bug in UE phy with m_srsPeriodicity == 0
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9501
diff
changeset
|
158 |
m_physicalConfigDedicated.soundingRsUlConfigDedicated.type = LteRrcSap::SoundingRsUlConfigDedicated::SETUP; |
9564
6a07929995e2
Set hpi.asConfig.sourceSystemInformationBlockType1 correct values.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9558
diff
changeset
|
159 |
m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsBandwidth = 0; |
9406 | 160 |
|
9471
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
161 |
m_rrc->m_cmacSapProvider->AddUe (m_rnti); |
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
162 |
m_rrc->m_cphySapProvider->AddUe (m_rnti); |
9406 | 163 |
|
164 |
// setup the eNB side of SRB0 |
|
165 |
{ |
|
166 |
uint8_t lcid = 0; |
|
167 |
||
168 |
Ptr<LteRlc> rlc = CreateObject<LteRlcTm> ()->GetObject<LteRlc> (); |
|
169 |
rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider); |
|
170 |
rlc->SetRnti (m_rnti); |
|
171 |
rlc->SetLcId (lcid); |
|
172 |
||
173 |
m_srb0 = CreateObject<LteSignalingRadioBearerInfo> (); |
|
174 |
m_srb0->m_rlc = rlc; |
|
9473
8b420bd32318
reset MAC and reinitialize SRBs upon handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9472
diff
changeset
|
175 |
m_srb0->m_srbIdentity = 0; |
9406 | 176 |
// no need to store logicalChannelConfig as SRB0 is pre-configured |
177 |
||
178 |
LteEnbCmacSapProvider::LcInfo lcinfo; |
|
179 |
lcinfo.rnti = m_rnti; |
|
180 |
lcinfo.lcId = lcid; |
|
181 |
// leave the rest of lcinfo empty as CCCH (LCID 0) is pre-configured |
|
182 |
m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ()); |
|
183 |
||
184 |
} |
|
185 |
||
186 |
// setup the eNB side of SRB1; the UE side will be set up upon RRC connection establishment |
|
187 |
{ |
|
188 |
uint8_t lcid = 1; |
|
189 |
||
190 |
Ptr<LteRlc> rlc = CreateObject<LteRlcAm> ()->GetObject<LteRlc> (); |
|
191 |
rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider); |
|
192 |
rlc->SetRnti (m_rnti); |
|
193 |
rlc->SetLcId (lcid); |
|
194 |
||
195 |
Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> (); |
|
196 |
pdcp->SetRnti (m_rnti); |
|
197 |
pdcp->SetLcId (lcid); |
|
9447
f836d3a3b71a
added LteUeRrcSapProvider::CompleteSetup ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9445
diff
changeset
|
198 |
pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser); |
9406 | 199 |
pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ()); |
200 |
rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ()); |
|
201 |
||
202 |
m_srb1 = CreateObject<LteSignalingRadioBearerInfo> (); |
|
203 |
m_srb1->m_rlc = rlc; |
|
204 |
m_srb1->m_pdcp = pdcp; |
|
205 |
m_srb1->m_srbIdentity = 1; |
|
206 |
m_srb1->m_logicalChannelConfig.priority = 0; |
|
207 |
m_srb1->m_logicalChannelConfig.prioritizedBitRateKbps = 100; |
|
208 |
m_srb1->m_logicalChannelConfig.bucketSizeDurationMs = 100; |
|
209 |
m_srb1->m_logicalChannelConfig.logicalChannelGroup = 0; |
|
210 |
||
211 |
LteEnbCmacSapProvider::LcInfo lcinfo; |
|
212 |
lcinfo.rnti = m_rnti; |
|
213 |
lcinfo.lcId = lcid; |
|
214 |
lcinfo.lcGroup = 0; // all SRBs always mapped to LCG 0 |
|
215 |
lcinfo.qci = EpsBearer::GBR_CONV_VOICE; // not sure why the FF API requires a CQI even for SRBs... |
|
216 |
lcinfo.isGbr = true; |
|
217 |
lcinfo.mbrUl = 1e6; |
|
218 |
lcinfo.mbrDl = 1e6; |
|
219 |
lcinfo.gbrUl = 1e4; |
|
220 |
lcinfo.gbrDl = 1e4; |
|
221 |
m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ()); |
|
222 |
} |
|
223 |
||
224 |
LteEnbRrcSapUser::SetupUeParameters ueParams; |
|
225 |
ueParams.srb0SapProvider = m_srb0->m_rlc->GetLteRlcSapProvider (); |
|
226 |
ueParams.srb1SapProvider = m_srb1->m_pdcp->GetLtePdcpSapProvider (); |
|
227 |
m_rrc->m_rrcSapUser->SetupUe (m_rnti, ueParams); |
|
228 |
||
229 |
// configure MAC (and scheduler) |
|
230 |
LteEnbCmacSapProvider::UeConfig req; |
|
9471
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
231 |
req.m_rnti = m_rnti; |
9406 | 232 |
req.m_transmissionMode = m_physicalConfigDedicated.antennaInfo.transmissionMode; |
233 |
m_rrc->m_cmacSapProvider->UeUpdateConfigurationReq (req); |
|
234 |
||
235 |
// configure PHY |
|
9471
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
236 |
m_rrc->m_cphySapProvider->SetTransmissionMode (m_rnti, m_physicalConfigDedicated.antennaInfo.transmissionMode); |
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
237 |
m_rrc->m_cphySapProvider->SetSrsConfigurationIndex (m_rnti, m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex); |
9567
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
238 |
|
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
239 |
// schedule this UeManager instance to be deleted if the UE does not give any sign of life within a reasonable time |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
240 |
Time maxConnectionDelay; |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
241 |
switch (m_state) |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
242 |
{ |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
243 |
case INITIAL_RANDOM_ACCESS: |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
244 |
// must account for reception of RAR and transmission of RRC CONNECTION REQUEST over UL GRANT |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
245 |
maxConnectionDelay = MilliSeconds (15); |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
246 |
break; |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
247 |
case HANDOVER_JOINING: |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
248 |
// must account for reception of X2 HO REQ ACK by source eNB, |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
249 |
// transmission of the Handover Command, and |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
250 |
// non-contention-based random access |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
251 |
maxConnectionDelay = MilliSeconds (50); |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
252 |
break; |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
253 |
default: |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
254 |
NS_FATAL_ERROR ("unspecified maxConnectionDelay for state " << ToString (m_state)); |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
255 |
break; |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
256 |
} |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
257 |
m_connectionTimeout = Simulator::Schedule (maxConnectionDelay, &LteEnbRrc::ConnectionTimeout, m_rrc, m_rnti); |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
258 |
|
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
259 |
m_servingCellMeasures = CreateObject<UeMeasure> (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
260 |
m_servingCellMeasures->m_cellId = m_rrc->m_cellId; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
261 |
m_servingCellMeasures->m_rsrp = 0; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
262 |
m_servingCellMeasures->m_rsrq = 0; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
263 |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
264 |
} |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
265 |
|
9406 | 266 |
|
267 |
UeManager::~UeManager (void) |
|
268 |
{ |
|
269 |
} |
|
270 |
||
271 |
void |
|
272 |
UeManager::DoDispose () |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
273 |
{ |
9447
f836d3a3b71a
added LteUeRrcSapProvider::CompleteSetup ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9445
diff
changeset
|
274 |
delete m_drbPdcpSapUser; |
9599
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
275 |
// delete eventual X2-U TEIDs |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
276 |
for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin (); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
277 |
it != m_drbMap.end (); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
278 |
++it) |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
279 |
{ |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
280 |
m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid); |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
281 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
282 |
|
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
283 |
m_servingCellMeasures = 0; |
9406 | 284 |
} |
285 |
||
286 |
TypeId UeManager::GetTypeId (void) |
|
287 |
{ |
|
288 |
static TypeId tid = TypeId ("ns3::UeManager") |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
289 |
.SetParent<Object> () |
9406 | 290 |
.AddConstructor<UeManager> () |
9615 | 291 |
.AddAttribute ("DataRadioBearerMap", "List of UE DataRadioBearerInfo by DRBID.", |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
292 |
ObjectMapValue (), |
9406 | 293 |
MakeObjectMapAccessor (&UeManager::m_drbMap), |
294 |
MakeObjectMapChecker<LteDataRadioBearerInfo> ()) |
|
9615 | 295 |
.AddAttribute ("Srb0", "SignalingRadioBearerInfo for SRB0", |
296 |
PointerValue (), |
|
297 |
MakePointerAccessor (&UeManager::m_srb0), |
|
298 |
MakePointerChecker<LteSignalingRadioBearerInfo> ()) |
|
299 |
.AddAttribute ("Srb1", "SignalingRadioBearerInfo for SRB1", |
|
300 |
PointerValue (), |
|
301 |
MakePointerAccessor (&UeManager::m_srb1), |
|
302 |
MakePointerChecker<LteSignalingRadioBearerInfo> ()) |
|
303 |
.AddAttribute ("C-RNTI", |
|
304 |
"Cell Radio Network Temporary Identifier", |
|
305 |
TypeId::ATTR_GET, // read-only attribute |
|
306 |
UintegerValue (0), // unused, read-only attribute |
|
307 |
MakeUintegerAccessor (&UeManager::m_rnti), |
|
308 |
MakeUintegerChecker<uint16_t> ()) |
|
9406 | 309 |
.AddTraceSource ("StateTransition", |
310 |
"fired upon every UE state transition seen by the UeManager at the eNB RRC", |
|
9452
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
311 |
MakeTraceSourceAccessor (&UeManager::m_stateTransitionTrace)) |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
312 |
; |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
313 |
return tid; |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
314 |
} |
7886 | 315 |
|
9407 | 316 |
void |
317 |
UeManager::SetSource (uint16_t sourceCellId, uint16_t sourceX2apId) |
|
318 |
{ |
|
319 |
m_sourceX2apId = sourceX2apId; |
|
320 |
m_sourceCellId = sourceCellId; |
|
321 |
} |
|
9406 | 322 |
|
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
323 |
void |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
324 |
UeManager::SetImsi (uint64_t imsi) |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
325 |
{ |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
326 |
m_imsi = imsi; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
327 |
} |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
328 |
|
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
329 |
void |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
330 |
UeManager::SetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint32_t gtpTeid, Ipv4Address transportLayerAddress) |
9406 | 331 |
{ |
332 |
NS_LOG_FUNCTION (this << (uint32_t) m_rnti); |
|
333 |
||
334 |
Ptr<LteDataRadioBearerInfo> drbInfo = CreateObject<LteDataRadioBearerInfo> (); |
|
335 |
uint8_t drbid = AddDataRadioBearerInfo (drbInfo); |
|
336 |
uint8_t lcid = Drbid2Lcid (drbid); |
|
337 |
uint8_t bid = Drbid2Bid (drbid); |
|
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
338 |
NS_ASSERT_MSG ( bearerId == 0 || bid == bearerId, "bearer ID mismatch (" << (uint32_t) bid << " != " << (uint32_t) bearerId << ", the assumption that ID are allocated in the same way by MME and RRC is not valid any more"); |
9406 | 339 |
drbInfo->m_epsBearerIdentity = bid; |
340 |
drbInfo->m_drbIdentity = drbid; |
|
341 |
drbInfo->m_logicalChannelIdentity = lcid; |
|
9408
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
342 |
drbInfo->m_gtpTeid = gtpTeid; |
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
343 |
drbInfo->m_transportLayerAddress = transportLayerAddress; |
9406 | 344 |
|
9599
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
345 |
if (m_state == HANDOVER_JOINING) |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
346 |
{ |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
347 |
// setup TEIDs for receiving data eventually forwarded over X2-U |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
348 |
LteEnbRrc::X2uTeidInfo x2uTeidInfo; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
349 |
x2uTeidInfo.rnti = m_rnti; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
350 |
x2uTeidInfo.drbid = drbid; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
351 |
std::pair<std::map<uint32_t, LteEnbRrc::X2uTeidInfo>::iterator, bool> |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
352 |
ret = m_rrc->m_x2uTeidInfoMap.insert (std::pair<uint32_t, LteEnbRrc::X2uTeidInfo> (gtpTeid, x2uTeidInfo)); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
353 |
NS_ASSERT_MSG (ret.second == true, "overwriting a pre-existing entry in m_x2uTeidInfoMap"); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
354 |
} |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
355 |
|
9406 | 356 |
TypeId rlcTypeId = m_rrc->GetRlcType (bearer); |
357 |
||
358 |
ObjectFactory rlcObjectFactory; |
|
359 |
rlcObjectFactory.SetTypeId (rlcTypeId); |
|
360 |
Ptr<LteRlc> rlc = rlcObjectFactory.Create ()->GetObject<LteRlc> (); |
|
361 |
rlc->SetLteMacSapProvider (m_rrc->m_macSapProvider); |
|
362 |
rlc->SetRnti (m_rnti); |
|
363 |
||
364 |
drbInfo->m_rlc = rlc; |
|
365 |
||
366 |
rlc->SetLcId (lcid); |
|
367 |
||
368 |
// we need PDCP only for real RLC, i.e., RLC/UM or RLC/AM |
|
369 |
// if we are using RLC/SM we don't care of anything above RLC |
|
370 |
if (rlcTypeId != LteRlcSm::GetTypeId ()) |
|
371 |
{ |
|
372 |
Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> (); |
|
373 |
pdcp->SetRnti (m_rnti); |
|
374 |
pdcp->SetLcId (lcid); |
|
9447
f836d3a3b71a
added LteUeRrcSapProvider::CompleteSetup ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9445
diff
changeset
|
375 |
pdcp->SetLtePdcpSapUser (m_drbPdcpSapUser); |
9406 | 376 |
pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ()); |
377 |
rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ()); |
|
378 |
drbInfo->m_pdcp = pdcp; |
|
379 |
} |
|
380 |
||
381 |
LteEnbCmacSapProvider::LcInfo lcinfo; |
|
382 |
lcinfo.rnti = m_rnti; |
|
383 |
lcinfo.lcId = lcid; |
|
384 |
lcinfo.lcGroup = m_rrc->GetLogicalChannelGroup (bearer); |
|
385 |
lcinfo.qci = bearer.qci; |
|
386 |
lcinfo.isGbr = bearer.IsGbr (); |
|
387 |
lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl; |
|
388 |
lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl; |
|
389 |
lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl; |
|
390 |
lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl; |
|
391 |
m_rrc->m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ()); |
|
392 |
||
393 |
if (drbInfo->m_rlc->GetTypeId () == LteRlcAm::GetTypeId ()) |
|
394 |
{ |
|
395 |
drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::AM; |
|
396 |
} |
|
397 |
else |
|
398 |
{ |
|
399 |
drbInfo->m_rlcConfig.choice = LteRrcSap::RlcConfig::UM_BI_DIRECTIONAL; |
|
400 |
} |
|
401 |
||
402 |
drbInfo->m_logicalChannelIdentity = lcid; |
|
403 |
drbInfo->m_logicalChannelConfig.priority = m_rrc->GetLogicalChannelPriority (bearer); |
|
404 |
drbInfo->m_logicalChannelConfig.logicalChannelGroup = m_rrc->GetLogicalChannelGroup (bearer); |
|
405 |
if (bearer.IsGbr ()) |
|
406 |
{ |
|
407 |
drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = bearer.gbrQosInfo.gbrUl; |
|
408 |
} |
|
409 |
else |
|
410 |
{ |
|
411 |
drbInfo->m_logicalChannelConfig.prioritizedBitRateKbps = 0; |
|
412 |
} |
|
413 |
drbInfo->m_logicalChannelConfig.bucketSizeDurationMs = 1000; |
|
414 |
||
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
415 |
ScheduleRrcConnectionReconfiguration (); |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
416 |
} |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
417 |
|
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
418 |
void |
9523
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
419 |
UeManager::RecordDataRadioBearersToBeStarted () |
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
420 |
{ |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
421 |
NS_LOG_FUNCTION (this << (uint32_t) m_rnti); |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
422 |
for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin (); |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
423 |
it != m_drbMap.end (); |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
424 |
++it) |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
425 |
{ |
9523
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
426 |
m_drbsToBeStarted.push_back (it->first); |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
427 |
} |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
428 |
} |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
429 |
|
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
430 |
void |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
431 |
UeManager::StartDataRadioBearers () |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
432 |
{ |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
433 |
NS_LOG_FUNCTION (this << (uint32_t) m_rnti); |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
434 |
for (std::list <uint8_t>::iterator drbIdIt = m_drbsToBeStarted.begin (); |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
435 |
drbIdIt != m_drbsToBeStarted.end (); |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
436 |
++drbIdIt) |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
437 |
{ |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
438 |
std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (*drbIdIt); |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
439 |
NS_ASSERT (drbIt != m_drbMap.end ()); |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
440 |
drbIt->second->m_rlc->Start (); |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
441 |
if (drbIt->second->m_pdcp) |
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
442 |
{ |
9523
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
443 |
drbIt->second->m_pdcp->Start (); |
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
444 |
} |
9523
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
445 |
} |
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
446 |
m_drbsToBeStarted.clear (); |
9406 | 447 |
} |
448 |
||
449 |
||
450 |
void |
|
451 |
UeManager::ReleaseDataRadioBearer (uint8_t drbid) |
|
452 |
{ |
|
453 |
NS_LOG_FUNCTION (this << (uint32_t) m_rnti << (uint32_t) drbid); |
|
454 |
uint8_t lcid = Drbid2Lcid (drbid); |
|
455 |
std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid); |
|
456 |
NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid); |
|
9599
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
457 |
|
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
458 |
// first delete eventual X2-U TEIDs |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
459 |
m_rrc->m_x2uTeidInfoMap.erase (it->second->m_gtpTeid); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
460 |
|
9406 | 461 |
m_drbMap.erase (it); |
462 |
m_rrc->m_cmacSapProvider->ReleaseLc (m_rnti, lcid); |
|
463 |
||
464 |
LteRrcSap::RadioResourceConfigDedicated rrcd; |
|
465 |
rrcd.havePhysicalConfigDedicated = false; |
|
466 |
rrcd.drbToReleaseList.push_back (drbid); |
|
467 |
||
468 |
LteRrcSap::RrcConnectionReconfiguration msg; |
|
469 |
msg.haveMeasConfig = false; |
|
470 |
msg.haveMobilityControlInfo = false; |
|
471 |
||
472 |
m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg); |
|
473 |
} |
|
474 |
||
475 |
||
476 |
void |
|
477 |
UeManager::ScheduleRrcConnectionReconfiguration () |
|
478 |
{ |
|
479 |
NS_LOG_FUNCTION (this); |
|
480 |
switch (m_state) |
|
481 |
{ |
|
482 |
case INITIAL_RANDOM_ACCESS: |
|
483 |
case CONNECTION_SETUP: |
|
484 |
case CONNECTION_RECONFIGURATION: |
|
485 |
case CONNECTION_REESTABLISHMENT: |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
486 |
case HANDOVER_PREPARATION: |
9406 | 487 |
case HANDOVER_JOINING: |
488 |
case HANDOVER_LEAVING: |
|
489 |
// a previous reconfiguration still ongoing, we need to wait for it to be finished |
|
490 |
m_pendingRrcConnectionReconfiguration = true; |
|
491 |
break; |
|
492 |
||
493 |
case CONNECTED_NORMALLY: |
|
494 |
{ |
|
495 |
m_pendingRrcConnectionReconfiguration = false; |
|
496 |
LteRrcSap::RrcConnectionReconfiguration msg = BuildRrcConnectionReconfiguration (); |
|
497 |
m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, msg); |
|
9523
4f5bc596bf98
LteEnbRrc: start only bearers in previous RRC connection setup/reconfiguration msg
Nicola Baldo <nbaldo@cttc.es>
parents:
9507
diff
changeset
|
498 |
RecordDataRadioBearersToBeStarted (); |
9406 | 499 |
SwitchToState (CONNECTION_RECONFIGURATION); |
500 |
} |
|
501 |
break; |
|
502 |
||
503 |
default: |
|
504 |
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state)); |
|
505 |
break; |
|
506 |
} |
|
507 |
} |
|
508 |
||
509 |
void |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
510 |
UeManager::PrepareHandover (uint16_t cellId) |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
511 |
{ |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
512 |
NS_LOG_FUNCTION (this << cellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
513 |
switch (m_state) |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
514 |
{ |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
515 |
case CONNECTED_NORMALLY: |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
516 |
{ |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
517 |
m_targetCellId = cellId; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
518 |
EpcX2SapProvider::HandoverRequestParams params; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
519 |
params.oldEnbUeX2apId = m_rnti; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
520 |
params.cause = EpcX2SapProvider::HandoverDesirableForRadioReason; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
521 |
params.sourceCellId = m_rrc->m_cellId; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
522 |
params.targetCellId = cellId; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
523 |
params.mmeUeS1apId = m_imsi; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
524 |
params.ueAggregateMaxBitRateDownlink = 200 * 1000; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
525 |
params.ueAggregateMaxBitRateUplink = 100 * 1000; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
526 |
params.bearers = GetErabList (); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
527 |
|
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
528 |
LteRrcSap::HandoverPreparationInfo hpi; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
529 |
hpi.asConfig.sourceUeIdentity = m_rnti; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
530 |
hpi.asConfig.sourceDlCarrierFreq = m_rrc->m_dlEarfcn; |
9991
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
531 |
hpi.asConfig.sourceMeasConfig = BuildMeasConfig (); |
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
532 |
hpi.asConfig.sourceRadioResourceConfig = GetRadioResourceConfigForHandoverPreparationInfo (); |
9564
6a07929995e2
Set hpi.asConfig.sourceSystemInformationBlockType1 correct values.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9558
diff
changeset
|
533 |
hpi.asConfig.sourceMasterInformationBlock.dlBandwidth = m_rrc->m_dlBandwidth; |
6a07929995e2
Set hpi.asConfig.sourceSystemInformationBlockType1 correct values.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9558
diff
changeset
|
534 |
hpi.asConfig.sourceMasterInformationBlock.systemFrameNumber = 0; |
6a07929995e2
Set hpi.asConfig.sourceSystemInformationBlockType1 correct values.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9558
diff
changeset
|
535 |
hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.plmnIdentityInfo.plmnIdentity = 0; |
6a07929995e2
Set hpi.asConfig.sourceSystemInformationBlockType1 correct values.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9558
diff
changeset
|
536 |
hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.cellIdentity = m_rrc->m_cellId; |
6a07929995e2
Set hpi.asConfig.sourceSystemInformationBlockType1 correct values.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9558
diff
changeset
|
537 |
hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIndication = 0; |
6a07929995e2
Set hpi.asConfig.sourceSystemInformationBlockType1 correct values.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9558
diff
changeset
|
538 |
hpi.asConfig.sourceSystemInformationBlockType1.cellAccessRelatedInfo.csgIdentity = 0; |
9660
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
539 |
LteEnbCmacSapProvider::RachConfig rc = m_rrc->m_cmacSapProvider->GetRachConfig (); |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
540 |
hpi.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles; |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
541 |
hpi.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax; |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
542 |
hpi.asConfig.sourceSystemInformationBlockType2.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize; |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
543 |
hpi.asConfig.sourceSystemInformationBlockType2.freqInfo.ulCarrierFreq = m_rrc->m_ulEarfcn; |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
544 |
hpi.asConfig.sourceSystemInformationBlockType2.freqInfo.ulBandwidth = m_rrc->m_ulBandwidth; |
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
545 |
params.rrcContext = m_rrc->m_rrcSapUser->EncodeHandoverPreparationInformation (hpi); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
546 |
|
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
547 |
NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
548 |
NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
549 |
NS_LOG_LOGIC ("targetCellId = " << params.targetCellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
550 |
NS_LOG_LOGIC ("mmmUeS1apId = " << params.oldEnbUeX2apId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
551 |
NS_LOG_LOGIC ("rrcContext = " << params.rrcContext); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
552 |
|
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
553 |
m_rrc->m_x2SapProvider->SendHandoverRequest (params); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
554 |
SwitchToState (HANDOVER_PREPARATION); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
555 |
} |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
556 |
break; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
557 |
|
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
558 |
default: |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
559 |
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state)); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
560 |
break; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
561 |
} |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
562 |
|
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
563 |
} |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
564 |
|
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
565 |
void |
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
566 |
UeManager::RecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams params) |
9406 | 567 |
{ |
568 |
NS_LOG_FUNCTION (this); |
|
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
569 |
|
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
570 |
NS_ASSERT_MSG (params.notAdmittedBearers.empty (), "not admission of some bearers upon handover is not supported"); |
9501
3c52c63f19fd
check admittedBearers upon handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9500
diff
changeset
|
571 |
NS_ASSERT_MSG (params.admittedBearers.size () == m_drbMap.size (), "not enough bearers in admittedBearers"); |
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
572 |
|
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
573 |
// note: the Handover command from the target eNB to the source eNB |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
574 |
// is expected to be sent transparently to the UE; however, here we |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
575 |
// decode the message and eventually reencode it. This way we can |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
576 |
// support both a real RRC protocol implementation and an ideal one |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
577 |
// without actual RRC protocol encoding. |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
578 |
|
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
579 |
Ptr<Packet> encodedHandoverCommand = params.rrcContext; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
580 |
LteRrcSap::RrcConnectionReconfiguration handoverCommand = m_rrc->m_rrcSapUser->DecodeHandoverCommand (encodedHandoverCommand); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
581 |
m_rrc->m_rrcSapUser->SendRrcConnectionReconfiguration (m_rnti, handoverCommand); |
9406 | 582 |
SwitchToState (HANDOVER_LEAVING); |
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
583 |
NS_ASSERT (handoverCommand.haveMobilityControlInfo); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
584 |
m_rrc->m_handoverStartTrace (m_imsi, m_rrc->m_cellId, m_rnti, handoverCommand.mobilityControlInfo.targetPhysCellId); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
585 |
|
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
586 |
EpcX2SapProvider::SnStatusTransferParams sst; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
587 |
sst.oldEnbUeX2apId = params.oldEnbUeX2apId; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
588 |
sst.newEnbUeX2apId = params.newEnbUeX2apId; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
589 |
sst.sourceCellId = params.sourceCellId; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
590 |
sst.targetCellId = params.targetCellId; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
591 |
for ( std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.begin (); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
592 |
drbIt != m_drbMap.end (); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
593 |
++drbIt) |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
594 |
{ |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
595 |
// SN status transfer is only for AM RLC |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
596 |
if (0 != drbIt->second->m_rlc->GetObject<LteRlcAm> ()) |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
597 |
{ |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
598 |
LtePdcp::Status status = drbIt->second->m_pdcp->GetStatus (); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
599 |
EpcX2Sap::ErabsSubjectToStatusTransferItem i; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
600 |
i.dlPdcpSn = status.txSn; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
601 |
i.ulPdcpSn = status.rxSn; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
602 |
sst.erabsSubjectToStatusTransferList.push_back (i); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
603 |
} |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
604 |
} |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
605 |
m_rrc->m_x2SapProvider->SendSnStatusTransfer (sst); |
9406 | 606 |
} |
607 |
||
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
608 |
|
9406 | 609 |
LteRrcSap::RadioResourceConfigDedicated |
610 |
UeManager::GetRadioResourceConfigForHandoverPreparationInfo () |
|
611 |
{ |
|
612 |
NS_LOG_FUNCTION (this); |
|
613 |
return BuildRadioResourceConfigDedicated (); |
|
614 |
} |
|
615 |
||
616 |
LteRrcSap::RrcConnectionReconfiguration |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
617 |
UeManager::GetRrcConnectionReconfigurationForHandover () |
9406 | 618 |
{ |
619 |
NS_LOG_FUNCTION (this); |
|
620 |
return BuildRrcConnectionReconfiguration (); |
|
621 |
} |
|
622 |
||
623 |
void |
|
624 |
UeManager::SendData (uint8_t bid, Ptr<Packet> p) |
|
625 |
{ |
|
626 |
NS_LOG_FUNCTION (this << p << (uint16_t) bid); |
|
9599
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
627 |
switch (m_state) |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
628 |
{ |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
629 |
case INITIAL_RANDOM_ACCESS: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
630 |
case CONNECTION_SETUP: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
631 |
NS_LOG_WARN ("not connected, discarding packet"); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
632 |
return; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
633 |
break; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
634 |
|
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
635 |
case CONNECTED_NORMALLY: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
636 |
case CONNECTION_RECONFIGURATION: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
637 |
case CONNECTION_REESTABLISHMENT: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
638 |
case HANDOVER_PREPARATION: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
639 |
case HANDOVER_JOINING: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
640 |
case HANDOVER_PATH_SWITCH: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
641 |
{ |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
642 |
NS_LOG_LOGIC ("queueing data on PDCP for transmission over the air"); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
643 |
LtePdcpSapProvider::TransmitPdcpSduParameters params; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
644 |
params.pdcpSdu = p; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
645 |
params.rnti = m_rnti; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
646 |
params.lcid = Bid2Lcid (bid); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
647 |
uint8_t drbid = Bid2Drbid (bid); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
648 |
LtePdcpSapProvider* pdcpSapProvider = GetDataRadioBearerInfo (drbid)->m_pdcp->GetLtePdcpSapProvider (); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
649 |
pdcpSapProvider->TransmitPdcpSdu (params); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
650 |
} |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
651 |
break; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
652 |
|
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
653 |
case HANDOVER_LEAVING: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
654 |
{ |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
655 |
NS_LOG_LOGIC ("forwarding data to target eNB over X2-U"); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
656 |
uint8_t drbid = Bid2Drbid (bid); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
657 |
EpcX2Sap::UeDataParams params; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
658 |
params.sourceCellId = m_rrc->m_cellId; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
659 |
params.targetCellId = m_targetCellId; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
660 |
params.gtpTeid = GetDataRadioBearerInfo (drbid)->m_gtpTeid; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
661 |
params.ueData = p; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
662 |
m_rrc->m_x2SapProvider->SendUeData (params); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
663 |
} |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
664 |
break; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
665 |
|
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
666 |
default: |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
667 |
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state)); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
668 |
break; |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
669 |
} |
9406 | 670 |
} |
671 |
||
672 |
std::vector<EpcX2Sap::ErabToBeSetupItem> |
|
673 |
UeManager::GetErabList () |
|
674 |
{ |
|
675 |
NS_LOG_FUNCTION (this); |
|
676 |
std::vector<EpcX2Sap::ErabToBeSetupItem> ret; |
|
677 |
for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin (); |
|
678 |
it != m_drbMap.end (); |
|
679 |
++it) |
|
680 |
{ |
|
9408
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
681 |
EpcX2Sap::ErabToBeSetupItem etbsi; |
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
682 |
etbsi.erabId = it->second->m_epsBearerIdentity; |
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
683 |
etbsi.erabLevelQosParameters = it->second->m_epsBearer; |
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
684 |
etbsi.dlForwarding = false; |
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
685 |
etbsi.transportLayerAddress = it->second->m_transportLayerAddress; |
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
686 |
etbsi.gtpTeid = it->second->m_gtpTeid; |
80fa1de0bef2
implemented UeManager::GetErabList ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9407
diff
changeset
|
687 |
ret.push_back (etbsi); |
9406 | 688 |
} |
689 |
return ret; |
|
690 |
} |
|
691 |
||
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
692 |
void |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
693 |
UeManager::SendUeContextRelease () |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
694 |
{ |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
695 |
NS_LOG_FUNCTION (this); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
696 |
switch (m_state) |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
697 |
{ |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
698 |
case HANDOVER_PATH_SWITCH: |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
699 |
NS_LOG_INFO ("Send UE CONTEXT RELEASE from target eNB to source eNB"); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
700 |
EpcX2SapProvider::UeContextReleaseParams ueCtxReleaseParams; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
701 |
ueCtxReleaseParams.oldEnbUeX2apId = m_sourceX2apId; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
702 |
ueCtxReleaseParams.newEnbUeX2apId = m_rnti; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
703 |
ueCtxReleaseParams.sourceCellId = m_sourceCellId; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
704 |
m_rrc->m_x2SapProvider->SendUeContextRelease (ueCtxReleaseParams); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
705 |
SwitchToState (CONNECTED_NORMALLY); |
9452
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
706 |
m_rrc->m_handoverEndOkTrace (m_imsi, m_rrc->m_cellId, m_rnti); |
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
707 |
break; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
708 |
|
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
709 |
default: |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
710 |
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state)); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
711 |
break; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
712 |
} |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
713 |
} |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
714 |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
715 |
void |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
716 |
UeManager::RecvHandoverPreparationFailure (uint16_t cellId) |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
717 |
{ |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
718 |
NS_LOG_FUNCTION (this << cellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
719 |
switch (m_state) |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
720 |
{ |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
721 |
case HANDOVER_PREPARATION: |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
722 |
NS_ASSERT (cellId == m_targetCellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
723 |
NS_LOG_INFO ("target eNB sent HO preparation failure, aborting HO"); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
724 |
SwitchToState (CONNECTED_NORMALLY); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
725 |
break; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
726 |
|
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
727 |
default: |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
728 |
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state)); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
729 |
break; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
730 |
} |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
731 |
} |
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
732 |
|
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
733 |
void |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
734 |
UeManager::RecvSnStatusTransfer (EpcX2SapUser::SnStatusTransferParams params) |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
735 |
{ |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
736 |
NS_LOG_FUNCTION (this); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
737 |
for (std::vector<EpcX2Sap::ErabsSubjectToStatusTransferItem>::iterator erabIt |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
738 |
= params.erabsSubjectToStatusTransferList.begin (); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
739 |
erabIt != params.erabsSubjectToStatusTransferList.end (); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
740 |
++erabIt) |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
741 |
{ |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
742 |
// LtePdcp::Status status; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
743 |
// status.txSn = erabIt->dlPdcpSn; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
744 |
// status.rxSn = erabIt->ulPdcpSn; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
745 |
// uint8_t drbId = Bid2Drbid (erabIt->erabId); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
746 |
// std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator drbIt = m_drbMap.find (drbId); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
747 |
// NS_ASSERT_MSG (drbIt != m_drbMap.end (), "could not find DRBID " << (uint32_t) drbId); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
748 |
// drbIt->second->m_pdcp->SetStatus (status); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
749 |
} |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
750 |
} |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
751 |
|
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
752 |
// methods forwarded from RRC SAP |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
753 |
|
9406 | 754 |
void |
755 |
UeManager::CompleteSetupUe (LteEnbRrcSapProvider::CompleteSetupUeParameters params) |
|
756 |
{ |
|
757 |
NS_LOG_FUNCTION (this); |
|
758 |
m_srb0->m_rlc->SetLteRlcSapUser (params.srb0SapUser); |
|
759 |
m_srb1->m_pdcp->SetLtePdcpSapUser (params.srb1SapUser); |
|
760 |
} |
|
761 |
||
762 |
void |
|
763 |
UeManager::RecvRrcConnectionRequest (LteRrcSap::RrcConnectionRequest msg) |
|
764 |
{ |
|
765 |
NS_LOG_FUNCTION (this); |
|
9407 | 766 |
switch (m_state) |
9406 | 767 |
{ |
9407 | 768 |
case INITIAL_RANDOM_ACCESS: |
769 |
{ |
|
9593
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
770 |
if (m_rrc->m_admitRrcConnectionRequest == true) |
9407 | 771 |
{ |
9593
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
772 |
m_connectionTimeout.Cancel (); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
773 |
m_imsi = msg.ueIdentity; |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
774 |
if (m_rrc->m_s1SapProvider != 0) |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
775 |
{ |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
776 |
m_rrc->m_s1SapProvider->InitialUeMessage (m_imsi, m_rnti); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
777 |
} |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
778 |
LteRrcSap::RrcConnectionSetup msg2; |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
779 |
msg2.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier (); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
780 |
msg2.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated (); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
781 |
m_rrc->m_rrcSapUser->SendRrcConnectionSetup (m_rnti, msg2); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
782 |
RecordDataRadioBearersToBeStarted (); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
783 |
SwitchToState (CONNECTION_SETUP); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
784 |
} |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
785 |
else |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
786 |
{ |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
787 |
m_connectionTimeout.Cancel (); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
788 |
NS_LOG_INFO ("rejecting connection request for RNTI " << m_rnti); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
789 |
LteRrcSap::RrcConnectionReject rejectMsg; |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
790 |
rejectMsg.waitTime = 3; |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
791 |
m_rrc->m_rrcSapUser->SendRrcConnectionReject (m_rnti, rejectMsg); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
792 |
Time maxRecvConnRejectDelay = MilliSeconds (30); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
793 |
m_connectionTimeout = Simulator::Schedule (maxRecvConnRejectDelay, &LteEnbRrc::ConnectionTimeout, m_rrc, m_rnti); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
794 |
SwitchToState (CONNECTION_REJECTED); |
d1da1374c434
added CONNECTION_REJECTED state at LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9568
diff
changeset
|
795 |
} |
9407 | 796 |
} |
797 |
break; |
|
798 |
||
799 |
default: |
|
800 |
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state)); |
|
801 |
break; |
|
9406 | 802 |
} |
803 |
} |
|
804 |
||
805 |
void |
|
806 |
UeManager::RecvRrcConnectionSetupCompleted (LteRrcSap::RrcConnectionSetupCompleted msg) |
|
807 |
{ |
|
808 |
NS_LOG_FUNCTION (this); |
|
9407 | 809 |
switch (m_state) |
810 |
{ |
|
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
811 |
case CONNECTION_SETUP: |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
812 |
StartDataRadioBearers (); |
9407 | 813 |
SwitchToState (CONNECTED_NORMALLY); |
9452
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
814 |
m_rrc->m_connectionEstablishedTrace (m_imsi, m_rrc->m_cellId, m_rnti); |
9407 | 815 |
break; |
816 |
||
817 |
default: |
|
818 |
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state)); |
|
819 |
break; |
|
820 |
} |
|
9406 | 821 |
} |
822 |
||
823 |
void |
|
824 |
UeManager::RecvRrcConnectionReconfigurationCompleted (LteRrcSap::RrcConnectionReconfigurationCompleted msg) |
|
825 |
{ |
|
826 |
NS_LOG_FUNCTION (this); |
|
9407 | 827 |
switch (m_state) |
828 |
{ |
|
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
829 |
case CONNECTION_RECONFIGURATION: |
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
830 |
StartDataRadioBearers (); |
9541
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
831 |
if (m_needTransmissionModeConfiguration) |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
832 |
{ |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
833 |
// configure MAC (and scheduler) |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
834 |
LteEnbCmacSapProvider::UeConfig req; |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
835 |
req.m_rnti = m_rnti; |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
836 |
req.m_transmissionMode = m_physicalConfigDedicated.antennaInfo.transmissionMode; |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
837 |
m_rrc->m_cmacSapProvider->UeUpdateConfigurationReq (req); |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
838 |
|
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
839 |
// configure PHY |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
840 |
m_rrc->m_cphySapProvider->SetTransmissionMode (req.m_rnti, req.m_transmissionMode); |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
841 |
|
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
842 |
m_needTransmissionModeConfiguration = false; |
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
843 |
} |
9407 | 844 |
SwitchToState (CONNECTED_NORMALLY); |
9452
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
845 |
m_rrc->m_connectionReconfigurationTrace (m_imsi, m_rrc->m_cellId, m_rnti); |
9407 | 846 |
break; |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
847 |
|
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
848 |
case HANDOVER_LEAVING: |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
849 |
NS_LOG_INFO ("ignoring RecvRrcConnectionReconfigurationCompleted in state " << ToString (m_state)); |
9407 | 850 |
break; |
851 |
||
852 |
case HANDOVER_JOINING: |
|
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
853 |
{ |
9567
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
854 |
m_connectionTimeout.Cancel (); |
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
855 |
NS_LOG_INFO ("Send PATH SWITCH REQUEST to the MME"); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
856 |
EpcEnbS1SapProvider::PathSwitchRequestParameters params; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
857 |
params.rnti = m_rnti; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
858 |
params.cellId = m_rrc->m_cellId; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
859 |
params.mmeUeS1Id = m_imsi; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
860 |
SwitchToState (HANDOVER_PATH_SWITCH); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
861 |
for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin (); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
862 |
it != m_drbMap.end (); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
863 |
++it) |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
864 |
{ |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
865 |
EpcEnbS1SapProvider::BearerToBeSwitched b; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
866 |
b.epsBearerId = it->second->m_epsBearerIdentity; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
867 |
b.teid = it->second->m_gtpTeid; |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
868 |
params.bearersToBeSwitched.push_back (b); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
869 |
} |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
870 |
m_rrc->m_s1SapProvider->PathSwitchRequest (params); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
871 |
} |
9420
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
872 |
break; |
9407 | 873 |
|
874 |
default: |
|
875 |
NS_FATAL_ERROR ("method unexpected in state " << ToString (m_state)); |
|
876 |
break; |
|
877 |
} |
|
9406 | 878 |
} |
879 |
||
880 |
void |
|
881 |
UeManager::RecvRrcConnectionReestablishmentRequest (LteRrcSap::RrcConnectionReestablishmentRequest msg) |
|
882 |
{ |
|
883 |
NS_LOG_FUNCTION (this); |
|
884 |
LteRrcSap::RrcConnectionReestablishment msg2; |
|
885 |
msg2.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier (); |
|
886 |
msg2.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated (); |
|
887 |
m_rrc->m_rrcSapUser->SendRrcConnectionReestablishment (m_rnti, msg2); |
|
888 |
SwitchToState (CONNECTION_REESTABLISHMENT); |
|
889 |
} |
|
890 |
||
891 |
void |
|
892 |
UeManager::RecvRrcConnectionReestablishmentComplete (LteRrcSap::RrcConnectionReestablishmentComplete msg) |
|
893 |
{ |
|
894 |
NS_LOG_FUNCTION (this); |
|
895 |
SwitchToState (CONNECTED_NORMALLY); |
|
896 |
} |
|
897 |
||
9601
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
898 |
void |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
899 |
UeManager::RecvMeasurementReport (LteRrcSap::MeasurementReport msg) |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
900 |
{ |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
901 |
NS_LOG_FUNCTION (this); |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
902 |
NS_LOG_LOGIC ("measId " << (uint16_t) msg.measResults.measId |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
903 |
<< " haveMeasResultNeighCells " << msg.measResults.haveMeasResultNeighCells |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
904 |
<< " measResultListEutra " << msg.measResults.measResultListEutra.size ()); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
905 |
NS_LOG_LOGIC ("serving cellId " << m_rrc->m_cellId |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
906 |
<< " RSRP " << (uint16_t) msg.measResults.rsrpResult |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
907 |
<< " RSRQ " << (uint16_t) msg.measResults.rsrqResult); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
908 |
|
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
909 |
for (std::list <LteRrcSap::MeasResultEutra>::iterator it = msg.measResults.measResultListEutra.begin (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
910 |
it != msg.measResults.measResultListEutra.end (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
911 |
++it) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
912 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
913 |
NS_LOG_LOGIC ("neighbour cellId " << it->physCellId |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
914 |
<< " RSRP " << (it->haveRsrpResult ? (uint16_t) it->rsrpResult : 255) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
915 |
<< " RSRQ " << (it->haveRsrqResult ? (uint16_t) it->rsrqResult : 255)); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
916 |
} |
10008
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
917 |
|
10011
6853962462ca
Add trace callback when MeasurementReport is received
Manuel Requena <manuel.requena@cttc.es>
parents:
10008
diff
changeset
|
918 |
m_rrc->m_recvMeasurementReportTrace (m_imsi, m_rrc->m_cellId, m_rnti, msg); |
6853962462ca
Add trace callback when MeasurementReport is received
Manuel Requena <manuel.requena@cttc.es>
parents:
10008
diff
changeset
|
919 |
|
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
920 |
// Just these two measId are supported |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
921 |
NS_ASSERT_MSG ((msg.measResults.measId == 1) || (msg.measResults.measId == 2), |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
922 |
"Measure identity is unknown"); |
10008
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
923 |
|
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
924 |
/// Event A2 (Serving becomes worse than threshold) |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
925 |
if (msg.measResults.measId == 1) |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
926 |
{ |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
927 |
// Keep new RSRQ value reported for the serving cell |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
928 |
m_servingCellMeasures->m_rsrq = msg.measResults.rsrqResult; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
929 |
m_servingCellMeasures->m_rsrp = msg.measResults.rsrpResult; |
10008
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
930 |
|
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
931 |
// Serving cell is worse than a handover threshold. |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
932 |
// This handover threshold is independent from the event A2 threshold |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
933 |
if (m_servingCellMeasures->m_rsrq <= m_rrc->m_servingCellHandoverThreshold) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
934 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
935 |
// Find the best neighbour cell (eNB) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
936 |
Ptr<UeMeasure> bestNeighbour = 0; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
937 |
uint8_t bestNeighbourRsrq = 0; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
938 |
NS_LOG_LOGIC ("Number of neighbour cells = " << m_neighbourCellMeasures.size ()); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
939 |
for (std::map <uint16_t, Ptr<UeMeasure> >::iterator it = m_neighbourCellMeasures.begin (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
940 |
it != m_neighbourCellMeasures.end (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
941 |
++it) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
942 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
943 |
if (it->second->m_rsrq > bestNeighbourRsrq) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
944 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
945 |
bestNeighbour = it->second; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
946 |
bestNeighbourRsrq = it->second->m_rsrq; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
947 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
948 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
949 |
|
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
950 |
// Trigger Handover, if needed |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
951 |
if (bestNeighbour) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
952 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
953 |
uint16_t targetCellId = bestNeighbour->m_cellId; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
954 |
NS_LOG_LOGIC ("Best neighbour cellId " << targetCellId); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
955 |
if (bestNeighbour->m_rsrq - m_servingCellMeasures->m_rsrq >= m_rrc->m_neighbourCellHandoverOffset) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
956 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
957 |
NS_LOG_LOGIC ("Trigger Handover to cellId " << targetCellId); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
958 |
NS_LOG_LOGIC ("target cell RSRQ " << (uint16_t) bestNeighbour->m_rsrq); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
959 |
NS_LOG_LOGIC ("serving cell RSRQ " << (uint16_t) m_servingCellMeasures->m_rsrq); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
960 |
PrepareHandover (targetCellId); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
961 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
962 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
963 |
} |
10008
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
964 |
} |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
965 |
/// Event A4 (Neighbour becomes better than threshold) |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
966 |
else if (msg.measResults.measId == 2) |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
967 |
{ |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
968 |
// Update the NRT |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
969 |
if (msg.measResults.haveMeasResultNeighCells && ! (msg.measResults.measResultListEutra.empty ())) |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
970 |
{ |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
971 |
for (std::list <LteRrcSap::MeasResultEutra>::iterator it = msg.measResults.measResultListEutra.begin (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
972 |
it != msg.measResults.measResultListEutra.end (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
973 |
++it) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
974 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
975 |
// Keep new RSRQ value reported for the neighbour cell |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
976 |
NS_ASSERT_MSG (it->haveRsrqResult == true, "RSRQ measure missing for cellId " << it->physCellId); |
10008
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
977 |
|
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
978 |
// Update Neighbour Relation Table |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
979 |
if (m_rrc->m_neighbourRelationTable.find (it->physCellId) != m_rrc->m_neighbourRelationTable.end ()) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
980 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
981 |
// Update neighbour info |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
982 |
Ptr<NeighbourRelation> neighbourRelation = m_rrc->m_neighbourRelationTable[it->physCellId]; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
983 |
NS_ASSERT_MSG (neighbourRelation->m_physCellId == it->physCellId, |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
984 |
"Wrong cellId " << neighbourRelation->m_physCellId); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
985 |
|
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
986 |
if (neighbourRelation->m_noX2 == false) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
987 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
988 |
neighbourRelation->m_noHo = false; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
989 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
990 |
neighbourRelation->m_detectedAsNeighbour = true; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
991 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
992 |
else // new neighbour |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
993 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
994 |
Ptr<NeighbourRelation> neighbourRelation = CreateObject <NeighbourRelation> (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
995 |
neighbourRelation->m_physCellId = it->physCellId; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
996 |
neighbourRelation->m_noRemove = false; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
997 |
neighbourRelation->m_noHo = true; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
998 |
neighbourRelation->m_noX2 = true; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
999 |
neighbourRelation->m_detectedAsNeighbour = true; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1000 |
m_rrc->m_neighbourRelationTable[it->physCellId] = neighbourRelation; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1001 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1002 |
|
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1003 |
// Update measure info of the neighbour cell |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1004 |
Ptr<UeMeasure> neighbourCellMeasures; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1005 |
if (m_neighbourCellMeasures.find (it->physCellId) != m_neighbourCellMeasures.end ()) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1006 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1007 |
neighbourCellMeasures = m_neighbourCellMeasures[it->physCellId]; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1008 |
neighbourCellMeasures->m_cellId = it->physCellId; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1009 |
neighbourCellMeasures->m_rsrq = it->rsrqResult; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1010 |
neighbourCellMeasures->m_rsrp = 0; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1011 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1012 |
else |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1013 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1014 |
neighbourCellMeasures = CreateObject <UeMeasure> (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1015 |
neighbourCellMeasures->m_cellId = it->physCellId; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1016 |
neighbourCellMeasures->m_rsrq = it->rsrqResult; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1017 |
neighbourCellMeasures->m_rsrp = 0; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1018 |
m_neighbourCellMeasures[it->physCellId] = neighbourCellMeasures; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1019 |
} |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1020 |
} |
10008
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
1021 |
} |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
1022 |
else |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
1023 |
{ |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1024 |
NS_LOG_LOGIC ("WARNING"); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1025 |
// NS_ASSERT_MSG ("Event A4 received without measure results for neighbour cells"); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1026 |
// TODO Remove neighbours in the neighbourCellMeasures table |
10008
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
1027 |
} |
e964b76bc631
Add some code in the reception of the MeasurementReport message
Manuel Requena <manuel.requena@cttc.es>
parents:
10006
diff
changeset
|
1028 |
} |
9601
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
1029 |
} |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
1030 |
|
9406 | 1031 |
|
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1032 |
// methods forwarded from CMAC SAP |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1033 |
|
9406 | 1034 |
void |
1035 |
UeManager::CmacUeConfigUpdateInd (LteEnbCmacSapUser::UeConfig cmacParams) |
|
1036 |
{ |
|
1037 |
NS_LOG_FUNCTION (this << m_rnti); |
|
1038 |
// at this stage used only by the scheduler for updating txMode |
|
1039 |
||
1040 |
m_physicalConfigDedicated.antennaInfo.transmissionMode = cmacParams.m_transmissionMode; |
|
1041 |
||
9541
7811eb81a32c
postpone eNB TX mode reconf to rx of RRC CONN RECONF COMPLETED
Nicola Baldo <nbaldo@cttc.es>
parents:
9528
diff
changeset
|
1042 |
m_needTransmissionModeConfiguration = true; |
9406 | 1043 |
|
1044 |
// reconfigure the UE RRC |
|
1045 |
ScheduleRrcConnectionReconfiguration (); |
|
1046 |
} |
|
1047 |
||
1048 |
||
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1049 |
// methods forwarded from PDCP SAP |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1050 |
|
9406 | 1051 |
void |
1052 |
UeManager::DoReceivePdcpSdu (LtePdcpSapUser::ReceivePdcpSduParameters params) |
|
1053 |
{ |
|
1054 |
NS_LOG_FUNCTION (this); |
|
1055 |
if (params.lcid > 2) |
|
1056 |
{ |
|
1057 |
// data radio bearer |
|
1058 |
EpsBearerTag tag; |
|
1059 |
tag.SetRnti (params.rnti); |
|
1060 |
tag.SetBid (Lcid2Bid (params.lcid)); |
|
1061 |
params.pdcpSdu->AddPacketTag (tag); |
|
1062 |
m_rrc->m_forwardUpCallback (params.pdcpSdu); |
|
1063 |
} |
|
1064 |
} |
|
1065 |
||
1066 |
||
1067 |
uint16_t |
|
1068 |
UeManager::GetRnti (void) |
|
1069 |
{ |
|
1070 |
return m_rnti; |
|
1071 |
} |
|
1072 |
||
8007 | 1073 |
uint64_t |
9406 | 1074 |
UeManager::GetImsi (void) |
8007 | 1075 |
{ |
1076 |
return m_imsi; |
|
1077 |
} |
|
1078 |
||
9036 | 1079 |
uint16_t |
9406 | 1080 |
UeManager::GetSrsConfigurationIndex (void) |
9036 | 1081 |
{ |
9406 | 1082 |
return m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex; |
9036 | 1083 |
} |
1084 |
||
1085 |
void |
|
9406 | 1086 |
UeManager::SetSrsConfigurationIndex (uint16_t srsConfIndex) |
9036 | 1087 |
{ |
9406 | 1088 |
NS_LOG_FUNCTION (this); |
1089 |
m_physicalConfigDedicated.soundingRsUlConfigDedicated.srsConfigIndex = srsConfIndex; |
|
1090 |
m_rrc->m_cphySapProvider->SetSrsConfigurationIndex (m_rnti, srsConfIndex); |
|
1091 |
switch (m_state) |
|
1092 |
{ |
|
1093 |
case INITIAL_RANDOM_ACCESS: |
|
1094 |
// do nothing, srs conf index will be correctly enforced upon |
|
1095 |
// RRC connection establishment |
|
1096 |
break; |
|
1097 |
||
1098 |
default: |
|
1099 |
ScheduleRrcConnectionReconfiguration (); |
|
1100 |
break; |
|
1101 |
} |
|
1102 |
} |
|
1103 |
||
1104 |
UeManager::State |
|
1105 |
UeManager::GetState (void) |
|
1106 |
{ |
|
1107 |
return m_state; |
|
9036 | 1108 |
} |
1109 |
||
7886 | 1110 |
uint8_t |
9406 | 1111 |
UeManager::AddDataRadioBearerInfo (Ptr<LteDataRadioBearerInfo> drbInfo) |
7886 | 1112 |
{ |
1113 |
NS_LOG_FUNCTION (this); |
|
9406 | 1114 |
const uint8_t MAX_DRB_ID = 32; |
1115 |
for (uint8_t drbid = (m_lastAllocatedDrbid + 1) % MAX_DRB_ID; |
|
1116 |
drbid != m_lastAllocatedDrbid; |
|
1117 |
drbid = (drbid + 1) % MAX_DRB_ID) |
|
7886 | 1118 |
{ |
9406 | 1119 |
if (drbid != 0) // 0 is not allowed |
7886 | 1120 |
{ |
9406 | 1121 |
if (m_drbMap.find (drbid) == m_drbMap.end ()) |
7886 | 1122 |
{ |
9406 | 1123 |
m_drbMap.insert (std::pair<uint8_t, Ptr<LteDataRadioBearerInfo> > (drbid, drbInfo)); |
1124 |
drbInfo->m_drbIdentity = drbid; |
|
1125 |
m_lastAllocatedDrbid = drbid; |
|
1126 |
return drbid; |
|
7886 | 1127 |
} |
1128 |
} |
|
1129 |
} |
|
9406 | 1130 |
NS_FATAL_ERROR ("no more data radio bearer ids available"); |
7886 | 1131 |
return 0; |
1132 |
} |
|
1133 |
||
9406 | 1134 |
Ptr<LteDataRadioBearerInfo> |
1135 |
UeManager::GetDataRadioBearerInfo (uint8_t drbid) |
|
7886 | 1136 |
{ |
9406 | 1137 |
NS_LOG_FUNCTION (this << (uint32_t) drbid); |
1138 |
NS_ASSERT (0 != drbid); |
|
1139 |
std::map<uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid); |
|
1140 |
NS_ABORT_IF (it == m_drbMap.end ()); |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
1141 |
return it->second; |
7886 | 1142 |
} |
1143 |
||
1144 |
||
1145 |
void |
|
9406 | 1146 |
UeManager::RemoveDataRadioBearerInfo (uint8_t drbid) |
1147 |
{ |
|
1148 |
NS_LOG_FUNCTION (this << (uint32_t) drbid); |
|
1149 |
std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.find (drbid); |
|
1150 |
NS_ASSERT_MSG (it != m_drbMap.end (), "request to remove radio bearer with unknown drbid " << drbid); |
|
1151 |
m_drbMap.erase (it); |
|
1152 |
} |
|
1153 |
||
1154 |
||
1155 |
LteRrcSap::RrcConnectionReconfiguration |
|
1156 |
UeManager::BuildRrcConnectionReconfiguration () |
|
1157 |
{ |
|
1158 |
LteRrcSap::RrcConnectionReconfiguration msg; |
|
1159 |
msg.rrcTransactionIdentifier = GetNewRrcTransactionIdentifier (); |
|
1160 |
msg.haveRadioResourceConfigDedicated = true; |
|
1161 |
msg.radioResourceConfigDedicated = BuildRadioResourceConfigDedicated (); |
|
1162 |
msg.haveMobilityControlInfo = false; |
|
9991
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1163 |
msg.haveMeasConfig = true; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1164 |
msg.measConfig = BuildMeasConfig (); |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1165 |
|
9406 | 1166 |
return msg; |
1167 |
} |
|
1168 |
||
9991
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1169 |
LteRrcSap::MeasConfig |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1170 |
UeManager::BuildMeasConfig () |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1171 |
{ |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1172 |
// Just intra-frequency measurements are supported, |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1173 |
// so just one measurement object is created |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1174 |
LteRrcSap::MeasObjectToAddMod measObject; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1175 |
measObject.measObjectId = 1; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1176 |
measObject.measObjectEutra.carrierFreq = m_rrc->m_dlEarfcn; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1177 |
measObject.measObjectEutra.allowedMeasBandwidth = m_rrc->m_dlBandwidth; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1178 |
measObject.measObjectEutra.presenceAntennaPort1 = false; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1179 |
measObject.measObjectEutra.neighCellConfig = 0; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1180 |
measObject.measObjectEutra.offsetFreq = 0; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1181 |
measObject.measObjectEutra.haveCellForWhichToReportCGI = false; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1182 |
|
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1183 |
// Just event A2 and event A4 are supported |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1184 |
LteRrcSap::ReportConfigToAddMod reportConfigA2; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1185 |
reportConfigA2.reportConfigId = 1; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1186 |
reportConfigA2.reportConfigEutra.triggerType = LteRrcSap::ReportConfigEutra::event; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1187 |
reportConfigA2.reportConfigEutra.eventId = LteRrcSap::ReportConfigEutra::eventA2; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1188 |
reportConfigA2.reportConfigEutra.threshold1.choice = LteRrcSap::ThresholdEutra::thresholdRsrq; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1189 |
reportConfigA2.reportConfigEutra.threshold1.range = m_rrc->m_eventA2Threshold; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1190 |
reportConfigA2.reportConfigEutra.hysteresis = 0; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1191 |
reportConfigA2.reportConfigEutra.timeToTrigger = 0; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1192 |
reportConfigA2.reportConfigEutra.triggerQuantity = LteRrcSap::ReportConfigEutra::rsrq; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1193 |
reportConfigA2.reportConfigEutra.reportQuantity = LteRrcSap::ReportConfigEutra::sameAsTriggerQuantity; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1194 |
reportConfigA2.reportConfigEutra.maxReportCells = LteRrcSap::MaxReportCells; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1195 |
reportConfigA2.reportConfigEutra.reportInterval = LteRrcSap::ReportConfigEutra::ms480; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1196 |
reportConfigA2.reportConfigEutra.reportAmount = 255; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1197 |
|
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1198 |
LteRrcSap::ReportConfigToAddMod reportConfigA4; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1199 |
reportConfigA4.reportConfigId = 2; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1200 |
reportConfigA4.reportConfigEutra.triggerType = LteRrcSap::ReportConfigEutra::event; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1201 |
reportConfigA4.reportConfigEutra.eventId = LteRrcSap::ReportConfigEutra::eventA4; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1202 |
reportConfigA4.reportConfigEutra.threshold1.choice = LteRrcSap::ThresholdEutra::thresholdRsrq; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1203 |
reportConfigA4.reportConfigEutra.threshold1.range = m_rrc->m_eventA4Threshold; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1204 |
reportConfigA4.reportConfigEutra.hysteresis = 0; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1205 |
reportConfigA4.reportConfigEutra.timeToTrigger = 0; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1206 |
reportConfigA4.reportConfigEutra.triggerQuantity = LteRrcSap::ReportConfigEutra::rsrq; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1207 |
reportConfigA4.reportConfigEutra.reportQuantity = LteRrcSap::ReportConfigEutra::sameAsTriggerQuantity; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1208 |
reportConfigA4.reportConfigEutra.maxReportCells = LteRrcSap::MaxReportCells; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1209 |
reportConfigA4.reportConfigEutra.reportInterval = LteRrcSap::ReportConfigEutra::ms480; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1210 |
reportConfigA4.reportConfigEutra.reportAmount = 255; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1211 |
|
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1212 |
LteRrcSap::MeasIdToAddMod measId[2]; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1213 |
measId[0].measId = 1; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1214 |
measId[0].measObjectId = 1; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1215 |
measId[0].reportConfigId = 1; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1216 |
measId[1].measId = 2; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1217 |
measId[1].measObjectId = 1; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1218 |
measId[1].reportConfigId = 2; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1219 |
|
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1220 |
LteRrcSap::MeasConfig measConfig; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1221 |
measConfig.measObjectToAddModList.push_back (measObject); |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1222 |
measConfig.reportConfigToAddModList.push_back (reportConfigA2); |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1223 |
measConfig.reportConfigToAddModList.push_back (reportConfigA4); |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1224 |
measConfig.measIdToAddModList.push_back (measId[0]); |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1225 |
measConfig.measIdToAddModList.push_back (measId[1]); |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1226 |
measConfig.haveQuantityConfig = true; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1227 |
measConfig.quantityConfig.filterCoefficientRSRP = 4; // default = fc4 (See TS 36.331) |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1228 |
measConfig.quantityConfig.filterCoefficientRSRQ = 4; // default = fc4 (See TS 36.331) |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1229 |
measConfig.haveMeasGapConfig = false; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1230 |
measConfig.haveSmeasure = false; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1231 |
measConfig.haveSpeedStatePars = false; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1232 |
|
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1233 |
return measConfig; |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1234 |
} |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1235 |
|
9406 | 1236 |
LteRrcSap::RadioResourceConfigDedicated |
1237 |
UeManager::BuildRadioResourceConfigDedicated () |
|
1238 |
{ |
|
1239 |
LteRrcSap::RadioResourceConfigDedicated rrcd; |
|
1240 |
||
1241 |
if (m_srb1 != 0) |
|
1242 |
{ |
|
1243 |
LteRrcSap::SrbToAddMod stam; |
|
1244 |
stam.srbIdentity = m_srb1->m_srbIdentity; |
|
1245 |
stam.logicalChannelConfig = m_srb1->m_logicalChannelConfig; |
|
1246 |
rrcd.srbToAddModList.push_back (stam); |
|
1247 |
} |
|
1248 |
||
1249 |
for (std::map <uint8_t, Ptr<LteDataRadioBearerInfo> >::iterator it = m_drbMap.begin (); |
|
1250 |
it != m_drbMap.end (); |
|
1251 |
++it) |
|
1252 |
{ |
|
1253 |
LteRrcSap::DrbToAddMod dtam; |
|
1254 |
dtam.epsBearerIdentity = it->second->m_epsBearerIdentity; |
|
1255 |
dtam.drbIdentity = it->second->m_drbIdentity; |
|
1256 |
dtam.rlcConfig = it->second->m_rlcConfig; |
|
1257 |
dtam.logicalChannelIdentity = it->second->m_logicalChannelIdentity; |
|
1258 |
dtam.logicalChannelConfig = it->second->m_logicalChannelConfig; |
|
1259 |
rrcd.drbToAddModList.push_back (dtam); |
|
1260 |
} |
|
1261 |
||
1262 |
rrcd.havePhysicalConfigDedicated = true; |
|
1263 |
rrcd.physicalConfigDedicated = m_physicalConfigDedicated; |
|
1264 |
return rrcd; |
|
1265 |
} |
|
1266 |
||
1267 |
uint8_t |
|
1268 |
UeManager::GetNewRrcTransactionIdentifier () |
|
1269 |
{ |
|
1270 |
return ++m_lastRrcTransactionIdentifier; |
|
1271 |
} |
|
1272 |
||
1273 |
uint8_t |
|
1274 |
UeManager::Lcid2Drbid (uint8_t lcid) |
|
1275 |
{ |
|
1276 |
NS_ASSERT (lcid > 2); |
|
1277 |
return lcid - 2; |
|
1278 |
} |
|
1279 |
||
1280 |
uint8_t |
|
1281 |
UeManager::Drbid2Lcid (uint8_t drbid) |
|
7886 | 1282 |
{ |
9406 | 1283 |
return drbid + 2; |
1284 |
} |
|
1285 |
uint8_t |
|
1286 |
UeManager::Lcid2Bid (uint8_t lcid) |
|
1287 |
{ |
|
1288 |
NS_ASSERT (lcid > 2); |
|
1289 |
return lcid - 2; |
|
1290 |
} |
|
1291 |
||
1292 |
uint8_t |
|
1293 |
UeManager::Bid2Lcid (uint8_t bid) |
|
1294 |
{ |
|
1295 |
return bid + 2; |
|
1296 |
} |
|
1297 |
||
1298 |
uint8_t |
|
1299 |
UeManager::Drbid2Bid (uint8_t drbid) |
|
1300 |
{ |
|
1301 |
return drbid; |
|
1302 |
} |
|
1303 |
||
1304 |
uint8_t |
|
1305 |
UeManager::Bid2Drbid (uint8_t bid) |
|
1306 |
{ |
|
1307 |
return bid; |
|
7886 | 1308 |
} |
9406 | 1309 |
|
1310 |
||
1311 |
void |
|
1312 |
UeManager::SwitchToState (State newState) |
|
1313 |
{ |
|
1314 |
NS_LOG_FUNCTION (this << newState); |
|
1315 |
State oldState = m_state; |
|
1316 |
m_state = newState; |
|
1317 |
NS_LOG_INFO ("IMSI " << m_imsi << " RNTI " << m_rnti << " UeManager " << ToString (oldState) << " --> " << ToString (newState)); |
|
9452
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1318 |
m_stateTransitionTrace (m_imsi, m_rrc->m_cellId, m_rnti, oldState, newState); |
9406 | 1319 |
|
1320 |
switch (newState) |
|
1321 |
{ |
|
1322 |
case INITIAL_RANDOM_ACCESS: |
|
1323 |
case HANDOVER_JOINING: |
|
1324 |
NS_FATAL_ERROR ("cannot switch to an initial state"); |
|
1325 |
break; |
|
1326 |
||
1327 |
case CONNECTION_SETUP: |
|
1328 |
break; |
|
1329 |
||
1330 |
case CONNECTED_NORMALLY: |
|
1331 |
{ |
|
1332 |
if (m_pendingRrcConnectionReconfiguration == true) |
|
1333 |
{ |
|
1334 |
ScheduleRrcConnectionReconfiguration (); |
|
1335 |
} |
|
1336 |
} |
|
1337 |
break; |
|
1338 |
||
1339 |
case CONNECTION_RECONFIGURATION: |
|
1340 |
break; |
|
1341 |
||
1342 |
case CONNECTION_REESTABLISHMENT: |
|
1343 |
break; |
|
1344 |
||
1345 |
case HANDOVER_LEAVING: |
|
1346 |
break; |
|
1347 |
||
1348 |
default: |
|
1349 |
break; |
|
1350 |
} |
|
1351 |
} |
|
1352 |
||
1353 |
||
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1354 |
|
7886 | 1355 |
// /////////////////////////// |
1356 |
// eNB RRC methods |
|
1357 |
// /////////////////////////// |
|
1358 |
||
7905
80557b09aa7f
Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
7903
diff
changeset
|
1359 |
NS_OBJECT_ENSURE_REGISTERED (LteEnbRrc); |
7886 | 1360 |
|
1361 |
LteEnbRrc::LteEnbRrc () |
|
9323
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1362 |
: m_x2SapProvider (0), |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1363 |
m_cmacSapProvider (0), |
9406 | 1364 |
m_rrcSapUser (0), |
7886 | 1365 |
m_macSapProvider (0), |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1366 |
m_s1SapProvider (0), |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1367 |
m_cphySapProvider (0), |
7886 | 1368 |
m_configured (false), |
9036 | 1369 |
m_lastAllocatedRnti (0), |
1370 |
m_srsCurrentPeriodicityId (0), |
|
1371 |
m_lastAllocatedConfigurationIndex (0), |
|
1372 |
m_reconfigureUes (false) |
|
7886 | 1373 |
{ |
1374 |
NS_LOG_FUNCTION (this); |
|
7888 | 1375 |
m_cmacSapUser = new EnbRrcMemberLteEnbCmacSapUser (this); |
9406 | 1376 |
m_rrcSapProvider = new MemberLteEnbRrcSapProvider<LteEnbRrc> (this); |
9323
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1377 |
m_x2SapUser = new EpcX2SpecificEpcX2SapUser<LteEnbRrc> (this); |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1378 |
m_s1SapUser = new MemberEpcEnbS1SapUser<LteEnbRrc> (this); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1379 |
m_cphySapUser = new MemberLteEnbCphySapUser<LteEnbRrc> (this); |
9406 | 1380 |
|
1381 |
||
7886 | 1382 |
} |
1383 |
||
1384 |
||
1385 |
LteEnbRrc::~LteEnbRrc () |
|
1386 |
{ |
|
1387 |
NS_LOG_FUNCTION (this); |
|
1388 |
} |
|
1389 |
||
1390 |
||
1391 |
void |
|
1392 |
LteEnbRrc::DoDispose () |
|
1393 |
{ |
|
1394 |
NS_LOG_FUNCTION (this); |
|
9623
0be7b61853e3
fixed some RRC valgrind errors
Nicola Baldo <nbaldo@cttc.es>
parents:
9615
diff
changeset
|
1395 |
m_ueMap.clear (); |
7886 | 1396 |
delete m_cmacSapUser; |
9406 | 1397 |
delete m_rrcSapProvider; |
9323
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1398 |
delete m_x2SapUser; |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1399 |
delete m_s1SapUser; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1400 |
delete m_cphySapUser; |
7886 | 1401 |
} |
1402 |
||
1403 |
TypeId |
|
1404 |
LteEnbRrc::GetTypeId (void) |
|
1405 |
{ |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
1406 |
NS_LOG_FUNCTION ("LteEnbRrc::GetTypeId"); |
7886 | 1407 |
static TypeId tid = TypeId ("ns3::LteEnbRrc") |
1408 |
.SetParent<Object> () |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
1409 |
.AddConstructor<LteEnbRrc> () |
9406 | 1410 |
.AddAttribute ("UeMap", "List of UeManager by C-RNTI.", |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
1411 |
ObjectMapValue (), |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
1412 |
MakeObjectMapAccessor (&LteEnbRrc::m_ueMap), |
9406 | 1413 |
MakeObjectMapChecker<UeManager> ()) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
1414 |
.AddAttribute ("DefaultTransmissionMode", |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
1415 |
"The default UEs' transmission mode (0: SISO)", |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
1416 |
UintegerValue (0), // default tx-mode |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
1417 |
MakeUintegerAccessor (&LteEnbRrc::m_defaultTransmissionMode), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
1418 |
MakeUintegerChecker<uint8_t> ()) |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1419 |
.AddAttribute ("EpsBearerToRlcMapping", |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1420 |
"Specify which type of RLC will be used for each type of EPS bearer. ", |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1421 |
EnumValue (RLC_SM_ALWAYS), |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1422 |
MakeEnumAccessor (&LteEnbRrc::m_epsBearerToRlcMapping), |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1423 |
MakeEnumChecker (RLC_SM_ALWAYS, "RlcSmAlways", |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1424 |
RLC_UM_ALWAYS, "RlcUmAlways", |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1425 |
RLC_AM_ALWAYS, "RlcAmAlways", |
9406 | 1426 |
PER_BASED, "PacketErrorRateBased")) |
1427 |
.AddAttribute ("SystemInformationPeriodicity", |
|
9568
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
1428 |
"The interval for sending system information (Time value)", |
9406 | 1429 |
TimeValue (MilliSeconds (80)), |
1430 |
MakeTimeAccessor (&LteEnbRrc::m_systemInformationPeriodicity), |
|
9568
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
1431 |
MakeTimeChecker ()) |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
1432 |
.AddAttribute ("SrsPeriodicity", |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
1433 |
"The SRS periodicity in milliseconds", |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
1434 |
UintegerValue (40), |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
1435 |
MakeUintegerAccessor (&LteEnbRrc::SetSrsPeriodicity, |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
1436 |
&LteEnbRrc::GetSrsPeriodicity), |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
1437 |
MakeUintegerChecker<uint32_t> ()) |
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1438 |
.AddAttribute ("AdmitHandoverRequest", |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1439 |
"Whether to admit an X2 handover request from another eNB", |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1440 |
BooleanValue (true), |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1441 |
MakeBooleanAccessor (&LteEnbRrc::m_admitHandoverRequest), |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1442 |
MakeBooleanChecker ()) |
9528
19959697c48e
Add implementation of RRC Connection Reject in Ue Recv.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9523
diff
changeset
|
1443 |
.AddAttribute ("AdmitRrcConnectionRequest", |
19959697c48e
Add implementation of RRC Connection Reject in Ue Recv.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9523
diff
changeset
|
1444 |
"Whether to admit a connection request from a Ue", |
19959697c48e
Add implementation of RRC Connection Reject in Ue Recv.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9523
diff
changeset
|
1445 |
BooleanValue (true), |
19959697c48e
Add implementation of RRC Connection Reject in Ue Recv.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9523
diff
changeset
|
1446 |
MakeBooleanAccessor (&LteEnbRrc::m_admitRrcConnectionRequest), |
9991
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1447 |
MakeBooleanChecker ()) |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1448 |
.AddAttribute ("EventA2Threshold", |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1449 |
"Threshold of the event A2 (Serving becomes worse than threshold)", |
10006
d4dffaadf383
Events A2 and A4 trigger with all RSRQ values
Manuel Requena <manuel.requena@cttc.es>
parents:
9998
diff
changeset
|
1450 |
UintegerValue (34), |
9991
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1451 |
MakeUintegerAccessor (&LteEnbRrc::m_eventA2Threshold), |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1452 |
MakeUintegerChecker<uint8_t> ()) |
9991
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1453 |
.AddAttribute ("EventA4Threshold", |
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1454 |
"Threshold of the event A4 (Neighbour becomes better than threshold)", |
10006
d4dffaadf383
Events A2 and A4 trigger with all RSRQ values
Manuel Requena <manuel.requena@cttc.es>
parents:
9998
diff
changeset
|
1455 |
UintegerValue (0), |
9991
3d1c37a99e73
Add MeasConfig IE in the RRC Connection Reconfiguration message
Manuel Requena <manuel.requena@cttc.es>
parents:
9668
diff
changeset
|
1456 |
MakeUintegerAccessor (&LteEnbRrc::m_eventA4Threshold), |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1457 |
MakeUintegerChecker<uint8_t> ()) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1458 |
.AddAttribute ("ServingCellHandoverThreshold", |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1459 |
"If serving cell is worse than this threshold, neighbour cells are consider for Handover", |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1460 |
UintegerValue (15), |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1461 |
MakeUintegerAccessor (&LteEnbRrc::m_servingCellHandoverThreshold), |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1462 |
MakeUintegerChecker<uint8_t> ()) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1463 |
.AddAttribute ("NeighbourCellHandoverOffset", |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1464 |
"Minimum offset between serving and best neighbour cell to trigger the Handover", |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1465 |
UintegerValue (1), |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1466 |
MakeUintegerAccessor (&LteEnbRrc::m_neighbourCellHandoverOffset), |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
1467 |
MakeUintegerChecker<uint8_t> ()) |
9615 | 1468 |
.AddTraceSource ("NewUeContext", |
1469 |
"trace fired upon creation of a new UE context", |
|
1470 |
MakeTraceSourceAccessor (&LteEnbRrc::m_newUeContextTrace)) |
|
9452
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1471 |
.AddTraceSource ("ConnectionEstablished", |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1472 |
"trace fired upon successful RRC connection establishment", |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1473 |
MakeTraceSourceAccessor (&LteEnbRrc::m_connectionEstablishedTrace)) |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1474 |
.AddTraceSource ("ConnectionReconfiguration", |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1475 |
"trace fired upon RRC connection reconfiguration", |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1476 |
MakeTraceSourceAccessor (&LteEnbRrc::m_connectionReconfigurationTrace)) |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1477 |
.AddTraceSource ("HandoverStart", |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1478 |
"trace fired upon start of a handover procedure", |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1479 |
MakeTraceSourceAccessor (&LteEnbRrc::m_handoverStartTrace)) |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1480 |
.AddTraceSource ("HandoverEndOk", |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1481 |
"trace fired upon successful termination of a handover procedure", |
9fa1012bd84b
dynamic connection of RadioBearerStatsCalculator so it works properly with handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9447
diff
changeset
|
1482 |
MakeTraceSourceAccessor (&LteEnbRrc::m_handoverEndOkTrace)) |
10011
6853962462ca
Add trace callback when MeasurementReport is received
Manuel Requena <manuel.requena@cttc.es>
parents:
10008
diff
changeset
|
1483 |
.AddTraceSource ("RecvMeasurementReport", |
6853962462ca
Add trace callback when MeasurementReport is received
Manuel Requena <manuel.requena@cttc.es>
parents:
10008
diff
changeset
|
1484 |
"trace fired when measurement report is received", |
6853962462ca
Add trace callback when MeasurementReport is received
Manuel Requena <manuel.requena@cttc.es>
parents:
10008
diff
changeset
|
1485 |
MakeTraceSourceAccessor (&LteEnbRrc::m_recvMeasurementReportTrace)) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
1486 |
; |
7886 | 1487 |
return tid; |
1488 |
} |
|
1489 |
||
1490 |
void |
|
9323
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1491 |
LteEnbRrc::SetEpcX2SapProvider (EpcX2SapProvider * s) |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1492 |
{ |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1493 |
NS_LOG_FUNCTION (this << s); |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1494 |
m_x2SapProvider = s; |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1495 |
} |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1496 |
|
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1497 |
EpcX2SapUser* |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1498 |
LteEnbRrc::GetEpcX2SapUser () |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1499 |
{ |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1500 |
NS_LOG_FUNCTION (this); |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1501 |
return m_x2SapUser; |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1502 |
} |
c4c734a16f4f
Add support for X2 SAP
Manuel Requena <manuel.requena@cttc.es>
parents:
8717
diff
changeset
|
1503 |
|
7886 | 1504 |
void |
1505 |
LteEnbRrc::SetLteEnbCmacSapProvider (LteEnbCmacSapProvider * s) |
|
1506 |
{ |
|
1507 |
NS_LOG_FUNCTION (this << s); |
|
1508 |
m_cmacSapProvider = s; |
|
1509 |
} |
|
1510 |
||
1511 |
LteEnbCmacSapUser* |
|
1512 |
LteEnbRrc::GetLteEnbCmacSapUser () |
|
1513 |
{ |
|
1514 |
NS_LOG_FUNCTION (this); |
|
1515 |
return m_cmacSapUser; |
|
1516 |
} |
|
1517 |
||
1518 |
void |
|
9406 | 1519 |
LteEnbRrc::SetLteEnbRrcSapUser (LteEnbRrcSapUser * s) |
1520 |
{ |
|
1521 |
NS_LOG_FUNCTION (this << s); |
|
1522 |
m_rrcSapUser = s; |
|
1523 |
} |
|
1524 |
||
1525 |
LteEnbRrcSapProvider* |
|
1526 |
LteEnbRrc::GetLteEnbRrcSapProvider () |
|
7886 | 1527 |
{ |
1528 |
NS_LOG_FUNCTION (this); |
|
9406 | 1529 |
return m_rrcSapProvider; |
7886 | 1530 |
} |
1531 |
||
1532 |
void |
|
1533 |
LteEnbRrc::SetLteMacSapProvider (LteMacSapProvider * s) |
|
1534 |
{ |
|
1535 |
NS_LOG_FUNCTION (this); |
|
1536 |
m_macSapProvider = s; |
|
1537 |
} |
|
1538 |
||
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1539 |
void |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1540 |
LteEnbRrc::SetS1SapProvider (EpcEnbS1SapProvider * s) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1541 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1542 |
m_s1SapProvider = s; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1543 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1544 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1545 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1546 |
EpcEnbS1SapUser* |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1547 |
LteEnbRrc::GetS1SapUser () |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1548 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1549 |
return m_s1SapUser; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1550 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1551 |
|
9406 | 1552 |
void |
1553 |
LteEnbRrc::SetLteEnbCphySapProvider (LteEnbCphySapProvider * s) |
|
1554 |
{ |
|
1555 |
NS_LOG_FUNCTION (this << s); |
|
1556 |
m_cphySapProvider = s; |
|
1557 |
} |
|
1558 |
||
1559 |
LteEnbCphySapUser* |
|
1560 |
LteEnbRrc::GetLteEnbCphySapUser () |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
1561 |
{ |
9406 | 1562 |
NS_LOG_FUNCTION (this); |
1563 |
return m_cphySapUser; |
|
1564 |
} |
|
1565 |
||
1566 |
Ptr<UeManager> |
|
1567 |
LteEnbRrc::GetUeManager (uint16_t rnti) |
|
1568 |
{ |
|
1569 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
1570 |
NS_ASSERT (0 != rnti); |
|
1571 |
std::map<uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti); |
|
1572 |
NS_ASSERT_MSG (it != m_ueMap.end (), "RNTI " << rnti << " not found in eNB with cellId " << m_cellId); |
|
1573 |
return it->second; |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
1574 |
} |
7886 | 1575 |
|
1576 |
void |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1577 |
LteEnbRrc::ConfigureCell (uint8_t ulBandwidth, uint8_t dlBandwidth, uint16_t ulEarfcn, uint16_t dlEarfcn, uint16_t cellId) |
7886 | 1578 |
{ |
1579 |
NS_LOG_FUNCTION (this); |
|
1580 |
NS_ASSERT (!m_configured); |
|
1581 |
m_cmacSapProvider->ConfigureMac (ulBandwidth, dlBandwidth); |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1582 |
m_cphySapProvider->SetBandwidth (ulBandwidth, dlBandwidth); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1583 |
m_cphySapProvider->SetEarfcn (ulEarfcn, dlEarfcn); |
9406 | 1584 |
m_dlEarfcn = dlEarfcn; |
1585 |
m_ulEarfcn = ulEarfcn; |
|
1586 |
m_dlBandwidth = dlBandwidth; |
|
1587 |
m_ulBandwidth = ulBandwidth; |
|
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1588 |
m_cellId = cellId; |
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1589 |
m_cphySapProvider->SetCellId (cellId); |
9406 | 1590 |
LteRrcSap::MasterInformationBlock mib; |
1591 |
mib.dlBandwidth = m_dlBandwidth; |
|
1592 |
m_cphySapProvider->SetMasterInformationBlock (mib); |
|
7886 | 1593 |
m_configured = true; |
9406 | 1594 |
|
1595 |
// the first time System Information is sent |
|
1596 |
Simulator::Schedule (MilliSeconds (16), &LteEnbRrc::SendSystemInformation, this); |
|
1597 |
} |
|
1598 |
||
1599 |
||
1600 |
void |
|
1601 |
LteEnbRrc::SetCellId (uint16_t cellId) |
|
1602 |
{ |
|
1603 |
m_cellId = cellId; |
|
1604 |
} |
|
1605 |
||
1606 |
bool |
|
1607 |
LteEnbRrc::SendData (Ptr<Packet> packet) |
|
1608 |
{ |
|
1609 |
NS_LOG_FUNCTION (this << packet); |
|
1610 |
||
1611 |
EpsBearerTag tag; |
|
1612 |
bool found = packet->RemovePacketTag (tag); |
|
1613 |
NS_ASSERT_MSG (found, "no EpsBearerTag found in packet to be sent"); |
|
1614 |
Ptr<UeManager> ueManager = GetUeManager (tag.GetRnti ()); |
|
1615 |
ueManager->SendData (tag.GetBid (), packet); |
|
1616 |
||
1617 |
return true; |
|
1618 |
} |
|
1619 |
||
1620 |
void |
|
1621 |
LteEnbRrc::SetForwardUpCallback (Callback <void, Ptr<Packet> > cb) |
|
1622 |
{ |
|
1623 |
m_forwardUpCallback = cb; |
|
7886 | 1624 |
} |
1625 |
||
9567
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
1626 |
void |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
1627 |
LteEnbRrc::ConnectionTimeout (uint16_t rnti) |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
1628 |
{ |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
1629 |
NS_LOG_FUNCTION (this << rnti); |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
1630 |
RemoveUe (rnti); |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
1631 |
} |
6941db633724
remove context at eNB after UE connection timeout
Nicola Baldo <nbaldo@cttc.es>
parents:
9564
diff
changeset
|
1632 |
|
9406 | 1633 |
|
1634 |
void |
|
1635 |
LteEnbRrc::SendHandoverRequest (uint16_t rnti, uint16_t cellId) |
|
7886 | 1636 |
{ |
9406 | 1637 |
NS_LOG_FUNCTION (this << rnti << cellId); |
1638 |
NS_LOG_LOGIC ("Request to send HANDOVER REQUEST"); |
|
1639 |
NS_ASSERT (m_configured); |
|
1640 |
||
1641 |
Ptr<UeManager> ueManager = GetUeManager (rnti); |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1642 |
ueManager->PrepareHandover (cellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1643 |
|
9406 | 1644 |
} |
9346 | 1645 |
|
9406 | 1646 |
void |
1647 |
LteEnbRrc::DoCompleteSetupUe (uint16_t rnti, LteEnbRrcSapProvider::CompleteSetupUeParameters params) |
|
1648 |
{ |
|
1649 |
NS_LOG_FUNCTION (this << rnti); |
|
1650 |
GetUeManager (rnti)->CompleteSetupUe (params); |
|
1651 |
} |
|
9346 | 1652 |
|
9406 | 1653 |
void |
1654 |
LteEnbRrc::DoRecvRrcConnectionRequest (uint16_t rnti, LteRrcSap::RrcConnectionRequest msg) |
|
1655 |
{ |
|
1656 |
NS_LOG_FUNCTION (this << rnti); |
|
9528
19959697c48e
Add implementation of RRC Connection Reject in Ue Recv.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9523
diff
changeset
|
1657 |
|
19959697c48e
Add implementation of RRC Connection Reject in Ue Recv.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9523
diff
changeset
|
1658 |
GetUeManager (rnti)->RecvRrcConnectionRequest (msg); |
9406 | 1659 |
} |
1660 |
||
1661 |
void |
|
1662 |
LteEnbRrc::DoRecvRrcConnectionSetupCompleted (uint16_t rnti, LteRrcSap::RrcConnectionSetupCompleted msg) |
|
1663 |
{ |
|
1664 |
NS_LOG_FUNCTION (this << rnti); |
|
1665 |
GetUeManager (rnti)->RecvRrcConnectionSetupCompleted (msg); |
|
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1666 |
} |
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1667 |
|
9346 | 1668 |
void |
9406 | 1669 |
LteEnbRrc::DoRecvRrcConnectionReconfigurationCompleted (uint16_t rnti, LteRrcSap::RrcConnectionReconfigurationCompleted msg) |
1670 |
{ |
|
1671 |
NS_LOG_FUNCTION (this << rnti); |
|
1672 |
GetUeManager (rnti)->RecvRrcConnectionReconfigurationCompleted (msg); |
|
1673 |
} |
|
1674 |
||
1675 |
void |
|
1676 |
LteEnbRrc::DoRecvRrcConnectionReestablishmentRequest (uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentRequest msg) |
|
1677 |
{ |
|
1678 |
NS_LOG_FUNCTION (this << rnti); |
|
1679 |
GetUeManager (rnti)->RecvRrcConnectionReestablishmentRequest (msg); |
|
1680 |
} |
|
1681 |
||
1682 |
void |
|
1683 |
LteEnbRrc::DoRecvRrcConnectionReestablishmentComplete (uint16_t rnti, LteRrcSap::RrcConnectionReestablishmentComplete msg) |
|
1684 |
{ |
|
1685 |
NS_LOG_FUNCTION (this << rnti); |
|
1686 |
GetUeManager (rnti)->RecvRrcConnectionReestablishmentComplete (msg); |
|
1687 |
} |
|
1688 |
||
9601
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
1689 |
void |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
1690 |
LteEnbRrc::DoRecvMeasurementReport (uint16_t rnti, LteRrcSap::MeasurementReport msg) |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
1691 |
{ |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
1692 |
NS_LOG_FUNCTION (this << rnti); |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
1693 |
GetUeManager (rnti)->RecvMeasurementReport (msg); |
869b6ed3ad40
Add MeasurementReport to Send/Rcv functions in real and ideal protocol.
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9599
diff
changeset
|
1694 |
} |
9406 | 1695 |
|
1696 |
void |
|
1697 |
LteEnbRrc::DoDataRadioBearerSetupRequest (EpcEnbS1SapUser::DataRadioBearerSetupRequestParameters request) |
|
1698 |
{ |
|
1699 |
Ptr<UeManager> ueManager = GetUeManager (request.rnti); |
|
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
1700 |
ueManager->SetupDataRadioBearer (request.bearer, request.bearerId, request.gtpTeid, request.transportLayerAddress); |
9406 | 1701 |
} |
1702 |
||
9439
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1703 |
void |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1704 |
LteEnbRrc::DoPathSwitchRequestAcknowledge (EpcEnbS1SapUser::PathSwitchRequestAcknowledgeParameters params) |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1705 |
{ |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1706 |
Ptr<UeManager> ueManager = GetUeManager (params.rnti); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1707 |
ueManager->SendUeContextRelease (); |
5107601b7a75
added S1 path switch + S11 modify bearer for X2 handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9438
diff
changeset
|
1708 |
} |
9406 | 1709 |
|
1710 |
void |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1711 |
LteEnbRrc::DoRecvHandoverRequest (EpcX2SapUser::HandoverRequestParams req) |
7886 | 1712 |
{ |
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1713 |
NS_LOG_FUNCTION (this); |
9406 | 1714 |
|
1715 |
NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST"); |
|
1716 |
||
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1717 |
NS_LOG_LOGIC ("oldEnbUeX2apId = " << req.oldEnbUeX2apId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1718 |
NS_LOG_LOGIC ("sourceCellId = " << req.sourceCellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1719 |
NS_LOG_LOGIC ("targetCellId = " << req.targetCellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1720 |
NS_LOG_LOGIC ("mmeUeS1apId = " << req.mmeUeS1apId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1721 |
|
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1722 |
NS_ASSERT (req.targetCellId == m_cellId); |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1723 |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1724 |
if (m_admitHandoverRequest == false) |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1725 |
{ |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1726 |
NS_LOG_INFO ("rejecting handover request from cellId " << req.sourceCellId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1727 |
EpcX2Sap::HandoverPreparationFailureParams res; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1728 |
res.oldEnbUeX2apId = req.oldEnbUeX2apId; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1729 |
res.sourceCellId = req.sourceCellId ; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1730 |
res.targetCellId = req.targetCellId ; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1731 |
res.cause = 0; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1732 |
res.criticalityDiagnostics = 0; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1733 |
m_x2SapProvider->SendHandoverPreparationFailure (res); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1734 |
return; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1735 |
} |
9406 | 1736 |
|
1737 |
uint16_t rnti = AddUe (UeManager::HANDOVER_JOINING); |
|
9420
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1738 |
LteEnbCmacSapProvider::AllocateNcRaPreambleReturnValue anrcrv = m_cmacSapProvider->AllocateNcRaPreamble (rnti); |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1739 |
if (anrcrv.valid == false) |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1740 |
{ |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1741 |
NS_LOG_INFO (this << "failed to allocate a preamble for non-contention based RA => cannot accept HO"); |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1742 |
RemoveUe (rnti); |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1743 |
NS_FATAL_ERROR ("should trigger HO Preparation Failure, but it is not implemented"); |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1744 |
return; |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1745 |
} |
9406 | 1746 |
|
9407 | 1747 |
Ptr<UeManager> ueManager = GetUeManager (rnti); |
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1748 |
ueManager->SetSource (req.sourceCellId, req.oldEnbUeX2apId); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1749 |
ueManager->SetImsi (req.mmeUeS1apId); |
9406 | 1750 |
|
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1751 |
EpcX2SapProvider::HandoverRequestAckParams ackParams; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1752 |
ackParams.oldEnbUeX2apId = req.oldEnbUeX2apId; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1753 |
ackParams.newEnbUeX2apId = rnti; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1754 |
ackParams.sourceCellId = req.sourceCellId; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1755 |
ackParams.targetCellId = req.targetCellId; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1756 |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1757 |
for (std::vector <EpcX2Sap::ErabToBeSetupItem>::iterator it = req.bearers.begin (); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1758 |
it != req.bearers.end (); |
9406 | 1759 |
++it) |
1760 |
{ |
|
9497
bd3e1a06df5c
really defer DRB activation to rx of RRC connection setup/reconfiguration completed
Nicola Baldo <nbaldo@cttc.es>
parents:
9480
diff
changeset
|
1761 |
ueManager->SetupDataRadioBearer (it->erabLevelQosParameters, it->erabId, it->gtpTeid, it->transportLayerAddress); |
9501
3c52c63f19fd
check admittedBearers upon handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9500
diff
changeset
|
1762 |
EpcX2Sap::ErabAdmittedItem i; |
3c52c63f19fd
check admittedBearers upon handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9500
diff
changeset
|
1763 |
i.erabId = it->erabId; |
3c52c63f19fd
check admittedBearers upon handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9500
diff
changeset
|
1764 |
ackParams.admittedBearers.push_back (i); |
9406 | 1765 |
} |
1766 |
||
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1767 |
LteRrcSap::RrcConnectionReconfiguration handoverCommand = ueManager->GetRrcConnectionReconfigurationForHandover (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1768 |
handoverCommand.haveMobilityControlInfo = true; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1769 |
handoverCommand.mobilityControlInfo.targetPhysCellId = m_cellId; |
9420
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1770 |
handoverCommand.mobilityControlInfo.haveCarrierFreq = true; |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1771 |
handoverCommand.mobilityControlInfo.carrierFreq.dlCarrierFreq = m_dlEarfcn; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1772 |
handoverCommand.mobilityControlInfo.carrierFreq.ulCarrierFreq = m_ulEarfcn; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1773 |
handoverCommand.mobilityControlInfo.haveCarrierBandwidth = true; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1774 |
handoverCommand.mobilityControlInfo.carrierBandwidth.dlBandwidth = m_dlBandwidth; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1775 |
handoverCommand.mobilityControlInfo.carrierBandwidth.ulBandwidth = m_ulBandwidth; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
1776 |
handoverCommand.mobilityControlInfo.newUeIdentity = rnti; |
9420
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1777 |
handoverCommand.mobilityControlInfo.haveRachConfigDedicated = true; |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1778 |
handoverCommand.mobilityControlInfo.rachConfigDedicated.raPreambleIndex = anrcrv.raPreambleId; |
cd49c7790894
X2 handover working on the control plane
Nicola Baldo <nbaldo@cttc.es>
parents:
9419
diff
changeset
|
1779 |
handoverCommand.mobilityControlInfo.rachConfigDedicated.raPrachMaskIndex = anrcrv.raPrachMaskIndex; |
9660
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
1780 |
|
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
1781 |
LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider->GetRachConfig (); |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
1782 |
handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles; |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
1783 |
handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax; |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
1784 |
handoverCommand.mobilityControlInfo.radioResourceConfigCommon.rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize; |
82b2691be894
fixed valgrind errors in LteEnbRrc
Nicola Baldo <nbaldo@cttc.es>
parents:
9623
diff
changeset
|
1785 |
|
9406 | 1786 |
Ptr<Packet> encodedHandoverCommand = m_rrcSapUser->EncodeHandoverCommand (handoverCommand); |
1787 |
||
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1788 |
ackParams.rrcContext = encodedHandoverCommand; |
9406 | 1789 |
|
1790 |
NS_LOG_LOGIC ("Send X2 message: HANDOVER REQUEST ACK"); |
|
1791 |
||
1792 |
NS_LOG_LOGIC ("oldEnbUeX2apId = " << ackParams.oldEnbUeX2apId); |
|
1793 |
NS_LOG_LOGIC ("newEnbUeX2apId = " << ackParams.newEnbUeX2apId); |
|
1794 |
NS_LOG_LOGIC ("sourceCellId = " << ackParams.sourceCellId); |
|
1795 |
NS_LOG_LOGIC ("targetCellId = " << ackParams.targetCellId); |
|
1796 |
||
1797 |
m_x2SapProvider->SendHandoverRequestAck (ackParams); |
|
9346 | 1798 |
} |
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1799 |
|
9346 | 1800 |
void |
9406 | 1801 |
LteEnbRrc::DoRecvHandoverRequestAck (EpcX2SapUser::HandoverRequestAckParams params) |
9346 | 1802 |
{ |
1803 |
NS_LOG_FUNCTION (this); |
|
9406 | 1804 |
|
1805 |
NS_LOG_LOGIC ("Recv X2 message: HANDOVER REQUEST ACK"); |
|
1806 |
||
1807 |
NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId); |
|
1808 |
NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId); |
|
1809 |
NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId); |
|
1810 |
NS_LOG_LOGIC ("targetCellId = " << params.targetCellId); |
|
1811 |
||
1812 |
uint16_t rnti = params.oldEnbUeX2apId; |
|
1813 |
Ptr<UeManager> ueManager = GetUeManager (rnti); |
|
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1814 |
ueManager->RecvHandoverRequestAck (params); |
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1815 |
} |
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1816 |
|
9407 | 1817 |
void |
9456
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1818 |
LteEnbRrc::DoRecvHandoverPreparationFailure (EpcX2SapUser::HandoverPreparationFailureParams params) |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1819 |
{ |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1820 |
NS_LOG_FUNCTION (this); |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1821 |
|
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1822 |
NS_LOG_LOGIC ("Recv X2 message: HANDOVER PREPARATION FAILURE"); |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1823 |
|
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1824 |
NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId); |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1825 |
NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId); |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1826 |
NS_LOG_LOGIC ("targetCellId = " << params.targetCellId); |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1827 |
NS_LOG_LOGIC ("cause = " << params.cause); |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1828 |
NS_LOG_LOGIC ("criticalityDiagnostics = " << params.criticalityDiagnostics); |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1829 |
|
9464
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1830 |
uint16_t rnti = params.oldEnbUeX2apId; |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1831 |
Ptr<UeManager> ueManager = GetUeManager (rnti); |
e2e3b9b3585a
added LteEnbRrc::AdmitHandoverRequest attribute; implemented handling of X2 HO prep failure
Nicola Baldo <nbaldo@cttc.es>
parents:
9458
diff
changeset
|
1832 |
ueManager->RecvHandoverPreparationFailure (params.targetCellId); |
9456
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1833 |
} |
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1834 |
|
3102416ce9d7
Add support of HandoverPreparationFailure primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9435
diff
changeset
|
1835 |
void |
9479
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1836 |
LteEnbRrc::DoRecvSnStatusTransfer (EpcX2SapUser::SnStatusTransferParams params) |
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1837 |
{ |
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1838 |
NS_LOG_FUNCTION (this); |
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1839 |
|
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1840 |
NS_LOG_LOGIC ("Recv X2 message: SN STATUS TRANSFER"); |
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1841 |
|
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1842 |
NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId); |
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1843 |
NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId); |
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1844 |
NS_LOG_LOGIC ("erabsSubjectToStatusTransferList size = " << params.erabsSubjectToStatusTransferList.size ()); |
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1845 |
|
9500
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1846 |
uint16_t rnti = params.newEnbUeX2apId; |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1847 |
Ptr<UeManager> ueManager = GetUeManager (rnti); |
17e4bf873a93
LteEnbRrc send/recv X2 sn status transfer
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
1848 |
ueManager->RecvSnStatusTransfer (params); |
9479
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1849 |
} |
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1850 |
|
a647c4d9b6e7
Add support of SnStatusTransfer in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9456
diff
changeset
|
1851 |
void |
9407 | 1852 |
LteEnbRrc::DoRecvUeContextRelease (EpcX2SapUser::UeContextReleaseParams params) |
9346 | 1853 |
{ |
1854 |
NS_LOG_FUNCTION (this); |
|
9418
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1855 |
|
9407 | 1856 |
NS_LOG_LOGIC ("Recv X2 message: UE CONTEXT RELEASE"); |
9418
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1857 |
|
9407 | 1858 |
NS_LOG_LOGIC ("oldEnbUeX2apId = " << params.oldEnbUeX2apId); |
1859 |
NS_LOG_LOGIC ("newEnbUeX2apId = " << params.newEnbUeX2apId); |
|
1860 |
||
1861 |
uint16_t rnti = params.oldEnbUeX2apId; |
|
1862 |
RemoveUe (rnti); |
|
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1863 |
} |
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1864 |
|
9418
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1865 |
void |
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1866 |
LteEnbRrc::DoRecvLoadInformation (EpcX2SapUser::LoadInformationParams params) |
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1867 |
{ |
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1868 |
NS_LOG_FUNCTION (this); |
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1869 |
|
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1870 |
NS_LOG_LOGIC ("Recv X2 message: LOAD INFORMATION"); |
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1871 |
|
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1872 |
NS_LOG_LOGIC ("Number of cellInformationItems = " << params.cellInformationList.size ()); |
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1873 |
|
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1874 |
NS_ASSERT ("Processing of LOAD INFORMATION X2 message IS NOT IMPLEMENTED"); |
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1875 |
} |
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1876 |
|
9435
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1877 |
void |
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1878 |
LteEnbRrc::DoRecvResourceStatusUpdate (EpcX2SapUser::ResourceStatusUpdateParams params) |
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1879 |
{ |
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1880 |
NS_LOG_FUNCTION (this); |
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1881 |
|
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1882 |
NS_LOG_LOGIC ("Recv X2 message: RESOURCE STATUS UPDATE"); |
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1883 |
|
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1884 |
NS_LOG_LOGIC ("Number of cellMeasurementResultItems = " << params.cellMeasurementResultList.size ()); |
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1885 |
|
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1886 |
NS_ASSERT ("Processing of RESOURCE STATUS UPDATE X2 message IS NOT IMPLEMENTED"); |
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1887 |
} |
a60d3218e8f4
Add support of ResourceStatusUpdate X2 primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9418
diff
changeset
|
1888 |
|
9555
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1889 |
void |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1890 |
LteEnbRrc::DoRecvUeData (EpcX2SapUser::UeDataParams params) |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1891 |
{ |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1892 |
NS_LOG_FUNCTION (this); |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1893 |
|
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1894 |
NS_LOG_LOGIC ("Recv UE DATA FORWARDING through X2 interface"); |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1895 |
NS_LOG_LOGIC ("sourceCellId = " << params.sourceCellId); |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1896 |
NS_LOG_LOGIC ("targetCellId = " << params.targetCellId); |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1897 |
NS_LOG_LOGIC ("gtpTeid = " << params.gtpTeid); |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1898 |
NS_LOG_LOGIC ("ueData = " << params.ueData); |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1899 |
NS_LOG_LOGIC ("ueData size = " << params.ueData->GetSize ()); |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1900 |
|
9599
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1901 |
std::map<uint32_t, X2uTeidInfo>::iterator |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1902 |
teidInfoIt = m_x2uTeidInfoMap.find (params.gtpTeid); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1903 |
if (teidInfoIt != m_x2uTeidInfoMap.end ()) |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1904 |
{ |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1905 |
GetUeManager (teidInfoIt->second.rnti)->SendData (teidInfoIt->second.drbid, params.ueData); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1906 |
} |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1907 |
else |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1908 |
{ |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1909 |
NS_FATAL_ERROR ("X2-U data received but no X2uTeidInfo found"); |
fc4c980050f2
LteEnbRrc forwarding data over X2-U during handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9593
diff
changeset
|
1910 |
} |
9555
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1911 |
} |
2fc5d91bb366
Add initial support for UE data forwarding in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9479
diff
changeset
|
1912 |
|
9418
150d133b96af
Add support of Load Information primitive in RRC
Manuel Requena <manuel.requena@cttc.es>
parents:
9408
diff
changeset
|
1913 |
|
9406 | 1914 |
uint16_t |
1915 |
LteEnbRrc::DoAllocateTemporaryCellRnti () |
|
1916 |
{ |
|
1917 |
NS_LOG_FUNCTION (this); |
|
1918 |
return AddUe (UeManager::INITIAL_RANDOM_ACCESS); |
|
1919 |
} |
|
1920 |
||
1921 |
void |
|
1922 |
LteEnbRrc::DoRrcConfigurationUpdateInd (LteEnbCmacSapUser::UeConfig cmacParams) |
|
1923 |
{ |
|
1924 |
Ptr<UeManager> ueManager = GetUeManager (cmacParams.m_rnti); |
|
1925 |
ueManager->CmacUeConfigUpdateInd (cmacParams); |
|
1926 |
} |
|
1927 |
||
1928 |
void |
|
1929 |
LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success) |
|
1930 |
{ |
|
1931 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
1932 |
NS_FATAL_ERROR ("not implemented"); |
|
1933 |
} |
|
1934 |
||
1935 |
||
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1936 |
|
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1937 |
uint16_t |
9406 | 1938 |
LteEnbRrc::AddUe (UeManager::State state) |
9345
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1939 |
{ |
8290ae6cab62
add/remove UEs and bearers upon handover
Nicola Baldo <nicola@baldo.biz>
parents:
9344
diff
changeset
|
1940 |
NS_LOG_FUNCTION (this); |
9406 | 1941 |
bool found = false; |
1942 |
uint16_t rnti; |
|
1943 |
for (rnti = m_lastAllocatedRnti; |
|
1944 |
(rnti != m_lastAllocatedRnti - 1) && (!found); |
|
1945 |
++rnti) |
|
1946 |
{ |
|
1947 |
if ((rnti != 0) && (m_ueMap.find (rnti) == m_ueMap.end ())) |
|
1948 |
{ |
|
1949 |
found = true; |
|
1950 |
break; |
|
1951 |
} |
|
1952 |
} |
|
9346 | 1953 |
|
9406 | 1954 |
NS_ASSERT_MSG (found, "no more RNTIs available (do you have more than 65535 UEs in a cell?)"); |
1955 |
m_lastAllocatedRnti = rnti; |
|
1956 |
Ptr<UeManager> ueManager = CreateObject<UeManager> (this, rnti, state); |
|
1957 |
m_ueMap.insert (std::pair<uint16_t, Ptr<UeManager> > (rnti, ueManager)); |
|
9471
082640d26eea
Implement real DoSendRrcConnectionSetupCompleted
Lluis Parcerisa <parcerisa@gmail.com>
parents:
9464
diff
changeset
|
1958 |
ueManager->Start (); |
9615 | 1959 |
NS_LOG_DEBUG (this << " New UE RNTI " << rnti << " cellId " << m_cellId << " srs CI " << ueManager->GetSrsConfigurationIndex ()); |
1960 |
m_newUeContextTrace (m_cellId, rnti); |
|
7886 | 1961 |
return rnti; |
1962 |
} |
|
1963 |
||
1964 |
void |
|
1965 |
LteEnbRrc::RemoveUe (uint16_t rnti) |
|
1966 |
{ |
|
1967 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
9406 | 1968 |
std::map <uint16_t, Ptr<UeManager> >::iterator it = m_ueMap.find (rnti); |
1969 |
NS_ASSERT_MSG (it != m_ueMap.end (), "request to remove UE info with unknown rnti " << rnti); |
|
1970 |
uint16_t srsCi = (*it).second->GetSrsConfigurationIndex (); |
|
1971 |
m_ueMap.erase (it); |
|
9623
0be7b61853e3
fixed some RRC valgrind errors
Nicola Baldo <nbaldo@cttc.es>
parents:
9615
diff
changeset
|
1972 |
m_cmacSapProvider->RemoveUe (rnti); |
0be7b61853e3
fixed some RRC valgrind errors
Nicola Baldo <nbaldo@cttc.es>
parents:
9615
diff
changeset
|
1973 |
m_cphySapProvider->RemoveUe (rnti); |
0be7b61853e3
fixed some RRC valgrind errors
Nicola Baldo <nbaldo@cttc.es>
parents:
9615
diff
changeset
|
1974 |
if (m_s1SapProvider != 0) |
0be7b61853e3
fixed some RRC valgrind errors
Nicola Baldo <nbaldo@cttc.es>
parents:
9615
diff
changeset
|
1975 |
{ |
0be7b61853e3
fixed some RRC valgrind errors
Nicola Baldo <nbaldo@cttc.es>
parents:
9615
diff
changeset
|
1976 |
m_s1SapProvider->UeContextRelease (rnti); |
0be7b61853e3
fixed some RRC valgrind errors
Nicola Baldo <nbaldo@cttc.es>
parents:
9615
diff
changeset
|
1977 |
} |
9406 | 1978 |
// need to do this after UeManager has been deleted |
1979 |
RemoveSrsConfigurationIndex (srsCi); |
|
1980 |
} |
|
7886 | 1981 |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1982 |
TypeId |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1983 |
LteEnbRrc::GetRlcType (EpsBearer bearer) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1984 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1985 |
switch (m_epsBearerToRlcMapping) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1986 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1987 |
case RLC_SM_ALWAYS: |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1988 |
return LteRlcSm::GetTypeId (); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1989 |
break; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1990 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1991 |
case RLC_UM_ALWAYS: |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1992 |
return LteRlcUm::GetTypeId (); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1993 |
break; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1994 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1995 |
case RLC_AM_ALWAYS: |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1996 |
return LteRlcAm::GetTypeId (); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1997 |
break; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1998 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
1999 |
case PER_BASED: |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2000 |
if (bearer.GetPacketErrorLossRate () > 1.0e-5) |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2001 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2002 |
return LteRlcUm::GetTypeId (); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2003 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2004 |
else |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2005 |
{ |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2006 |
return LteRlcAm::GetTypeId (); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2007 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2008 |
break; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2009 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2010 |
default: |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2011 |
return LteRlcSm::GetTypeId (); |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2012 |
break; |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2013 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2014 |
} |
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2015 |
|
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2016 |
|
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2017 |
void |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2018 |
LteEnbRrc::AddX2Neighbour (uint16_t cellId) |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2019 |
{ |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2020 |
NS_LOG_FUNCTION (cellId); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2021 |
NS_ASSERT_MSG (m_neighbourRelationTable.find (cellId) == m_neighbourRelationTable.end (), |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2022 |
"There is already an entry in the Neighbour Relation Table for cellId " << cellId); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2023 |
|
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2024 |
Ptr<NeighbourRelation> neighbourRelation = CreateObject <NeighbourRelation> (); |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2025 |
neighbourRelation->m_physCellId = cellId; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2026 |
neighbourRelation->m_noRemove = true; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2027 |
neighbourRelation->m_noHo = true; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2028 |
neighbourRelation->m_noX2 = false; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2029 |
neighbourRelation->m_detectedAsNeighbour = false; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2030 |
m_neighbourRelationTable[cellId] = neighbourRelation; |
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2031 |
} |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
2032 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
2033 |
|
9036 | 2034 |
// from 3GPP TS 36.213 table 8.2-1 UE Specific SRS Periodicity |
9568
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2035 |
const uint8_t SRS_ENTRIES = 9; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2036 |
uint16_t g_srsPeriodicity[SRS_ENTRIES] = {0, 2, 5, 10, 20, 40, 80, 160, 320}; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2037 |
uint16_t g_srsCiLow[SRS_ENTRIES] = {0, 0, 2, 7, 17, 37, 77, 157, 317}; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2038 |
uint16_t g_srsCiHigh[SRS_ENTRIES] = {0, 1, 6, 16, 36, 76, 156, 316, 636}; |
9543
5976c95cf6e3
always use max SRS periodicity with more than 10 UEs
Nicola Baldo <nbaldo@cttc.es>
parents:
9541
diff
changeset
|
2039 |
|
9568
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2040 |
void |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2041 |
LteEnbRrc::SetSrsPeriodicity (uint32_t p) |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2042 |
{ |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2043 |
NS_LOG_FUNCTION (this << p); |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2044 |
for (uint32_t id = 1; id < SRS_ENTRIES; ++id) |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2045 |
{ |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2046 |
if (g_srsPeriodicity[id] == p) |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2047 |
{ |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2048 |
m_srsCurrentPeriodicityId = id; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2049 |
return; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2050 |
} |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2051 |
} |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2052 |
// no match found |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2053 |
std::ostringstream allowedValues; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2054 |
for (uint32_t id = 1; id < SRS_ENTRIES; ++id) |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2055 |
{ |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2056 |
allowedValues << g_srsPeriodicity[id] << " "; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2057 |
} |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2058 |
NS_FATAL_ERROR ("illecit SRS periodicity value " << p << ". Allowed values: " << allowedValues.str ()); |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2059 |
} |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2060 |
|
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2061 |
uint32_t |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2062 |
LteEnbRrc::GetSrsPeriodicity () const |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2063 |
{ |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2064 |
NS_LOG_FUNCTION (this); |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2065 |
NS_ASSERT (m_srsCurrentPeriodicityId > 0); |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2066 |
NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES); |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2067 |
return g_srsPeriodicity[m_srsCurrentPeriodicityId]; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2068 |
} |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2069 |
|
9036 | 2070 |
|
2071 |
uint16_t |
|
2072 |
LteEnbRrc::GetNewSrsConfigurationIndex () |
|
2073 |
{ |
|
2074 |
NS_LOG_FUNCTION (this << m_ueSrsConfigurationIndexSet.size ()); |
|
2075 |
// SRS |
|
9568
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2076 |
NS_ASSERT (m_srsCurrentPeriodicityId > 0); |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2077 |
NS_ASSERT (m_srsCurrentPeriodicityId < SRS_ENTRIES); |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2078 |
NS_LOG_DEBUG (this << " SRS p " << g_srsPeriodicity[m_srsCurrentPeriodicityId] << " set " << m_ueSrsConfigurationIndexSet.size ()); |
9568
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2079 |
if (m_ueSrsConfigurationIndexSet.size () >= g_srsPeriodicity[m_srsCurrentPeriodicityId]) |
9036 | 2080 |
{ |
9568
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2081 |
NS_FATAL_ERROR ("too many UEs (" << m_ueSrsConfigurationIndexSet.size () + 1 |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2082 |
<< ") for current SRS periodicity " |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2083 |
<< g_srsPeriodicity[m_srsCurrentPeriodicityId] |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2084 |
<< ", consider increasing the value of ns3::LteEnbRrc::SrsPeriodicity"); |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2085 |
} |
9406 | 2086 |
|
9568
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2087 |
if (m_ueSrsConfigurationIndexSet.empty ()) |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2088 |
{ |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2089 |
// first entry |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2090 |
m_lastAllocatedConfigurationIndex = g_srsCiLow[m_srsCurrentPeriodicityId]; |
2ef7e29ee20d
make SRS periodicity static to avoid excessive RRC overhead of dynamic one
Nicola Baldo <nbaldo@cttc.es>
parents:
9567
diff
changeset
|
2091 |
m_ueSrsConfigurationIndexSet.insert (m_lastAllocatedConfigurationIndex); |
9036 | 2092 |
} |
2093 |
else |
|
2094 |
{ |
|
2095 |
// find a CI from the available ones |
|
2096 |
std::set<uint16_t>::reverse_iterator rit = m_ueSrsConfigurationIndexSet.rbegin (); |
|
9425
b7eddbdb3a5a
added lte-x2-handover test suite
Nicola Baldo <nbaldo@cttc.es>
parents:
9420
diff
changeset
|
2097 |
NS_ASSERT (rit != m_ueSrsConfigurationIndexSet.rend ()); |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2098 |
NS_LOG_DEBUG (this << " lower bound " << (*rit) << " of " << g_srsCiHigh[m_srsCurrentPeriodicityId]); |
9469
28a7b04a0b11
removed spurious LteUePhy::m_enbCellId; fixed bug in LteEnbRrc::GetNewSrsConfigurationIndex ()
Nicola Baldo <nbaldo@cttc.es>
parents:
9464
diff
changeset
|
2099 |
if ((*rit) < g_srsCiHigh[m_srsCurrentPeriodicityId]) |
9036 | 2100 |
{ |
2101 |
// got it from the upper bound |
|
2102 |
m_lastAllocatedConfigurationIndex = (*rit) + 1; |
|
2103 |
m_ueSrsConfigurationIndexSet.insert (m_lastAllocatedConfigurationIndex); |
|
2104 |
} |
|
2105 |
else |
|
2106 |
{ |
|
2107 |
// look for released ones |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2108 |
for (uint16_t srcCi = g_srsCiLow[m_srsCurrentPeriodicityId]; srcCi < g_srsCiHigh[m_srsCurrentPeriodicityId]; srcCi++) |
9036 | 2109 |
{ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2110 |
std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi); |
9036 | 2111 |
if (it==m_ueSrsConfigurationIndexSet.end ()) |
2112 |
{ |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2113 |
m_lastAllocatedConfigurationIndex = srcCi; |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2114 |
m_ueSrsConfigurationIndexSet.insert (srcCi); |
9036 | 2115 |
break; |
2116 |
} |
|
2117 |
} |
|
2118 |
} |
|
2119 |
} |
|
2120 |
return m_lastAllocatedConfigurationIndex; |
|
2121 |
||
2122 |
} |
|
2123 |
||
2124 |
||
2125 |
void |
|
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2126 |
LteEnbRrc::RemoveSrsConfigurationIndex (uint16_t srcCi) |
9036 | 2127 |
{ |
9038
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2128 |
NS_LOG_FUNCTION (this << srcCi); |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2129 |
std::set<uint16_t>::iterator it = m_ueSrsConfigurationIndexSet.find (srcCi); |
e1d67c8aa95b
Polish code according to codereview
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9036
diff
changeset
|
2130 |
NS_ASSERT_MSG (it != m_ueSrsConfigurationIndexSet.end (), "request to remove unkwown SRS CI " << srcCi); |
9036 | 2131 |
m_ueSrsConfigurationIndexSet.erase (it); |
2132 |
} |
|
2133 |
||
9406 | 2134 |
uint8_t |
2135 |
LteEnbRrc::GetLogicalChannelGroup (EpsBearer bearer) |
|
7886 | 2136 |
{ |
9406 | 2137 |
if (bearer.IsGbr ()) |
2138 |
{ |
|
2139 |
return 1; |
|
2140 |
} |
|
2141 |
else |
|
2142 |
{ |
|
2143 |
return 2; |
|
2144 |
} |
|
2145 |
} |
|
2146 |
||
2147 |
uint8_t |
|
2148 |
LteEnbRrc::GetLogicalChannelPriority (EpsBearer bearer) |
|
2149 |
{ |
|
2150 |
return bearer.qci; |
|
7886 | 2151 |
} |
2152 |
||
2153 |
void |
|
9406 | 2154 |
LteEnbRrc::SendSystemInformation () |
9036 | 2155 |
{ |
10019
6efd95740e39
Add automatic triger of the HO based on the RSRQ measures
Manuel Requena <manuel.requena@cttc.es>
parents:
10011
diff
changeset
|
2156 |
// NS_LOG_FUNCTION (this); |
9406 | 2157 |
// for simplicity, we use the same periodicity for all sibs |
2158 |
// note that in real systems the periodicy of each sibs could be different |
|
2159 |
LteRrcSap::SystemInformation si; |
|
2160 |
si.haveSib2 = true; |
|
2161 |
si.sib2.freqInfo.ulCarrierFreq = m_ulEarfcn; |
|
2162 |
si.sib2.freqInfo.ulBandwidth = m_ulBandwidth; |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
2163 |
|
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
2164 |
LteEnbCmacSapProvider::RachConfig rc = m_cmacSapProvider->GetRachConfig (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
2165 |
LteRrcSap::RachConfigCommon rachConfigCommon; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
2166 |
rachConfigCommon.preambleInfo.numberOfRaPreambles = rc.numberOfRaPreambles; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
2167 |
rachConfigCommon.raSupervisionInfo.preambleTransMax = rc.preambleTransMax; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
2168 |
rachConfigCommon.raSupervisionInfo.raResponseWindowSize = rc.raResponseWindowSize; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9408
diff
changeset
|
2169 |
si.sib2.radioResourceConfigCommon.rachConfigCommon = rachConfigCommon; |
7886 | 2170 |
|
9406 | 2171 |
m_rrcSapUser->SendSystemInformation (si); |
2172 |
Simulator::Schedule (m_systemInformationPeriodicity, &LteEnbRrc::SendSystemInformation, this); |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8717
diff
changeset
|
2173 |
} |
7886 | 2174 |
|
2175 |
} // namespace ns3 |
|
2176 |