OLD | NEW |
(Empty) | |
| 1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
| 2 /* |
| 3 * Copyright (c) 2015 Danilo Abrignani |
| 4 * |
| 5 * This program is free software; you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 2 as |
| 7 * published by the Free Software Foundation; |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software |
| 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 * |
| 18 * Author: Danilo Abrignani <danilo.abrignani@unibo.it> |
| 19 * |
| 20 */ |
| 21 |
| 22 #ifndef LTE_CCM_RRC_SAP_H |
| 23 #define LTE_CCM_RRC_SAP_H |
| 24 |
| 25 #include <ns3/lte-rrc-sap.h> |
| 26 #include <ns3/eps-bearer.h> |
| 27 #include <ns3/lte-enb-cmac-sap.h> |
| 28 #include <ns3/lte-mac-sap.h> |
| 29 #include <map> |
| 30 |
| 31 |
| 32 namespace ns3 { |
| 33 class LteUeCmacSapProvider; |
| 34 class UeManager; |
| 35 class LteEnbCmacSapProvider; |
| 36 class LteMacSapUser; |
| 37 |
| 38 /** |
| 39 * \brief Service Access Point (SAP) offered by the component carrier selection
algorithm instance |
| 40 * to the eNodeB RRC instance. |
| 41 * |
| 42 * This is the *Component Carrier Management SAP Provider*, i.e., the part of th
e SAP |
| 43 * that contains the component carrier selection algorithm methods called by the
eNodeB RRC |
| 44 * instance. |
| 45 */ |
| 46 class LteCcmRrcSapProvider |
| 47 { |
| 48 · |
| 49 public: |
| 50 virtual ~LteCcmRrcSapProvider (); |
| 51 |
| 52 friend class UeManager; |
| 53 friend class LteMacSapUser; |
| 54 struct LcsConfig |
| 55 { |
| 56 uint16_t componentCarrierId; |
| 57 LteEnbCmacSapProvider::LcInfo lc; |
| 58 LteMacSapUser *msu; |
| 59 }; |
| 60 |
| 61 /** |
| 62 * \brief Send a UE measurement report to component carrier selection algorith
m. |
| 63 * \param rnti Radio Network Temporary Identity, an integer identifying the UE |
| 64 * where the report originates from |
| 65 * \param measResults a single report of one measurement identity |
| 66 * |
| 67 * The received measurement report is a result of the UE measurement |
| 68 * configuration previously configured by calling |
| 69 * LteCcmRrcSapProvider::AddUeMeasReportConfigForComponentCarrierSelection. Th
e report |
| 70 * may be stored and utilised for the purpose of making ComponentCarrier decis
ion. |
| 71 */ |
| 72 //virtual void ReportUeMeas (uint16_t rnti, LteRrcSap::MeasResults measResults
) = 0; |
| 73 virtual void AddUe (uint16_t rnti, uint8_t state) = 0; |
| 74 virtual void RemoveUe (uint16_t rnti) = 0; |
| 75 virtual std::vector<LteCcmRrcSapProvider::LcsConfig> SetupDataRadioBearer (Eps
Bearer bearer, uint8_t bearerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, L
teMacSapUser *msu) = 0; |
| 76 virtual std::vector<uint16_t> ReleaseDataRadioBearer (uint16_t rnti, uint8_t l
cid) = 0; |
| 77 virtual LteMacSapUser* ConfigureSignalBearer(LteEnbCmacSapProvider::LcInfo lci
nfo, LteMacSapUser* rlcMacSapUser) = 0; |
| 78 |
| 79 }; // end of class LteCcmRrcSapProvider |
| 80 |
| 81 |
| 82 /** |
| 83 * \brief Service Access Point (SAP) offered by the eNodeB RRC instance to the |
| 84 * ComponentCarrier algorithm instance. |
| 85 * |
| 86 * This is the *Component Carrier Management SAP User*, i.e., the part of the SA
P that |
| 87 * contains the eNodeB RRC methods called by the component carrier selection alg
orithm instance. |
| 88 */ |
| 89 class LteCcmRrcSapUser |
| 90 { |
| 91 public: |
| 92 virtual ~LteCcmRrcSapUser (); |
| 93 |
| 94 /** |
| 95 * \brief Request a certain reporting configuration to be fulfilled by the UEs |
| 96 * attached to the eNodeB entity. |
| 97 * \param reportConfig the UE measurement reporting configuration |
| 98 * \return the measurement identity associated with this newly added |
| 99 * reporting configuration |
| 100 * |
| 101 * The eNodeB RRC entity is expected to configure the same reporting |
| 102 * configuration in each of the attached UEs. When later in the simulation a |
| 103 * UE measurement report is received from a UE as a result of this |
| 104 * configuration, the eNodeB RRC entity shall forward this report to the |
| 105 * ComponentCarrier algorithm through the LteCcmRrcSapUser::ReportUeMeas |
| 106 * SAP function. |
| 107 * |
| 108 * \note This function is only valid before the simulation begins. |
| 109 */ |
| 110 //virtual uint8_t AddUeMeasReportConfigForComponentCarrier (LteRrcSap::ReportC
onfigEutra reportConfig) = 0; |
| 111 |
| 112 /** |
| 113 * \brief Instruct the eNodeB RRC entity to prepare a ComponentCarrier. |
| 114 * \param rnti Radio Network Temporary Identity, an integer identifying the |
| 115 * UE which shall perform the ComponentCarrier |
| 116 * \param targetCellId the cell ID of the target eNodeB |
| 117 * |
| 118 * This function is used by the ComponentCarrier algorithm entity when a Compo
nentCarrier |
| 119 * decision has been reached. |
| 120 * |
| 121 * The process to produce the decision is up to the implementation of Componen
tCarrier |
| 122 * algorithm. It is typically based on the reported UE measurements, which are |
| 123 * received through the LteCcmRrcSapProvider::ReportUeMeas function. |
| 124 */ |
| 125 //virtual void TriggerComponentCarrier (uint16_t rnti, uint16_t targetCellId)
= 0; |
| 126 |
| 127 virtual void AddLcs (std::vector<LteEnbRrcSapProvider::LogicalChannelConfig> l
cConfig) = 0; |
| 128 virtual void ReleaseLcs (uint16_t rnti, uint8_t lcid) = 0; |
| 129 |
| 130 }; // end of class LteCcmRrcSapUser |
| 131 |
| 132 template <class C> |
| 133 class MemberLteCcmRrcSapProvider : public LteCcmRrcSapProvider |
| 134 { |
| 135 public: |
| 136 MemberLteCcmRrcSapProvider (C* owner); |
| 137 |
| 138 // inherited from LteCcmRrcSapProvider |
| 139 virtual void AddUe (uint16_t rnti, uint8_t state); |
| 140 virtual void RemoveUe (uint16_t rnti); |
| 141 virtual std::vector<LteCcmRrcSapProvider::LcsConfig> SetupDataRadioBearer (Eps
Bearer bearer, uint8_t bearerId, uint16_t rnti, uint8_t lcid, uint8_t lcGroup, L
teMacSapUser *msu); |
| 142 virtual std::vector<uint16_t> ReleaseDataRadioBearer (uint16_t rnti, uint8_t l
cid); |
| 143 |
| 144 virtual LteMacSapUser* ConfigureSignalBearer(LteEnbCmacSapProvider::LcInfo lci
nfo, LteMacSapUser* rlcMacSapUser); |
| 145 |
| 146 private: |
| 147 C* m_owner; |
| 148 }; |
| 149 |
| 150 template <class C> |
| 151 MemberLteCcmRrcSapProvider<C>::MemberLteCcmRrcSapProvider (C* owner) |
| 152 : m_owner (owner) |
| 153 { |
| 154 } |
| 155 · |
| 156 template <class C> |
| 157 void MemberLteCcmRrcSapProvider<C>::AddUe (uint16_t rnti, uint8_t state) |
| 158 { |
| 159 m_owner->DoAddUe (rnti, state); |
| 160 } |
| 161 |
| 162 template <class C> |
| 163 void MemberLteCcmRrcSapProvider<C>::RemoveUe (uint16_t rnti) |
| 164 { |
| 165 m_owner->DoRemoveUe (rnti); |
| 166 } |
| 167 |
| 168 template <class C> |
| 169 std::vector<LteCcmRrcSapProvider::LcsConfig> MemberLteCcmRrcSapProvider<C>::Setu
pDataRadioBearer (EpsBearer bearer, uint8_t bearerId, uint16_t rnti, uint8_t lci
d, uint8_t lcGroup, LteMacSapUser *msu) |
| 170 { |
| 171 return m_owner->DoSetupDataRadioBearer (bearer, bearerId, rnti, lcid, lcGroup,
msu); |
| 172 } |
| 173 |
| 174 template <class C> |
| 175 std::vector<uint16_t> MemberLteCcmRrcSapProvider<C>::ReleaseDataRadioBearer (uin
t16_t rnti, uint8_t lcid) |
| 176 { |
| 177 return m_owner->DoReleaseDataRadioBearer (rnti, lcid); |
| 178 } |
| 179 |
| 180 template <class C> |
| 181 LteMacSapUser* MemberLteCcmRrcSapProvider<C>::ConfigureSignalBearer(LteEnbCmacSa
pProvider::LcInfo lcinfo, LteMacSapUser* rlcMacSapUser) |
| 182 { |
| 183 return m_owner->DoConfigureSignalBearer (lcinfo, rlcMacSapUser); |
| 184 } |
| 185 |
| 186 |
| 187 |
| 188 template <class C> |
| 189 class MemberLteCcmRrcSapUser : public LteCcmRrcSapUser |
| 190 { |
| 191 public: |
| 192 MemberLteCcmRrcSapUser (C* owner); |
| 193 |
| 194 // inherited from LteCcmRrcSapUser |
| 195 virtual void AddLcs (std::vector<LteEnbRrcSapProvider::LogicalChannelConfig> l
cConfig); |
| 196 virtual void ReleaseLcs (uint16_t rnti, uint8_t lcid); |
| 197 |
| 198 |
| 199 private: |
| 200 C* m_owner; |
| 201 }; |
| 202 |
| 203 template <class C> |
| 204 MemberLteCcmRrcSapUser<C>::MemberLteCcmRrcSapUser (C* owner) |
| 205 : m_owner (owner) |
| 206 { |
| 207 } |
| 208 |
| 209 template <class C> |
| 210 void MemberLteCcmRrcSapUser<C>::AddLcs (std::vector<LteEnbRrcSapProvider::Logica
lChannelConfig> lcConfig) |
| 211 { |
| 212 m_owner->DoAddLcs (lcConfig); |
| 213 } |
| 214 |
| 215 template <class C> |
| 216 void MemberLteCcmRrcSapUser<C>::ReleaseLcs (uint16_t rnti, uint8_t lcid) |
| 217 { |
| 218 m_owner->DoReleaseLcs (rnti, lcid); |
| 219 } |
| 220 ·· |
| 221 } // end of namespace ns3 |
| 222 |
| 223 |
| 224 #endif /* LTE_CCM_RRC_SAP_H */ |
| 225 |
OLD | NEW |