author | Marco Miozzo <marco.miozzo@cttc.es> |
Thu, 22 Mar 2012 18:16:01 +0100 | |
changeset 8714 | 398bbcbb3f42 |
parent 8462 | cf6a48994db5 |
child 8717 | 5427774a21cf |
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> |
7886 | 20 |
*/ |
21 |
||
22 |
#include <ns3/fatal-error.h> |
|
23 |
#include <ns3/log.h> |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
24 |
#include <ns3/abort.h> |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
25 |
#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
|
26 |
#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
|
27 |
#include "ns3/object-factory.h" |
7886 | 28 |
|
29 |
#include "lte-enb-rrc.h" |
|
30 |
#include "lte-rlc.h" |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
31 |
#include "lte-pdcp.h" |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
32 |
#include "lte-pdcp-sap.h" |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
33 |
#include "lte-radio-bearer-info.h" |
8462
cf6a48994db5
renamed LteMacTag --> LteRadioBearerTag
Nicola Baldo <nbaldo@cttc.es>
parents:
8390
diff
changeset
|
34 |
#include "lte-radio-bearer-tag.h" |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
35 |
#include "ns3/object-map.h" |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
36 |
#include <ns3/ff-mac-csched-sap.h> |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
37 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
38 |
// WILD ACK for UE-RRC direct communications |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
39 |
#include <ns3/node-list.h> |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
40 |
#include <ns3/node.h> |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
41 |
#include <ns3/lte-ue-net-device.h> |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
42 |
#include <ns3/lte-ue-rrc.h> |
7886 | 43 |
|
44 |
||
45 |
NS_LOG_COMPONENT_DEFINE ("LteEnbRrc"); |
|
46 |
||
47 |
namespace ns3 { |
|
48 |
||
49 |
||
50 |
||
7905
80557b09aa7f
Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
7903
diff
changeset
|
51 |
|
80557b09aa7f
Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
7903
diff
changeset
|
52 |
|
7886 | 53 |
// /////////////////////////// |
54 |
// CMAC SAP forwarder |
|
55 |
// /////////////////////////// |
|
56 |
||
7888 | 57 |
class EnbRrcMemberLteEnbCmacSapUser : public LteEnbCmacSapUser |
7886 | 58 |
{ |
59 |
public: |
|
7888 | 60 |
EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc); |
7886 | 61 |
|
62 |
virtual void NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success); |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
63 |
virtual void RrcConfigurationUpdateInd (LteUeConfig_t params); |
7886 | 64 |
|
65 |
private: |
|
66 |
LteEnbRrc* m_rrc; |
|
67 |
}; |
|
68 |
||
7888 | 69 |
EnbRrcMemberLteEnbCmacSapUser::EnbRrcMemberLteEnbCmacSapUser (LteEnbRrc* rrc) |
7886 | 70 |
: m_rrc (rrc) |
71 |
{ |
|
72 |
} |
|
73 |
||
74 |
void |
|
7888 | 75 |
EnbRrcMemberLteEnbCmacSapUser::NotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success) |
7886 | 76 |
{ |
77 |
m_rrc->DoNotifyLcConfigResult (rnti, lcid, success); |
|
78 |
} |
|
79 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
80 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
81 |
EnbRrcMemberLteEnbCmacSapUser::RrcConfigurationUpdateInd (LteUeConfig_t params) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
82 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
83 |
m_rrc->DoRrcConfigurationUpdateInd (params); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
84 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
85 |
|
7886 | 86 |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
87 |
//////////////////////////////// |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
88 |
// PDCP SAP Forwarder |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
89 |
//////////////////////////////// |
7886 | 90 |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
91 |
// not needed any more if the template works |
7886 | 92 |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
93 |
// class EnbRrcMemberLtePdcpSapUser : public LtePdcpSapUser |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
94 |
// { |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
95 |
// public: |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
96 |
// MemberLtePdcpSapUser (LteEnbRrc* rrc); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
97 |
// virtual void ReceiveRrcPdu (Ptr<Packet> p); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
98 |
// private: |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
99 |
// LteEnbRrc* m_rrc; |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
100 |
// }; |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
101 |
|
7905
80557b09aa7f
Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
7903
diff
changeset
|
102 |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
103 |
// EnbRrcMemberLtePdcpSapUser::EnbRrcMemberLtePdcpSapUser (LteEnbRrc* rrc) |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
104 |
// : m_rrc (rrc) |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
105 |
// { |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
106 |
// } |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
107 |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
108 |
// void EnbRrcMemberLtePdcpSapUser::ReceiveRrcPdu (Ptr<Packet> p) |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
109 |
// { |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
110 |
// m_rrc->DoReceiveRrcPdu (p); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
111 |
// } |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
112 |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
113 |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
114 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
115 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
116 |
/////////////////////////////////////////// |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
117 |
// UeInfo |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
118 |
/////////////////////////////////////////// |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
119 |
|
7886 | 120 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
121 |
NS_OBJECT_ENSURE_REGISTERED (UeInfo); |
7905
80557b09aa7f
Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
7903
diff
changeset
|
122 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
123 |
UeInfo::UeInfo (void) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
124 |
: m_lastAllocatedId (0) |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
125 |
{ |
8007 | 126 |
m_imsi = 0; |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
127 |
} |
7886 | 128 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
129 |
UeInfo::UeInfo (uint64_t imsi) |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
130 |
: m_lastAllocatedId (0) |
8007 | 131 |
{ |
132 |
m_imsi = imsi; |
|
133 |
} |
|
134 |
||
135 |
||
136 |
||
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
137 |
UeInfo::~UeInfo (void) |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
138 |
{ |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
139 |
// Nothing to do here |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
140 |
} |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
141 |
|
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
142 |
TypeId UeInfo::GetTypeId (void) |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
143 |
{ |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
144 |
static TypeId tid = TypeId ("ns3::UeInfo") |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
145 |
.SetParent<Object> () |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
146 |
.AddConstructor<UeInfo> () |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
147 |
.AddAttribute ("RadioBearerMap", "List of UE RadioBearerInfo by LCID.", |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
148 |
ObjectMapValue (), |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
149 |
MakeObjectMapAccessor (&UeInfo::m_rbMap), |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
150 |
MakeObjectMapChecker<LteRadioBearerInfo> ()) |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
151 |
; |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
152 |
return tid; |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
153 |
} |
7886 | 154 |
|
8007 | 155 |
uint64_t |
156 |
UeInfo::GetImsi (void) |
|
157 |
{ |
|
158 |
return m_imsi; |
|
159 |
} |
|
160 |
||
7886 | 161 |
uint8_t |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
162 |
UeInfo::AddRadioBearer (Ptr<LteRadioBearerInfo> rbi) |
7886 | 163 |
{ |
164 |
NS_LOG_FUNCTION (this); |
|
165 |
for (uint8_t lcid = m_lastAllocatedId; lcid != m_lastAllocatedId - 1; ++lcid) |
|
166 |
{ |
|
167 |
if (lcid != 0) |
|
168 |
{ |
|
169 |
if (m_rbMap.find (lcid) == m_rbMap.end ()) |
|
170 |
{ |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
171 |
m_rbMap.insert (std::pair<uint8_t, Ptr<LteRadioBearerInfo> > (lcid, rbi)); |
7886 | 172 |
m_lastAllocatedId = lcid; |
173 |
return lcid; |
|
174 |
} |
|
175 |
} |
|
176 |
} |
|
177 |
NS_LOG_WARN ("no more logical channel ids available"); |
|
178 |
return 0; |
|
179 |
} |
|
180 |
||
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
181 |
Ptr<LteRadioBearerInfo> |
8152
325396a9f9bf
fixed misspelling in UeInfo::GetRadioBearer
Nicola Baldo <nbaldo@cttc.es>
parents:
8148
diff
changeset
|
182 |
UeInfo::GetRadioBearer (uint8_t lcid) |
7886 | 183 |
{ |
184 |
NS_LOG_FUNCTION (this << (uint32_t) lcid); |
|
185 |
NS_ASSERT (0 != lcid); |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
186 |
std::map<uint8_t, Ptr<LteRadioBearerInfo> >::iterator it = m_rbMap.find (lcid); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
187 |
NS_ABORT_IF (it == m_rbMap.end ()); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
188 |
return it->second; |
7886 | 189 |
} |
190 |
||
191 |
||
192 |
void |
|
193 |
UeInfo::RemoveRadioBearer (uint8_t lcid) |
|
194 |
{ |
|
195 |
NS_LOG_FUNCTION (this << (uint32_t) lcid); |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
196 |
std::map <uint8_t, Ptr<LteRadioBearerInfo> >::iterator it = m_rbMap.find (lcid); |
7886 | 197 |
NS_ASSERT_MSG (it != m_rbMap.end (), "request to remove radio bearer with unknown lcid " << lcid); |
198 |
m_rbMap.erase (it); |
|
199 |
} |
|
200 |
||
201 |
||
202 |
||
203 |
||
204 |
||
205 |
// /////////////////////////// |
|
206 |
// eNB RRC methods |
|
207 |
// /////////////////////////// |
|
208 |
||
7905
80557b09aa7f
Added missing NS_OBJECT_ENSURE_REGISTERED to all ns3::Objects created.
jnin
parents:
7903
diff
changeset
|
209 |
NS_OBJECT_ENSURE_REGISTERED (LteEnbRrc); |
7886 | 210 |
|
211 |
LteEnbRrc::LteEnbRrc () |
|
212 |
: m_cmacSapProvider (0), |
|
213 |
m_ffMacSchedSapProvider (0), |
|
214 |
m_macSapProvider (0), |
|
215 |
m_configured (false), |
|
216 |
m_lastAllocatedRnti (0) |
|
217 |
{ |
|
218 |
NS_LOG_FUNCTION (this); |
|
7888 | 219 |
m_cmacSapUser = new EnbRrcMemberLteEnbCmacSapUser (this); |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
220 |
m_pdcpSapUser = new LtePdcpSpecificLtePdcpSapUser<LteEnbRrc> (this); |
7886 | 221 |
} |
222 |
||
223 |
||
224 |
LteEnbRrc::~LteEnbRrc () |
|
225 |
{ |
|
226 |
NS_LOG_FUNCTION (this); |
|
227 |
} |
|
228 |
||
229 |
||
230 |
void |
|
231 |
LteEnbRrc::DoDispose () |
|
232 |
{ |
|
233 |
NS_LOG_FUNCTION (this); |
|
234 |
delete m_cmacSapUser; |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
235 |
delete m_pdcpSapUser; |
7886 | 236 |
} |
237 |
||
238 |
TypeId |
|
239 |
LteEnbRrc::GetTypeId (void) |
|
240 |
{ |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
241 |
NS_LOG_FUNCTION ("LteEnbRrc::GetTypeId"); |
7886 | 242 |
static TypeId tid = TypeId ("ns3::LteEnbRrc") |
243 |
.SetParent<Object> () |
|
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
244 |
.AddConstructor<LteEnbRrc> () |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
245 |
.AddAttribute ("UeMap", "List of UE Info by C-RNTI.", |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
246 |
ObjectMapValue (), |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
247 |
MakeObjectMapAccessor (&LteEnbRrc::m_ueMap), |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
248 |
MakeObjectMapChecker<UeInfo> ()) |
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
249 |
.AddAttribute ("DefaultTransmissionMode", |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
250 |
"The default UEs' transmission mode (0: SISO)", |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
251 |
UintegerValue (0), // default tx-mode |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
252 |
MakeUintegerAccessor (&LteEnbRrc::m_defaultTransmissionMode), |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
253 |
MakeUintegerChecker<uint8_t> ()) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
254 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
255 |
; |
7886 | 256 |
return tid; |
257 |
} |
|
258 |
||
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
259 |
uint16_t |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
260 |
LteEnbRrc::GetLastAllocatedRnti () const |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
261 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
262 |
NS_LOG_FUNCTION (this); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
263 |
return m_lastAllocatedRnti; |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
264 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
265 |
std::map<uint16_t,Ptr<UeInfo> > LteEnbRrc::GetUeMap (void) const |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
266 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
267 |
return m_ueMap; |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
268 |
} |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
269 |
|
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
270 |
void LteEnbRrc::SetUeMap (std::map<uint16_t,Ptr<UeInfo> > ueMap) |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
271 |
{ |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
272 |
this->m_ueMap = ueMap; |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
273 |
} |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
274 |
|
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
275 |
|
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
276 |
void |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
277 |
LteEnbRrc::SetLastAllocatedRnti (uint16_t lastAllocatedRnti) |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
278 |
{ |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
279 |
NS_LOG_FUNCTION (this << lastAllocatedRnti); |
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
8032
diff
changeset
|
280 |
m_lastAllocatedRnti = lastAllocatedRnti; |
7901
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
281 |
} |
2451f71f1ce4
Added attributes to enable access to RLC instances in Enb
jnin
parents:
7888
diff
changeset
|
282 |
|
7886 | 283 |
|
284 |
||
285 |
void |
|
286 |
LteEnbRrc::SetLteEnbCmacSapProvider (LteEnbCmacSapProvider * s) |
|
287 |
{ |
|
288 |
NS_LOG_FUNCTION (this << s); |
|
289 |
m_cmacSapProvider = s; |
|
290 |
} |
|
291 |
||
292 |
LteEnbCmacSapUser* |
|
293 |
LteEnbRrc::GetLteEnbCmacSapUser () |
|
294 |
{ |
|
295 |
NS_LOG_FUNCTION (this); |
|
296 |
return m_cmacSapUser; |
|
297 |
} |
|
298 |
||
299 |
void |
|
300 |
LteEnbRrc::SetFfMacSchedSapProvider (FfMacSchedSapProvider * s) |
|
301 |
{ |
|
302 |
NS_LOG_FUNCTION (this); |
|
303 |
m_ffMacSchedSapProvider = s; |
|
304 |
} |
|
305 |
||
306 |
||
307 |
void |
|
308 |
LteEnbRrc::SetLteMacSapProvider (LteMacSapProvider * s) |
|
309 |
{ |
|
310 |
NS_LOG_FUNCTION (this); |
|
311 |
m_macSapProvider = s; |
|
312 |
} |
|
313 |
||
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
314 |
LtePdcpSapProvider* |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
315 |
LteEnbRrc::GetLtePdcpSapProvider (uint16_t rnti, uint8_t lcid) |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
316 |
{ |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
317 |
return GetUeInfo (rnti)->GetRadioBearer (lcid)->m_pdcp->GetLtePdcpSapProvider (); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
318 |
} |
7886 | 319 |
|
320 |
void |
|
321 |
LteEnbRrc::ConfigureCell (uint8_t ulBandwidth, uint8_t dlBandwidth) |
|
322 |
{ |
|
323 |
NS_LOG_FUNCTION (this); |
|
324 |
NS_ASSERT (!m_configured); |
|
325 |
m_cmacSapProvider->ConfigureMac (ulBandwidth, dlBandwidth); |
|
326 |
m_configured = true; |
|
327 |
} |
|
328 |
||
329 |
uint16_t |
|
8007 | 330 |
LteEnbRrc::AddUe (uint64_t imsi) |
7886 | 331 |
{ |
8032 | 332 |
NS_LOG_FUNCTION (this << imsi); |
7886 | 333 |
// no Call Admission Control for now |
8007 | 334 |
uint16_t rnti = CreateUeInfo (imsi); // side effect: create UeInfo for this UE |
7886 | 335 |
NS_ASSERT_MSG (rnti != 0, "CreateUeInfo returned RNTI==0"); |
336 |
m_cmacSapProvider->AddUe (rnti); |
|
337 |
return rnti; |
|
338 |
} |
|
339 |
||
340 |
void |
|
341 |
LteEnbRrc::RemoveUe (uint16_t rnti) |
|
342 |
{ |
|
343 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
344 |
RemoveUeInfo (rnti); |
|
345 |
NS_FATAL_ERROR ("missing RemoveUe method in CMAC SAP"); |
|
346 |
} |
|
347 |
||
348 |
uint8_t |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
349 |
LteEnbRrc::SetupRadioBearer (uint16_t rnti, EpsBearer bearer, TypeId rlcTypeId) |
7886 | 350 |
{ |
351 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
352 |
Ptr<UeInfo> ueInfo = GetUeInfo (rnti); |
|
353 |
||
354 |
// create RLC instance |
|
355 |
||
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
356 |
ObjectFactory rlcObjectFactory; |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
357 |
rlcObjectFactory.SetTypeId (rlcTypeId); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
358 |
Ptr<LteRlc> rlc = rlcObjectFactory.Create ()->GetObject<LteRlc> (); |
7886 | 359 |
rlc->SetLteMacSapProvider (m_macSapProvider); |
360 |
rlc->SetRnti (rnti); |
|
361 |
||
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
362 |
Ptr<LteRadioBearerInfo> rbInfo = CreateObject<LteRadioBearerInfo> (); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
363 |
rbInfo->m_rlc = rlc; |
7886 | 364 |
uint8_t lcid = ueInfo->AddRadioBearer (rbInfo); |
365 |
rlc->SetLcId (lcid); |
|
366 |
||
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
367 |
// we need PDCP only for real RLC, i.e., RLC/UM or RLC/AM |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
368 |
// if we are using RLC/SM we don't care of anything above RLC |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
369 |
if (rlcTypeId != LteRlcSm::GetTypeId ()) |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
370 |
{ |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
371 |
Ptr<LtePdcp> pdcp = CreateObject<LtePdcp> (); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
372 |
pdcp->SetRnti (rnti); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
373 |
pdcp->SetLcId (lcid); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
374 |
pdcp->SetLtePdcpSapUser (m_pdcpSapUser); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
375 |
pdcp->SetLteRlcSapProvider (rlc->GetLteRlcSapProvider ()); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
376 |
rlc->SetLteRlcSapUser (pdcp->GetLteRlcSapUser ()); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
377 |
rbInfo->m_pdcp = pdcp; |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
378 |
} |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
379 |
|
7886 | 380 |
LteEnbCmacSapProvider::LcInfo lcinfo; |
381 |
lcinfo.rnti = rnti; |
|
382 |
lcinfo.lcId = lcid; |
|
383 |
lcinfo.lcGroup = 0; // TBD |
|
384 |
lcinfo.qci = bearer.qci; |
|
385 |
lcinfo.isGbr = bearer.IsGbr (); |
|
386 |
lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl; |
|
387 |
lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl; |
|
388 |
lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl; |
|
389 |
lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl; |
|
390 |
m_cmacSapProvider->AddLc (lcinfo, rlc->GetLteMacSapUser ()); |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
391 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
392 |
// Transmission mode settings |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
393 |
LteUeConfig_t ueConfig; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
394 |
ueConfig.m_rnti = rnti; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
395 |
ueConfig.m_transmissionMode = m_defaultTransmissionMode; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
396 |
DoRrcConfigurationUpdateInd (ueConfig); |
7886 | 397 |
|
398 |
return lcid; |
|
399 |
} |
|
400 |
||
401 |
void |
|
402 |
LteEnbRrc::ReleaseRadioBearer (uint16_t rnti, uint8_t lcId) |
|
403 |
{ |
|
404 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
405 |
Ptr<UeInfo> ueInfo = GetUeInfo (rnti); |
|
406 |
ueInfo->RemoveRadioBearer (lcId); |
|
407 |
} |
|
408 |
||
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
409 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
410 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
411 |
bool |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
412 |
LteEnbRrc::Send (Ptr<Packet> packet) |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
413 |
{ |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
414 |
NS_LOG_FUNCTION (this << packet); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
415 |
|
8462
cf6a48994db5
renamed LteMacTag --> LteRadioBearerTag
Nicola Baldo <nbaldo@cttc.es>
parents:
8390
diff
changeset
|
416 |
LteRadioBearerTag tag; |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
417 |
bool found = packet->RemovePacketTag (tag); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
418 |
NS_ASSERT (found); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
419 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
420 |
LtePdcpSapProvider::TransmitRrcPduParameters params; |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
421 |
params.rrcPdu = packet; |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
422 |
params.rnti = tag.GetRnti (); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
423 |
params.lcid = tag.GetLcid (); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
424 |
LtePdcpSapProvider* pdcpSapProvider = GetLtePdcpSapProvider (tag.GetRnti (), tag.GetLcid ()); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
425 |
pdcpSapProvider->TransmitRrcPdu (params); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
426 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
427 |
return true; |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
428 |
} |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
429 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
430 |
void |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
431 |
LteEnbRrc::SetForwardUpCallback (Callback <void, Ptr<Packet> > cb) |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
432 |
{ |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
433 |
m_forwardUpCallback = cb; |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
434 |
} |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
435 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
436 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
437 |
void |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
438 |
LteEnbRrc::DoReceiveRrcPdu (LtePdcpSapUser::ReceiveRrcPduParameters params) |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
439 |
{ |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
440 |
NS_LOG_FUNCTION (this); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
441 |
// this tag is needed by the EpcEnbApplication to determine the S1 bearer that corresponds to this radio bearer |
8462
cf6a48994db5
renamed LteMacTag --> LteRadioBearerTag
Nicola Baldo <nbaldo@cttc.es>
parents:
8390
diff
changeset
|
442 |
LteRadioBearerTag tag; |
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
443 |
tag.SetRnti (params.rnti); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
444 |
tag.SetLcid (params.lcid); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
445 |
params.rrcPdu->AddPacketTag (tag); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
446 |
m_forwardUpCallback (params.rrcPdu); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
447 |
} |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
448 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
449 |
|
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
450 |
|
7886 | 451 |
void |
452 |
LteEnbRrc::DoNotifyLcConfigResult (uint16_t rnti, uint8_t lcid, bool success) |
|
453 |
{ |
|
454 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
455 |
NS_FATAL_ERROR ("not implemented"); |
|
456 |
} |
|
457 |
||
458 |
||
459 |
||
460 |
// ///////////////////////////////////////// |
|
461 |
// management of multiple UE info instances |
|
462 |
// ///////////////////////////////////////// |
|
463 |
||
464 |
||
465 |
uint16_t |
|
8007 | 466 |
LteEnbRrc::CreateUeInfo (uint64_t imsi) |
7886 | 467 |
{ |
8032 | 468 |
NS_LOG_FUNCTION (this << imsi); |
7886 | 469 |
for (uint16_t rnti = m_lastAllocatedRnti; rnti != m_lastAllocatedRnti - 1; ++rnti) |
470 |
{ |
|
471 |
if (rnti != 0) |
|
472 |
{ |
|
473 |
if (m_ueMap.find (rnti) == m_ueMap.end ()) |
|
474 |
{ |
|
475 |
m_lastAllocatedRnti = rnti; |
|
8007 | 476 |
m_ueMap.insert (std::pair<uint16_t, Ptr<UeInfo> > (rnti, CreateObject<UeInfo> (imsi))); |
7886 | 477 |
return rnti; |
478 |
} |
|
479 |
} |
|
480 |
} |
|
481 |
return 0; |
|
482 |
} |
|
483 |
||
484 |
Ptr<UeInfo> |
|
485 |
LteEnbRrc::GetUeInfo (uint16_t rnti) |
|
486 |
{ |
|
487 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
488 |
NS_ASSERT (0 != rnti); |
|
8389
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
489 |
std::map<uint16_t, Ptr<UeInfo> >::iterator it = m_ueMap.find (rnti); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
490 |
NS_ABORT_IF (it == m_ueMap.end ()); |
cb215987eb77
LTE-EPC end-to-end data plane imlemented and partially working
Nicola Baldo <nbaldo@cttc.es>
parents:
8156
diff
changeset
|
491 |
return it->second; |
7886 | 492 |
} |
493 |
||
494 |
void |
|
495 |
LteEnbRrc::RemoveUeInfo (uint16_t rnti) |
|
496 |
{ |
|
497 |
NS_LOG_FUNCTION (this << (uint32_t) rnti); |
|
498 |
std::map <uint16_t, Ptr<UeInfo> >::iterator it = m_ueMap.find (rnti); |
|
499 |
NS_ASSERT_MSG (it != m_ueMap.end (), "request to remove UE info with unknown rnti " << rnti); |
|
500 |
m_ueMap.erase (it); |
|
501 |
} |
|
502 |
||
503 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
504 |
void |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
505 |
LteEnbRrc::DoRrcConfigurationUpdateInd (LteUeConfig_t params) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
506 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
507 |
NS_LOG_FUNCTION (this); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
508 |
// up tp now only for TxMode change |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
509 |
// update the peer UE-RRC on the change |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
510 |
NodeList::Iterator listEnd = NodeList::End (); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
511 |
bool done = false; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
512 |
for (NodeList::Iterator i = NodeList::Begin (); i != listEnd; i++) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
513 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
514 |
Ptr<Node> node = *i; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
515 |
int nDevs = node->GetNDevices (); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
516 |
for (int j = 0; j < nDevs; j++) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
517 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
518 |
Ptr<LteUeNetDevice> uedev = node->GetDevice (j)->GetObject <LteUeNetDevice> (); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
519 |
if (!uedev) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
520 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
521 |
continue; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
522 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
523 |
else |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
524 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
525 |
Ptr<LteUeRrc> ueRrc = uedev->GetRrc (); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
526 |
if (ueRrc->GetRnti () == params.m_rnti) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
527 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
528 |
ueRrc->DoRrcConfigurationUpdateInd (params); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
529 |
done = true; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
530 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
531 |
else |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
532 |
{ |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
533 |
continue; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
534 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
535 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
536 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
537 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
538 |
NS_ASSERT_MSG (done , " Unable to find peer UE-RRC, RNTI " << params.m_rnti); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
539 |
// answer to MAC (and scheduler) |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
540 |
FfMacCschedSapProvider::CschedUeConfigReqParameters req; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
541 |
req.m_rnti = params.m_rnti; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
542 |
req.m_transmissionMode = params.m_transmissionMode; |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
543 |
m_cmacSapProvider->RrcUpdateConfigurationReq (req); |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
544 |
|
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
545 |
} |
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
546 |
|
7886 | 547 |
|
548 |
||
549 |
||
550 |
} // namespace ns3 |
|
551 |