|
A Discrete-Event Network Simulator
|
API
|
Go to the documentation of this file.
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;
697 cellMeasures->
m_rsrp = rsrp;
698 cellMeasures->
m_rsrq = rsrq;
703 cellMeasures = Create<UeMeasure> ();
705 cellMeasures->
m_rsrp = rsrp;
706 cellMeasures->
m_rsrq = rsrq;
707 it1->second[cellId] = cellMeasures;
enum ns3::LteRrcSap::ReportConfigEutra::@5 reportInterval
Report interval enumeration.
a unique identifier for an interface.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
uint8_t rsrqResult
RSRQ result.
@ EVENT_A1
Event A1: Serving becomes better than absolute threshold.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Ptr< const AttributeChecker > MakeTimeChecker(const Time min, const Time max)
Helper to make a Time checker with bounded range.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
virtual void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults)
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
uint8_t range
Value range used in RSRP/RSRQ threshold.
virtual LteFfrRrcSapProvider * GetLteFfrRrcSapProvider()
Export the "provider" part of the LteFfrRrcSap interface.
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
EventId m_calculationEvent
calculation event
std::vector< bool > m_ulEdgeRbgMap
UL edge RBG map.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
friend class MemberLteFfrRrcSapProvider< LteFfrDistributedAlgorithm >
let the forwarder class access the protected and private members
uint8_t rsrpResult
RSRP result.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
virtual void DoDispose()
Destructor implementation.
enum ns3::LteRrcSap::ThresholdEutra::@0 choice
Threshold enumeration.
std::vector< uint16_t > m_neigborCell
neighbor cell
ThresholdEutra threshold1
Threshold for event A1, A2, A4, and A5.
@ RSRP
Reference Signal Received Power.
virtual void DoReportUlCqiInfo(const struct FfMacSchedSapProvider::SchedUlCqiInfoReqParameters ¶ms)
DoReportUlCqiInfo.
void SetUplinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set up link configuration function.
std::map< uint16_t, Ptr< UeMeasure > > MeasurementRow_t
Cell Id is used as the key for the following map.
virtual bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
static TypeId GetTypeId()
Get the type ID.
uint8_t m_rsrqMeasId
RSRQ measurement ID.
static EventId Schedule(Time const &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
bool m_needReconfiguration
If true FR algorithm will be reconfigured.
uint8_t m_ulBandwidth
uplink bandwidth in RBs
void InitializeUplinkRbgMaps()
Initialize up link RGB maps function.
virtual uint16_t DoGetMinContinuousUlBandwidth()
DoGetMinContinuousUlBandwidth in number of RB.
virtual void SetLteFfrSapUser(LteFfrSapUser *s)
Set the "user" part of the LteFfrSap interface that this frequency reuse algorithm instance will inte...
Smart pointer class similar to boost::intrusive_ptr.
uint8_t m_centerPowerOffset
center power offset
enum ns3::LteRrcSap::ReportConfigEutra::@2 eventId
Event enumeration.
PdschConfigDedicated structure.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP User.
void SetDownlinkConfiguration(uint16_t cellId, uint8_t bandwidth)
Set down link configuration function.
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
MeasurementTable_t m_ueMeasures
UE measures.
enum ns3::LteRrcSap::ReportConfigEutra::@3 triggerQuantity
Trigger type enumeration.
virtual void DoInitialize()
Initialize() implementation.
std::vector< bool > rntpPerPrbList
RNTP per prb list.
void UpdateNeighbourMeasurements(uint16_t rnti, uint16_t cellId, uint8_t rsrp, uint8_t rsrq)
Initialize up link RGB maps function.
virtual void DoRecvLoadInformation(EpcX2Sap::LoadInformationParams params)
DoRecvLoadInformation.
virtual uint8_t AddUeMeasReportConfigForFfr(LteRrcSap::ReportConfigEutra reportConfig)=0
Request a certain reporting configuration to be fulfilled by the UEs attached to the eNodeB entity.
std::vector< bool > m_ulRbgMap
UL RBG map.
uint8_t m_frCellTypeId
FFR cell type ID for automatic configuration.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
@ THRESHOLD_RSRP
RSRP is used for the threshold.
void InitializeDownlinkRbgMaps()
Initialize down link RGB maps function.
std::map< uint16_t, uint8_t > m_ues
UEs map.
Specifies criteria for triggering of an E-UTRA measurement reporting event.
uint8_t m_dlBandwidth
downlink bandwidth in RBs
virtual std::vector< bool > DoGetAvailableDlRbg()
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
@ RSRQ
Reference Signal Received Quality.
Distributed Fractional Frequency Reuse algorithm implementation.
std::map< uint16_t, uint32_t > m_cellWeightMap
cell weight map
virtual void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s)
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
void SendLoadInformation(uint16_t targetCellId)
Send load information function.
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
LteFfrSapUser * m_ffrSapUser
FFR SAP User.
virtual void DoInitialize(void)
Initialize() implementation.
virtual std::vector< bool > DoGetAvailableUlRbg()
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
std::list< MeasResultEutra > measResultListEutra
measure result list eutra
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 DoGetTpc(uint16_t rnti)
DoGetTpc for UE.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP Provider.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
std::vector< bool > m_dlRbgMap
DL RBG map.
@ EVENT_A4
Event A4: Neighbour becomes better than absolute threshold.
friend class MemberLteFfrSapProvider< LteFfrDistributedAlgorithm >
let the forwarder class access the protected and private members
bool haveMeasResultNeighCells
have measure result neighbor cells
uint8_t m_edgeSubBandRsrqThreshold
edge sub band RSRQ threshold
Time Seconds(double value)
Construct a Time in the indicated unit.
virtual ~LteFfrDistributedAlgorithm()
int GetRbgSize(int dlbandwidth)
Get RBG size for DL Bandwidth according to table 7.1.6.1-1 of 36.213.
uint8_t m_edgeRbNum
edge RB number
The abstract base class of a Frequency Reuse algorithm.
AttributeValue implementation for Time.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
Relative Narrowband Tx Power (RNTP) as it is used in the LOAD INFORMATION message.
uint8_t m_rsrpMeasId
RSRP measurement ID.
Hold an unsigned integer type.
uint8_t m_centerAreaTpc
center area TPC
bool m_enabledInUplink
If true FR algorithm will also work in Uplink.
std::map< uint16_t, std::vector< bool > > m_rntp
RNTP.
LteFfrDistributedAlgorithm()
uint16_t m_cellId
Cell ID.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
@ THRESHOLD_RSRQ
RSRQ is used for the threshold.
void Calculate()
Calculate function.
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP Provider.
virtual void Reconfigure()
Automatic FR reconfiguration.
virtual LteFfrSapProvider * GetLteFfrSapProvider()
Export the "provider" part of the LteFfrSap interface.
virtual void DoReportDlCqiInfo(const struct FfMacSchedSapProvider::SchedDlCqiInfoReqParameters ¶ms)
DoReportDlCqiInfo.
std::vector< bool > m_dlEdgeRbgMap
DL edge RBG map.
uint8_t m_rsrpDifferenceThreshold
RSRP difference threshold.
uint8_t m_edgePowerOffset
edge power offset
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the eNodeB RRC instan...
static EventId ScheduleNow(FUNC f, Ts &&... args)
Schedule an event to expire Now.
virtual bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti)
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
Ptr< const AttributeAccessor > MakeTimeAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
uint8_t m_edgeAreaTpc
edge area TCP
Time m_calculationInterval
calculation interval
virtual void SendLoadInformation(EpcX2Sap::LoadInformationParams params)=0
SendLoadInformation.