60 static TypeId tid =
TypeId (
"ns3::LteFfrDistributedAlgorithm")
64 .AddAttribute (
"CalculationInterval",
65 "Time interval between calculation of Edge sub-band, Default value 1 second",
69 .AddAttribute (
"RsrqThreshold",
70 "If the RSRQ of is worse than this threshold, UE should be served in Edge sub-band",
73 MakeUintegerChecker<uint8_t> ())
74 .AddAttribute (
"RsrpDifferenceThreshold",
75 "If the difference between the power of the signal received by UE from "
76 "the serving cell and the power of the signal received from the adjacent cell is less "
77 "than a RsrpDifferenceThreshold value, the cell weight is incremented",
80 MakeUintegerChecker<uint8_t> ())
81 .AddAttribute (
"CenterPowerOffset",
82 "PdschConfigDedicated::Pa value for Edge Sub-band, default value dB0",
85 MakeUintegerChecker<uint8_t> ())
86 .AddAttribute (
"EdgePowerOffset",
87 "PdschConfigDedicated::Pa value for Edge Sub-band, default value dB0",
90 MakeUintegerChecker<uint8_t> ())
91 .AddAttribute (
"EdgeRbNum",
92 "Number of RB that can be used in edge Sub-band",
95 MakeUintegerChecker<uint8_t> ())
96 .AddAttribute (
"CenterAreaTpc",
97 "TPC value which will be set in DL-DCI for UEs in center area"
98 "Absolute mode is used, default value 1 is mapped to -1 according to"
99 "TS36.213 Table 5.1.1.1-2",
102 MakeUintegerChecker<uint8_t> ())
103 .AddAttribute (
"EdgeAreaTpc",
104 "TPC value which will be set in DL-DCI for UEs in edge area"
105 "Absolute mode is used, default value 1 is mapped to -1 according to"
106 "TS36.213 Table 5.1.1.1-2",
109 MakeUintegerChecker<uint8_t> ())
159 NS_LOG_LOGIC (
this <<
" requesting Event A1 and A4 measurements"
160 <<
" (threshold = 0" <<
")");
252 std::map< uint16_t, uint8_t >::iterator it =
m_ues.find (rnti);
253 if (it ==
m_ues.end ())
265 return (edgeRbg && edgeUe) || (!edgeRbg && !edgeUe);
293 std::map< uint16_t, uint8_t >::iterator it =
m_ues.find (rnti);
294 if (it ==
m_ues.end ())
306 return (edgeRbg && edgeUe) || (!edgeRbg && !edgeUe);
313 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");
350 std::map< uint16_t, uint8_t >::iterator it =
m_ues.find (rnti);
351 if (it ==
m_ues.end ())
377 return minContinuousUlBandwidth;
380 minContinuousUlBandwidth =
383 return minContinuousUlBandwidth;
392 <<
" RSRP: " << (uint16_t)measResults.
rsrpResult
393 <<
" RSRQ: " << (uint16_t)measResults.
rsrqResult);
398 std::map< uint16_t, uint8_t >::iterator it =
m_ues.find (rnti);
399 if (it ==
m_ues.end ())
404 it =
m_ues.find (rnti);
409 NS_LOG_INFO (
"UE RNTI: " << rnti <<
" will be served in Center sub-band");
421 NS_LOG_INFO (
"UE RNTI: " << rnti <<
" will be served in Edge sub-band");
432 std::map< uint16_t, uint8_t >::iterator it =
m_ues.find (rnti);
433 if (it ==
m_ues.end ())
443 for (std::list <LteRrcSap::MeasResultEutra>::iterator it = measResults.
measResultListEutra.begin ();
448 "RSRP measurement is missing from cellId " << it->physCellId);
450 "RSRQ measurement is missing from cellId " << it->physCellId);
456 if ((*ncIt) == it->physCellId)
469 NS_LOG_WARN (
this <<
" Event A4 received without measurement results from neighbouring cells");
493 MeasurementTable_t::iterator it1;
494 MeasurementRow_t::iterator it2;
498 uint32_t edgeUeNum = 0;
499 std::map< uint16_t, uint8_t >::iterator areaIt;
500 for (areaIt =
m_ues.begin (); areaIt !=
m_ues.end (); areaIt++)
512 std::map< uint16_t, uint8_t >::iterator areaIt =
m_ues.find (it1->first);
518 servingCellMeasures = 0;
519 neighbourCellMeasures = 0;
522 if (it2 != it1->second.end ())
524 servingCellMeasures = it2->second;
531 for (it2 = it1->second.begin (); it2 != it1->second.end (); it2++)
535 neighbourCellMeasures = it2->second;
542 if (servingCellMeasures && neighbourCellMeasures)
544 int16_t rsrpDifference = servingCellMeasures->
m_rsrp - neighbourCellMeasures->
m_rsrp;
546 <<
" NeighborCellId: " << neighbourCellMeasures->
m_cellId
547 <<
" RSRP Serving: " << (
int)servingCellMeasures->
m_rsrp
548 <<
" RSRP Neighbor: " << (
int)neighbourCellMeasures->
m_rsrp
549 <<
" RSRP Difference: " << (
int)rsrpDifference);
559 std::map< uint16_t, uint64_t > metricA;
560 for (uint16_t i = 0; i < rbgNum; i++)
565 std::map<uint16_t, uint32_t>::iterator cellIt;
568 NS_LOG_INFO (
"CellId: " <<
m_cellId <<
" NeighborCellId: " << cellIt->first <<
" Weight: " << cellIt->second);
570 std::map<uint16_t, std::vector <bool> >::iterator rntpIt =
m_rntp.find (cellIt->first);
571 if (rntpIt ==
m_rntp.end ())
576 for (uint8_t i = 0; i < rbgNum; i++)
578 metricA[i] += cellIt->second * rntpIt->second[i];
582 std::vector<uint16_t> sortedRbgByMetric;
583 std::multimap< uint64_t, uint16_t > sortedMetricA;
584 for (std::map<uint16_t, uint64_t>::const_iterator it = metricA.begin (); it != metricA.end (); ++it)
586 sortedMetricA.insert (std::pair<uint64_t, uint16_t> (it->second, it->first));
589 for (std::multimap< uint64_t, uint16_t >::const_iterator it = sortedMetricA.begin ();
590 it != sortedMetricA.end (); ++it)
592 sortedRbgByMetric.push_back (it->second);
602 uint32_t rbgIndex = sortedRbgByMetric[i];
603 for (
int k = 0; k < rbgSize; k++)
605 uint32_t rbIndex = rbgSize * rbgIndex + k;
622 NS_LOG_INFO (
"SendLoadInformation to CellId : " << targetCellId );
624 std::vector<EpcX2Sap::UlInterferenceOverloadIndicationItem> m_currentUlInterferenceOverloadIndicationList;
625 std::vector <EpcX2Sap::UlHighInterferenceInformationItem> m_currentUlHighInterferenceInformationList;
648 <<
" Recv X2 message: LOAD INFORMATION from CellId:" << params.
cellInformationList[0].sourceCellId);
656 std::map<uint16_t, std::vector <bool> >::iterator it =
m_rntp.find (neighborCellId);
663 m_rntp.insert (std::pair<uint16_t, std::vector <bool> > (neighborCellId, params.
cellInformationList[0].relativeNarrowbandTxBand.rntpPerPrbList));
675 MeasurementTable_t::iterator it1;
682 std::pair<MeasurementTable_t::iterator, bool> ret;
683 ret =
m_ueMeasures.insert (std::pair<uint16_t, MeasurementRow_t> (rnti, row));
690 std::map<uint16_t, Ptr<UeMeasure> >::iterator it2;
691 it2 = it1->second.find (cellId);
693 if (it2 != it1->second.end ())
695 cellMeasures = it2->second;
696 cellMeasures->m_cellId = cellId;
697 cellMeasures->m_rsrp = rsrp;
698 cellMeasures->m_rsrq = rsrq;
703 cellMeasures = Create<UeMeasure> ();
704 cellMeasures->m_cellId = cellId;
705 cellMeasures->m_rsrp = rsrp;
706 cellMeasures->m_rsrq = rsrq;
707 it1->second[cellId] = cellMeasures;
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
uint8_t m_edgePowerOffset
Template for the implementation of the LteFfrRrcSapProvider as a member of an owner class of type C t...
std::vector< bool > m_ulEdgeRbgMap
LteFfrDistributedAlgorithm()
Smart pointer class similar to boost::intrusive_ptr.
LteFfrSapUser * m_ffrSapUser
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
uint8_t m_rsrpDifferenceThreshold
EventId m_calculationEvent
std::vector< bool > m_dlEdgeRbgMap
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
LteFfrRrcSapUser * m_ffrRrcSapUser
std::list< MeasResultEutra > measResultListEutra
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
Specifies criteria for triggering of an E-UTRA measurement reporting event.
Distributed Fractional Frequency Reuse algorithm implementation.
uint8_t m_ulBandwidth
uplink bandwidth in RBs
RSRP is used for the threshold.
enum ns3::LteRrcSap::ReportConfigEutra::@72 eventId
Choice of E-UTRA event triggered reporting criteria.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
void SendLoadInformation(uint16_t targetCellId)
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
MeasurementTable_t m_ueMeasures
uint8_t m_egdeSubBandRsrqThreshold
std::map< uint16_t, std::vector< bool > > m_rntp
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
enum ns3::LteRrcSap::ReportConfigEutra::@76 reportInterval
Indicates the interval between periodical reports.
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
Schedule an event to expire at the relative time "time" is reached.
std::vector< uint16_t > m_neigborCell
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
static TypeId GetTypeId()
RSRQ is used for the threshold.
virtual uint8_t AddUeMeasReportConfigForFfr(LteRrcSap::ReportConfigEutra reportConfig)=0
Request a certain reporting configuration to be fulfilled by the UEs attached to the eNodeB entity...
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
virtual bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
virtual void SetPdschConfigDedicated(uint16_t rnti, LteRrcSap::PdschConfigDedicated pdschConfigDedicated)=0
Instruct the eNodeB RRC entity to perform RrcConnectionReconfiguration to inform UE about new PdschCo...
Template for the implementation of the LteFfrSapProvider as a member of an owner class of type C to w...
Reference Signal Received Quality.
AttributeValue implementation for Time.
void InitializeDownlinkRbgMaps()
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Hold an unsigned integer type.
virtual LteFfrSapProvider * GetLteFfrSapProvider()
Export the "provider" part of the LteFfrSap interface.
virtual void Reconfigure()
Automatic FR reconfiguration.
bool m_enabledInUplink
If true FR algorithm will also work in Uplink.
bool m_needReconfiguration
If true FR algorithm will be reconfigured.
std::map< uint16_t, uint8_t > m_ues
Event A4: Neighbour becomes better than absolute threshold.
uint8_t m_dlBandwidth
downlink bandwidth in RBs
virtual void SendLoadInformation(EpcX2Sap::LoadInformationParams params)=0
SendLoadInformation.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
virtual void DoDispose()
Destructor implementation.
virtual std::vector< bool > DoGetAvailableDlRbg()
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
virtual bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
virtual void DoReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)
DoReportUlCqiInfo.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The abstract base class of a Frequency Reuse algorithm.
enum ns3::LteRrcSap::ThresholdEutra::@70 choice
virtual void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s)
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
bool haveMeasResultNeighCells
uint8_t range
Value range used in RSRP/RSRQ threshold.
std::vector< bool > m_dlRbgMap
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
std::vector< bool > rntpPerPrbList
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Reference Signal Received Power.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
enum ns3::LteRrcSap::ReportConfigEutra::@74 triggerQuantity
The quantities used to evaluate the triggering condition for the event, see 3GPP TS 36...
uint8_t m_frCellTypeId
FFR cell type ID for automatic configuration.
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq)
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
virtual ~LteFfrDistributedAlgorithm()
Time m_calculationInterval
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)
DoRecvLoadInformation.
Time Seconds(double value)
Construct a Time in the indicated unit.
int GetRbgSize(int dlbandwidth)
Get RBG size for DL Bandwidth according to table 7.1.6.1-1 of 36.213.
std::map< uint16_t, uint32_t > m_cellWeightMap
std::map< uint16_t, Ptr< UeMeasure > > MeasurementRow_t
LteFfrSapProvider * m_ffrSapProvider
Relative Narrowband Tx Power (RNTP) as it is used in the LOAD INFORMATION message.
uint8_t m_centerPowerOffset
virtual void DoInitialize()
Initialize() implementation.
virtual void SetLteFfrSapUser(LteFfrSapUser *s)
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
std::vector< bool > m_ulRbgMap
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual void DoReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)
DoReportDlCqiInfo.
Event A1: Serving becomes better than absolute threshold.
a unique identifier for an interface.
virtual uint8_t DoGetTpc(uint16_t rnti)
DoGetTpc for UE.
TypeId SetParent(TypeId tid)
virtual uint8_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
virtual void DoInitialize(void)
Initialize() implementation.
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.
void InitializeUplinkRbgMaps()