OLD | NEW |
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2015 Danilo Abrignani | 3 * Copyright (c) 2015 Danilo Abrignani |
4 * Copyright (c) 2016 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) | 4 * Copyright (c) 2016 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or modify | 6 * This program is free software; you can redistribute it and/or modify |
7 * it under the terms of the GNU General Public License version 2 as | 7 * it under the terms of the GNU General Public License version 2 as |
8 * published by the Free Software Foundation; | 8 * published by the Free Software Foundation; |
9 * | 9 * |
10 * This program is distributed in the hope that it will be useful, | 10 * This program is distributed in the hope that it will be useful, |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 } | 188 } |
189 | 189 |
190 | 190 |
191 } | 191 } |
192 | 192 |
193 void | 193 void |
194 NoOpComponentCarrierManager::DoAddLc (LteEnbCmacSapProvider::LcInfo lcInfo, LteM
acSapUser* msu) | 194 NoOpComponentCarrierManager::DoAddLc (LteEnbCmacSapProvider::LcInfo lcInfo, LteM
acSapUser* msu) |
195 { | 195 { |
196 NS_LOG_FUNCTION (this); | 196 NS_LOG_FUNCTION (this); |
197 NS_ASSERT_MSG( m_rlcLcInstantiated.find(lcInfo.rnti) != m_rlcLcInstantiated.en
d(), "Adding lc for a user that was not yet added to component carrier manager l
ist."); | 197 NS_ASSERT_MSG( m_rlcLcInstantiated.find(lcInfo.rnti) != m_rlcLcInstantiated.en
d(), "Adding lc for a user that was not yet added to component carrier manager l
ist."); |
| 198 NS_UNUSED (msu); |
198 m_rlcLcInstantiated.find(lcInfo.rnti)->second.insert(std::pair <uint8_t, LteEn
bCmacSapProvider::LcInfo> (lcInfo.lcId, lcInfo)); | 199 m_rlcLcInstantiated.find(lcInfo.rnti)->second.insert(std::pair <uint8_t, LteEn
bCmacSapProvider::LcInfo> (lcInfo.lcId, lcInfo)); |
199 } | 200 } |
200 | 201 |
201 | 202 |
202 void | 203 void |
203 NoOpComponentCarrierManager::DoRemoveUe (uint16_t rnti) | 204 NoOpComponentCarrierManager::DoRemoveUe (uint16_t rnti) |
204 { | 205 { |
205 NS_LOG_FUNCTION (this); | 206 NS_LOG_FUNCTION (this); |
206 std::map<uint16_t, uint8_t>::iterator stateIt; | 207 std::map<uint16_t, uint8_t>::iterator stateIt; |
207 std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iter
ator | 208 std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iter
ator |
208 stateIt = m_ueState.find (rnti); | 209 stateIt = m_ueState.find (rnti); |
209 eccIt = m_enabledComponentCarrier.find (rnti); | 210 eccIt = m_enabledComponentCarrier.find (rnti); |
210 NS_ASSERT_MSG (stateIt != m_ueState.end (), "request to remove UE info with un
known rnti "); | 211 NS_ASSERT_MSG (stateIt != m_ueState.end (), "request to remove UE info with un
known rnti "); |
211 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "request to remove U
E info with unknown rnti "); | 212 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "request to remove U
E info with unknown rnti "); |
212 | 213 |
213 } | 214 } |
214 | 215 |
215 std::vector<LteCcmRrcSapProvider::LcsConfig> | 216 std::vector<LteCcmRrcSapProvider::LcsConfig> |
216 NoOpComponentCarrierManager::DoSetupDataRadioBearer (EpsBearer bearer, uint8_t b
earerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, LteMacSapUser *msu) | 217 NoOpComponentCarrierManager::DoSetupDataRadioBearer (EpsBearer bearer, uint8_t b
earerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, LteMacSapUser *msu) |
217 { | 218 { |
218 NS_LOG_FUNCTION (this << rnti); | 219 NS_LOG_FUNCTION (this << rnti); |
| 220 NS_UNUSED (bearerId); |
219 std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iter
ator | 221 std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iter
ator |
220 eccIt = m_enabledComponentCarrier.find (rnti); | 222 eccIt = m_enabledComponentCarrier.find (rnti); |
221 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "SetupDataRadioBeare
r on unknown rnti "); | 223 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "SetupDataRadioBeare
r on unknown rnti "); |
222 | 224 |
223 // enable by default all carriers | 225 // enable by default all carriers |
224 eccIt->second = m_noOfComponentCarriers; | 226 eccIt->second = static_cast<uint8_t> (m_noOfComponentCarriers); |
225 | 227 |
226 std::vector<LteCcmRrcSapProvider::LcsConfig> res; | 228 std::vector<LteCcmRrcSapProvider::LcsConfig> res; |
227 LteCcmRrcSapProvider::LcsConfig entry; | 229 LteCcmRrcSapProvider::LcsConfig entry; |
228 LteEnbCmacSapProvider::LcInfo lcinfo; | 230 LteEnbCmacSapProvider::LcInfo lcinfo; |
229 // NS_LOG_DEBUG (this << " componentCarrierEnabled " << (uint16_t) eccIt->seco
nd); | 231 // NS_LOG_DEBUG (this << " componentCarrierEnabled " << (uint16_t) eccIt->seco
nd); |
230 for (uint16_t ncc = 0; ncc < m_noOfComponentCarriers; ncc++) | 232 for (uint16_t ncc = 0; ncc < m_noOfComponentCarriers; ncc++) |
231 { | 233 { |
232 // NS_LOG_DEBUG (this << " res size " << (uint16_t) res.size ()); | 234 // NS_LOG_DEBUG (this << " res size " << (uint16_t) res.size ()); |
233 LteEnbCmacSapProvider::LcInfo lci; | 235 LteEnbCmacSapProvider::LcInfo lci; |
234 lci.rnti = rnti; | 236 lci.rnti = rnti; |
235 lci.lcId = lcid; | 237 lci.lcId = lcid; |
236 lci.lcGroup = lcGroup; | 238 lci.lcGroup = lcGroup; |
237 lci.qci = bearer.qci; | 239 lci.qci = static_cast<uint8_t> (bearer.qci); |
238 if (ncc == 0) | 240 if (ncc == 0) |
239 { | 241 { |
240 lci.isGbr = bearer.IsGbr (); | 242 lci.isGbr = bearer.IsGbr (); |
241 lci.mbrUl = bearer.gbrQosInfo.mbrUl; | 243 lci.mbrUl = bearer.gbrQosInfo.mbrUl; |
242 lci.mbrDl = bearer.gbrQosInfo.mbrDl; | 244 lci.mbrDl = bearer.gbrQosInfo.mbrDl; |
243 lci.gbrUl = bearer.gbrQosInfo.gbrUl; | 245 lci.gbrUl = bearer.gbrQosInfo.gbrUl; |
244 lci.gbrDl = bearer.gbrQosInfo.gbrDl; | 246 lci.gbrDl = bearer.gbrQosInfo.gbrDl; |
245 } | 247 } |
246 else | 248 else |
247 { | 249 { |
248 lci.isGbr = 0; | 250 lci.isGbr = 0; |
249 lci.mbrUl = 0; | 251 lci.mbrUl = 0; |
250 lci.mbrDl = 0; | 252 lci.mbrDl = 0; |
251 lci.gbrUl = 0; | 253 lci.gbrUl = 0; |
252 lci.gbrDl = 0; | 254 lci.gbrDl = 0; |
253 } // data flows only on PC | 255 } // data flows only on PC |
254 NS_LOG_DEBUG (this << " RNTI " << lci.rnti << "Lcid " << (uint16_t) lci.lc
Id << " lcGroup " << (uint16_t) lci.lcGroup); | 256 NS_LOG_DEBUG (this << " RNTI " << lci.rnti << " Lcid " << (uint16_t) lci.l
cId << " lcGroup " << (uint16_t) lci.lcGroup); |
255 entry.componentCarrierId = ncc; | 257 entry.componentCarrierId = ncc; |
256 entry.lc = lci; | 258 entry.lc = lci; |
257 entry.msu = m_ccmMacSapUser; | 259 entry.msu = m_ccmMacSapUser; |
258 res.push_back (entry); | 260 res.push_back (entry); |
259 } // end for | 261 } // end for |
260 | 262 |
261 | 263 |
262 // preparing the rnti,lcid,LcInfo map | 264 // preparing the rnti,lcid,LcInfo map |
263 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterat
or rntiIter = m_rlcLcInstantiated.find (rnti); | 265 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterat
or rntiIter = m_rlcLcInstantiated.find (rnti); |
264 rntiIter = m_rlcLcInstantiated.begin (); | 266 rntiIter = m_rlcLcInstantiated.begin (); |
(...skipping 15 matching lines...) Expand all Loading... |
280 NS_ASSERT_MSG (sapIt != m_ueAttached.end (), "RNTI not found"); | 282 NS_ASSERT_MSG (sapIt != m_ueAttached.end (), "RNTI not found"); |
281 rntiIter = m_rlcLcInstantiated.find (rnti); | 283 rntiIter = m_rlcLcInstantiated.find (rnti); |
282 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcidIt = rntiIter->
second.find (lcid); | 284 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcidIt = rntiIter->
second.find (lcid); |
283 //std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = sapIt->second.find (lci
nfo.lcId); | 285 //std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = sapIt->second.find (lci
nfo.lcId); |
284 NS_ASSERT_MSG (rntiIter != m_rlcLcInstantiated.end (), "RNTI not found"); | 286 NS_ASSERT_MSG (rntiIter != m_rlcLcInstantiated.end (), "RNTI not found"); |
285 if (lcidIt == rntiIter->second.end ()) | 287 if (lcidIt == rntiIter->second.end ()) |
286 { | 288 { |
287 lcinfo.rnti = rnti; | 289 lcinfo.rnti = rnti; |
288 lcinfo.lcId = lcid; | 290 lcinfo.lcId = lcid; |
289 lcinfo.lcGroup = lcGroup; | 291 lcinfo.lcGroup = lcGroup; |
290 lcinfo.qci = bearer.qci; | 292 lcinfo.qci = static_cast<uint8_t> (bearer.qci); |
291 lcinfo.isGbr = bearer.IsGbr (); | 293 lcinfo.isGbr = bearer.IsGbr (); |
292 lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl; | 294 lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl; |
293 lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl; | 295 lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl; |
294 lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl; | 296 lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl; |
295 lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl; | 297 lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl; |
296 rntiIter->second.insert (std::pair<uint8_t, LteEnbCmacSapProvider::LcInfo>
(lcinfo.lcId, lcinfo)); | 298 rntiIter->second.insert (std::pair<uint8_t, LteEnbCmacSapProvider::LcInfo>
(lcinfo.lcId, lcinfo)); |
297 sapIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.lcId, msu
)); | 299 sapIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.lcId, msu
)); |
298 } | 300 } |
299 else | 301 else |
300 { | 302 { |
(...skipping 13 matching lines...) Expand all Loading... |
314 eccIt= m_enabledComponentCarrier.find (rnti); | 316 eccIt= m_enabledComponentCarrier.find (rnti); |
315 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "request to Release
Data Radio Bearer on Ue without Component Carrier Enabled"); | 317 NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "request to Release
Data Radio Bearer on Ue without Component Carrier Enabled"); |
316 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterat
or lcsIt; | 318 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterat
or lcsIt; |
317 lcsIt = m_rlcLcInstantiated.find (rnti); | 319 lcsIt = m_rlcLcInstantiated.find (rnti); |
318 NS_ASSERT_MSG (lcsIt != m_rlcLcInstantiated.end (), "request to Release Data R
adio Bearer on Ue without Logical Channels enabled"); | 320 NS_ASSERT_MSG (lcsIt != m_rlcLcInstantiated.end (), "request to Release Data R
adio Bearer on Ue without Logical Channels enabled"); |
319 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcIt; | 321 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcIt; |
320 NS_LOG_DEBUG (this << " remove lcid " << (uint16_t) lcid << " for rnti " << rn
ti); | 322 NS_LOG_DEBUG (this << " remove lcid " << (uint16_t) lcid << " for rnti " << rn
ti); |
321 lcIt = lcsIt->second.find (lcid); | 323 lcIt = lcsIt->second.find (lcid); |
322 NS_ASSERT_MSG (lcIt != lcsIt->second.end (), " Logical Channel not found"); | 324 NS_ASSERT_MSG (lcIt != lcsIt->second.end (), " Logical Channel not found"); |
323 std::vector<uint8_t> res; | 325 std::vector<uint8_t> res; |
324 for (uint16_t i = 0; i < eccIt->second; i++) | 326 for (uint8_t i = 0; i < eccIt->second; i++) |
325 { | 327 { |
326 res.insert (res.end (), i); | 328 res.insert (res.end (), i); |
327 } | 329 } |
328 //Find user based on rnti and then erase lcid stored against the same | 330 //Find user based on rnti and then erase lcid stored against the same |
329 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_u
eAttached.find (rnti); | 331 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_u
eAttached.find (rnti); |
330 rntiIt->second.erase (lcid); | 332 rntiIt->second.erase (lcid); |
331 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterat
or rlcInstancesIt = m_rlcLcInstantiated.find (rnti); | 333 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterat
or rlcInstancesIt = m_rlcLcInstantiated.find (rnti); |
332 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator rclLcIt; | 334 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator rclLcIt; |
333 lcIt = rlcInstancesIt->second.find (lcid); | 335 lcIt = rlcInstancesIt->second.find (lcid); |
334 NS_ASSERT_MSG (lcIt != lcsIt->second.end (), " Erasing: Logical Channel not fo
und"); | 336 NS_ASSERT_MSG (lcIt != lcsIt->second.end (), " Erasing: Logical Channel not fo
und"); |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 if (params.lcid == 0 || params.lcid == 1 || numberOfCarriersForUe == 1) | 452 if (params.lcid == 0 || params.lcid == 1 || numberOfCarriersForUe == 1) |
451 { | 453 { |
452 NS_LOG_INFO("Buffer status forwarded to the primary carrier."); | 454 NS_LOG_INFO("Buffer status forwarded to the primary carrier."); |
453 auto ueManager = m_ccmRrcSapUser->GetUeManager (params.rnti); | 455 auto ueManager = m_ccmRrcSapUser->GetUeManager (params.rnti); |
454 m_macSapProvidersMap.at (ueManager->GetComponentCarrierId ())->ReportBuffe
rStatus (params); | 456 m_macSapProvidersMap.at (ueManager->GetComponentCarrierId ())->ReportBuffe
rStatus (params); |
455 } | 457 } |
456 else | 458 else |
457 { | 459 { |
458 params.retxQueueSize /= numberOfCarriersForUe; | 460 params.retxQueueSize /= numberOfCarriersForUe; |
459 params.txQueueSize /= numberOfCarriersForUe; | 461 params.txQueueSize /= numberOfCarriersForUe; |
460 for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++) | 462 for ( uint8_t i = 0; i < numberOfCarriersForUe ; i++) |
461 { | 463 { |
462 NS_ASSERT_MSG (m_macSapProvidersMap.find(i)!=m_macSapProvidersMap.end(
), "Mac sap provider does not exist."); | 464 NS_ASSERT_MSG (m_macSapProvidersMap.find(i)!=m_macSapProvidersMap.end(
), "Mac sap provider does not exist."); |
463 m_macSapProvidersMap.find(i)->second->ReportBufferStatus(params); | 465 m_macSapProvidersMap.find(i)->second->ReportBufferStatus(params); |
464 } | 466 } |
465 } | 467 } |
466 } | 468 } |
467 | 469 |
468 | 470 |
469 void | 471 void |
470 RrComponentCarrierManager::DoUlReceiveMacCe (MacCeListElement_s bsr, uint8_t com
ponentCarrierId) | 472 RrComponentCarrierManager::DoUlReceiveMacCe (MacCeListElement_s bsr, uint8_t com
ponentCarrierId) |
471 { | 473 { |
472 NS_LOG_FUNCTION (this); | 474 NS_LOG_FUNCTION (this); |
473 NS_ASSERT_MSG (componentCarrierId == 0, "Received BSR from a ComponentCarrier
not allowed, ComponentCarrierId = " << componentCarrierId); | 475 NS_ASSERT_MSG (componentCarrierId == 0, "Received BSR from a ComponentCarrier
not allowed, ComponentCarrierId = " << componentCarrierId); |
| 476 (void)componentCarrierId; // make compiler happy |
474 NS_ASSERT_MSG (bsr.m_macCeType == MacCeListElement_s::BSR, "Received a Control
Message not allowed " << bsr.m_macCeType); | 477 NS_ASSERT_MSG (bsr.m_macCeType == MacCeListElement_s::BSR, "Received a Control
Message not allowed " << bsr.m_macCeType); |
475 | 478 |
476 // split traffic in uplink equally among carriers | 479 // split traffic in uplink equally among carriers |
477 uint32_t numberOfCarriersForUe = m_enabledComponentCarrier.find(bsr.m_rnti)->s
econd; | 480 uint32_t numberOfCarriersForUe = m_enabledComponentCarrier.find(bsr.m_rnti)->s
econd; |
478 | 481 |
479 if ( bsr.m_macCeType == MacCeListElement_s::BSR) | 482 if ( bsr.m_macCeType == MacCeListElement_s::BSR) |
480 { | 483 { |
481 MacCeListElement_s newBsr; | 484 MacCeListElement_s newBsr; |
482 newBsr.m_rnti = bsr.m_rnti; | 485 newBsr.m_rnti = bsr.m_rnti; |
483 // mac control element type, values can be BSR, PHR, CRNTI | 486 // mac control element type, values can be BSR, PHR, CRNTI |
(...skipping 11 matching lines...) Expand all Loading... |
495 uint32_t bufferSize = BufferSizeLevelBsr::BsrId2BufferSize (bsrStatusI
d); | 498 uint32_t bufferSize = BufferSizeLevelBsr::BsrId2BufferSize (bsrStatusI
d); |
496 // here the buffer should be divide among the different sap | 499 // here the buffer should be divide among the different sap |
497 // since the buffer status report are compressed information | 500 // since the buffer status report are compressed information |
498 // it is needed to use BsrId2BufferSize to uncompress | 501 // it is needed to use BsrId2BufferSize to uncompress |
499 // after the split over all component carriers is is needed to | 502 // after the split over all component carriers is is needed to |
500 // compress again the information to fit MacCeListElement_s structure | 503 // compress again the information to fit MacCeListElement_s structure |
501 // verify how many Component Carrier are enabled per UE | 504 // verify how many Component Carrier are enabled per UE |
502 newBsr.m_macCeValue.m_bufferStatus.at(i) = BufferSizeLevelBsr::BufferS
ize2BsrId (bufferSize/numberOfCarriersForUe); | 505 newBsr.m_macCeValue.m_bufferStatus.at(i) = BufferSizeLevelBsr::BufferS
ize2BsrId (bufferSize/numberOfCarriersForUe); |
503 } | 506 } |
504 // notify MAC of each component carrier that is enabled for this UE | 507 // notify MAC of each component carrier that is enabled for this UE |
505 for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++) | 508 for ( uint8_t i = 0; i < numberOfCarriersForUe ; i++) |
506 { | 509 { |
507 NS_ASSERT_MSG (m_ccmMacSapProviderMap.find(i)!=m_ccmMacSapProviderMap.
end(), "Mac sap provider does not exist."); | 510 NS_ASSERT_MSG (m_ccmMacSapProviderMap.find(i)!=m_ccmMacSapProviderMap.
end(), "Mac sap provider does not exist."); |
508 m_ccmMacSapProviderMap.find(i)->second->ReportMacCeToScheduler(newBsr)
; | 511 m_ccmMacSapProviderMap.find(i)->second->ReportMacCeToScheduler(newBsr)
; |
509 } | 512 } |
510 } | 513 } |
511 else | 514 else |
512 { | 515 { |
513 auto ueManager = m_ccmRrcSapUser->GetUeManager (bsr.m_rnti); | 516 auto ueManager = m_ccmRrcSapUser->GetUeManager (bsr.m_rnti); |
514 m_ccmMacSapProviderMap.at (ueManager->GetComponentCarrierId ())->ReportMac
CeToScheduler (bsr); | 517 m_ccmMacSapProviderMap.at (ueManager->GetComponentCarrierId ())->ReportMac
CeToScheduler (bsr); |
515 } | 518 } |
516 } | 519 } |
517 | 520 |
518 } // end of namespace ns3 | 521 } // end of namespace ns3 |
OLD | NEW |