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);
105 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt =
m_ueAttached.find (txOpParams.
rnti);
107 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (txOpParams.
lcid);
108 NS_ASSERT_MSG (lcidIt != rntiIt->second.end (),
"could not find LCID " << (uint16_t) txOpParams.
lcid);
110 (*lcidIt).second->NotifyTxOpportunity (txOpParams);
118 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt =
m_ueAttached.find (rxPduParams.
rnti);
120 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (rxPduParams.
lcid);
121 if (lcidIt != rntiIt->second.end ())
123 (*lcidIt).second->ReceivePdu (rxPduParams);
144 std::map<uint16_t, uint8_t>::iterator stateIt;
145 std::map<uint16_t, uint8_t>::iterator eccIt;
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));
165 NS_FATAL_ERROR (
this <<
" Ue " << rnti <<
" had Component Carrier enabled before join the network" << (uint16_t) state);
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*> >
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");
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> >
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);
186 NS_LOG_DEBUG (
this <<
" UE " << rnti <<
"found, updating the state from " << (uint16_t) stateIt->second <<
" to " << (uint16_t) state);
187 stateIt->second = state;
206 std::map<uint16_t, uint8_t>::iterator stateIt;
207 std::map<uint16_t, uint8_t>::iterator eccIt;
227 std::vector<LteCcmRrcSapProvider::LcsConfig>
231 std::map<uint16_t, uint8_t>::iterator eccIt;
238 std::vector<LteCcmRrcSapProvider::LcsConfig> res;
270 res.push_back (entry);
275 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator rntiIter =
m_rlcLcInstantiated.find (rnti);
291 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator sapIt =
m_ueAttached.find (rnti);
294 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcidIt = rntiIter->second.find (lcid);
297 if (lcidIt == rntiIter->second.end ())
308 rntiIter->second.insert (std::pair<uint8_t, LteEnbCmacSapProvider::LcInfo> (lcinfo.
lcId, lcinfo));
309 sapIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.
lcId, msu));
325 std::map<uint16_t, uint8_t>::iterator eccIt;
328 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator lcsIt;
331 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcIt;
332 NS_LOG_DEBUG (
this <<
" remove lcid " << (uint16_t) lcid <<
" for rnti " << rnti);
333 lcIt = lcsIt->second.find (lcid);
334 NS_ASSERT_MSG (lcIt != lcsIt->second.end (),
" Logical Channel not found");
335 std::vector<uint8_t> res;
336 for (uint16_t i = 0; i < eccIt->second; i++)
338 res.insert (res.end (), i);
341 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt =
m_ueAttached.find (rnti);
342 rntiIt->second.erase (lcid);
343 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator rlcInstancesIt =
m_rlcLcInstantiated.find (rnti);
344 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator rclLcIt;
345 lcIt = rlcInstancesIt->second.find (lcid);
346 NS_ASSERT_MSG (lcIt != lcsIt->second.end (),
" Erasing: Logical Channel not found");
347 lcsIt->second.erase (lcid);
355 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator itSapUserAtCcm;
358 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt =
m_ueAttached.find (lcinfo.
rnti);
360 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcinfo.
lcId);
361 if (lcidIt == rntiIt->second.end ())
363 rntiIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.
lcId, msu));
377 NS_LOG_DEBUG (
"Update PRB occupancy:"<<prbOccupancy<<
" at carrier:"<< (uint32_t) componentCarrierId);
378 m_ccPrbOccupancy.insert(std::pair<uint8_t, double> (componentCarrierId, prbOccupancy));
394 for (uint16_t i = 0; i < 4; i++)
417 sapIt->second->ReportMacCeToScheduler (newBsr);
433 "Sap not found in the CcmMacSapProviderMap");
435 sapIt->second->ReportSrToScheduler (rnti);
457 static TypeId tid =
TypeId (
"ns3::RrComponentCarrierManager")
474 if (params.
lcid == 0 || params.
lcid == 1 || numberOfCarriersForUe == 1)
476 NS_LOG_INFO(
"Buffer status forwarded to the primary carrier.");
484 for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++)
497 NS_ASSERT_MSG (componentCarrierId == 0,
"Received BSR from a ComponentCarrier not allowed, ComponentCarrierId = " << componentCarrierId);
516 for (uint16_t i = 0; i < 4; i++)
529 for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++)
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.
EnbMacMemberLteMacSapProvider class.
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 "...
Parameters for LteMacSapUser::NotifyTxOpportunity.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
virtual void DoUlReceiveSr(uint16_t rnti, uint8_t componentCarrierId) override
Forward uplink SR to CCM, called by MAC through CCM SAP interface.
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 DoTransmitPdu(LteMacSapProvider::TransmitPduParameters params)
Transmit PDU.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
virtual void DoAddLc(LteEnbCmacSapProvider::LcInfo lcInfo, LteMacSapUser *msu)
Add LC.
std::map< uint8_t, double > m_ccPrbOccupancy
The physical resource block occupancy per carrier.
#define NS_UNUSED(x)
Mark a local variable as unused.
uint32_t retxQueueSize
the current size of the RLC retransmission queue in bytes
struct MacCeValue_u m_macCeValue
MAC CE value.
uint16_t rnti
the C-RNTI identifying the UE
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
uint64_t mbrDl
maximum bitrate in downlink
uint8_t m_lastCcIdForSr
Last CCID to which a SR was routed.
uint8_t componentCarrierId
the component carrier id corresponding to the sending Mac istance
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 ...
uint16_t rnti
the C-RNTI identifying the UE
virtual void DoNotifyHarqDeliveryFailure()
Notify HARQ delivery failure.
LteCcmMacSapUser * m_ccmMacSapUser
LteCcmMacSapUser is extended version of LteMacSapUser interface.
Parameters for LteMacSapProvider::ReportBufferStatus.
uint8_t lcid
the logical channel id
uint8_t lcid
the logical channel id
uint16_t componentCarrierId
component carrier ID
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of ReportUeMeas.
uint8_t lcId
logical channel identifier
The default component carrier manager that forwards all traffic, the uplink and the downlink...
make Callback use a separate empty type
static uint8_t BufferSize2BsrId(uint32_t val)
Convert Buffer size to BSR ID.
std::map< uint16_t, std::map< uint8_t, LteEnbCmacSapProvider::LcInfo > > m_rlcLcInstantiated
This map contains logical channel configuration per flow Id (rnti, lcid).
virtual void DoReportBufferStatus(LteMacSapProvider::ReportBufferStatusParameters params) override
Report buffer status.
static TypeId GetTypeId()
Get the type ID.
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
Component carrier manager implementation that splits traffic equally among carriers.
virtual void DoUlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId)
Forwards uplink BSR to CCM, called by MAC through CCM SAP interface.
uint8_t componentCarrierId
the component carrier id
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...
virtual void DoUlReceiveMacCe(MacCeListElement_s bsr, uint8_t componentCarrierId) override
Forwards uplink BSR to CCM, called by MAC through CCM SAP interface.
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.
NoOpComponentCarrierManager()
MemberLteCcmRrcSapProvider class.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
RrComponentCarrierManager()
uint8_t lcGroup
logical channel group
static TypeId GetTypeId()
Get the type ID.
This class contains the specification of EPS Bearers.
uint8_t lcid
the logical channel id corresponding to the sending RLC instance
uint32_t txQueueSize
the current size of the RLC transmission queue
virtual void DoInitialize()
Initialize() implementation.
virtual ~NoOpComponentCarrierManager()
std::map< uint16_t, uint8_t > m_ueState
Map of RRC states per UE (rnti, state), e.g.
enum ns3::EpsBearer::Qci qci
Qos class indicator.
uint16_t rnti
C-RNTI identifying the UE.
std::vector< uint8_t > m_bufferStatus
buffer status
uint64_t mbrUl
maximum bitrate in uplink
uint64_t gbrUl
guaranteed bitrate in uplink
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
GbrQosInformation gbrQosInfo
GBR QOS information.
uint8_t layer
the layer of transmission (MIMO)
static uint32_t BsrId2BufferSize(uint8_t val)
Convert BSR ID to buffer size.
Service Access Point (SAP) offered by the MAC to the RLC See Femto Forum MAC Scheduler Interface Spec...
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...
virtual void DoNotifyTxOpportunity(LteMacSapUser::TxOpportunityParameters txOpParams)
Notify transmit opportunity.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
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.
Parameters for LteMacSapUser::ReceivePdu.
uint16_t rnti
the C-RNTI identifying the UE
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
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.
virtual void DoAddUe(uint16_t rnti, uint8_t state)
Add UE.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
virtual void DoUlReceiveSr(uint16_t rnti, uint8_t componentCarrierId)
Forward uplink SR to CCM, called by MAC through CCM SAP interface.
virtual ~RrComponentCarrierManager() override
virtual void DoReceivePdu(LteMacSapUser::ReceivePduParameters rxPduParams)
Receive PDU.
bool isGbr
true if the bearer is GBR, false if the bearer is NON-GBR
uint16_t m_noOfComponentCarriers
The number component of carriers that are supported by this eNb.
Parameters for LteMacSapProvider::TransmitPdu.