33 : m_ffrSapUser(nullptr),
34 m_ffrRrcSapUser(nullptr)
58 TypeId(
"ns3::LteFfrDistributedAlgorithm")
63 "CalculationInterval",
64 "Time interval between calculation of Edge sub-band, Default value 1 second",
70 "If the RSRQ of is worse than this threshold, UE should be served in Edge sub-band",
73 MakeUintegerChecker<uint8_t>())
75 "RsrpDifferenceThreshold",
76 "If the difference between the power of the signal received by UE from "
77 "the serving cell and the power of the signal received from the adjacent cell is "
79 "than a RsrpDifferenceThreshold value, the cell weight is incremented",
82 MakeUintegerChecker<uint8_t>())
83 .AddAttribute(
"CenterPowerOffset",
84 "PdschConfigDedicated::Pa value for Center Sub-band, default value dB0",
87 MakeUintegerChecker<uint8_t>())
88 .AddAttribute(
"EdgePowerOffset",
89 "PdschConfigDedicated::Pa value for Edge Sub-band, default value dB0",
92 MakeUintegerChecker<uint8_t>())
93 .AddAttribute(
"EdgeRbNum",
94 "Number of RB that can be used in edge Sub-band",
97 MakeUintegerChecker<uint8_t>())
98 .AddAttribute(
"CenterAreaTpc",
99 "TPC value which will be set in DL-DCI for UEs in center area"
100 "Absolute mode is used, default value 1 is mapped to -1 according to"
101 "TS36.213 Table 5.1.1.1-2",
104 MakeUintegerChecker<uint8_t>())
105 .AddAttribute(
"EdgeAreaTpc",
106 "TPC value which will be set in DL-DCI for UEs in edge area"
107 "Absolute mode is used, default value 1 is mapped to -1 according to"
108 "TS36.213 Table 5.1.1.1-2",
111 MakeUintegerChecker<uint8_t>())
157 NS_LOG_LOGIC(
this <<
" requesting Event A1 and A4 measurements"
250 std::map<uint16_t, uint8_t>::iterator it =
m_ues.find(rnti);
251 if (it ==
m_ues.end())
263 return (edgeRbg && edgeUe) || (!edgeRbg && !edgeUe);
291 std::map<uint16_t, uint8_t>::iterator it =
m_ues.find(rnti);
292 if (it ==
m_ues.end())
304 return (edgeRbg && edgeUe) || (!edgeRbg && !edgeUe);
312 NS_LOG_WARN(
"Method should not be called, because it is empty");
320 NS_LOG_WARN(
"Method should not be called, because it is empty");
327 NS_LOG_WARN(
"Method should not be called, because it is empty");
351 std::map<uint16_t, uint8_t>::iterator it =
m_ues.find(rnti);
352 if (it ==
m_ues.end())
378 return minContinuousUlBandwidth;
383 : minContinuousUlBandwidth;
385 return minContinuousUlBandwidth;
393 <<
" MeasId: " << (uint16_t)measResults.
measId
400 std::map<uint16_t, uint8_t>::iterator it =
m_ues.find(rnti);
401 if (it ==
m_ues.end())
406 it =
m_ues.find(rnti);
411 NS_LOG_INFO(
"UE RNTI: " << rnti <<
" will be served in Center sub-band");
423 NS_LOG_INFO(
"UE RNTI: " << rnti <<
" will be served in Edge sub-band");
434 std::map<uint16_t, uint8_t>::iterator it =
m_ues.find(rnti);
435 if (it ==
m_ues.end())
447 for (std::list<LteRrcSap::MeasResultEutra>::iterator it =
453 "RSRP measurement is missing from cellId " << it->physCellId);
455 "RSRQ measurement is missing from cellId " << it->physCellId);
459 for (std::vector<uint16_t>::iterator ncIt =
m_neighborCell.begin();
463 if ((*ncIt) == it->physCellId)
477 this <<
" Event A4 received without measurement results from neighbouring cells");
502 MeasurementTable_t::iterator it1;
503 MeasurementRow_t::iterator it2;
508 std::map<uint16_t, uint8_t>::iterator areaIt;
509 for (areaIt =
m_ues.begin(); areaIt !=
m_ues.end(); areaIt++)
521 std::map<uint16_t, uint8_t>::iterator areaIt =
m_ues.find(it1->first);
527 servingCellMeasures =
nullptr;
528 neighbourCellMeasures =
nullptr;
531 if (it2 != it1->second.end())
533 servingCellMeasures = it2->second;
540 for (it2 = it1->second.begin(); it2 != it1->second.end(); it2++)
544 neighbourCellMeasures = it2->second;
551 if (servingCellMeasures && neighbourCellMeasures)
553 int16_t rsrpDifference =
554 servingCellMeasures->m_rsrp - neighbourCellMeasures->m_rsrp;
556 <<
" NeighborCellId: " << neighbourCellMeasures->m_cellId
557 <<
" RSRP Serving: " << (
int)servingCellMeasures->m_rsrp
558 <<
" RSRP Neighbor: "
559 << (
int)neighbourCellMeasures->m_rsrp
560 <<
" RSRP Difference: " << (
int)rsrpDifference);
570 std::map<uint16_t, uint64_t> metricA;
571 for (uint16_t i = 0; i < rbgNum; i++)
576 std::map<uint16_t, uint32_t>::iterator cellIt;
580 <<
" Weight: " << cellIt->second);
582 std::map<uint16_t, std::vector<bool>>::iterator rntpIt =
m_rntp.find(cellIt->first);
583 if (rntpIt ==
m_rntp.end())
588 for (uint16_t i = 0; i < rbgNum; i++)
590 if (rntpIt->second[i])
592 metricA[i] += cellIt->second;
597 std::vector<uint16_t> sortedRbgByMetric;
598 std::multimap<uint64_t, uint16_t> sortedMetricA;
599 for (std::map<uint16_t, uint64_t>::const_iterator it = metricA.begin(); it != metricA.end();
602 sortedMetricA.insert(std::pair<uint64_t, uint16_t>(it->second, it->first));
605 for (std::multimap<uint64_t, uint16_t>::const_iterator it = sortedMetricA.begin();
606 it != sortedMetricA.end();
609 sortedRbgByMetric.push_back(it->second);
619 uint32_t rbgIndex = sortedRbgByMetric[i];
620 for (
int k = 0; k < rbgSize; k++)
622 uint32_t rbIndex = rbgSize * rbgIndex + k;
628 for (std::vector<uint16_t>::iterator ncIt =
m_neighborCell.begin();
641 NS_LOG_INFO(
"SendLoadInformation to CellId : " << targetCellId);
643 std::vector<EpcX2Sap::UlInterferenceOverloadIndicationItem>
644 m_currentUlInterferenceOverloadIndicationList;
645 std::vector<EpcX2Sap::UlHighInterferenceInformationItem>
646 m_currentUlHighInterferenceInformationList;
658 params.targetCellId = targetCellId;
659 params.cellInformationList.push_back(cii);
669 << params.cellInformationList[0].sourceCellId);
671 if (params.cellInformationList[0].sourceCellId >
m_cellId)
676 uint16_t neighborCellId = params.cellInformationList[0].sourceCellId;
677 std::map<uint16_t, std::vector<bool>>::iterator it =
m_rntp.find(neighborCellId);
680 it->second = params.cellInformationList[0].relativeNarrowbandTxBand.rntpPerPrbList;
684 m_rntp.insert(std::pair<uint16_t, std::vector<bool>>(
686 params.cellInformationList[0].relativeNarrowbandTxBand.rntpPerPrbList));
698 MeasurementTable_t::iterator it1;
705 std::pair<MeasurementTable_t::iterator, bool> ret;
706 ret =
m_ueMeasures.insert(std::pair<uint16_t, MeasurementRow_t>(rnti, row));
712 std::map<uint16_t, Ptr<UeMeasure>>::iterator it2;
713 it2 = it1->second.find(cellId);
715 if (it2 != it1->second.end())
717 it2->second->m_cellId = cellId;
718 it2->second->m_rsrp = rsrp;
719 it2->second->m_rsrq = rsrq;
725 cellMeasures->m_cellId = cellId;
726 cellMeasures->m_rsrp = rsrp;
727 cellMeasures->m_rsrq = rsrq;
728 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 RGB 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 RGB 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 RGB 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 AttributeChecker > MakeTimeChecker()
Helper to make an unbounded Time checker.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
#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.
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.