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 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation;
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 *
17 * Author: Piotr Gawlowicz <gawlowicz.p@gmail.com>
18 *
19 */
20
21#ifndef LTE_FFR_SIMPLE_H
22#define LTE_FFR_SIMPLE_H
23
24#include <ns3/lte-ffr-algorithm.h>
25#include <ns3/lte-ffr-rrc-sap.h>
26#include <ns3/lte-ffr-sap.h>
27#include <ns3/lte-rrc-sap.h>
28#include <ns3/traced-callback.h>
29
30#include <map>
31
32namespace ns3
33{
34
35/**
36 * \ingroup lte-test
37 *
38 * \brief Simple Frequency Reuse algorithm implementation which uses only 1 sub-band.
39 * Used to test Downlink Power Allocation. When Simple FR receives UE measurements
40 * it immediately call functions to change PdschConfigDedicated (i.e. P_A) value for
41 * this UE.
42 */
44{
45 public:
46 /**
47 * \brief Creates a trivial ffr algorithm instance.
48 */
50
51 ~LteFfrSimple() override;
52
53 /**
54 * \brief Get the type ID.
55 * \return the object TypeId
56 */
57 static TypeId GetTypeId();
58
59 /**
60 * \brief Callback function that is used to be connected to trace ChangePdschConfigDedicated
61 * \param change trace fired upon change of PdschConfigDedicated if true
62 */
63 void ChangePdschConfigDedicated(bool change);
64 /**
65 * \brief Set PDSCH config dedicated function
66 * \param pdschConfigDedicated LteRrcSap::PdschConfigDedicated object
67 */
69
70 /**
71 * \brief Set transmission power control
72 * \param tpc TPC
73 * \param num number of TPC configurations in the test case
74 * \param accumulatedMode whether TPC accumulated mode is used
75 */
76 void SetTpc(uint32_t tpc, uint32_t num, bool accumulatedMode);
77
78 // inherited from LteFfrAlgorithm
79 void SetLteFfrSapUser(LteFfrSapUser* s) override;
81
82 void SetLteFfrRrcSapUser(LteFfrRrcSapUser* s) override;
84
85 /// let the forwarder class access the protected and private members
87 /// let the forwarder class access the protected and private members
89
90 /**
91 * TracedCallback signature for change of PdschConfigDedicated.
92 *
93 * \param [in] rnti
94 * \param [in] pdschPa PdschConfiDedicated.pa
95 */
96 typedef void (*PdschTracedCallback)(uint16_t rnti, uint8_t pdschPa);
97
98 protected:
99 // inherited from Object
100 void DoInitialize() override;
101 void DoDispose() override;
102
103 void Reconfigure() override;
104
105 // FFR SAP PROVIDER IMPLEMENTATION
106 std::vector<bool> DoGetAvailableDlRbg() override;
107 bool DoIsDlRbgAvailableForUe(int i, uint16_t rnti) override;
108 std::vector<bool> DoGetAvailableUlRbg() override;
109 bool DoIsUlRbgAvailableForUe(int i, uint16_t rnti) override;
114 void DoReportUlCqiInfo(std::map<uint16_t, std::vector<double>> ulCqiMap) override;
115 uint8_t DoGetTpc(uint16_t rnti) override;
116 uint16_t DoGetMinContinuousUlBandwidth() override;
117
118 // FFR SAP RRC PROVIDER IMPLEMENTATION
119 void DoReportUeMeas(uint16_t rnti, LteRrcSap::MeasResults measResults) override;
121
122 private:
123 /// Update PDSCH config dedicated function
125
126 // FFR SAP
127 LteFfrSapUser* m_ffrSapUser; ///< FFR SAP user
128 LteFfrSapProvider* m_ffrSapProvider; ///< FFR SAP provider
129
130 // FFR RRF SAP
131 LteFfrRrcSapUser* m_ffrRrcSapUser; ///< FFR RRC SAP user
132 LteFfrRrcSapProvider* m_ffrRrcSapProvider; ///< FFR RRC SAP provider
133
134 uint8_t m_dlOffset; ///< DL offset
135 uint8_t m_dlSubBand; ///< DL subband
136
137 uint8_t m_ulOffset; ///< UL offset
138 uint8_t m_ulSubBand; ///< UL subband
139
140 std::vector<bool> m_dlRbgMap; ///< DL RBG map
141 std::vector<bool> m_ulRbgMap; ///< UL RBG map
142
143 std::map<uint16_t, LteRrcSap::PdschConfigDedicated> m_ues; ///< UEs
144
145 // The expected measurement identity
146 uint8_t m_measId; ///< measure ID
147
148 bool m_changePdschConfigDedicated; ///< PDSCH config dedicate changed?
149
151
153 m_changePdschConfigDedicatedTrace; ///< PDSCH config dedicated change trace callback
154
155 // Uplink Power Control
156 uint32_t m_tpc; ///< transmission power control to be used
157 uint32_t m_tpcNum; ///< number of TPC configurations
158 bool m_accumulatedMode; ///< whether to use the TPC accumulated mode
159
160}; // end of class LteFfrSimple
161
162} // end of namespace ns3
163
164#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:40
Service Access Point (SAP) offered by the eNodeB RRC instance to the Frequency Reuse algorithm instan...
Definition: lte-ffr-sap.h:140
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...
Definition: lte-ffr-sap.h:153
Forward calls to a chain of Callback.
a unique identifier for an interface.
Definition: type-id.h:59
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Parameters of the LOAD INFORMATION message.
Definition: epc-x2-sap.h:306
Parameters of the SCHED_DL_CQI_INFO_REQ primitive.
Parameters of the SCHED_UL_CQI_INFO_REQ primitive.
MeasResults structure.
Definition: lte-rrc-sap.h:717
PdschConfigDedicated structure.
Definition: lte-rrc-sap.h:163