22 : m_ffrSapUser(nullptr),
23 m_ffrRrcSapUser(nullptr)
47 TypeId(
"ns3::LteFfrDistributedAlgorithm")
52 "CalculationInterval",
53 "Time interval between calculation of Edge sub-band, Default value 1 second",
59 "If the RSRQ of is worse than this threshold, UE should be served in Edge sub-band",
64 "RsrpDifferenceThreshold",
65 "If the difference between the power of the signal received by UE from "
66 "the serving cell and the power of the signal received from the adjacent cell is "
68 "than a RsrpDifferenceThreshold value, the cell weight is incremented",
72 .AddAttribute(
"CenterPowerOffset",
73 "PdschConfigDedicated::Pa value for Center Sub-band, default value dB0",
77 .AddAttribute(
"EdgePowerOffset",
78 "PdschConfigDedicated::Pa value for Edge Sub-band, default value dB0",
82 .AddAttribute(
"EdgeRbNum",
83 "Number of RB that can be used in edge Sub-band",
87 .AddAttribute(
"CenterAreaTpc",
88 "TPC value which will be set in DL-DCI for UEs in center area"
89 "Absolute mode is used, default value 1 is mapped to -1 according to"
90 "TS36.213 Table 5.1.1.1-2",
94 .AddAttribute(
"EdgeAreaTpc",
95 "TPC value which will be set in DL-DCI for UEs in edge area"
96 "Absolute mode is used, default value 1 is mapped to -1 according to"
97 "TS36.213 Table 5.1.1.1-2",
146 NS_LOG_LOGIC(
this <<
" requesting Event A1 and A4 measurements"
239 auto it =
m_ues.find(rnti);
240 if (it ==
m_ues.end())
252 return (edgeRbg && edgeUe) || (!edgeRbg && !edgeUe);
280 auto it =
m_ues.find(rnti);
281 if (it ==
m_ues.end())
293 return (edgeRbg && edgeUe) || (!edgeRbg && !edgeUe);
301 NS_LOG_WARN(
"Method should not be called, because it is empty");
309 NS_LOG_WARN(
"Method should not be called, because it is empty");
316 NS_LOG_WARN(
"Method should not be called, because it is empty");
340 auto it =
m_ues.find(rnti);
341 if (it ==
m_ues.end())
367 return minContinuousUlBandwidth;
372 : minContinuousUlBandwidth;
374 return minContinuousUlBandwidth;
382 <<
" MeasId: " << (uint16_t)measResults.
measId
389 auto it =
m_ues.find(rnti);
390 if (it ==
m_ues.end())
395 it =
m_ues.find(rnti);
400 NS_LOG_INFO(
"UE RNTI: " << rnti <<
" will be served in Center sub-band");
412 NS_LOG_INFO(
"UE RNTI: " << rnti <<
" will be served in Edge sub-band");
423 auto it =
m_ues.find(rnti);
424 if (it ==
m_ues.end())
441 "RSRP measurement is missing from cellId " << it->physCellId);
443 "RSRQ measurement is missing from cellId " << it->physCellId);
449 if ((*ncIt) == it->physCellId)
463 this <<
" Event A4 received without measurement results from neighbouring cells");
492 for (
auto areaIt =
m_ues.begin(); areaIt !=
m_ues.end(); areaIt++)
504 auto areaIt =
m_ues.find(it1->first);
510 servingCellMeasures =
nullptr;
511 neighbourCellMeasures =
nullptr;
513 auto it2 = it1->second.find(
m_cellId);
514 if (it2 != it1->second.end())
516 servingCellMeasures = it2->second;
523 for (it2 = it1->second.begin(); it2 != it1->second.end(); it2++)
527 neighbourCellMeasures = it2->second;
534 if (servingCellMeasures && neighbourCellMeasures)
536 int16_t rsrpDifference =
537 servingCellMeasures->m_rsrp - neighbourCellMeasures->m_rsrp;
539 <<
" NeighborCellId: " << neighbourCellMeasures->m_cellId
540 <<
" RSRP Serving: " << (
int)servingCellMeasures->m_rsrp
541 <<
" RSRP Neighbor: "
542 << (
int)neighbourCellMeasures->m_rsrp
543 <<
" RSRP Difference: " << (
int)rsrpDifference);
553 std::map<uint16_t, uint64_t> metricA;
554 for (uint16_t i = 0; i < rbgNum; i++)
562 <<
" Weight: " << cellIt->second);
564 auto rntpIt =
m_rntp.find(cellIt->first);
565 if (rntpIt ==
m_rntp.end())
570 for (uint16_t i = 0; i < rbgNum; i++)
572 if (rntpIt->second[i])
574 metricA[i] += cellIt->second;
579 std::vector<uint16_t> sortedRbgByMetric;
580 std::multimap<uint64_t, uint16_t> sortedMetricA;
581 for (
auto it = metricA.begin(); it != metricA.end(); ++it)
583 sortedMetricA.insert(std::pair<uint64_t, uint16_t>(it->second, it->first));
586 for (
auto it = sortedMetricA.begin(); it != sortedMetricA.end(); ++it)
588 sortedRbgByMetric.push_back(it->second);
598 uint32_t rbgIndex = sortedRbgByMetric[i];
599 for (
int k = 0; k < rbgSize; k++)
601 uint32_t rbIndex = rbgSize * rbgIndex + k;
618 NS_LOG_INFO(
"SendLoadInformation to CellId : " << targetCellId);
620 std::vector<EpcX2Sap::UlInterferenceOverloadIndicationItem>
621 m_currentUlInterferenceOverloadIndicationList;
622 std::vector<EpcX2Sap::UlHighInterferenceInformationItem>
623 m_currentUlHighInterferenceInformationList;
635 params.targetCellId = targetCellId;
636 params.cellInformationList.push_back(cii);
646 << params.cellInformationList[0].sourceCellId);
648 if (params.cellInformationList[0].sourceCellId >
m_cellId)
653 uint16_t neighborCellId = params.cellInformationList[0].sourceCellId;
654 auto it =
m_rntp.find(neighborCellId);
657 it->second = params.cellInformationList[0].relativeNarrowbandTxBand.rntpPerPrbList;
661 m_rntp.insert(std::pair<uint16_t, std::vector<bool>>(
663 params.cellInformationList[0].relativeNarrowbandTxBand.rntpPerPrbList));
681 auto ret =
m_ueMeasures.insert(std::pair<uint16_t, MeasurementRow_t>(rnti, row));
687 auto it2 = it1->second.find(cellId);
689 if (it2 != it1->second.end())
691 it2->second->m_cellId = cellId;
692 it2->second->m_rsrp = rsrp;
693 it2->second->m_rsrq = rsrq;
699 cellMeasures->m_cellId = cellId;
700 cellMeasures->m_rsrp = rsrp;
701 cellMeasures->m_rsrq = rsrq;
702 it1->second[cellId] = cellMeasures;
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
Distributed Fractional Frequency Reuse algorithm implementation.
std::map< uint16_t, Ptr< UeMeasure > > MeasurementRow_t
Cell Id is used as the key for the following map.
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
uint8_t DoGetTpc(uint16_t rnti) override
DoGetTpc for UE.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP Provider.
~LteFfrDistributedAlgorithm() override
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP Provider.
std::map< uint16_t, uint8_t > m_ues
UEs map.
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq)
Initialize up link RBG maps function.
uint8_t m_rsrpDifferenceThreshold
RSRP difference threshold.
uint8_t m_rsrpMeasId
RSRP measurement ID.
void DoDispose() override
Destructor implementation.
Time m_calculationInterval
calculation interval
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP User.
std::map< uint16_t, uint32_t > m_cellWeightMap
cell weight map
friend class MemberLteFfrSapProvider< LteFfrDistributedAlgorithm >
let the forwarder class access the protected and private members
bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set up link configuration function.
void DoInitialize() override
Initialize() implementation.
void DoReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms) override
DoReportDlCqiInfo.
LteFfrDistributedAlgorithm()
uint8_t m_edgeAreaTpc
edge area TCP
uint8_t m_rsrqMeasId
RSRQ measurement ID.
uint16_t DoGetMinContinuousUlBandwidth() override
DoGetMinContinuousUlBandwidth in number of RB.
uint8_t m_edgePowerOffset
edge power offset
void SetLteFfrSapUser(LteFfrSapUser *s) override
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params) override
DoRecvLoadInformation.
uint8_t m_centerAreaTpc
center area TPC
MeasurementTable_t m_ueMeasures
UE measures.
std::vector< bool > DoGetAvailableDlRbg() override
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
std::map< uint16_t, std::vector< bool > > m_rntp
RNTP.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set down link configuration function.
std::vector< uint16_t > m_neighborCell
neighbor cell
friend class MemberLteFfrRrcSapProvider< LteFfrDistributedAlgorithm >
let the forwarder class access the protected and private members
std::vector< bool > m_ulRbgMap
UL RBG map.
uint8_t m_edgeRbNum
edge RB number
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
uint8_t m_edgeSubBandRsrqThreshold
edge sub band RSRQ threshold
EventId m_calculationEvent
calculation event
std::vector< bool > DoGetAvailableUlRbg() override
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
static TypeId GetTypeId()
Get the type ID.
LteFfrSapProvider * GetLteFfrSapProvider() override
Export the "provider" part of the LteFfrSap interface.
void Calculate()
Calculate function.
LteFfrRrcSapProvider * GetLteFfrRrcSapProvider() override
Export the "provider" part of the LteFfrRrcSap interface.
std::vector< bool > m_dlRbgMap
DL RBG map.
void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s) override
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void Reconfigure() override
Automatic FR reconfiguration.
uint8_t m_centerPowerOffset
center power offset
void InitializeUplinkRbgMaps()
Initialize up link RBG maps function.
std::vector< bool > m_dlEdgeRbgMap
DL edge RBG map.
LteFfrSapUser * m_ffrSapUser
FFR SAP User.
void DoReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms) override
DoReportUlCqiInfo.
void SendLoadInformation(uint16_t targetCellId)
Send load information function.
void InitializeDownlinkRbgMaps()
Initialize down link RBG maps function.
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.
virtual void SendLoadInformation(EpcX2Sap::LoadInformationParams params)=0
SendLoadInformation.
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...
virtual void DoInitialize()
Initialize() implementation.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
AttributeValue implementation for Time.
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Ptr< const AttributeChecker > MakeUintegerChecker()
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
#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.
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Relative Narrowband Tx Power (RNTP) as it is used in the LOAD INFORMATION message.
std::vector< bool > rntpPerPrbList
RNTP per prb list.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
uint8_t rsrqResult
the RSRQ result
uint8_t rsrpResult
the RSRP result
bool haveMeasResultNeighCells
have measure result neighbor cells
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
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.
@ RSRP
Reference Signal Received Power.
@ RSRQ
Reference Signal Received Quality.
@ EVENT_A4
Event A4: Neighbour becomes better than absolute threshold.
@ 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_RSRP
RSRP is used for the threshold.
@ 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.