28 #include <ns3/random-variable-stream.h>
62 static TypeId tid =
TypeId(
"ns3::NoOpComponentCarrierManager")
86 "could not find Sap for ComponentCarrier " <<
params.componentCarrierId);
88 it->second->TransmitPdu(
params);
99 it->second->ReportBufferStatus(
params);
107 NS_LOG_DEBUG(
this <<
" rnti= " << txOpParams.
rnti <<
" lcid= " << +txOpParams.
lcid <<
" layer= "
109 m_ueInfo.at(txOpParams.
rnti).m_ueAttached.at(txOpParams.
lcid)->NotifyTxOpportunity(txOpParams);
116 auto lcidIt =
m_ueInfo.at(rxPduParams.
rnti).m_ueAttached.find(rxPduParams.
lcid);
117 if (lcidIt !=
m_ueInfo.at(rxPduParams.
rnti).m_ueAttached.end())
119 lcidIt->second->ReceivePdu(rxPduParams);
139 auto ueInfoIt =
m_ueInfo.find(rnti);
142 NS_LOG_DEBUG(
this <<
" UE " << rnti <<
" was not found, now it is added in the map");
156 NS_LOG_DEBUG(
this <<
" UE " << rnti <<
"found, updating the state from "
157 << +ueInfoIt->second.m_ueState <<
" to " << +state);
158 ueInfoIt->second.m_ueState = state;
178 std::vector<LteCcmRrcSapProvider::LcsConfig>
193 std::vector<LteCcmRrcSapProvider::LcsConfig>
res;
226 res.push_back(entry);
229 auto lcidIt = rntiIt->second.m_rlcLcInstantiated.find(lcid);
230 if (lcidIt == rntiIt->second.m_rlcLcInstantiated.end())
241 rntiIt->second.m_rlcLcInstantiated.emplace(lcinfo.
lcId, lcinfo);
242 rntiIt->second.m_ueAttached.emplace(lcinfo.
lcId, msu);
260 "request to Release Data Radio Bearer on UE with unknown RNTI " << rnti);
262 NS_LOG_DEBUG(
this <<
" remove LCID " << +lcid <<
" for RNTI " << rnti);
263 std::vector<uint8_t>
res;
264 for (uint16_t i = 0; i < rntiIt->second.m_enabledComponentCarrier; i++)
269 auto lcIt = rntiIt->second.m_ueAttached.find(lcid);
270 NS_ASSERT_MSG(lcIt != rntiIt->second.m_ueAttached.end(),
"Logical Channel not found");
271 rntiIt->second.m_ueAttached.erase(lcIt);
273 auto rlcInstancesIt = rntiIt->second.m_rlcLcInstantiated.find(rnti);
274 NS_ASSERT_MSG(rlcInstancesIt != rntiIt->second.m_rlcLcInstantiated.end(),
275 "Logical Channel not found");
276 rntiIt->second.m_rlcLcInstantiated.erase(rlcInstancesIt);
289 "request to add a signal bearer to unknown RNTI " << lcinfo.
rnti);
291 auto lcidIt = rntiIt->second.m_ueAttached.find(lcinfo.
lcId);
292 if (lcidIt == rntiIt->second.m_ueAttached.end())
294 rntiIt->second.m_ueAttached.emplace(lcinfo.
lcId, msu);
309 <<
" at carrier:" << (uint32_t)componentCarrierId);
310 m_ccPrbOccupancy.insert(std::pair<uint8_t, double>(componentCarrierId, prbOccupancy));
318 "Received a Control Message not allowed " << bsr.m_macCeType);
323 newBsr.m_macCeType = bsr.m_macCeType;
327 for (uint16_t i = 0; i < 4; i++)
351 sapIt->second->ReportMacCeToScheduler(newBsr);
367 "Sap not found in the CcmMacSapProviderMap");
369 sapIt->second->ReportSrToScheduler(rnti);
389 static TypeId tid =
TypeId(
"ns3::RrComponentCarrierManager")
402 uint32_t numberOfCarriersForUe =
m_ueInfo.at(
params.rnti).m_enabledComponentCarrier;
403 if (
params.lcid == 0 ||
params.lcid == 1 || numberOfCarriersForUe == 1)
405 NS_LOG_INFO(
"Buffer status forwarded to the primary carrier.");
411 params.retxQueueSize /= numberOfCarriersForUe;
412 params.txQueueSize /= numberOfCarriersForUe;
413 for (uint32_t i = 0; i < numberOfCarriersForUe; i++)
416 "Mac sap provider does not exist.");
427 "Received BSR from a ComponentCarrier not allowed, ComponentCarrierId = "
428 << componentCarrierId);
430 "Received a Control Message not allowed " << bsr.m_macCeType);
433 uint32_t numberOfCarriersForUe =
m_ueInfo.at(bsr.
m_rnti).m_enabledComponentCarrier;
440 newBsr.m_macCeType = bsr.m_macCeType;
448 for (uint16_t i = 0; i < 4; i++)
462 for (uint32_t i = 0; i < numberOfCarriersForUe; i++)
465 "Mac sap provider does not exist.");
481 uint32_t numberOfCarriersForUe =
m_ueInfo.at(rnti).m_enabledComponentCarrier;
static uint8_t BufferSize2BsrId(uint32_t val)
Convert Buffer size to BSR ID.
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
This class contains the specification of EPS Bearers.
uint8_t GetResourceType() const
Qci qci
Qos class indicator.
GbrQosInformation gbrQosInfo
GBR QOS information.
virtual Ptr< UeManager > GetUeManager(uint16_t rnti)=0
Get UE manager by RNTI.
The class implements Component Carrier Manager (CCM) that operates using the Component Carrier Manage...
std::map< uint16_t, UeInfo > m_ueInfo
The map from RNTI to UE information.
LteCcmRrcSapProvider * m_ccmRrcSapProvider
A pointer to the SAP interface of the CCM instance to receive API calls from the eNodeB RRC instance.
LteMacSapProvider * m_macSapProvider
A pointer to main SAP interface of the MAC instance, which is in this case handled by CCM.
std::map< uint8_t, LteMacSapProvider * > m_macSapProvidersMap
A map of pointers to real SAP interfaces of MAC instances.
uint16_t m_noOfComponentCarriers
The number component of carriers that are supported by this eNb.
std::map< uint8_t, LteCcmMacSapProvider * > m_ccmMacSapProviderMap
A map of pointers to the SAP interfaces of CCM instance that provides the CCM specific functionalitie...
LteCcmMacSapUser * m_ccmMacSapUser
LteCcmMacSapUser is extended version of LteMacSapUser interface.
LteCcmRrcSapUser * m_ccmRrcSapUser
A pointer to SAP interface of RRC instance, i.e.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
The default component carrier manager that forwards all traffic, the uplink and the downlink,...
void DoDispose() override
Destructor implementation.
virtual LteMacSapUser * DoConfigureSignalBearer(LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser *msu)
Configure the signal bearer.
std::map< uint8_t, double > m_ccPrbOccupancy
The physical resource block occupancy per carrier.
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 ...
friend class MemberLteCcmRrcSapProvider< NoOpComponentCarrierManager >
allow MemberLteCcmRrcSapProvider<NoOpComponentCarrierManager> class friend access
virtual void DoTransmitPdu(LteMacSapProvider::TransmitPduParameters params)
Transmit PDU.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of ReportUeMeas.
virtual void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params)
Report buffer status.
virtual void DoAddLc(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser *msu)
Add LC.
virtual void DoRemoveUe(uint16_t rnti)
Remove UE.
virtual void DoAddUe(uint16_t rnti, uint8_t state)
Add UE.
virtual void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters txOpParams)
Notify transmit opportunity.
virtual void DoUlReceiveSr(uint16_t rnti, uint8_t componentCarrierId)
Forward uplink SR to CCM, called by MAC through CCM SAP interface.
friend class MemberLteCcmMacSapUser< NoOpComponentCarrierManager >
allow MemberLteCcmMacSapUser<NoOpComponentCarrierManager> class friend access
NoOpComponentCarrierManager()
virtual void DoUlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId)
Forwards uplink BSR to CCM, called by MAC through CCM SAP interface.
friend class EnbMacMemberLteMacSapProvider< NoOpComponentCarrierManager >
allow EnbMacMemberLteMacSapProvider<NoOpComponentCarrierManager> class friend access
virtual std::vector< uint8_t > DoReleaseDataRadioBearer(uint16_t rnti, uint8_t lcid)
Release data radio bearer.
~NoOpComponentCarrierManager() override
virtual void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams)
Receive PDU.
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.
void DoInitialize() override
Initialize() implementation.
static TypeId GetTypeId()
Get the type ID.
virtual void DoNotifyHarqDeliveryFailure()
Notify HARQ delivery failure.
virtual void DoInitialize()
Initialize() implementation.
Component carrier manager implementation that splits traffic equally among carriers.
void DoUlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId) override
Forwards uplink BSR to CCM, called by MAC through CCM SAP interface.
~RrComponentCarrierManager() override
static TypeId GetTypeId()
Get the type ID.
RrComponentCarrierManager()
void DoUlReceiveSr(uint16_t rnti, uint8_t componentCarrierId) override
Forward uplink SR to CCM, called by MAC through CCM SAP interface.
uint8_t m_lastCcIdForSr
Last CCID to which a SR was routed.
void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params) override
Report buffer status.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
uint16_t componentCarrierId
component carrier ID
LteEnbCmacSapProvider::LcInfo lc
LC info.
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
uint64_t gbrUl
guaranteed bitrate in uplink
uint8_t qci
QoS Class Identifier.
uint64_t mbrDl
maximum bitrate in downlink
uint64_t mbrUl
maximum bitrate in uplink
uint8_t lcGroup
logical channel group
uint8_t resourceType
0 if the bearer is NON-GBR, 1 if the bearer is GBR, 2 if the bearer in DC-GBR
uint64_t gbrDl
guaranteed bitrate in downlink
uint8_t lcId
logical channel identifier
uint16_t rnti
C-RNTI identifying the UE.
Structure to represent UE info.
uint8_t m_enabledComponentCarrier
The number of enabled component carriers.
uint8_t m_ueState
RRC states of UE, e.g.
Parameters for LteMacSapProvider::ReportBufferStatus.
Parameters for LteMacSapProvider::TransmitPdu.
Parameters for LteMacSapUser::ReceivePdu.
uint8_t lcid
the logical channel id
uint16_t rnti
the C-RNTI identifying the UE
Parameters for LteMacSapUser::NotifyTxOpportunity.
uint16_t rnti
the C-RNTI identifying the UE
uint8_t componentCarrierId
the component carrier id
uint8_t layer
the layer of transmission (MIMO)
uint8_t lcid
the logical channel id
See section 4.3.14 macCEListElement.
struct MacCeValue_u m_macCeValue
MAC CE value.
std::vector< uint8_t > m_bufferStatus
buffer status