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 (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);
118 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt =
m_ueAttached.find (rnti);
120 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcid);
121 if (lcidIt != rntiIt->second.end ())
123 (*lcidIt).second->ReceivePdu (p, rnti, lcid);
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;
215 std::vector<LteCcmRrcSapProvider::LcsConfig>
219 std::map<uint16_t, uint8_t>::iterator eccIt;
226 std::vector<LteCcmRrcSapProvider::LcsConfig> res;
258 res.push_back (entry);
263 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator rntiIter =
m_rlcLcInstantiated.find (rnti);
279 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator sapIt =
m_ueAttached.find (rnti);
282 std::map<uint8_t, LteEnbCmacSapProvider::LcInfo>::iterator lcidIt = rntiIter->second.find (lcid);
285 if (lcidIt == rntiIter->second.end ())
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));
313 std::map<uint16_t, uint8_t>::iterator eccIt;
316 std::map <uint16_t, std::map<uint8_t, LteEnbCmacSapProvider::LcInfo> >::iterator lcsIt;
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++)
326 res.insert (res.end (), i);
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);
343 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator itSapUserAtCcm;
346 std::map <uint16_t, std::map<uint8_t, LteMacSapUser*> >::iterator rntiIt =
m_ueAttached.find (lcinfo.
rnti);
348 std::map<uint8_t, LteMacSapUser*>::iterator lcidIt = rntiIt->second.find (lcinfo.
lcId);
349 if (lcidIt == rntiIt->second.end ())
351 rntiIt->second.insert (std::pair<uint8_t, LteMacSapUser*> (lcinfo.
lcId, msu));
365 NS_LOG_DEBUG (
"Update PRB occupancy:"<<prbOccupancy<<
" at carrier:"<< (uint32_t) componentCarrierId);
366 m_ccPrbOccupancy.insert(std::pair<uint8_t, double> (componentCarrierId, prbOccupancy));
382 for (uint16_t i = 0; i < 4; i++)
405 sapIt->second->ReportMacCeToScheduler (newBsr);
433 static TypeId tid =
TypeId (
"ns3::RrComponentCarrierManager")
450 if (params.
lcid == 0 || params.
lcid == 1 || numberOfCarriersForUe == 1)
452 NS_LOG_INFO(
"Buffer status forwarded to the primary carrier.");
460 for ( uint16_t i = 0; i < numberOfCarriersForUe ; i++)
473 NS_ASSERT_MSG (componentCarrierId == 0,
"Received BSR from a ComponentCarrier not allowed, ComponentCarrierId = " << componentCarrierId);
492 for (uint16_t i = 0; i < 4; i++)
505 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 "...
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
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.
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
struct MacCeValue_u m_macCeValue
MAC CE value.
#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 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.
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.
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
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).
static TypeId GetTypeId()
Get the type ID.
Logical Channel information to be passed to CmacSapProvider::ConfigureLc.
GbrQosInformation gbrQosInfo
GBR QOS information.
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...
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.
enum ns3::EpsBearer::Qci qci
Qos class indicator.
RrComponentCarrierManager()
uint8_t lcGroup
logical channel group
static TypeId GetTypeId()
Get the type ID.
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.
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.
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...
#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.
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
virtual ~RrComponentCarrierManager()
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.
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.