author | Manuel Requena <manuel.requena@cttc.es> |
Tue, 26 Mar 2013 10:41:49 +0100 | |
changeset 10019 | 6efd95740e39 |
parent 9632 | 09dac25f1230 |
child 9870 | 6543f3876ff5 |
child 10024 | 07b1d791701f |
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> |
|
19 |
* Author: Marco Miozzo <mmiozzo@cttc.es> |
|
20 |
*/ |
|
21 |
||
22 |
||
23 |
||
24 |
#include <ns3/log.h> |
|
25 |
#include <ns3/pointer.h> |
|
26 |
#include <ns3/packet.h> |
|
27 |
#include <ns3/packet-burst.h> |
|
9414 | 28 |
#include <ns3/random-variable.h> |
7886 | 29 |
|
30 |
#include "lte-ue-mac.h" |
|
7887 | 31 |
#include "lte-ue-net-device.h" |
8462
cf6a48994db5
renamed LteMacTag --> LteRadioBearerTag
Nicola Baldo <nbaldo@cttc.es>
parents:
8436
diff
changeset
|
32 |
#include "lte-radio-bearer-tag.h" |
7886 | 33 |
#include <ns3/ff-mac-common.h> |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
34 |
#include <ns3/lte-control-messages.h> |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
35 |
#include <ns3/simulator.h> |
8435
6b0542a91970
Transmission queue head-of-line delay and queue size at MAC Scheduler
mmiozzo
parents:
8416
diff
changeset
|
36 |
#include <ns3/lte-common.h> |
7886 | 37 |
|
38 |
||
9414 | 39 |
|
7886 | 40 |
NS_LOG_COMPONENT_DEFINE ("LteUeMac"); |
41 |
||
42 |
namespace ns3 { |
|
43 |
||
44 |
NS_OBJECT_ENSURE_REGISTERED (LteUeMac); |
|
45 |
||
46 |
||
8436
c5b3b5ba81be
Remove BufferSizeLevelBsr table in LteUeMac, moved to lte-common
mmiozzo
parents:
8435
diff
changeset
|
47 |
/////////////////////////////////////////////////////////// |
7886 | 48 |
// SAP forwarders |
49 |
/////////////////////////////////////////////////////////// |
|
50 |
||
51 |
||
52 |
class UeMemberLteUeCmacSapProvider : public LteUeCmacSapProvider |
|
53 |
{ |
|
54 |
public: |
|
55 |
UeMemberLteUeCmacSapProvider (LteUeMac* mac); |
|
56 |
||
57 |
// inherited from LteUeCmacSapProvider |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
58 |
virtual void ConfigureRach (RachConfig rc); |
9406 | 59 |
virtual void StartContentionBasedRandomAccessProcedure (); |
60 |
virtual void StartNonContentionBasedRandomAccessProcedure (uint16_t rnti, uint8_t preambleId, uint8_t prachMask); |
|
61 |
virtual void AddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu); |
|
7886 | 62 |
virtual void RemoveLc (uint8_t lcId); |
9406 | 63 |
virtual void Reset (); |
7886 | 64 |
|
65 |
private: |
|
66 |
LteUeMac* m_mac; |
|
67 |
}; |
|
68 |
||
69 |
||
70 |
UeMemberLteUeCmacSapProvider::UeMemberLteUeCmacSapProvider (LteUeMac* mac) |
|
71 |
: m_mac (mac) |
|
72 |
{ |
|
73 |
} |
|
74 |
||
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
75 |
void |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
76 |
UeMemberLteUeCmacSapProvider::ConfigureRach (RachConfig rc) |
7886 | 77 |
{ |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
78 |
m_mac->DoConfigureRach (rc); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
79 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
80 |
|
9406 | 81 |
void |
82 |
UeMemberLteUeCmacSapProvider::StartContentionBasedRandomAccessProcedure () |
|
7886 | 83 |
{ |
9406 | 84 |
m_mac->DoStartContentionBasedRandomAccessProcedure (); |
7886 | 85 |
} |
86 |
||
9406 | 87 |
void |
88 |
UeMemberLteUeCmacSapProvider::StartNonContentionBasedRandomAccessProcedure (uint16_t rnti, uint8_t preambleId, uint8_t prachMask) |
|
89 |
{ |
|
90 |
m_mac->DoStartNonContentionBasedRandomAccessProcedure (rnti, preambleId, prachMask); |
|
91 |
} |
|
92 |
||
93 |
||
7886 | 94 |
void |
9406 | 95 |
UeMemberLteUeCmacSapProvider::AddLc (uint8_t lcId, LogicalChannelConfig lcConfig, LteMacSapUser* msu) |
7886 | 96 |
{ |
9406 | 97 |
m_mac->DoAddLc (lcId, lcConfig, msu); |
7886 | 98 |
} |
99 |
||
100 |
void |
|
101 |
UeMemberLteUeCmacSapProvider::RemoveLc (uint8_t lcid) |
|
102 |
{ |
|
103 |
m_mac->DoRemoveLc (lcid); |
|
104 |
} |
|
105 |
||
9406 | 106 |
void |
107 |
UeMemberLteUeCmacSapProvider::Reset () |
|
108 |
{ |
|
109 |
m_mac->DoReset (); |
|
110 |
} |
|
111 |
||
7886 | 112 |
class UeMemberLteMacSapProvider : public LteMacSapProvider |
113 |
{ |
|
114 |
public: |
|
115 |
UeMemberLteMacSapProvider (LteUeMac* mac); |
|
116 |
||
117 |
// inherited from LteMacSapProvider |
|
118 |
virtual void TransmitPdu (TransmitPduParameters params); |
|
119 |
virtual void ReportBufferStatus (ReportBufferStatusParameters params); |
|
120 |
||
121 |
private: |
|
122 |
LteUeMac* m_mac; |
|
123 |
}; |
|
124 |
||
125 |
||
126 |
UeMemberLteMacSapProvider::UeMemberLteMacSapProvider (LteUeMac* mac) |
|
127 |
: m_mac (mac) |
|
128 |
{ |
|
129 |
} |
|
130 |
||
131 |
void |
|
132 |
UeMemberLteMacSapProvider::TransmitPdu (TransmitPduParameters params) |
|
133 |
{ |
|
134 |
m_mac->DoTransmitPdu (params); |
|
135 |
} |
|
136 |
||
137 |
||
138 |
void |
|
139 |
UeMemberLteMacSapProvider::ReportBufferStatus (ReportBufferStatusParameters params) |
|
140 |
{ |
|
141 |
m_mac->DoReportBufferStatus (params); |
|
142 |
} |
|
143 |
||
144 |
||
145 |
||
146 |
||
7887 | 147 |
class UeMemberLteUePhySapUser : public LteUePhySapUser |
7886 | 148 |
{ |
149 |
public: |
|
7887 | 150 |
UeMemberLteUePhySapUser (LteUeMac* mac); |
7886 | 151 |
|
152 |
// inherited from LtePhySapUser |
|
153 |
virtual void ReceivePhyPdu (Ptr<Packet> p); |
|
154 |
virtual void SubframeIndication (uint32_t frameNo, uint32_t subframeNo); |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
155 |
virtual void ReceiveLteControlMessage (Ptr<LteControlMessage> msg); |
7886 | 156 |
|
157 |
private: |
|
158 |
LteUeMac* m_mac; |
|
159 |
}; |
|
160 |
||
7887 | 161 |
UeMemberLteUePhySapUser::UeMemberLteUePhySapUser (LteUeMac* mac) : m_mac (mac) |
7886 | 162 |
{ |
163 |
||
164 |
} |
|
165 |
||
166 |
void |
|
7887 | 167 |
UeMemberLteUePhySapUser::ReceivePhyPdu (Ptr<Packet> p) |
7886 | 168 |
{ |
169 |
m_mac->DoReceivePhyPdu (p); |
|
170 |
} |
|
171 |
||
172 |
||
173 |
void |
|
7887 | 174 |
UeMemberLteUePhySapUser::SubframeIndication (uint32_t frameNo, uint32_t subframeNo) |
7886 | 175 |
{ |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
176 |
m_mac->DoSubframeIndication (frameNo, subframeNo); |
7886 | 177 |
} |
178 |
||
179 |
void |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
180 |
UeMemberLteUePhySapUser::ReceiveLteControlMessage (Ptr<LteControlMessage> msg) |
7886 | 181 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
182 |
m_mac->DoReceiveLteControlMessage (msg); |
7886 | 183 |
} |
184 |
||
185 |
||
186 |
||
187 |
||
188 |
////////////////////////////////////////////////////////// |
|
189 |
// LteUeMac methods |
|
190 |
/////////////////////////////////////////////////////////// |
|
191 |
||
192 |
||
193 |
TypeId |
|
194 |
LteUeMac::GetTypeId (void) |
|
195 |
{ |
|
196 |
static TypeId tid = TypeId ("ns3::LteUeMac") |
|
197 |
.SetParent<Object> () |
|
198 |
.AddConstructor<LteUeMac> (); |
|
199 |
return tid; |
|
200 |
} |
|
201 |
||
202 |
||
203 |
LteUeMac::LteUeMac () |
|
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
204 |
: m_bsrPeriodicity (MilliSeconds (1)), // ideal behavior |
9406 | 205 |
m_bsrLast (MilliSeconds (0)), |
206 |
m_freshUlBsr (false), |
|
9414 | 207 |
m_harqProcessId (0), |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
208 |
m_rnti (0), |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
209 |
m_rachConfigured (false), |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
210 |
m_waitingForRaResponse (false) |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
211 |
|
7886 | 212 |
{ |
7920
dd522ac64b64
added more logging to LteUeMac
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
213 |
NS_LOG_FUNCTION (this); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
214 |
m_miUlHarqProcessesPacket.resize (HARQ_PERIOD); |
9535
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
215 |
for (uint8_t i = 0; i < m_miUlHarqProcessesPacket.size (); i++) |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
216 |
{ |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
217 |
Ptr<PacketBurst> pb = CreateObject <PacketBurst> (); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
218 |
m_miUlHarqProcessesPacket.at (i) = pb; |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
219 |
} |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
220 |
m_miUlHarqProcessesPacketTimer.resize (HARQ_PERIOD, 0); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
221 |
|
7886 | 222 |
m_macSapProvider = new UeMemberLteMacSapProvider (this); |
223 |
m_cmacSapProvider = new UeMemberLteUeCmacSapProvider (this); |
|
7887 | 224 |
m_uePhySapUser = new UeMemberLteUePhySapUser (this); |
9414 | 225 |
m_raPreambleUniformVariable = CreateObject<UniformRandomVariable> (); |
7886 | 226 |
} |
227 |
||
228 |
||
229 |
LteUeMac::~LteUeMac () |
|
230 |
{ |
|
7920
dd522ac64b64
added more logging to LteUeMac
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
231 |
NS_LOG_FUNCTION (this); |
7886 | 232 |
} |
233 |
||
234 |
void |
|
235 |
LteUeMac::DoDispose () |
|
236 |
{ |
|
7920
dd522ac64b64
added more logging to LteUeMac
Nicola Baldo <nbaldo@cttc.es>
parents:
7887
diff
changeset
|
237 |
NS_LOG_FUNCTION (this); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
238 |
m_miUlHarqProcessesPacket.clear (); |
7886 | 239 |
delete m_macSapProvider; |
240 |
delete m_cmacSapProvider; |
|
7930
ccb40542ae88
fixed memory leak in PHY SAP usage
Nicola Baldo <nbaldo@cttc.es>
parents:
7920
diff
changeset
|
241 |
delete m_uePhySapUser; |
7886 | 242 |
Object::DoDispose (); |
243 |
} |
|
244 |
||
245 |
||
246 |
LteUePhySapUser* |
|
247 |
LteUeMac::GetLteUePhySapUser (void) |
|
248 |
{ |
|
249 |
return m_uePhySapUser; |
|
250 |
} |
|
251 |
||
252 |
void |
|
253 |
LteUeMac::SetLteUePhySapProvider (LteUePhySapProvider* s) |
|
254 |
{ |
|
255 |
m_uePhySapProvider = s; |
|
256 |
} |
|
257 |
||
258 |
||
259 |
LteMacSapProvider* |
|
260 |
LteUeMac::GetLteMacSapProvider (void) |
|
261 |
{ |
|
262 |
return m_macSapProvider; |
|
263 |
} |
|
264 |
||
265 |
void |
|
266 |
LteUeMac::SetLteUeCmacSapUser (LteUeCmacSapUser* s) |
|
267 |
{ |
|
268 |
m_cmacSapUser = s; |
|
269 |
} |
|
270 |
||
271 |
LteUeCmacSapProvider* |
|
272 |
LteUeMac::GetLteUeCmacSapProvider (void) |
|
273 |
{ |
|
274 |
return m_cmacSapProvider; |
|
275 |
} |
|
276 |
||
277 |
||
278 |
void |
|
279 |
LteUeMac::DoTransmitPdu (LteMacSapProvider::TransmitPduParameters params) |
|
280 |
{ |
|
281 |
NS_LOG_FUNCTION (this); |
|
282 |
NS_ASSERT_MSG (m_rnti == params.rnti, "RNTI mismatch between RLC and MAC"); |
|
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8496
diff
changeset
|
283 |
LteRadioBearerTag tag (params.rnti, params.lcid, 0 /* UE works in SISO mode*/); |
7886 | 284 |
params.pdu->AddPacketTag (tag); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
285 |
// store pdu in HARQ buffer |
9535
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
286 |
m_miUlHarqProcessesPacket.at (m_harqProcessId)->AddPacket (params.pdu); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
287 |
m_miUlHarqProcessesPacketTimer.at (m_harqProcessId) = HARQ_PERIOD; |
7886 | 288 |
m_uePhySapProvider->SendMacPdu (params.pdu); |
289 |
} |
|
290 |
||
291 |
void |
|
292 |
LteUeMac::DoReportBufferStatus (LteMacSapProvider::ReportBufferStatusParameters params) |
|
293 |
{ |
|
9475
fd37f7e77d9e
reestablish DRBs at UE upon handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9473
diff
changeset
|
294 |
NS_LOG_FUNCTION (this << (uint32_t) params.lcid); |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
295 |
|
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
296 |
std::map <uint8_t, LteMacSapProvider::ReportBufferStatusParameters>::iterator it; |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
297 |
|
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
298 |
|
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
299 |
it = m_ulBsrReceived.find (params.lcid); |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
300 |
if (it!=m_ulBsrReceived.end ()) |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
301 |
{ |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
302 |
// update entry |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
303 |
(*it).second = params; |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
304 |
} |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
305 |
else |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
306 |
{ |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
307 |
m_ulBsrReceived.insert (std::pair<uint8_t, LteMacSapProvider::ReportBufferStatusParameters> (params.lcid, params)); |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
308 |
} |
8496
8d1759a15c2e
Update LteUeMac for sending BSR only when new BSR are received from RLC
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
309 |
m_freshUlBsr = true; |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
310 |
} |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
311 |
|
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
312 |
|
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
313 |
void |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
314 |
LteUeMac::SendReportBufferStatus (void) |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
315 |
{ |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
316 |
NS_LOG_FUNCTION (this); |
9406 | 317 |
|
318 |
if (m_rnti == 0) |
|
319 |
{ |
|
320 |
NS_LOG_INFO ("MAC not initialized, BSR deferred"); |
|
321 |
return; |
|
322 |
} |
|
323 |
||
8496
8d1759a15c2e
Update LteUeMac for sending BSR only when new BSR are received from RLC
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
324 |
if (m_ulBsrReceived.size () == 0) |
8d1759a15c2e
Update LteUeMac for sending BSR only when new BSR are received from RLC
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
325 |
{ |
9406 | 326 |
NS_LOG_INFO ("No BSR report to transmit"); |
327 |
return; |
|
8496
8d1759a15c2e
Update LteUeMac for sending BSR only when new BSR are received from RLC
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
328 |
} |
7886 | 329 |
MacCeListElement_s bsr; |
330 |
bsr.m_rnti = m_rnti; |
|
331 |
bsr.m_macCeType = MacCeListElement_s::BSR; |
|
8887
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8763
diff
changeset
|
332 |
|
9406 | 333 |
// BSR is reported for each LCG |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
334 |
std::map <uint8_t, LteMacSapProvider::ReportBufferStatusParameters>::iterator it; |
9406 | 335 |
std::vector<uint32_t> queue (4, 0); // one value per each of the 4 LCGs, initialized to 0 |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
336 |
for (it = m_ulBsrReceived.begin (); it != m_ulBsrReceived.end (); it++) |
7886 | 337 |
{ |
9406 | 338 |
uint8_t lcid = it->first; |
339 |
std::map <uint8_t, LcInfo>::iterator lcInfoMapIt; |
|
340 |
lcInfoMapIt = m_lcInfoMap.find (lcid); |
|
341 |
NS_ASSERT (lcInfoMapIt != m_lcInfoMap.end ()); |
|
342 |
uint8_t lcg = lcInfoMapIt->second.lcConfig.logicalChannelGroup; |
|
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
343 |
queue.at (lcg) += ((*it).second.txQueueSize + (*it).second.retxQueueSize + (*it).second.statusPduSize); |
7886 | 344 |
} |
9406 | 345 |
|
8887
90cbd09c8ff6
fixed bug with multiple LCs in UL BSR
Nicola Baldo <nbaldo@cttc.es>
parents:
8763
diff
changeset
|
346 |
// FF API says that all 4 LCGs are always present |
9406 | 347 |
bsr.m_macCeValue.m_bufferStatus.push_back (BufferSizeLevelBsr::BufferSize2BsrId (queue.at (0))); |
348 |
bsr.m_macCeValue.m_bufferStatus.push_back (BufferSizeLevelBsr::BufferSize2BsrId (queue.at (1))); |
|
349 |
bsr.m_macCeValue.m_bufferStatus.push_back (BufferSizeLevelBsr::BufferSize2BsrId (queue.at (2))); |
|
350 |
bsr.m_macCeValue.m_bufferStatus.push_back (BufferSizeLevelBsr::BufferSize2BsrId (queue.at (3))); |
|
7886 | 351 |
|
352 |
// create the feedback to eNB |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
353 |
Ptr<BsrLteControlMessage> msg = Create<BsrLteControlMessage> (); |
7886 | 354 |
msg->SetBsr (bsr); |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
355 |
m_uePhySapProvider->SendLteControlMessage (msg); |
7886 | 356 |
|
357 |
} |
|
358 |
||
9406 | 359 |
void |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
360 |
LteUeMac::RandomlySelectAndSendRaPreamble () |
9406 | 361 |
{ |
362 |
NS_LOG_FUNCTION (this); |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
363 |
// 3GPP 36.321 5.1.1 |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
364 |
NS_ASSERT_MSG (m_rachConfigured, "RACH not configured"); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
365 |
// assume that there is no Random Access Preambles group B |
9414 | 366 |
m_raPreambleId = m_raPreambleUniformVariable->GetInteger (0, m_rachConfig.numberOfRaPreambles - 1); |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
367 |
bool contention = true; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
368 |
SendRaPreamble (contention); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
369 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
370 |
|
7886 | 371 |
void |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
372 |
LteUeMac::SendRaPreamble (bool contention) |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
373 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
374 |
NS_LOG_FUNCTION (this << (uint32_t) m_raPreambleId << contention); |
9406 | 375 |
// Since regular UL LteControlMessages need m_ulConfigured = true in |
376 |
// order to be sent by the UE, the rach preamble needs to be sent |
|
377 |
// with a dedicated primitive (not |
|
378 |
// m_uePhySapProvider->SendLteControlMessage (msg)) so that it can |
|
379 |
// bypass the m_ulConfigured flag. This is reasonable, since In fact |
|
380 |
// the RACH preamble is sent on 6RB bandwidth so the uplink |
|
381 |
// bandwidth does not need to be configured. |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
382 |
NS_ASSERT (m_subframeNo > 0); // sanity check for subframe starting at 1 |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
383 |
m_raRnti = m_subframeNo - 1; |
9460
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
384 |
m_uePhySapProvider->SendRachPreamble (m_raPreambleId, m_raRnti); |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
385 |
NS_LOG_INFO (this << " sent preamble id " << (uint32_t) m_raPreambleId << ", RA-RNTI " << (uint32_t) m_raRnti); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
386 |
// 3GPP 36.321 5.1.4 |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
387 |
Time raWindowBegin = MilliSeconds (3); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
388 |
Time raWindowEnd = MilliSeconds (3 + m_rachConfig.raResponseWindowSize); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
389 |
Simulator::Schedule (raWindowBegin, &LteUeMac::StartWaitingForRaResponse, this); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
390 |
m_noRaResponseReceivedEvent = Simulator::Schedule (raWindowEnd, &LteUeMac::RaResponseTimeout, this, contention); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
391 |
} |
9406 | 392 |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
393 |
void |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
394 |
LteUeMac::StartWaitingForRaResponse () |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
395 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
396 |
NS_LOG_FUNCTION (this); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
397 |
m_waitingForRaResponse = true; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
398 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
399 |
|
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
400 |
void |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
401 |
LteUeMac::RecvRaResponse (BuildRarListElement_s raResponse) |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
402 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
403 |
NS_LOG_FUNCTION (this); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
404 |
m_waitingForRaResponse = false; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
405 |
m_noRaResponseReceivedEvent.Cancel (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
406 |
NS_LOG_INFO ("got RAR for RAPID " << (uint32_t) m_raPreambleId << ", setting T-C-RNTI = " << raResponse.m_rnti); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
407 |
m_rnti = raResponse.m_rnti; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
408 |
m_cmacSapUser->SetTemporaryCellRnti (m_rnti); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
409 |
// in principle we should wait for contention resolution, |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
410 |
// but in the current LTE model when two or more identical |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
411 |
// preambles are sent no one is received, so there is no need |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
412 |
// for contention resolution |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
413 |
m_cmacSapUser->NotifyRandomAccessSuccessful (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
414 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
415 |
|
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
416 |
void |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
417 |
LteUeMac::RaResponseTimeout (bool contention) |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
418 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
419 |
NS_LOG_FUNCTION (this << contention); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
420 |
m_waitingForRaResponse = false; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
421 |
// 3GPP 36.321 5.1.4 |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
422 |
++m_preambleTransmissionCounter; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
423 |
if (m_preambleTransmissionCounter == m_rachConfig.preambleTransMax + 1) |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
424 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
425 |
NS_LOG_INFO ("RAR timeout, preambleTransMax reached => giving up"); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
426 |
m_cmacSapUser->NotifyRandomAccessFailed (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
427 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
428 |
else |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
429 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
430 |
NS_LOG_INFO ("RAR timeout, re-send preamble"); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
431 |
if (contention) |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
432 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
433 |
RandomlySelectAndSendRaPreamble (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
434 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
435 |
else |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
436 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
437 |
SendRaPreamble (contention); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
438 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
439 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
440 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
441 |
|
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
442 |
void |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
443 |
LteUeMac::DoConfigureRach (LteUeCmacSapProvider::RachConfig rc) |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
444 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
445 |
NS_LOG_FUNCTION (this); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
446 |
m_rachConfig = rc; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
447 |
m_rachConfigured = true; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
448 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
449 |
|
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
450 |
void |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
451 |
LteUeMac::DoStartContentionBasedRandomAccessProcedure () |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
452 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
453 |
NS_LOG_FUNCTION (this); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
454 |
|
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
455 |
// 3GPP 36.321 5.1.1 |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
456 |
NS_ASSERT_MSG (m_rachConfigured, "RACH not configured"); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
457 |
m_preambleTransmissionCounter = 0; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
458 |
m_backoffParameter = 0; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
459 |
RandomlySelectAndSendRaPreamble (); |
9406 | 460 |
} |
461 |
||
462 |
void |
|
463 |
LteUeMac::DoStartNonContentionBasedRandomAccessProcedure (uint16_t rnti, uint8_t preambleId, uint8_t prachMask) |
|
7886 | 464 |
{ |
465 |
NS_LOG_FUNCTION (this << " rnti" << rnti); |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
466 |
NS_ASSERT_MSG (prachMask == 0, "requested PRACH MASK = " << (uint32_t) prachMask << ", but only PRACH MASK = 0 is supported"); |
7886 | 467 |
m_rnti = rnti; |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
468 |
m_raPreambleId = preambleId; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
469 |
bool contention = false; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
470 |
SendRaPreamble (contention); |
7886 | 471 |
} |
472 |
||
473 |
void |
|
9406 | 474 |
LteUeMac::DoAddLc (uint8_t lcId, LteUeCmacSapProvider::LogicalChannelConfig lcConfig, LteMacSapUser* msu) |
7886 | 475 |
{ |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
476 |
NS_LOG_FUNCTION (this << " lcId" << (uint32_t) lcId); |
9406 | 477 |
NS_ASSERT_MSG (m_lcInfoMap.find (lcId) == m_lcInfoMap.end (), "cannot add channel because LCID " << lcId << " is already present"); |
478 |
||
479 |
LcInfo lcInfo; |
|
480 |
lcInfo.lcConfig = lcConfig; |
|
481 |
lcInfo.macSapUser = msu; |
|
482 |
m_lcInfoMap[lcId] = lcInfo; |
|
7886 | 483 |
} |
484 |
||
485 |
void |
|
486 |
LteUeMac::DoRemoveLc (uint8_t lcId) |
|
487 |
{ |
|
488 |
NS_LOG_FUNCTION (this << " lcId" << lcId); |
|
9406 | 489 |
NS_ASSERT_MSG (m_lcInfoMap.find (lcId) == m_lcInfoMap.end (), "could not find LCID " << lcId); |
490 |
m_lcInfoMap.erase (lcId); |
|
491 |
} |
|
492 |
||
493 |
void |
|
494 |
LteUeMac::DoReset () |
|
495 |
{ |
|
496 |
NS_LOG_FUNCTION (this); |
|
497 |
std::map <uint8_t, LcInfo>::iterator it = m_lcInfoMap.begin (); |
|
498 |
while (it != m_lcInfoMap.end ()) |
|
499 |
{ |
|
500 |
// don't delete CCCH) |
|
501 |
if (it->first == 0) |
|
502 |
{ |
|
503 |
++it; |
|
504 |
} |
|
505 |
else |
|
506 |
{ |
|
507 |
// note: use of postfix operator preserves validity of iterator |
|
508 |
m_lcInfoMap.erase (it++); |
|
509 |
} |
|
510 |
} |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
511 |
m_rachConfigured = false; |
9473
8b420bd32318
reset MAC and reinitialize SRBs upon handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9460
diff
changeset
|
512 |
m_freshUlBsr = false; |
8b420bd32318
reset MAC and reinitialize SRBs upon handover
Nicola Baldo <nbaldo@cttc.es>
parents:
9460
diff
changeset
|
513 |
m_ulBsrReceived.clear (); |
7886 | 514 |
} |
515 |
||
8714
398bbcbb3f42
Add MIMO model, test and documentation
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8496
diff
changeset
|
516 |
void |
7886 | 517 |
LteUeMac::DoReceivePhyPdu (Ptr<Packet> p) |
518 |
{ |
|
8462
cf6a48994db5
renamed LteMacTag --> LteRadioBearerTag
Nicola Baldo <nbaldo@cttc.es>
parents:
8436
diff
changeset
|
519 |
LteRadioBearerTag tag; |
7886 | 520 |
p->RemovePacketTag (tag); |
521 |
if (tag.GetRnti () == m_rnti) |
|
522 |
{ |
|
523 |
// packet is for the current user |
|
9406 | 524 |
std::map <uint8_t, LcInfo>::const_iterator it = m_lcInfoMap.find (tag.GetLcid ()); |
525 |
NS_ASSERT_MSG (it != m_lcInfoMap.end (), "received packet with unknown lcid"); |
|
526 |
it->second.macSapUser->ReceivePdu (p); |
|
7886 | 527 |
} |
528 |
} |
|
529 |
||
530 |
||
531 |
void |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
532 |
LteUeMac::DoReceiveLteControlMessage (Ptr<LteControlMessage> msg) |
7886 | 533 |
{ |
534 |
NS_LOG_FUNCTION (this); |
|
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
535 |
if (msg->GetMessageType () == LteControlMessage::UL_DCI) |
7886 | 536 |
{ |
9035
e40974228d94
Update Phy Layer for managing different frames for different set of channels (data vs. ctrl and srs)
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8763
diff
changeset
|
537 |
Ptr<UlDciLteControlMessage> msg2 = DynamicCast<UlDciLteControlMessage> (msg); |
7886 | 538 |
UlDciListElement_s dci = msg2->GetDci (); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
539 |
if (dci.m_ndi==1) |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
540 |
{ |
9632
09dac25f1230
Introduced forced HARQ pkt buffer emtying in UL for inhibiting PDUs duplication when harq feedback has been lost for channel errors
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9624
diff
changeset
|
541 |
// New transmission -> emtpy pkt buffer queue (for deleting eventual pkts not acked ) |
09dac25f1230
Introduced forced HARQ pkt buffer emtying in UL for inhibiting PDUs duplication when harq feedback has been lost for channel errors
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9624
diff
changeset
|
542 |
Ptr<PacketBurst> pb = CreateObject <PacketBurst> (); |
09dac25f1230
Introduced forced HARQ pkt buffer emtying in UL for inhibiting PDUs duplication when harq feedback has been lost for channel errors
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9624
diff
changeset
|
543 |
m_miUlHarqProcessesPacket.at (m_harqProcessId) = pb; |
09dac25f1230
Introduced forced HARQ pkt buffer emtying in UL for inhibiting PDUs duplication when harq feedback has been lost for channel errors
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9624
diff
changeset
|
544 |
// Retrieve data from RLC |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
545 |
std::map <uint8_t, LteMacSapProvider::ReportBufferStatusParameters>::iterator itBsr; |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
546 |
uint16_t activeLcs = 0; |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
547 |
uint32_t statusPduMinSize = 0; |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
548 |
for (itBsr = m_ulBsrReceived.begin (); itBsr != m_ulBsrReceived.end (); itBsr++) |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
549 |
{ |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
550 |
if (((*itBsr).second.statusPduSize > 0) || ((*itBsr).second.retxQueueSize > 0) || ((*itBsr).second.txQueueSize > 0)) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
551 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
552 |
activeLcs++; |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
553 |
if (((*itBsr).second.statusPduSize!=0)&&((*itBsr).second.statusPduSize < statusPduMinSize)) |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
554 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
555 |
statusPduMinSize = (*itBsr).second.statusPduSize; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
556 |
} |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
557 |
if (((*itBsr).second.statusPduSize!=0)&&(statusPduMinSize == 0)) |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
558 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
559 |
statusPduMinSize = (*itBsr).second.statusPduSize; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
560 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
561 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
562 |
} |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
563 |
if (activeLcs == 0) |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
564 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
565 |
NS_LOG_ERROR (this << " No active flows for this UL-DCI"); |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
566 |
return; |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
567 |
} |
9414 | 568 |
std::map <uint8_t, LcInfo>::iterator it; |
569 |
uint32_t bytesPerActiveLc = dci.m_tbSize / activeLcs; |
|
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
570 |
bool statusPduPriority = false; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
571 |
if ((statusPduMinSize != 0)&&(bytesPerActiveLc < statusPduMinSize)) |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
572 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
573 |
// send only the status PDU which has highest priority |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
574 |
statusPduPriority = true; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
575 |
NS_LOG_DEBUG (this << " Reduced resource -> send only Status, b ytes " << statusPduMinSize); |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
576 |
if (dci.m_tbSize < statusPduMinSize) |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
577 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
578 |
NS_FATAL_ERROR ("Insufficient Tx Opportunity for sending a status message"); |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
579 |
} |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
580 |
} |
9624
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
581 |
NS_LOG_LOGIC (this << " UE " << m_rnti << ": UL-CQI notified TxOpportunity of " << dci.m_tbSize << " => " << bytesPerActiveLc << " bytes per active LC" << " statusPduMinSize " << statusPduMinSize); |
9414 | 582 |
for (it = m_lcInfoMap.begin (); it!=m_lcInfoMap.end (); it++) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
583 |
{ |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
584 |
itBsr = m_ulBsrReceived.find ((*it).first); |
9624
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
585 |
NS_LOG_DEBUG (this << " Processing LC " << (uint32_t)(*it).first << " bytesPerActiveLc " << bytesPerActiveLc); |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
586 |
if ( (itBsr!=m_ulBsrReceived.end ()) && |
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
587 |
( ((*itBsr).second.statusPduSize > 0) || |
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
588 |
((*itBsr).second.retxQueueSize > 0) || |
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
589 |
((*itBsr).second.txQueueSize > 0)) ) |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
590 |
{ |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
591 |
if ((statusPduPriority) && ((*itBsr).second.statusPduSize == statusPduMinSize)) |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
592 |
{ |
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
593 |
(*it).second.macSapUser->NotifyTxOpportunity ((*itBsr).second.statusPduSize, 0, 0); |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
594 |
NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << " send " << (*itBsr).second.statusPduSize << " status bytes to LC " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" << (*itBsr).second.txQueueSize); |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
595 |
(*itBsr).second.statusPduSize = 0; |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
596 |
break; |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
597 |
} |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
598 |
else |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
599 |
{ |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
600 |
uint32_t bytesForThisLc = bytesPerActiveLc; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
601 |
NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << " bytes to LC " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" << (*itBsr).second.txQueueSize); |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
602 |
if (((*itBsr).second.statusPduSize > 0) && (bytesForThisLc > (*itBsr).second.statusPduSize)) |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
603 |
{ |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
604 |
(*it).second.macSapUser->NotifyTxOpportunity ((*itBsr).second.statusPduSize, 0, 0); |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
605 |
bytesForThisLc -= (*itBsr).second.statusPduSize; |
9624
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
606 |
NS_LOG_DEBUG (this << " serve STATUS " << (*itBsr).second.statusPduSize); |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
607 |
(*itBsr).second.statusPduSize = 0; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
608 |
} |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
609 |
else |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
610 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
611 |
if ((*itBsr).second.statusPduSize>bytesForThisLc) |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
612 |
{ |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
613 |
NS_FATAL_ERROR ("Insufficient Tx Opportunity for sending a status message"); |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
614 |
} |
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
615 |
} |
9624
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
616 |
|
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
617 |
if ((bytesForThisLc > 7) && // 7 is the min TxOpportunity useful for Rlc |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
618 |
(((*itBsr).second.retxQueueSize > 0) || |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
619 |
((*itBsr).second.txQueueSize > 0))) |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
620 |
{ |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
621 |
if ((*itBsr).second.retxQueueSize > 0) |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
622 |
{ |
9624
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
623 |
NS_LOG_DEBUG (this << " serve retx DATA, bytes " << bytesForThisLc); |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
624 |
(*it).second.macSapUser->NotifyTxOpportunity (bytesForThisLc, 0, 0); |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
625 |
if ((*itBsr).second.retxQueueSize >= bytesForThisLc) |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
626 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
627 |
(*itBsr).second.retxQueueSize -= bytesForThisLc; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
628 |
} |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
629 |
else |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
630 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
631 |
(*itBsr).second.retxQueueSize = 0; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
632 |
} |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
633 |
} |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
634 |
else if ((*itBsr).second.txQueueSize > 0) |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
635 |
{ |
9624
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
636 |
NS_LOG_DEBUG (this << " serve tx DATA, bytes " << bytesForThisLc); |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
637 |
(*it).second.macSapUser->NotifyTxOpportunity (bytesForThisLc, 0, 0); |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
638 |
if ((*itBsr).second.txQueueSize >= bytesForThisLc - 2) |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
639 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
640 |
(*itBsr).second.txQueueSize -= bytesForThisLc - 2; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
641 |
} |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
642 |
else |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
643 |
{ |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
644 |
(*itBsr).second.txQueueSize = 0; |
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
645 |
} |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
646 |
} |
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
647 |
} |
9624
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
648 |
else |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
649 |
{ |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
650 |
if ( ((*itBsr).second.retxQueueSize > 0) || ((*itBsr).second.txQueueSize > 0)) |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
651 |
{ |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
652 |
// resend BSR info for updating eNB peer MAC |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
653 |
m_freshUlBsr = true; |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
654 |
} |
2a61baf2956c
Update LteUeMac scheduler for avoiding data blocks of less than 7 bytes according to RLC constraints
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9571
diff
changeset
|
655 |
} |
9571
2840bae9607f
Introduced high priority to status PDU trasmission in case of reduced resource at LteUeMac
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9536
diff
changeset
|
656 |
NS_LOG_LOGIC (this << "\t" << bytesPerActiveLc << "\t new queues " << (uint32_t)(*it).first << " statusQueue " << (*itBsr).second.statusPduSize << " retxQueue" << (*itBsr).second.retxQueueSize << " txQueue" << (*itBsr).second.txQueueSize); |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
657 |
} |
9505
77a16713540b
Split Tx Opportunities in LteUeMac for status, retx and tx buffers
mmiozzo
parents:
9475
diff
changeset
|
658 |
|
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
659 |
} |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
660 |
} |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
661 |
} |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
662 |
else |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
663 |
{ |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
664 |
// HARQ retransmission -> retrieve data from HARQ buffer |
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
665 |
NS_LOG_DEBUG (this << " UE MAC RETX HARQ " << (uint16_t)m_harqProcessId); |
9535
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
666 |
Ptr<PacketBurst> pb = m_miUlHarqProcessesPacket.at (m_harqProcessId); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
667 |
for (std::list<Ptr<Packet> >::const_iterator j = pb->Begin (); j != pb->End (); ++j) |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
668 |
{ |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
669 |
Ptr<Packet> pkt = (*j)->Copy (); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
670 |
m_uePhySapProvider->SendMacPdu (pkt); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
671 |
} |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
672 |
m_miUlHarqProcessesPacketTimer.at (m_harqProcessId) = HARQ_PERIOD; |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
673 |
} |
8148
09e2d03022a2
run check-style on src/lte/model
Nicola Baldo <nbaldo@cttc.es>
parents:
7930
diff
changeset
|
674 |
|
7886 | 675 |
} |
9406 | 676 |
else if (msg->GetMessageType () == LteControlMessage::RAR) |
677 |
{ |
|
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
678 |
if (m_waitingForRaResponse) |
9406 | 679 |
{ |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
680 |
Ptr<RarLteControlMessage> rarMsg = DynamicCast<RarLteControlMessage> (msg); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
681 |
uint16_t raRnti = rarMsg->GetRaRnti (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
682 |
NS_LOG_LOGIC (this << "got RAR with RA-RNTI " << (uint32_t) raRnti << ", expecting " << (uint32_t) m_raRnti); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
683 |
if (raRnti == m_raRnti) // RAR corresponds to TX subframe of preamble |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
684 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
685 |
for (std::list<RarLteControlMessage::Rar>::const_iterator it = rarMsg->RarListBegin (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
686 |
it != rarMsg->RarListEnd (); |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
687 |
++it) |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
688 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
689 |
if (it->rapId == m_raPreambleId) // RAR is for me |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
690 |
{ |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
691 |
RecvRaResponse (it->rarPayload); |
9460
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
692 |
// TODO:: RRC generates the RecvRaResponse messaged |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
693 |
// for avoiding holes in transmission at PHY layer |
0674e66ee483
Introduces RACH procedures in the schedulers and UL grant at PHY layer
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9414
diff
changeset
|
694 |
// (which produce erroneous UL CQI evaluation) |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
695 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
696 |
} |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
697 |
} |
9406 | 698 |
} |
699 |
} |
|
7886 | 700 |
else |
701 |
{ |
|
9406 | 702 |
NS_LOG_WARN (this << " LteControlMessage not recognized"); |
7886 | 703 |
} |
704 |
} |
|
705 |
||
9535
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
706 |
void |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
707 |
LteUeMac::RefreshHarqProcessesPacketBuffer (void) |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
708 |
{ |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
709 |
NS_LOG_FUNCTION (this); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
710 |
|
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
711 |
for (uint16_t i = 0; i < m_miUlHarqProcessesPacketTimer.size (); i++) |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
712 |
{ |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
713 |
if (m_miUlHarqProcessesPacketTimer.at (i) == 0) |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
714 |
{ |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
715 |
if (m_miUlHarqProcessesPacket.at (i)->GetSize () > 0) |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
716 |
{ |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
717 |
// timer expired: drop packets in buffer for this process |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
718 |
NS_LOG_INFO (this << " HARQ Proc Id " << i << " packets buffer expired"); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
719 |
Ptr<PacketBurst> emptyPb = CreateObject <PacketBurst> (); |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
720 |
m_miUlHarqProcessesPacket.at (i) = emptyPb; |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
721 |
} |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
722 |
} |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
723 |
else |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
724 |
{ |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
725 |
m_miUlHarqProcessesPacketTimer.at (i)--; |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
726 |
} |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
727 |
} |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
728 |
} |
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
729 |
|
7886 | 730 |
|
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
731 |
void |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
732 |
LteUeMac::DoSubframeIndication (uint32_t frameNo, uint32_t subframeNo) |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
733 |
{ |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
734 |
NS_LOG_FUNCTION (this); |
9413
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
735 |
m_frameNo = frameNo; |
20f1c6678ee2
improved LTE Random Access model
Nicola Baldo <nbaldo@cttc.es>
parents:
9406
diff
changeset
|
736 |
m_subframeNo = subframeNo; |
9535
999521532532
Bug-fix LteEnbMac and LteUeMac on HARQ packets buffer in managing several LCs
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9505
diff
changeset
|
737 |
RefreshHarqProcessesPacketBuffer (); |
8496
8d1759a15c2e
Update LteUeMac for sending BSR only when new BSR are received from RLC
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
738 |
if ((Simulator::Now () >= m_bsrLast + m_bsrPeriodicity) && (m_freshUlBsr==true)) |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
739 |
{ |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
740 |
SendReportBufferStatus (); |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
741 |
m_bsrLast = Simulator::Now (); |
8496
8d1759a15c2e
Update LteUeMac for sending BSR only when new BSR are received from RLC
Marco Miozzo <marco.miozzo@cttc.es>
parents:
8462
diff
changeset
|
742 |
m_freshUlBsr = false; |
9351
6e074e67a1ad
HARQ first draft version: RR works, PF todo, LteMiErrorModel on-going
mmiozzo
parents:
9346
diff
changeset
|
743 |
m_harqProcessId = (m_harqProcessId + 1) % HARQ_PERIOD; |
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
744 |
} |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
745 |
} |
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
746 |
|
9414 | 747 |
int64_t |
748 |
LteUeMac::AssignStreams (int64_t stream) |
|
749 |
{ |
|
750 |
NS_LOG_FUNCTION (this << stream); |
|
751 |
m_raPreambleUniformVariable->SetStream (stream); |
|
752 |
return 1; |
|
753 |
} |
|
8415
e9a27a8c6331
Uplink scheduler with multiple bearers (LCs) allocates in a Round Robin fashion the active ones
mmiozzo
parents:
8148
diff
changeset
|
754 |
|
7886 | 755 |
} // namespace ns3 |