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 #ifndef CC_HELPER_H |
| 22 #define CC_HELPER_H |
| 23 |
| 24 #include <ns3/config.h> |
| 25 #include <ns3/simulator.h> |
| 26 #include <ns3/names.h> |
| 27 #include <ns3/net-device.h> |
| 28 #include <ns3/net-device-container.h> |
| 29 #include <ns3/node.h> |
| 30 #include <ns3/node-container.h> |
| 31 #include <ns3/component-carrier-enb.h> |
| 32 #include <map> |
| 33 |
| 34 namespace ns3 { |
| 35 |
| 36 |
| 37 /** |
| 38 * \ingroup lte |
| 39 * |
| 40 * Creation and configuration of Component Carrier entities. One CcHelper instan
ce is |
| 41 * typically enough for an LTE simulation. To create it: |
| 42 * |
| 43 * Ptr<CcHelper> ccHelper = CreateObject<CcHelper> (); |
| 44 * |
| 45 * The general responsibility of the helper is to create various Component Carri
er objects |
| 46 * and arrange them together to set the eNodeB. The overall |
| 47 * arrangement would look like the following: |
| 48 * - Ul Bandwidths |
| 49 * - Dl Bandwidths |
| 50 * - Ul Earfcn |
| 51 * - Dl Earfcn |
| 52 * - A LteEnbPhy pointer, the correspondent object it is created and linked with
in InstallSingleEnb |
| 53 * |
| 54 * It is needed to call this helper before LteHelper, then the map created using
the helper |
| 55 * can be sent to the LteHelper LteHelper::SetCcEnb(std::map< uint8_t, Ptr<Compo
nentCarrier> >) |
| 56 * |
| 57 * This helper it is also used within the LteHelper in order to maintain backwar
ds compatibility |
| 58 * with previous user simulation script.· |
| 59 */ |
| 60 class CcHelper : public Object |
| 61 { |
| 62 public: |
| 63 CcHelper (void); |
| 64 virtual ~CcHelper (void); |
| 65 |
| 66 /** |
| 67 * Register this type. |
| 68 * \return The object TypeId. |
| 69 */ |
| 70 static TypeId GetTypeId (void); |
| 71 virtual void DoDispose (void); |
| 72 |
| 73 Ptr<ComponentCarrierEnb> DoCreateSingleCc (uint16_t ulBandwidth, uint16_t dlBa
ndwidth, uint16_t ulEarfcn, uint16_t dlEarfcn, bool isPrimary); |
| 74 |
| 75 /** |
| 76 * Set an attribute for the Component Carrier (LteEnbNetDevice) to be created. |
| 77 * |
| 78 * \param n the name of the attribute. |
| 79 * \param v the value of the attribute |
| 80 */ |
| 81 void SetCcAttribute (std::string n, const AttributeValue &v); |
| 82 |
| 83 /** |
| 84 * EquallySpacedCcs() create a valid std::map< uint8_t, Ptr<ComponentCarrier> > |
| 85 * The Primary Component Carrier it is at the position 0 in the map |
| 86 * The number of Component Carrier created depend on m_noOfCcs |
| 87 * Currently it is limited to maximum 2 ComponentCarrier |
| 88 * Since, only a LteEnbPhy object is available just symmetric Carrier Aggregati
on scheme |
| 89 * are allowed, i.e. 2 Uplink Component Carrier and 2 Downlink Component Carrie
r |
| 90 * Using this method, each CC will have the same characteristics (bandwidth) |
| 91 * while they are spaced by exactly the bandwidth. Hence, using this method, |
| 92 * you will create a intra-channel Carrier Aggregation scheme. |
| 93 */ |
| 94 |
| 95 std::map< uint8_t, Ptr<ComponentCarrierEnb> > EquallySpacedCcs (); |
| 96 |
| 97 uint16_t m_numberOfComponentCarries; |
| 98 |
| 99 /** |
| 100 * Probably the attribute listen below will become private and Set/Get method w
ill be written |
| 101 */ |
| 102 |
| 103 uint16_t m_ulEarfcn; /// Uplink EARFCN |
| 104 uint16_t m_dlEarfcn; /// Downlink EARFCN |
| 105 uint16_t m_dlBandwidth; /// Downlink Bandwidth |
| 106 uint16_t m_ulBandwidth; /// Uplink Bandwidth |
| 107 |
| 108 |
| 109 protected: |
| 110 // inherited from Object |
| 111 virtual void DoInitialize (void); |
| 112 |
| 113 private: |
| 114 /** |
| 115 * Create an eNodeB device (LteEnbNetDevice) on the given node. |
| 116 * \param ulBw uplink bandwidth for the current CC |
| 117 * \param dlBw downlink bandwidth for the current CC |
| 118 * \param ulFreq uplink EARFCN - not control on the validity at this point |
| 119 * \param dlFreq downlink EARFCN - not control on the validity at this point·· |
| 120 * \param pc - this identify if this is the Primary Component Carrier (PCC) -
only one PCC is allowed· |
| 121 * \return pointer to the created object |
| 122 */ |
| 123 Ptr<ComponentCarrierEnb> CreateSingleCc (uint16_t ulBandwidth, uint16_t dlBand
width, uint16_t ulEarfcn, uint16_t dlEarfcn, bool isPrimary); |
| 124 |
| 125 /// Factory for each Carrier Component. |
| 126 ObjectFactory m_ccFactory; |
| 127 |
| 128 |
| 129 |
| 130 }; // end of `class LteHelper` |
| 131 |
| 132 |
| 133 } // namespace ns3 |
| 134 |
| 135 |
| 136 |
| 137 #endif // LTE_HELPER_H |
OLD | NEW |