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;
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;
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.
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.
virtual void DoInitialize()
Initialize() implementation.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP Provider.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP Provider.
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq)
Initialize up link RGB maps function.
std::map< uint16_t, uint8_t > m_ues
UEs map.
std::map< uint16_t, std::vector< bool > > m_rntp
RNTP.
virtual ~LteFfrDistributedAlgorithm()
virtual void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s)
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
uint8_t m_rsrpDifferenceThreshold
RSRP difference threshold.
uint8_t m_rsrpMeasId
RSRP measurement ID.
Time m_calculationInterval
calculation interval
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP User.
virtual LteFfrSapProvider * GetLteFfrSapProvider()
Export the "provider" part of the LteFfrSap interface.
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
virtual std::vector< bool > DoGetAvailableDlRbg()
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set up link configuration function.
LteFfrDistributedAlgorithm()
uint8_t m_edgeAreaTpc
edge area TCP
uint8_t m_rsrqMeasId
RSRQ measurement ID.
uint8_t m_edgePowerOffset
edge power offset
virtual bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
uint8_t m_centerAreaTpc
center area TPC
MeasurementTable_t m_ueMeasures
UE measures.
virtual void DoDispose()
Destructor implementation.
std::vector< uint16_t > m_neigborCell
neighbor cell
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)
DoRecvLoadInformation.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set down link configuration function.
virtual bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
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
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
virtual uint16_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
uint8_t m_edgeSubBandRsrqThreshold
edge sub band RSRQ threshold
EventId m_calculationEvent
calculation event
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
virtual uint8_t DoGetTpc(uint16_t rnti)
DoGetTpc for UE.
static TypeId GetTypeId()
Get the type ID.
void Calculate()
Calculate function.
std::vector< bool > m_dlRbgMap
DL RBG map.
virtual void SetLteFfrSapUser(LteFfrSapUser *s)
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
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.
virtual void Reconfigure()
Automatic FR reconfiguration.
virtual void DoReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)
DoReportDlCqiInfo.
void SendLoadInformation(uint16_t targetCellId)
Send load information function.
void InitializeDownlinkRbgMaps()
Initialize down link RGB maps function.
virtual void DoReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)
DoReportUlCqiInfo.
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(void)
Initialize() implementation.
Smart pointer class similar to boost::intrusive_ptr.
static EventId Schedule(Time const &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 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.
Time Seconds(double value)
Construct a Time in the indicated unit.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
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.
@ EVENT_A4
Event A4: Neighbour becomes better than absolute threshold.
@ EVENT_A1
Event A1: Serving becomes better than absolute threshold.
@ RSRP
Reference Signal Received Power.
@ RSRQ
Reference Signal Received Quality.
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
enum ns3::LteRrcSap::ReportConfigEutra::@67 triggerQuantity
Trigger type enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@66 eventId
Event enumeration.
enum ns3::LteRrcSap::ReportConfigEutra::@69 reportInterval
Report interval enumeration.
@ THRESHOLD_RSRP
RSRP is used for the threshold.
@ THRESHOLD_RSRQ
RSRQ is used for the threshold.
uint8_t range
Value range used in RSRP/RSRQ threshold.
enum ns3::LteRrcSap::ThresholdEutra::@64 choice
Threshold enumeration.