A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lte-ffr-simple.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2014 Piotr Gawlowicz
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
7 *
8 */
9
10#ifndef LTE_FFR_SIMPLE_H
11#define LTE_FFR_SIMPLE_H
12
13#include <ns3/lte-ffr-algorithm.h>
14#include <ns3/lte-ffr-rrc-sap.h>
15#include <ns3/lte-ffr-sap.h>
16#include <ns3/lte-rrc-sap.h>
17#include <ns3/traced-callback.h>
18
19#include <map>
20
21namespace ns3
22{
23
24/**
25 * \ingroup lte-test
26 *
27 * \brief Simple Frequency Reuse algorithm implementation which uses only 1 sub-band.
28 * Used to test Downlink Power Allocation. When Simple FR receives UE measurements
29 * it immediately call functions to change PdschConfigDedicated (i.e. P_A) value for
30 * this UE.
31 */
33{
34 public:
35 /**
36 * \brief Creates a trivial ffr algorithm instance.
37 */
39
40 ~LteFfrSimple() override;
41
42 /**
43 * \brief Get the type ID.
44 * \return the object TypeId
45 */
46 static TypeId GetTypeId();
47
48 /**
49 * \brief Callback function that is used to be connected to trace ChangePdschConfigDedicated
50 * \param change trace fired upon change of PdschConfigDedicated if true
51 */
52 void ChangePdschConfigDedicated(bool change);
53 /**
54 * \brief Set PDSCH config dedicated function
55 * \param pdschConfigDedicated LteRrcSap::PdschConfigDedicated object
56 */
58
59 /**
60 * \brief Set transmission power control
61 * \param tpc TPC
62 * \param num number of TPC configurations in the test case
63 * \param accumulatedMode whether TPC accumulated mode is used
64 */
65 void SetTpc(uint32_t tpc, uint32_t num, bool accumulatedMode);
66
67 // inherited from LteFfrAlgorithm
68 void SetLteFfrSapUser(LteFfrSapUser* s) override;
70
71 void SetLteFfrRrcSapUser(LteFfrRrcSapUser* s) override;
73
74 /// let the forwarder class access the protected and private members
76 /// let the forwarder class access the protected and private members
78
79 /**
80 * TracedCallback signature for change of PdschConfigDedicated.
81 *
82 * \param [in] rnti
83 * \param [in] pdschPa PdschConfiDedicated.pa
84 */
85 typedef void (*PdschTracedCallback)(uint16_t rnti, uint8_t pdschPa);
86
87 protected:
88 // inherited from Object
89 void DoInitialize() override;
90 void DoDispose() override;
91
92 void Reconfigure() override;
93
94 // FFR SAP PROVIDER IMPLEMENTATION
95 std::vector<bool> DoGetAvailableDlRbg() override;
96 bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override;
97 std::vector<bool> DoGetAvailableUlRbg() override;
98 bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override;
103 void DoReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) override;
104 uint8_t DoGetTpc(uint16_t rnti) override;
105 uint16_t DoGetMinContinuousUlBandwidth() override;
106
107 // FFR SAP RRC PROVIDER IMPLEMENTATION
108 void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override;
110
111 private:
112 /// Update PDSCH config dedicated function
114
115 // FFR SAP
116 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP user
117 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP provider
118
119 // FFR RRF SAP
120 LteFfrRrcSapUser* m_ffrRrcSapUser; ///< FFR RRC SAP user
121 LteFfrRrcSapProvider* m_ffrRrcSapProvider; ///< FFR RRC SAP provider
122
123 uint8_t m_dlOffset; ///< DL offset
124 uint8_t m_dlSubBand; ///< DL subband
125
126 uint8_t m_ulOffset; ///< UL offset
127 uint8_t m_ulSubBand; ///< UL subband
128
129 std::vector<bool> m_dlRbgMap; ///< DL RBG map
130 std::vector<bool> m_ulRbgMap; ///< UL RBG map
131
132 std::map<uint16_t, LteRrcSap::PdschConfigDedicated> m_ues; ///< UEs
133
134 // The expected measurement identity
135 uint8_t m_measId; ///< measure ID
136
137 bool m_changePdschConfigDedicated; ///< PDSCH config dedicate changed?
138
140
142 m_changePdschConfigDedicatedTrace; ///< PDSCH config dedicated change trace callback
143
144 // Uplink Power Control
145 uint32_t m_tpc; ///< transmission power control to be used
146 uint32_t m_tpcNum; ///< number of TPC configurations
147 bool m_accumulatedMode; ///< whether to use the TPC accumulated mode
148
149}; // end of class LteFfrSimple
150
151} // end of namespace ns3
152
153#endif /* LTE_FFR_SIMPLE_H */
The abstract base class of a Frequency Reuse algorithm.
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...
Service Access Point (SAP) offered by the Frequency Reuse algorithm instance to the MAC Scheduler ins...
Definition lte-ffr-sap.h:29
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Simple Frequency Reuse algorithm implementation which uses only 1 sub-band.
void DoReportDlCqiInfo(const FfMacSchedSapProvider::SchedDlCqiInfoReqParameters &params) override
DoReportDlCqiInfo.
LteRrcSap::PdschConfigDedicated m_pdschConfigDedicated
PDSCH config dedicated.
uint8_t DoGetTpc(uint16_t rnti) override
DoGetTpc for UE.
void DoInitialize() override
Initialize() implementation.
void ChangePdschConfigDedicated(bool change)
Callback function that is used to be connected to trace ChangePdschConfigDedicated.
uint8_t m_measId
measure ID
void SetPdschConfigDedicated(LteRrcSap::PdschConfigDedicated pdschConfigDedicated)
Set PDSCH config dedicated function.
void SetLteFfrRrcSapUser(LteFfrRrcSapUser *s) override
Set the "user" part of the LteFfrRrcSap interface that this frequency reuse algorithm instance will i...
LteFfrRrcSapProvider * m_ffrRrcSapProvider
FFR RRC SAP provider.
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.
uint32_t m_tpc
transmission power control to be used
uint8_t m_dlSubBand
DL subband.
uint16_t DoGetMinContinuousUlBandwidth() override
DoGetMinContinuousUlBandwidth in number of RB.
std::vector< bool > m_dlRbgMap
DL RBG map.
uint8_t m_dlOffset
DL offset.
void Reconfigure() override
Automatic FR reconfiguration.
std::map< uint16_t, LteRrcSap::PdschConfigDedicated > m_ues
UEs.
std::vector< bool > DoGetAvailableUlRbg() override
Implementation of LteFfrSapProvider::GetAvailableUlRbg.
uint32_t m_tpcNum
number of TPC configurations
void DoReportUlCqiInfo(const FfMacSchedSapProvider::SchedUlCqiInfoReqParameters &params) override
DoReportUlCqiInfo.
void(* PdschTracedCallback)(uint16_t rnti, uint8_t pdschPa)
TracedCallback signature for change of PdschConfigDedicated.
LteFfrRrcSapUser * m_ffrRrcSapUser
FFR RRC SAP user.
bool m_accumulatedMode
whether to use the TPC accumulated mode
void SetTpc(uint32_t tpc, uint32_t num, bool accumulatedMode)
Set transmission power control.
std::vector< bool > m_ulRbgMap
UL RBG map.
LteFfrSapProvider * m_ffrSapProvider
FFR SAP provider.
bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsUlRbgAvailableForUe.
LteFfrSimple()
Creates a trivial ffr algorithm instance.
~LteFfrSimple() override
void DoDispose() override
Destructor implementation.
uint8_t m_ulSubBand
UL subband.
LteFfrRrcSapProvider * GetLteFfrRrcSapProvider() override
Export the "provider" part of the LteFfrRrcSap interface.
static TypeId GetTypeId()
Get the type ID.
bool m_changePdschConfigDedicated
PDSCH config dedicate changed?
void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override
Implementation of LteFfrRrcSapProvider::ReportUeMeas.
LteFfrSapUser * m_ffrSapUser
FFR SAP user.
bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override
Implementation of LteFfrSapProvider::IsDlRbgAvailableForUe.
LteFfrSapProvider * GetLteFfrSapProvider() override
Export the "provider" part of the LteFfrSap interface.
TracedCallback< uint16_t, uint8_t > m_changePdschConfigDedicatedTrace
PDSCH config dedicated change trace callback.
std::vector< bool > DoGetAvailableDlRbg() override
Implementation of LteFfrSapProvider::GetAvailableDlRbg.
uint8_t m_ulOffset
UL offset.
void UpdatePdschConfigDedicated()
Update PDSCH config dedicated function.
Template for the implementation of the LteFfrRrcSapProvider as a member of an owner class of type C t...
Template for the implementation of the LteFfrSapProvider as a member of an owner class of type C to w...
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition type-id.h:48
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the LOAD INFORMATION message.
Definition epc-x2-sap.h:295
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
MeasResults structure.
PdschConfigDedicated structure.