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;
uint8_t m_edgeSubBandRsrqThreshold
edge sub band RSRQ threshold
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
enum ns3::LteRrcSap::ThresholdEutra::@63 choice
Threshold enumeration.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
uint8_t m_edgePowerOffset
edge power offset
virtual void DoInitialize(void)
Initialize() implementation.
Template for the implementation of the LteFfrRrcSapProvider as a member of an owner class of type C t...
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
LteFfrDistributedAlgorithm()
Smart pointer class similar to boost::intrusive_ptr.
LteFfrSapUser * m_ffrSapUser
FFR SAP User.
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_edgeAreaTpc
edge area TCP
uint8_t m_rsrpDifferenceThreshold
RSRP difference threshold.
uint8_t m_rsrpMeasId
RSRP measurement ID.
EventId m_calculationEvent
calculation event
std::vector< bool > m_dlEdgeRbgMap
DL edge RBG map.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP User.
NS_ASSERT_MSG(false, "Ipv4AddressGenerator::MaskToIndex(): Impossible")
RSRP is used for the threshold.
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
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
#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)
Send load information function.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
MeasurementTable_t m_ueMeasures
UE measures.
std::map< uint16_t, std::vector< bool > > m_rntp
RNTP.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
enum ns3::LteRrcSap::ReportConfigEutra::@66 triggerQuantity
Trigger type enumeration.
std::vector< uint16_t > m_neigborCell
neighbor cell
Reference Signal Received Quality.
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
static TypeId GetTypeId()
Get the type ID.
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...
uint8_t rsrpResult
RSRP result.
Template for the implementation of the LteFfrSapProvider as a member of an owner class of type C to w...
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
AttributeValue implementation for Time.
void InitializeDownlinkRbgMaps()
Initialize down link RGB maps function.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
uint8_t m_centerAreaTpc
center area TPC
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
UEs map.
uint8_t m_dlBandwidth
downlink bandwidth in RBs
enum ns3::LteRrcSap::ReportConfigEutra::@68 reportInterval
Report interval enumeration.
virtual void SendLoadInformation(EpcX2Sap::LoadInformationParams params)=0
SendLoadInformation.
enum ns3::LteRrcSap::ReportConfigEutra::@65 eventId
Event enumeration.
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.
virtual void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s)
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
Reference Signal Received Power.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set up link configuration function.
bool haveMeasResultNeighCells
have measure result neighbor cells
uint8_t range
Value range used in RSRP/RSRQ threshold.
std::vector< bool > m_dlRbgMap
DL RBG map.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set down link configuration function.
static EventId ScheduleNow(MEM mem_ptr, OBJ obj)
Schedule an event to expire Now.
uint8_t m_edgeRbNum
edge RB number
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...
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
std::vector< bool > rntpPerPrbList
RNTP per prb list.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
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)
Initialize up link RGB maps function.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
virtual ~LteFfrDistributedAlgorithm()
Time m_calculationInterval
calculation interval
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP Provider.
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.
Event A1: Serving becomes better than absolute threshold.
std::map< uint16_t, uint32_t > m_cellWeightMap
cell weight map
RSRQ is used for the threshold.
Event A4: Neighbour becomes better than absolute threshold.
std::map< uint16_t, Ptr< UeMeasure > > MeasurementRow_t
cellId
uint8_t m_rsrqMeasId
RSRQ measurement ID.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP Provider.
uint8_t rsrqResult
RSRQ result.
Relative Narrowband Tx Power (RNTP) as it is used in the LOAD INFORMATION message.
uint8_t m_centerPowerOffset
center power offset
PdschConfigDedicated structure.
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
UL RBG map.
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.
a unique identifier for an interface.
virtual uint8_t DoGetTpc(uint16_t rnti)
DoGetTpc for UE.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
uint16_t m_cellId
Cell ID.
virtual uint8_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.
void InitializeUplinkRbgMaps()
Initialize up link RGB maps function.
void Calculate()
Calculate function.