A Discrete-Event Network Simulator
API
no-op-component-carrier-manager.cc
Go to the documentation of this file.
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2015 Danilo Abrignani
4  * Copyright (c) 2016 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
5  *
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
8  * published by the Free Software Foundation;
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  *
19  * Authors: Danilo Abrignani <danilo.abrignani@unibo.it>
20  * Biljana Bojovic <biljana.bojovic@cttc.es>
21  *
22  */
23 
25 #include <ns3/log.h>
26 #include <ns3/random-variable-stream.h>
27 
28 namespace ns3 {
29 
30 NS_LOG_COMPONENT_DEFINE ("NoOpComponentCarrierManager");
31 NS_OBJECT_ENSURE_REGISTERED (NoOpComponentCarrierManager);
32 
34 {
35  NS_LOG_FUNCTION (this);
39  m_ccmRrcSapUser = 0;
40 }
41 
43 {
44  NS_LOG_FUNCTION (this);
45 }
46 
47 void
49 {
50  NS_LOG_FUNCTION (this);
51  delete m_ccmRrcSapProvider;
52  delete m_ccmMacSapUser;
53  delete m_macSapProvider;
54 }
55 
56 
57 TypeId
59 {
60  static TypeId tid = TypeId ("ns3::NoOpComponentCarrierManager")
62  .SetGroupName("Lte")
63  .AddConstructor<NoOpComponentCarrierManager> ()
64  ;
65  return tid;
66 }
67 
68 
69 void
71 {
72  NS_LOG_FUNCTION (this);
74 }
75 
77 // MAC SAP
79 
80 
81 void
83 {
84  NS_LOG_FUNCTION (this);
85  std::map <uint8_t, LteMacSapProvider*>::iterator it = m_macSapProvidersMap.find (params.componentCarrierId);
86  NS_ASSERT_MSG (it != m_macSapProvidersMap.end (), "could not find Sap for ComponentCarrier " << params.componentCarrierId);
87  // with this algorithm all traffic is on Primary Carrier
88  it->second->TransmitPdu (params);
89 }
90 
91 void
93 {
94  NS_LOG_FUNCTION (this);
95  auto ueManager = m_ccmRrcSapUser->GetUeManager (params.rnti);
96  std::map <uint8_t, LteMacSapProvider*>::iterator it = m_macSapProvidersMap.find (ueManager->GetComponentCarrierId ());
97  NS_ASSERT_MSG (it != m_macSapProvidersMap.end (), "could not find Sap for ComponentCarrier ");
98  it->second->ReportBufferStatus (params);
99 }
100 
101 void
102 NoOpComponentCarrierManager::DoNotifyTxOpportunity (uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
103 {
104  NS_LOG_FUNCTION (this);
105  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (rnti);
106  NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << rnti);
107  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
108  NS_ASSERT_MSG (lcidIt != rntiIt->second.end (), "could not find LCID " << (uint16_t) lcid);
109  NS_LOG_DEBUG (this << " rnti= " << rnti << " lcid= " << (uint32_t) lcid << " layer= " << (uint32_t)layer<<" ccId="<< (uint32_t)componentCarrierId);
110  (*lcidIt).second->NotifyTxOpportunity (bytes, layer, harqId, componentCarrierId, rnti, lcid);
111 
112 }
113 
114 void
116 {
117  NS_LOG_FUNCTION (this);
118  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (rnti);
119  NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "could not find RNTI" << rnti);
120  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
121  if (lcidIt != rntiIt->second.end ())
122  {
123  (*lcidIt).second->ReceivePdu (p, rnti, lcid);
124  }
125 }
126 
127 void
129 {
130  NS_LOG_FUNCTION (this);
131 }
132 
133 void
135  LteRrcSap::MeasResults measResults)
136 {
137  NS_LOG_FUNCTION (this << rnti << (uint16_t) measResults.measId);
138 }
139 
140 void
141 NoOpComponentCarrierManager::DoAddUe (uint16_t rnti, uint8_t state)
142 {
143  NS_LOG_FUNCTION (this << rnti << (uint16_t) state);
144  std::map<uint16_t, uint8_t>::iterator stateIt;
145  std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iterator
146  stateIt = m_ueState.find (rnti);
147  if (stateIt == m_ueState.end ())
148  {
149  // NS_ASSERT_MSG ((stateIt == m_ueState.end () && state == 3), " ERROR: Ue was not indexed and current state is CONNECTED_NORMALLY" << (uint16_t) state);
150  NS_LOG_DEBUG (this << " UE " << rnti << " was not found, now it is added in the map");
151  m_ueState.insert (std::pair<uint16_t, uint8_t> (rnti, state));
152  eccIt = m_enabledComponentCarrier.find (rnti);
153  //if ((state == 7 || state == 0) && eccIt == m_enabledComponentCarrier.end ())
154  if (eccIt == m_enabledComponentCarrier.end ())
155  {
156  // the Primary carrier (PC) is enabled by default
157  // on the PC the SRB0 and SRB1 are enabled when the Ue is connected
158  // these are hard-coded and the configuration not pass through the
159  // Component Carrier Manager which is responsible of configure
160  // only DataRadioBearer on the different Component Carrier
161  m_enabledComponentCarrier.insert (std::pair<uint16_t, uint8_t> (rnti, 1));
162  }
163  else
164  {
165  NS_FATAL_ERROR (this << " Ue " << rnti << " had Component Carrier enabled before join the network" << (uint16_t) state);
166  }
167  // preparing the rnti,lcid,LteMacSapUser map
168  std::map<uint8_t, LteMacSapUser*> empty;
169  std::pair <std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator, bool>
170  ret = m_ueAttached.insert (std::pair <uint16_t, std::map<uint8_t, LteMacSapUser*> >
171  (rnti, empty));
172  NS_LOG_DEBUG (this << "AddUe: UE Pointer LteMacSapUser Map " << rnti << " added " << (uint16_t) ret.second);
173  NS_ASSERT_MSG (ret.second, "element already present, RNTI already existed");
174 
175  //add new rnti in the map
176  std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> emptyA;
177  std::pair <std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator, bool>
178  retA = m_rlcLcInstantiated.insert (std::pair <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >
179  (rnti, emptyA));
180  NS_ASSERT_MSG (retA.second, "element already present, RNTI already existed");
181  NS_LOG_DEBUG (this << "AddUe: UE " << rnti << " added " << (uint16_t) retA.second);
182 
183  }
184  else
185  {
186  NS_LOG_DEBUG (this << " UE " << rnti << "found, updating the state from " << (uint16_t) stateIt->second << " to " << (uint16_t) state);
187  stateIt->second = state;
188  }
189 
190 
191 }
192 
193 void
195 {
196  NS_LOG_FUNCTION (this);
197  NS_ASSERT_MSG( m_rlcLcInstantiated.find(lcInfo.rnti) != m_rlcLcInstantiated.end(), "Adding lc for a user that was not yet added to component carrier manager list.");
198  m_rlcLcInstantiated.find(lcInfo.rnti)->second.insert(std::pair <uint8_t, LteEnbCmacSapProvider::LcInfo> (lcInfo.lcId, lcInfo));
199 }
200 
201 
202 void
204 {
205  NS_LOG_FUNCTION (this);
206  std::map<uint16_t, uint8_t>::iterator stateIt;
207  std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iterator
208  stateIt = m_ueState.find (rnti);
209  eccIt = m_enabledComponentCarrier.find (rnti);
210  NS_ASSERT_MSG (stateIt != m_ueState.end (), "request to remove UE info with unknown rnti ");
211  NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "request to remove UE info with unknown rnti ");
212 
213 }
214 
215 std::vector<LteCcmRrcSapProvider::LcsConfig>
216 NoOpComponentCarrierManager::DoSetupDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, LteMacSapUser *msu)
217 {
218  NS_LOG_FUNCTION (this << rnti);
219  std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iterator
220  eccIt = m_enabledComponentCarrier.find (rnti);
221  NS_ASSERT_MSG (eccIt != m_enabledComponentCarrier.end (), "SetupDataRadioBearer on unknown rnti ");
222 
223  // enable by default all carriers
224  eccIt->second = m_noOfComponentCarriers;
225 
226  std::vector<LteCcmRrcSapProvider::LcsConfig> res;
229  // NS_LOG_DEBUG (this << " componentCarrierEnabled " << (uint16_t) eccIt->second);
230  for (uint16_t ncc = 0; ncc < m_noOfComponentCarriers; ncc++)
231  {
232  // NS_LOG_DEBUG (this << " res size " << (uint16_t) res.size ());
234  lci.rnti = rnti;
235  lci.lcId = lcid;
236  lci.lcGroup = lcGroup;
237  lci.qci = bearer.qci;
238  if (ncc == 0)
239  {
240  lci.isGbr = bearer.IsGbr ();
241  lci.mbrUl = bearer.gbrQosInfo.mbrUl;
242  lci.mbrDl = bearer.gbrQosInfo.mbrDl;
243  lci.gbrUl = bearer.gbrQosInfo.gbrUl;
244  lci.gbrDl = bearer.gbrQosInfo.gbrDl;
245  }
246  else
247  {
248  lci.isGbr = 0;
249  lci.mbrUl = 0;
250  lci.mbrDl = 0;
251  lci.gbrUl = 0;
252  lci.gbrDl = 0;
253  } // data flows only on PC
254  NS_LOG_DEBUG (this << " RNTI " << lci.rnti << "Lcid " << (uint16_t) lci.lcId << " lcGroup " << (uint16_t) lci.lcGroup);
255  entry.componentCarrierId = ncc;
256  entry.lc = lci;
257  entry.msu = m_ccmMacSapUser;
258  res.push_back (entry);
259  } // end for
260 
261 
262  // preparing the rnti,lcid,LcInfo map
263  std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator rntiIter = m_rlcLcInstantiated.find (rnti);
264  rntiIter = m_rlcLcInstantiated.begin ();
265  // while (rntiIter != m_rlcLcInstantiated.end ())
266  // {
267  // ++rntiIter;
268  // }
269  // if (rntiIt == m_rlcLcInstantiated.end ())
270  // {
271  // //add new rnti in the map
272  // std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> empty;
273  // std::pair <std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator, bool>
274  // ret = m_rlcLcInstantiated.insert (std::pair <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >
275  // (rnti, empty));
276  // NS_LOG_DEBUG (this << " UE " << rnti << " added " << (uint16_t) ret.second);
277  // }
278 
279  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator sapIt = m_ueAttached.find (rnti);
280  NS_ASSERT_MSG (sapIt != m_ueAttached.end (), "RNTI not found");
281  rntiIter = m_rlcLcInstantiated.find (rnti);
282  std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcidIt = rntiIter->second.find (lcid);
283  //std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = sapIt->second.find (lcinfo.lcId);
284  NS_ASSERT_MSG (rntiIter != m_rlcLcInstantiated.end (), "RNTI not found");
285  if (lcidIt == rntiIter->second.end ())
286  {
287  lcinfo.rnti = rnti;
288  lcinfo.lcId = lcid;
289  lcinfo.lcGroup = lcGroup;
290  lcinfo.qci = bearer.qci;
291  lcinfo.isGbr = bearer.IsGbr ();
292  lcinfo.mbrUl = bearer.gbrQosInfo.mbrUl;
293  lcinfo.mbrDl = bearer.gbrQosInfo.mbrDl;
294  lcinfo.gbrUl = bearer.gbrQosInfo.gbrUl;
295  lcinfo.gbrDl = bearer.gbrQosInfo.gbrDl;
296  rntiIter->second.insert (std::pair<uint8_t, LteEnbCmacSapProvider::LcInfo> (lcinfo.lcId, lcinfo));
297  sapIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.lcId, msu));
298  }
299  else
300  {
301  NS_LOG_ERROR ("LC already exists");
302  }
303  return res;
304 
305 }
306 
307 std::vector<uint8_t>
309 {
310  NS_LOG_FUNCTION (this);
311  // here we receive directly the rnti and the lcid, instead of only drbid
312  // drbid are mapped as drbid = lcid + 2
313  std::map<uint16_t, uint8_t>::iterator eccIt; // m_enabledComponentCarrier iterator
314  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");
316  std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator lcsIt;
317  lcsIt = m_rlcLcInstantiated.find (rnti);
318  NS_ASSERT_MSG (lcsIt != m_rlcLcInstantiated.end (), "request to Release Data Radio Bearer on Ue without Logical Channels enabled");
319  std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcIt;
320  NS_LOG_DEBUG (this << " remove lcid " << (uint16_t) lcid << " for rnti " << rnti);
321  lcIt = lcsIt->second.find (lcid);
322  NS_ASSERT_MSG (lcIt != lcsIt->second.end (), " Logical Channel not found");
323  std::vector<uint8_t> res;
324  for (uint16_t i = 0; i < eccIt->second; i++)
325  {
326  res.insert (res.end (), i);
327  }
328  //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_ueAttached.find (rnti);
330  rntiIt->second.erase (lcid);
331  std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator rlcInstancesIt = m_rlcLcInstantiated.find (rnti);
332  std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator rclLcIt;
333  lcIt = rlcInstancesIt->second.find (lcid);
334  NS_ASSERT_MSG (lcIt != lcsIt->second.end (), " Erasing: Logical Channel not found");
335  lcsIt->second.erase (lcid);
336  return res;
337 }
338 
341 {
342  NS_LOG_FUNCTION (this);
343  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator itSapUserAtCcm;
344  itSapUserAtCcm = m_ueAttached.find (lcinfo.rnti);
345  NS_ASSERT_MSG (itSapUserAtCcm != m_ueAttached.end (), "request to Add a SignalBearer to unknown rnti");
346  std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt = m_ueAttached.find (lcinfo.rnti);
347  NS_ASSERT_MSG (rntiIt != m_ueAttached.end (), "RNTI not found");
348  std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcinfo.lcId);
349  if (lcidIt == rntiIt->second.end ())
350  {
351  rntiIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.lcId, msu));
352  }
353  else
354  {
355  NS_LOG_ERROR ("LC already exists");
356  }
357 
358  return m_ccmMacSapUser;
359 }
360 
361 void
362 NoOpComponentCarrierManager::DoNotifyPrbOccupancy (double prbOccupancy, uint8_t componentCarrierId)
363 {
364  NS_LOG_FUNCTION (this);
365  NS_LOG_DEBUG ("Update PRB occupancy:"<<prbOccupancy<<" at carrier:"<< (uint32_t) componentCarrierId);
366  m_ccPrbOccupancy.insert(std::pair<uint8_t, double> (componentCarrierId, prbOccupancy));
367 }
368 
369 void
371 {
372  NS_LOG_FUNCTION (this);
373  NS_ASSERT_MSG (bsr.m_macCeType == MacCeListElement_s::BSR, "Received a Control Message not allowed " << bsr.m_macCeType);
375  {
376  MacCeListElement_s newBsr;
377  newBsr.m_rnti = bsr.m_rnti;
378  newBsr.m_macCeType = bsr.m_macCeType;
379  newBsr.m_macCeValue.m_phr = bsr.m_macCeValue.m_phr;
381  newBsr.m_macCeValue.m_bufferStatus.resize (4);
382  for (uint16_t i = 0; i < 4; i++)
383  {
384  uint8_t bsrId = bsr.m_macCeValue.m_bufferStatus.at (i);
385  uint32_t buffer = BufferSizeLevelBsr::BsrId2BufferSize (bsrId);
386  // here the buffer should be divide among the different sap
387  // since the buffer status report are compressed information
388  // it is needed to use BsrId2BufferSize to uncompress
389  // after the split over all component carriers is is needed to
390  // compress again the information to fit MacCeListEkement_s structure
391  // verify how many Component Carrier are enabled per UE
392  // in this simple code the BufferStatus will be notify only
393  // to the primary carrier component
395  }
396  auto sapIt = m_ccmMacSapProviderMap.find (componentCarrierId);
397  if (sapIt == m_ccmMacSapProviderMap.end ())
398  {
399  NS_FATAL_ERROR ("Sap not found in the CcmMacSapProviderMap");
400  }
401  else
402  {
403  // in the current implementation bsr in uplink is forwarded only to the primary carrier.
404  // above code demonstrates how to resize buffer status if more carriers are being used in future
405  sapIt->second->ReportMacCeToScheduler (newBsr);
406  }
407  }
408  else
409  {
410  NS_FATAL_ERROR ("Expected BSR type of message.");
411  }
412 }
413 
414 
416 
418 
420 {
421  NS_LOG_FUNCTION (this);
422 
423 }
424 
426 {
427  NS_LOG_FUNCTION (this);
428 }
429 
430 TypeId
432 {
433  static TypeId tid = TypeId ("ns3::RrComponentCarrierManager")
435  .SetGroupName("Lte")
436  .AddConstructor<RrComponentCarrierManager> ()
437  ;
438  return tid;
439 }
440 
441 
442 void
444 {
445  NS_LOG_FUNCTION (this);
446 
447  NS_ASSERT_MSG( m_enabledComponentCarrier.find(params.rnti)!=m_enabledComponentCarrier.end(), " UE with provided RNTI not found. RNTI:"<<params.rnti);
448 
449  uint32_t numberOfCarriersForUe = m_enabledComponentCarrier.find (params.rnti)->second;
450  if (params.lcid == 0 || params.lcid == 1 || numberOfCarriersForUe == 1)
451  {
452  NS_LOG_INFO("Buffer status forwarded to the primary carrier.");
453  auto ueManager = m_ccmRrcSapUser->GetUeManager (params.rnti);
454  m_macSapProvidersMap.at (ueManager->GetComponentCarrierId ())->ReportBufferStatus (params);
455  }
456  else
457  {
458  params.retxQueueSize /= numberOfCarriersForUe;
459  params.txQueueSize /= numberOfCarriersForUe;
460  for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++)
461  {
462  NS_ASSERT_MSG (m_macSapProvidersMap.find(i)!=m_macSapProvidersMap.end(), "Mac sap provider does not exist.");
463  m_macSapProvidersMap.find(i)->second->ReportBufferStatus(params);
464  }
465  }
466 }
467 
468 
469 void
471 {
472  NS_LOG_FUNCTION (this);
473  NS_ASSERT_MSG (componentCarrierId == 0, "Received BSR from a ComponentCarrier not allowed, ComponentCarrierId = " << componentCarrierId);
474  NS_ASSERT_MSG (bsr.m_macCeType == MacCeListElement_s::BSR, "Received a Control Message not allowed " << bsr.m_macCeType);
475 
476  // split traffic in uplink equally among carriers
477  uint32_t numberOfCarriersForUe = m_enabledComponentCarrier.find(bsr.m_rnti)->second;
478 
480  {
481  MacCeListElement_s newBsr;
482  newBsr.m_rnti = bsr.m_rnti;
483  // mac control element type, values can be BSR, PHR, CRNTI
484  newBsr.m_macCeType = bsr.m_macCeType;
485  // the power headroom, 64 means no valid phr is available
486  newBsr.m_macCeValue.m_phr = bsr.m_macCeValue.m_phr;
487  // indicates that the CRNTI MAC CE was received. The value is not used.
489  // and value 64 means that the buffer status should not be updated
490  newBsr.m_macCeValue.m_bufferStatus.resize (4);
491  // always all 4 LCGs are present see 6.1.3.1 of 3GPP TS 36.321.
492  for (uint16_t i = 0; i < 4; i++)
493  {
494  uint8_t bsrStatusId = bsr.m_macCeValue.m_bufferStatus.at (i);
495  uint32_t bufferSize = BufferSizeLevelBsr::BsrId2BufferSize (bsrStatusId);
496  // here the buffer should be divide among the different sap
497  // since the buffer status report are compressed information
498  // it is needed to use BsrId2BufferSize to uncompress
499  // after the split over all component carriers is is needed to
500  // compress again the information to fit MacCeListElement_s structure
501  // verify how many Component Carrier are enabled per UE
502  newBsr.m_macCeValue.m_bufferStatus.at(i) = BufferSizeLevelBsr::BufferSize2BsrId (bufferSize/numberOfCarriersForUe);
503  }
504  // notify MAC of each component carrier that is enabled for this UE
505  for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++)
506  {
507  NS_ASSERT_MSG (m_ccmMacSapProviderMap.find(i)!=m_ccmMacSapProviderMap.end(), "Mac sap provider does not exist.");
508  m_ccmMacSapProviderMap.find(i)->second->ReportMacCeToScheduler(newBsr);
509  }
510  }
511  else
512  {
513  auto ueManager = m_ccmRrcSapUser->GetUeManager (bsr.m_rnti);
514  m_ccmMacSapProviderMap.at (ueManager->GetComponentCarrierId ())->ReportMacCeToScheduler (bsr);
515  }
516 }
517 
518 } // end of namespace ns3
virtual Ptr< UeManager > GetUeManager(uint16_t rnti)=0
Get UE manager by RNTI.
LteCcmRrcSapUser * m_ccmRrcSapUser
A pointer to SAP interface of RRC instance, i.e.
virtual void DoInitialize(void)
Initialize() implementation.
Definition: object.cc:353
EnbMacMemberLteMacSapProvider class.
Definition: lte-mac-sap.h:134
LteCcmRrcSapProvider * m_ccmRrcSapProvider
A pointer to the SAP interface of the CCM instance to receive API calls from the eNodeB RRC instance...
virtual void DoRemoveUe(uint16_t rnti)
Remove UE.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Definition: object-base.h:45
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
A map of pointers to real SAP interfaces of MAC instances.
uint8_t qci
QoS Class Identifier.
virtual std::vector< LteCcmRrcSapProvider::LcsConfig > DoSetupDataRadioBearer(EpsBearer bearer, uint8_t bearerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, LteMacSapUser *msu)
Setup data radio bearer.
virtual void DoNotifyTxOpportunity(uint32_t bytes, uint8_t layer, uint8_t harqId, uint8_t componentCarrierId, uint16_t rnti, uint8_t lcid)
Notify transmit opportunity.
virtual void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters params)
Transmit PDU.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:202
virtual void DoAddLc(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser *msu)
Add LC.
std::map< uint8_t, double > m_ccPrbOccupancy
The physical resource block occupancy per carrier.
uint32_t retxQueueSize
the current size of the RLC retransmission queue in bytes
Definition: lte-mac-sap.h:73
struct MacCeValue_u m_macCeValue
MAC CE value.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:278
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:162
uint64_t mbrDl
maximum bitrate in downlink
uint8_t componentCarrierId
the component carrier id corresponding to the sending Mac istance
Definition: lte-mac-sap.h:52
virtual void DoNotifyPrbOccupancy(double prbOccupancy, uint8_t componentCarrierId)
Function implements the function of the SAP interface of CCM instance which is used by MAC to notify ...
bool IsGbr() const
Definition: eps-bearer.cc:61
uint16_t rnti
the C-RNTI identifying the UE
Definition: lte-mac-sap.h:69
virtual void DoNotifyHarqDeliveryFailure()
Notify HARQ delivery failure.
LteCcmMacSapUser * m_ccmMacSapUser
LteCcmMacSapUser is extended version of LteMacSapUser interface.
uint8_t m_crnti
NRTI.
Parameters for LteMacSapProvider::ReportBufferStatus.
Definition: lte-mac-sap.h:67
uint64_t gbrUl
Guaranteed Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:41
uint16_t componentCarrierId
component carrier ID
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of ReportUeMeas.
uint8_t lcId
logical channel identifier
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
virtual void DoUlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId)
Forwards uplink BSR to CCM, called by MAC through CCM SAP interface.
The default component carrier manager that forwards all traffic, the uplink and the downlink...
make Callback use a separate empty type
Definition: empty.h:33
static uint8_t BufferSize2BsrId(uint32_t val)
Convert Buffer size to BSR ID.
Definition: lte-common.cc:191
std::map< uint16_t, std::map< uint8_t, LteEnbCmacSapProvider::LcInfo > > m_rlcLcInstantiated
This map contains logical channel configuration per flow Id (rnti, lcid).
MeasResults structure.
Definition: lte-rrc-sap.h:671
static TypeId GetTypeId()
Get the type ID.
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
GbrQosInformation gbrQosInfo
GBR QOS information.
Definition: eps-bearer.h:90
virtual void DoUlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId)
Forwards uplink BSR to CCM, called by MAC through CCM SAP interface.
virtual LteMacSapUser * DoConfigureSignalBearer(LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser *msu)
Configure the signal bearer.
std::map< uint8_t, LteCcmMacSapProvider * > m_ccmMacSapProviderMap
A map of pointers to the SAP interfaces of CCM instance that provides the CCM specific functionalitie...
uint64_t gbrDl
Guaranteed Bit Rate (bit/s) in downlink.
Definition: eps-bearer.h:40
virtual std::vector< uint8_t > DoReleaseDataRadioBearer(uint16_t rnti, uint8_t lcid)
Release data radio bearer.
std::map< uint16_t, std::map< uint8_t, LteMacSapUser * > > m_ueAttached
The map that contains the rnti, lcid, SAP of the RLC instance.
See section 4.3.14 macCEListElement.
MemberLteCcmRrcSapProvider class.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
enum ns3::EpsBearer::Qci qci
Qos class indicator.
uint8_t lcGroup
logical channel group
static TypeId GetTypeId()
Get the type ID.
uint64_t mbrUl
Maximum Bit Rate (bit/s) in uplink.
Definition: eps-bearer.h:43
uint8_t m_phr
phr
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
Definition: lte-mac-sap.h:70
uint32_t txQueueSize
the current size of the RLC transmission queue
Definition: lte-mac-sap.h:71
virtual void DoInitialize()
Initialize() implementation.
std::map< uint16_t, uint8_t > m_ueState
Map of RRC states per UE (rnti, state), e.g.
uint8_t measId
measure ID
Definition: lte-rrc-sap.h:673
uint16_t rnti
C-RNTI identifying the UE.
std::vector< uint8_t > m_bufferStatus
buffer status
uint64_t mbrUl
maximum bitrate in uplink
virtual void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params)
Report buffer status.
uint64_t gbrUl
guaranteed bitrate in uplink
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
Definition: lte-common.cc:184
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
Definition: lte-mac-sap.h:95
MemberLteCcmMacSapUser class.
std::map< uint16_t, uint8_t > m_enabledComponentCarrier
This map tells for each RNTI the number of enabled component carriers.
The class implements Component Carrier Manager (CCM) that operates using the Component Carrier Manage...
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
Definition: log.h:270
LteEnbCmacSapProvider::LcInfo lc
LC info.
virtual void DoDispose()
Destructor implementation.
virtual void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params)
Report buffer status.
enum ns3::MacCeListElement_s::MacCeType_e m_macCeType
MAC CE type.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:254
uint64_t mbrDl
Maximum Bit Rate (bit/s) in downlink.
Definition: eps-bearer.h:42
uint64_t gbrDl
guaranteed bitrate in downlink
LteMacSapProvider * m_macSapProvider
A pointer to main SAP interface of the MAC instance, which is in this case handled by CCM...
a unique identifier for an interface.
Definition: type-id.h:58
virtual void DoAddUe(uint16_t rnti, uint8_t state)
Add UE.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Definition: type-id.cc:915
bool isGbr
true if the bearer is GBR, false if the bearer is NON-GBR
virtual void DoReceivePdu(Ptr< Packet > p, uint16_t rnti, uint8_t lcid)
Receive PDU.
uint16_t m_noOfComponentCarriers
The number component of carriers that are supported by this eNb.
Parameters for LteMacSapProvider::TransmitPdu.
Definition: lte-mac-sap.h:45