26 #include <ns3/random-variable-stream.h>
60 static TypeId tid =
TypeId (
"ns3::NoOpComponentCarrierManager")
88 it->second->TransmitPdu (params);
96 std::map <uint8_t, LteMacSapProvider*>::iterator it =
m_macSapProvidersMap.find (ueManager->GetComponentCarrierId ());
98 it->second->ReportBufferStatus (params);
106 m_ueInfo.at (txOpParams.
rnti).m_ueAttached.at (txOpParams.
lcid)->NotifyTxOpportunity (txOpParams);
113 auto lcidIt =
m_ueInfo.at (rxPduParams.
rnti).m_ueAttached.find (rxPduParams.
lcid);
114 if (lcidIt !=
m_ueInfo.at (rxPduParams.
rnti).m_ueAttached.end ())
116 lcidIt->second->ReceivePdu (rxPduParams);
137 std::map<uint16_t, uint8_t>::iterator eccIt;
138 auto ueInfoIt =
m_ueInfo.find (rnti);
141 NS_LOG_DEBUG (
this <<
" UE " << rnti <<
" was not found, now it is added in the map");
155 NS_LOG_DEBUG (
this <<
" UE " << rnti <<
"found, updating the state from " << +ueInfoIt->second.m_ueState <<
" to " << +state);
156 ueInfoIt->second.m_ueState = state;
164 m_ueInfo.at (lcInfo.
rnti).m_rlcLcInstantiated.emplace (lcInfo.
lcId, lcInfo);
177 std::vector<LteCcmRrcSapProvider::LcsConfig>
187 std::vector<LteCcmRrcSapProvider::LcsConfig> res;
219 res.push_back (entry);
222 auto lcidIt = rntiIt->second.m_rlcLcInstantiated.find (lcid);
223 if (lcidIt == rntiIt->second.m_rlcLcInstantiated.end ())
234 rntiIt->second.m_rlcLcInstantiated.emplace (lcinfo.
lcId, lcinfo);
235 rntiIt->second.m_ueAttached.emplace (lcinfo.
lcId, msu);
253 NS_ASSERT_MSG (rntiIt !=
m_ueInfo.end (),
"request to Release Data Radio Bearer on UE with unknown RNTI " << rnti);
255 NS_LOG_DEBUG (
this <<
" remove LCID " << +lcid <<
" for RNTI " << rnti);
256 std::vector<uint8_t> res;
257 for (uint16_t i = 0; i < rntiIt->second.m_enabledComponentCarrier; i++)
259 res.insert (res.end (), i);
262 auto lcIt = rntiIt->second.m_ueAttached.find (lcid);
263 NS_ASSERT_MSG (lcIt != rntiIt->second.m_ueAttached.end (),
"Logical Channel not found");
264 rntiIt->second.m_ueAttached.erase (lcIt);
266 auto rlcInstancesIt = rntiIt->second.m_rlcLcInstantiated.find (rnti);
267 NS_ASSERT_MSG (rlcInstancesIt != rntiIt->second.m_rlcLcInstantiated.end (),
"Logical Channel not found");
268 rntiIt->second.m_rlcLcInstantiated.erase (rlcInstancesIt);
281 auto lcidIt = rntiIt->second.m_ueAttached.find (lcinfo.
lcId);
282 if (lcidIt == rntiIt->second.m_ueAttached.end ())
284 rntiIt->second.m_ueAttached.emplace (lcinfo.
lcId, msu);
298 NS_LOG_DEBUG (
"Update PRB occupancy:"<<prbOccupancy<<
" at carrier:"<< (uint32_t) componentCarrierId);
299 m_ccPrbOccupancy.insert(std::pair<uint8_t, double> (componentCarrierId, prbOccupancy));
311 newBsr.m_macCeType = bsr.m_macCeType;
315 for (uint16_t i = 0; i < 4; i++)
338 sapIt->second->ReportMacCeToScheduler (newBsr);
354 "Sap not found in the CcmMacSapProviderMap");
356 sapIt->second->ReportSrToScheduler (rnti);
378 static TypeId tid =
TypeId (
"ns3::RrComponentCarrierManager")
392 uint32_t numberOfCarriersForUe =
m_ueInfo.at (params.
rnti).m_enabledComponentCarrier;
393 if (params.
lcid == 0 || params.
lcid == 1 || numberOfCarriersForUe == 1)
395 NS_LOG_INFO(
"Buffer status forwarded to the primary carrier.");
403 for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++)
416 NS_ASSERT_MSG (componentCarrierId == 0,
"Received BSR from a ComponentCarrier not allowed, ComponentCarrierId = " << componentCarrierId);
420 uint32_t numberOfCarriersForUe =
m_ueInfo.at (bsr.
m_rnti).m_enabledComponentCarrier;
427 newBsr.m_macCeType = bsr.m_macCeType;
435 for (uint16_t i = 0; i < 4; i++)
448 for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++)
466 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.
enum ns3::EpsBearer::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.
std::map< uint8_t, LteCcmMacSapProvider * > m_ccmMacSapProviderMap
A map of pointers to the SAP interfaces of CCM instance that provides the CCM specific functionalitie...
uint16_t m_noOfComponentCarriers
The number component of carriers that are supported by this eNb.
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,...
virtual LteMacSapUser * DoConfigureSignalBearer(LteEnbCmacSapProvider::LcInfo lcinfo, LteMacSapUser *msu)
Configure the signal bearer.
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.
virtual ~NoOpComponentCarrierManager()
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 DoDispose()
Destructor implementation.
std::map< uint8_t, double > m_ccPrbOccupancy
The physical resource block occupancy per carrier.
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.
virtual void DoInitialize()
Initialize() implementation.
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.
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.
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of ReportUeMeas.
static TypeId GetTypeId()
Get the type ID.
virtual void DoNotifyHarqDeliveryFailure()
Notify HARQ delivery failure.
virtual void DoInitialize(void)
Initialize() implementation.
Component carrier manager implementation that splits traffic equally among carriers.
virtual void DoUlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId) override
Forwards uplink BSR to CCM, called by MAC through CCM SAP interface.
virtual ~RrComponentCarrierManager() override
static TypeId GetTypeId()
Get the type ID.
RrComponentCarrierManager()
virtual 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.
virtual 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.
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
uint64_t gbrDl
guaranteed bitrate in downlink
uint8_t lcId
logical channel identifier
bool isGbr
true if the bearer is GBR, false if the bearer is NON-GBR
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.
uint32_t txQueueSize
the current size of the RLC transmission queue
uint32_t retxQueueSize
the current size of the RLC retransmission queue in bytes
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
uint16_t rnti
the C-RNTI identifying the UE
Parameters for LteMacSapProvider::TransmitPdu.
uint8_t componentCarrierId
the component carrier id corresponding to the sending Mac istance
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