5#include "bwp-manager-ue.h"
7#include "bwp-manager-algorithm.h"
8#include "nr-control-messages.h"
11#include "ns3/pointer.h"
16NS_LOG_COMPONENT_DEFINE(
"BwpManagerUe");
17NS_OBJECT_ENSURE_REGISTERED(BwpManagerUe);
22 NS_LOG_FUNCTION(
this);
27 NS_LOG_FUNCTION(
this);
33 NS_LOG_FUNCTION(
this);
34 m_algorithm = algorithm;
40 static TypeId tid = TypeId(
"ns3::BwpManagerUe")
44 .AddAttribute(
"BwpManagerAlgorithm",
45 "The algorithm pointer",
47 MakePointerAccessor(&BwpManagerUe::m_algorithm),
48 MakePointerChecker<BwpManagerAlgorithm>());
55 NS_LOG_FUNCTION(
this);
56 NS_ASSERT(m_algorithm !=
nullptr);
58 uint8_t bwpIndex = m_algorithm->GetBwpForEpsBearer(m_lcToBearerMap.at(params.
lcid));
61 <<
" from RLC for LCID = " <<
static_cast<uint32_t
>(params.
lcid)
62 <<
" traffic type " << m_lcToBearerMap.at(params.
lcid)
63 <<
" reported to CcId " <<
static_cast<uint32_t
>(bwpIndex));
68std::vector<NrUeCcmRrcSapProvider::LcsConfig>
73 NS_LOG_FUNCTION(
this);
75 NS_LOG_INFO(
"For LC ID " <<
static_cast<uint32_t
>(lcId) <<
" bearer qci "
76 <<
static_cast<uint32_t
>(lcConfig.
priority) <<
" from priority "
77 <<
static_cast<uint32_t
>(lcConfig.
priority));
90 NS_LOG_FUNCTION(
this);
100 NS_LOG_FUNCTION(
this);
108 NS_LOG_FUNCTION(
this);
109 m_outputLinks.insert(std::make_pair(sourceBwp, outputBwp));
115 NS_LOG_FUNCTION(
this);
117 NS_LOG_INFO(
"Msg type " << msg->GetMessageType() <<
" that wants to go out from UE");
119 if (m_outputLinks.empty())
121 NS_LOG_INFO(
"No linked BWP, routing outgoing msg to the source: " << +sourceBwpId);
125 auto it = m_outputLinks.find(sourceBwpId);
126 if (it == m_outputLinks.end())
128 NS_LOG_INFO(
"Source BWP not in the map, routing outgoing msg to itself: " << +sourceBwpId);
132 NS_LOG_INFO(
"routing outgoing msg to bwp: " << +it->second);
139 NS_LOG_FUNCTION(
this);
141 NS_LOG_INFO(
"Msg type " << msg->GetMessageType() <<
" comes from BWP " << +sourceBwpId
142 <<
" that wants to go in the UE, goes in BWP " << msg->GetSourceBwp());
143 return msg->GetSourceBwp();
146Ptr<const BwpManagerAlgorithm>
uint8_t RouteIngoingCtrlMsg(const Ptr< NrControlMessage > &msg, uint8_t sourceBwpId) const
Decide the BWP for the control message received.
NrMacSapUser * DoConfigureSignalBearer(uint8_t lcId, NrUeCmacSapProvider::LogicalChannelConfig lcConfig, NrMacSapUser *msu) override
Configure signal bearer function.
Ptr< const BwpManagerAlgorithm > GetAlgorithm() const
~BwpManagerUe() override
~BwpManagerUe
void SetBwpManagerAlgorithm(const Ptr< BwpManagerAlgorithm > &algorithm)
Set the algorithm.
uint8_t RouteDlHarqFeedback(const DlHarqInfo &m) const
The UE received a HARQ feedback from spectrum. Where this feedback should be forwarded?
std::vector< NrUeCcmRrcSapProvider::LcsConfig > DoAddLc(uint8_t lcId, NrUeCmacSapProvider::LogicalChannelConfig lcConfig, NrMacSapUser *msu) override
Add LC function.
static TypeId GetTypeId()
GetTypeId.
uint8_t RouteOutgoingCtrlMsg(const Ptr< NrControlMessage > &msg, uint8_t sourceBwpId) const
Route the outgoing messages to the right BWP.
void SetOutputLink(uint32_t sourceBwp, uint32_t outputBwp)
Set a mapping between two BWP.
BwpManagerUe()
BwpManagerUe constructor.
void DoTransmitBufferStatusReport(NrMacSapProvider::BufferStatusReportParameters params) override
Buffer status report function.
Component carrier manager implementation which simply does nothing.
virtual NrMacSapUser * DoConfigureSignalBearer(uint8_t lcId, NrUeCmacSapProvider::LogicalChannelConfig lcConfig, NrMacSapUser *msu)
Configure signal bearer function.
virtual std::vector< NrUeCcmRrcSapProvider::LcsConfig > DoAddLc(uint8_t lcId, NrUeCmacSapProvider::LogicalChannelConfig lcConfig, NrMacSapUser *msu)
Add LC function.
std::map< uint8_t, std::map< uint8_t, NrMacSapProvider * > > m_componentCarrierLcMap
Flow configuration per flow Id of this UE.
A struct that contains info for the DL HARQ.
uint8_t m_bwpIndex
BWP identifier, uniquely identifies BWP within the UE.
LogicalChannelConfig structure.