12#include "ns3/boolean.h"
88 : m_ffrSapUser(nullptr),
89 m_ffrRrcSapUser(nullptr),
90 m_dlEdgeSubBandOffset(0),
91 m_dlEdgeSubBandwidth(0),
92 m_ulEdgeSubBandOffset(0),
93 m_ulEdgeSubBandwidth(0),
118 TypeId(
"ns3::LteFfrSoftAlgorithm")
122 .AddAttribute(
"UlCommonSubBandwidth",
123 "Uplink Medium (Common) SubBandwidth Configuration in number of Resource "
128 .AddAttribute(
"UlEdgeSubBandOffset",
129 "Uplink Edge SubBand Offset in number of Resource Block Groups",
134 "UlEdgeSubBandwidth",
135 "Uplink Edge SubBandwidth Configuration in number of Resource Block Groups",
139 .AddAttribute(
"DlCommonSubBandwidth",
140 "Downlink Medium (Common) SubBandwidth Configuration in number of "
141 "Resource Block Groups",
145 .AddAttribute(
"DlEdgeSubBandOffset",
146 "Downlink Edge SubBand Offset in number of Resource Block Groups",
151 "DlEdgeSubBandwidth",
152 "Downlink Edge SubBandwidth Configuration in number of Resource Block Groups",
156 .AddAttribute(
"CenterRsrqThreshold",
157 "If the RSRQ of is worse than this threshold, UE should be served in "
164 "If the RSRQ of is worse than this threshold, UE should be served in Edge sub-band",
168 .AddAttribute(
"CenterAreaPowerOffset",
169 "PdschConfigDedicated::Pa value for Center Sub-band, default value dB0",
173 .AddAttribute(
"MediumAreaPowerOffset",
174 "PdschConfigDedicated::Pa value for Medium Sub-band, default value dB0",
178 .AddAttribute(
"EdgeAreaPowerOffset",
179 "PdschConfigDedicated::Pa value for Edge Sub-band, default value dB0",
183 .AddAttribute(
"CenterAreaTpc",
184 "TPC value which will be set in DL-DCI for UEs in center area"
185 "Absolute mode is used, default value 1 is mapped to -1 according to"
186 "TS36.213 Table 5.1.1.1-2",
190 .AddAttribute(
"MediumAreaTpc",
191 "TPC value which will be set in DL-DCI for UEs in medium area"
192 "Absolute mode is used, default value 1 is mapped to -1 according to"
193 "TS36.213 Table 5.1.1.1-2",
197 .AddAttribute(
"EdgeAreaTpc",
198 "TPC value which will be set in DL-DCI for UEs in edge area"
199 "Absolute mode is used, default value 1 is mapped to -1 according to"
200 "TS36.213 Table 5.1.1.1-2",
250 NS_LOG_LOGIC(
this <<
" requesting Event A1 measurements"
323 "DlCommonSubBandwidth higher than DlBandwidth");
325 "DlCommonSubBandwidth + DlEdgeSubBandOffset higher than DlBandwidth");
327 "DlEdgeSubBandOffset higher than DlBandwidth");
329 "DlEdgeSubBandwidth higher than DlBandwidth");
332 "(DlCommonSubBandwidth + DlEdgeSubBandOffset+DlEdgeSubBandwidth) higher than DlBandwidth");
363 "UlCommonSubBandwidth higher than UlBandwidth");
365 "UlCommonSubBandwidth + UlEdgeSubBandOffset higher than UlBandwidth");
367 "UlEdgeSubBandOffset higher than UlBandwidth");
369 "UlEdgeSubBandwidth higher than UlBandwidth");
372 "(UlCommonSubBandwidth + UlEdgeSubBandOffset+UlEdgeSubBandwidth) higher than UlBandwidth");
416 auto it =
m_ues.find(rnti);
417 if (it ==
m_ues.end())
422 it =
m_ues.find(rnti);
430 bool isCenterUe =
false;
431 bool isMediumUe =
false;
432 bool isEdgeUe =
false;
447 return (isCenterRbg && isCenterUe) || (isMediumRbg && isMediumUe) || (isEdgeRbg && isEdgeUe);
477 auto it =
m_ues.find(rnti);
478 if (it ==
m_ues.end())
483 it =
m_ues.find(rnti);
491 bool isCenterUe =
false;
492 bool isMediumUe =
false;
493 bool isEdgeUe =
false;
508 return (isCenterRbg && isCenterUe) || (isMediumRbg && isMediumUe) || (isEdgeRbg && isEdgeUe);
516 NS_LOG_WARN(
"Method should not be called, because it is empty");
524 NS_LOG_WARN(
"Method should not be called, because it is empty");
531 NS_LOG_WARN(
"Method should not be called, because it is empty");
555 auto it =
m_ues.find(rnti);
556 if (it ==
m_ues.end())
587 uint8_t centerSubBandwidth = 0;
588 uint8_t mediumSubBandwidth = 0;
589 uint8_t edgeSubBandwidth = 0;
595 centerSubBandwidth++;
603 mediumSubBandwidth++;
617 minContinuousUlBandwidth =
618 ((centerSubBandwidth > 0) && (centerSubBandwidth < minContinuousUlBandwidth))
620 : minContinuousUlBandwidth;
622 minContinuousUlBandwidth =
623 ((mediumSubBandwidth > 0) && (mediumSubBandwidth < minContinuousUlBandwidth))
625 : minContinuousUlBandwidth;
627 minContinuousUlBandwidth =
628 ((edgeSubBandwidth > 0) && (edgeSubBandwidth < minContinuousUlBandwidth))
630 : minContinuousUlBandwidth;
632 NS_LOG_INFO(
"minContinuousUlBandwidth: " << (
int)minContinuousUlBandwidth);
634 return minContinuousUlBandwidth;
646 "CenterSubBandThreshold must be higher than EdgeSubBandThreshold");
654 auto it =
m_ues.find(rnti);
655 if (it ==
m_ues.end())
660 it =
m_ues.find(rnti);
665 NS_LOG_INFO(
"UE RNTI: " << rnti <<
" will be served in Center sub-band");
677 NS_LOG_INFO(
"UE RNTI: " << rnti <<
" will be served in Edge sub-band");
689 NS_LOG_INFO(
"UE RNTI: " << rnti <<
" will be served in Medium sub-band");
704 NS_LOG_WARN(
"Method should not be called, because it is empty");
The abstract base class of a Frequency Reuse algorithm.
bool m_needReconfiguration
If true FR algorithm will be reconfigured.
uint8_t m_frCellTypeId
FFR cell type ID for automatic configuration.
int GetRbgSize(int dlbandwidth)
Get RBG size for DL Bandwidth according to table 7.1.6.1-1 of 36.213.
bool m_enabledInUplink
If true FR algorithm will also work in Uplink.
uint8_t m_dlBandwidth
downlink bandwidth in RBs
uint8_t m_ulBandwidth
uplink bandwidth in RBs
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
virtual void SetPdschConfigDedicated(uint16_t rnti, LteRrcSap::PdschConfigDedicated pdschConfigDedicated)=0
Instruct the eNodeB RRC entity to perform RrcConnectionReconfiguration to inform UE about new PdschCo...
virtual uint8_t AddUeMeasReportConfigForFfr(LteRrcSap::ReportConfigEutra reportConfig)=0
Request a certain reporting configuration to be fulfilled by the UEs attached to the eNodeB entity.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Soft Fractional Frequency Reuse algorithm implementation.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set uplink configuration function.
std::vector< bool > m_dlRbgMap
DL RBG Map.
LteFfrSoftAlgorithm()
Creates a trivial ffr algorithm instance.
void DoReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms) override
DoReportUlCqiInfo.
void DoInitialize() override
Initialize() implementation.
LteFfrRrcSapProvider * GetLteFfrRrcSapProvider() override
Export the "provider" part of the LteFfrRrcSap interface.
uint8_t m_dlEdgeSubBandOffset
DL edge subband offset.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
friend class MemberLteFfrRrcSapProvider< LteFfrSoftAlgorithm >
let the forwarder class access the protected and private members
std::vector< bool > m_ulMediumRbgMap
UL medium RBG map.
uint8_t m_ulEdgeSubBandwidth
UL edge subbandwidth.
LteFfrSapProvider * GetLteFfrSapProvider() override
Export the "provider" part of the LteFfrSap interface.
uint8_t m_centerAreaTpc
center area tpc
std::vector< bool > m_ulRbgMap
UL RBG map.
void DoDispose() override
Destructor implementation.
std::vector< bool > m_dlMediumRbgMap
DL medium RBG map.
void SetLteFfrSapUser(LteFfrSapUser *s) override
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
std::vector< bool > DoGetAvailableDlRbg() override
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
std::vector< bool > m_dlEdgeRbgMap
DL edge RBG map.
bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
uint8_t m_mediumAreaPowerOffset
medium area power offset
void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s) override
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void DoReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms) override
DoReportDlCqiInfo.
uint8_t m_edgeAreaPowerOffset
edge area power offset
std::vector< bool > m_dlCenterRbgMap
DL center RBG map.
uint8_t m_mediumAreaTpc
medium area tpc
void InitializeUplinkRbgMaps()
Initialize uplink RBG maps function.
uint8_t m_ulEdgeSubBandOffset
UL edge subband offset.
uint8_t m_dlEdgeSubBandwidth
DL edge subbandwidth.
uint8_t m_edgeSubBandThreshold
edge subband threshold
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
std::vector< bool > m_ulCenterRbgMap
UL center RBG map.
~LteFfrSoftAlgorithm() override
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set downlink configuration function.
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
uint8_t m_ulCommonSubBandwidth
UL common subbandwidth.
void Reconfigure() override
Automatic FR reconfiguration.
uint16_t DoGetMinContinuousUlBandwidth() override
DoGetMinContinuousUlBandwidth in number of RB.
uint8_t m_centerAreaPowerOffset
center area power offset
uint8_t m_centerSubBandThreshold
center subband threshold
uint8_t m_measId
The expected measurement identity.
std::vector< bool > DoGetAvailableUlRbg() override
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP provider.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP user.
bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
uint8_t m_dlCommonSubBandwidth
DL common subbandwidth.
void InitializeDownlinkRbgMaps()
Initialize downlink RBG maps function.
std::map< uint16_t, uint8_t > m_ues
UEs.
friend class MemberLteFfrSapProvider< LteFfrSoftAlgorithm >
let the forwarder class access the protected and private members
void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params) override
DoRecvLoadInformation.
uint8_t m_edgeAreaTpc
edge area tpc
uint8_t DoGetTpc(uint16_t rnti) override
DoGetTpc for UE.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
static TypeId GetTypeId()
Get the type ID.
virtual void DoInitialize()
Initialize() implementation.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#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_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#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.
static const FfrSoftDownlinkDefaultConfiguration g_ffrSoftDownlinkDefaultConfiguration[]
The soft downlink default configuration.
Ptr< const AttributeChecker > MakeUintegerChecker()
static const FfrSoftUplinkDefaultConfiguration g_ffrSoftUplinkDefaultConfiguration[]
The soft uplink default configuration.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
const uint16_t NUM_DOWNLINK_CONFS(sizeof(g_ffrEnhancedDownlinkDefaultConfiguration)/sizeof(FfrEnhancedDownlinkDefaultConfiguration))
const uint16_t NUM_UPLINK_CONFS(sizeof(g_ffrEnhancedUplinkDefaultConfiguration)/sizeof(FfrEnhancedUplinkDefaultConfiguration))
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
FfrSoftDownlinkDefaultConfiguration structure.
uint8_t dlBandwidth
DL bandwidth.
uint8_t dlEdgeSubBandOffset
DL edge subband offset.
uint8_t dlEdgeSubBandwidth
DL edge subbandwidth.
uint8_t dlCommonSubBandwidth
DL common subbandwidth.
FfrSoftUplinkDefaultConfiguration structure.
uint8_t ulCommonSubBandwidth
UL common subbandwidth.
uint8_t ulBandwidth
UL bandwidth.
uint8_t ulEdgeSubBandOffset
UL edge subband offset.
uint8_t ulEdgeSubBandwidth
edge subbandwidth
uint8_t rsrqResult
the RSRQ result
uint8_t rsrpResult
the RSRP result
MeasResultPCell measResultPCell
measurement result primary cell
PdschConfigDedicated structure.
Specifies criteria for triggering of an E-UTRA measurement reporting event.
enum ns3::LteRrcSap::ReportConfigEutra::@62 eventId
Event enumeration.
@ RSRQ
Reference Signal Received Quality.
@ EVENT_A1
Event A1: Serving becomes better than absolute threshold.
enum ns3::LteRrcSap::ReportConfigEutra::@65 reportInterval
Report interval enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@63 triggerQuantity
Trigger type enumeration.
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
@ THRESHOLD_RSRQ
RSRQ is used for the threshold.
enum ns3::LteRrcSap::ThresholdEutra::@60 choice
Threshold enumeration.
uint8_t range
Value range used in RSRP/RSRQ threshold.