1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ 2 /* 3 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) 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: Manuel Requena <manuel.requena@cttc.es> (Based on lte-helper.h) 19 */ 20 21 #ifndef LTE_SIMPLE_HELPER_H 22 #define LTE_SIMPLE_HELPER_H 23 24 #include "ns3/net-device-container.h" 25 #include "ns3/simple-channel.h" 26 #include "ns3/node-container.h" 27 #include "ns3/radio-bearer-stats-calculator.h" 28 29 #include "ns3/lte-pdcp.h" 30 #include "ns3/lte-rlc.h" 31 #include "ns3/lte-rlc-um.h" 32 #include "ns3/lte-rlc-am.h" 33 34 namespace ns3 { 35 36 class LteTestRrc; 37 class LteTestMac; 38 39 /** 40 * \ingroup lte-test 41 * \ingroup tests 42 * 43 * \brief A simplified version of LteHelper, that 44 * is used for creation and configuration of LTE entities for testing purposes 45 * when just a limited LteHelper functionality is wanted. 46 * 47 */ 48 class LteSimpleHelper : public Object 49 { 50 public: 51 LteSimpleHelper (void); 52 virtual ~LteSimpleHelper (void); 53 54 /** 55 * \brief Get the type ID. 56 * \return the object TypeId 57 */ 58 static TypeId GetTypeId (void); 59 virtual void DoDispose (void); 60 61 62 /** 63 * create a set of eNB devices 64 * 65 * \param c the node container where the devices are to be installed 66 * 67 * \return the NetDeviceContainer with the newly created devices 68 */ 69 NetDeviceContainer InstallEnbDevice (NodeContainer c); 70 71 /** 72 * create a set of UE devices 73 * 74 * \param c the node container where the devices are to be installed 75 * 76 * \return the NetDeviceContainer with the newly created devices 77 */ 78 NetDeviceContainer InstallUeDevice (NodeContainer c); 79 80 81 /** 82 * Enables logging for all components of the LENA architecture 83 * 84 */ 85 void EnableLogComponents (void); 86 87 /** 88 * Enables trace sinks for MAC, RLC and PDCP 89 */ 90 void EnableTraces (void); 91 92 93 /** 94 * Enable trace sinks for RLC layer 95 */ 96 void EnableRlcTraces (void); 97 98 /** 99 * Enable trace sinks for DL RLC layer 100 */ 101 void EnableDlRlcTraces (void); 102 103 /** 104 * Enable trace sinks for UL RLC layer 105 */ 106 void EnableUlRlcTraces (void); 107 108 109 /** 110 * Enable trace sinks for PDCP layer 111 */ 112 void EnablePdcpTraces (void); 113 114 /** 115 * Enable trace sinks for DL PDCP layer 116 */ 117 void EnableDlPdcpTraces (void); 118 119 /** 120 * Enable trace sinks for UL PDCP layer 121 */ 122 void EnableUlPdcpTraces (void); 123 124 protected: 125 // inherited from Object 126 virtual void DoInitialize (void); 127 128 private: 129 /** 130 * Install single ENB device 131 * 132 * \param n the node 133 * \returns the device 134 */ 135 Ptr<NetDevice> InstallSingleEnbDevice (Ptr<Node> n); 136 /** 137 * Install single UE device 138 * 139 * \param n the node 140 * \returns the device 141 */ 142 Ptr<NetDevice> InstallSingleUeDevice (Ptr<Node> n); 143 144 Ptr<SimpleChannel> m_phyChannel; ///< the physical channel 145 146 public: 147 148 Ptr<LteTestRrc> m_enbRrc; ///< ENB RRC 149 Ptr<LteTestRrc> m_ueRrc; ///< UE RRC 150 151 Ptr<LteTestMac> m_enbMac; ///< ENB MAC 152 Ptr<LteTestMac> m_ueMac; ///< UE MAC 153 154 private: 155 156 Ptr<LtePdcp> m_enbPdcp; ///< ENB PDCP 157 Ptr<LteRlc> m_enbRlc; ///< ENB RLC 158 159 Ptr<LtePdcp> m_uePdcp; ///< UE PDCP 160 Ptr<LteRlc> m_ueRlc; ///< UE RLC 161 162 ObjectFactory m_enbDeviceFactory; ///< ENB device factory 163 ObjectFactory m_ueDeviceFactory; ///< UE device factory 164 165 /// LteRlcEntityType_t enumeration 166 enum LteRlcEntityType_t {RLC_UM = 1, 167 RLC_AM = 2 } m_lteRlcEntityType; ///< RLC entity type 168 169 }; 170 171 172 } // namespace ns3 173 174 175 #endif // LTE_SIMPLE_HELPER_H 176