A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
lte-helper.h
1 /* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2011 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: Nicola Baldo <nbaldo@cttc.es>
19  */
20 
21 #ifndef LTE_HELPER_H
22 #define LTE_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/eps-bearer.h>
32 #include <ns3/phy-stats-calculator.h>
33 #include <ns3/phy-tx-stats-calculator.h>
34 #include <ns3/phy-rx-stats-calculator.h>
35 #include <ns3/mac-stats-calculator.h>
36 #include <ns3/radio-bearer-stats-calculator.h>
37 #include <ns3/radio-bearer-stats-connector.h>
38 #include <ns3/epc-tft.h>
39 #include <ns3/mobility-model.h>
40 
41 namespace ns3 {
42 
43 
44 class LteUePhy;
45 class LteEnbPhy;
46 class SpectrumChannel;
47 class EpcHelper;
48 class PropagationLossModel;
49 
50 
55 class LteHelper : public Object
56 {
57 public:
58  LteHelper (void);
59  virtual ~LteHelper (void);
60 
61  static TypeId GetTypeId (void);
62  virtual void DoDispose (void);
63 
64 
79 
85  void SetPathlossModelType (std::string type);
86 
93  void SetPathlossModelAttribute (std::string n, const AttributeValue &v);
94 
99  void SetSchedulerType (std::string type);
100 
107  void SetSchedulerAttribute (std::string n, const AttributeValue &v);
108 
115  void SetEnbDeviceAttribute (std::string n, const AttributeValue &v);
116 
121  void SetEnbAntennaModelType (std::string type);
122 
129  void SetEnbAntennaModelAttribute (std::string n, const AttributeValue &v);
130 
135  void SetUeAntennaModelType (std::string type);
136 
143  void SetUeAntennaModelAttribute (std::string n, const AttributeValue &v);
144 
149  void SetSpectrumChannelType (std::string type);
150 
157  void SetSpectrumChannelAttribute (std::string n, const AttributeValue &v);
166 
175 
182  void Attach (NetDeviceContainer ueDevices, Ptr<NetDevice> enbDevice);
183 
192  void Attach (Ptr<NetDevice> ueDevice, Ptr<NetDevice> enbDevice);
193 
202  void AttachToClosestEnb (NetDeviceContainer ueDevices, NetDeviceContainer enbDevices);
203 
212  void AttachToClosestEnb (Ptr<NetDevice> ueDevice, NetDeviceContainer enbDevices);
213 
222 
230  void ActivateDedicatedEpsBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer, Ptr<EpcTft> tft);
231 
232 
238  void AddX2Interface (NodeContainer enbNodes);
239 
246  void AddX2Interface (Ptr<Node> enbNode1, Ptr<Node> enbNode2);
247 
256  void HandoverRequest (Time hoTime, Ptr<NetDevice> ueDev, Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev);
257 
258 
266  void ActivateDataRadioBearer (NetDeviceContainer ueDevices, EpsBearer bearer);
267 
277  void ActivateDataRadioBearer (Ptr<NetDevice> ueDevice, EpsBearer bearer);
278 
284  void SetFadingModel (std::string model);
285 
289  void SetFadingModelAttribute (std::string n, const AttributeValue &v);
290 
295  void EnableLogComponents (void);
296 
302  void EnableTraces (void);
303 
307  void EnablePhyTraces (void);
308 
309 
310 
314  void EnableDlPhyTraces (void);
315 
319  void EnableUlPhyTraces (void);
320 
324  void EnableDlTxPhyTraces (void);
325 
329  void EnableUlTxPhyTraces (void);
330 
334  void EnableDlRxPhyTraces (void);
335 
339  void EnableUlRxPhyTraces (void);
340 
344  void EnableMacTraces (void);
345 
349  void EnableDlMacTraces (void);
350 
354  void EnableUlMacTraces (void);
355 
359  void EnableRlcTraces (void);
360 
366 
370  void EnablePdcpTraces (void);
371 
377 
378  enum LteEpsBearerToRlcMapping_t {RLC_SM_ALWAYS = 1,
379  RLC_UM_ALWAYS = 2,
380  RLC_AM_ALWAYS = 3,
381  PER_BASED = 4};
382 
394  int64_t AssignStreams (NetDeviceContainer c, int64_t stream);
395 
396 protected:
397  // inherited from Object
398  virtual void DoInitialize (void);
399 
400 private:
401  Ptr<NetDevice> InstallSingleEnbDevice (Ptr<Node> n);
402  Ptr<NetDevice> InstallSingleUeDevice (Ptr<Node> n);
403 
404  void DoHandoverRequest (Ptr<NetDevice> ueDev, Ptr<NetDevice> sourceEnbDev, Ptr<NetDevice> targetEnbDev);
405 
406  Ptr<SpectrumChannel> m_downlinkChannel;
407  Ptr<SpectrumChannel> m_uplinkChannel;
408 
409  Ptr<Object> m_downlinkPathlossModel;
410  Ptr<Object> m_uplinkPathlossModel;
411 
412  ObjectFactory m_schedulerFactory;
413  ObjectFactory m_propagationModelFactory;
414  ObjectFactory m_enbNetDeviceFactory;
415  ObjectFactory m_enbAntennaModelFactory;
416  ObjectFactory m_ueAntennaModelFactory;
417 
418  ObjectFactory m_dlPathlossModelFactory;
419  ObjectFactory m_ulPathlossModelFactory;
420 
421  ObjectFactory m_channelFactory;
422 
423  std::string m_fadingModelType;
424  ObjectFactory m_fadingModelFactory;
425 
426  Ptr<PhyStatsCalculator> m_phyStats;
427  Ptr<PhyTxStatsCalculator> m_phyTxStats;
428  Ptr<PhyRxStatsCalculator> m_phyRxStats;
429  Ptr<MacStatsCalculator> m_macStats;
432  RadioBearerStatsConnector m_radioBearerStatsConnector;
433 
434  Ptr<EpcHelper> m_epcHelper;
435 
436  uint64_t m_imsiCounter;
437  uint16_t m_cellIdCounter;
438 
439  bool m_useIdealRrc;
440 };
441 
442 
443 } // namespace ns3
444 
445 
446 
447 #endif // LTE_HELPER_H
keep track of time unit.
Definition: nstime.h:149
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
Definition: lte-helper.cc:209
void EnableDlRxPhyTraces(void)
Definition: lte-helper.cc:1152
smart pointer class similar to boost::intrusive_ptr
Definition: ptr.h:59
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Definition: lte-helper.cc:285
void EnableLogComponents(void)
Definition: lte-helper.cc:783
void HandoverRequest(Time hoTime, Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
Definition: lte-helper.cc:750
Hold a value for an Attribute.
Definition: attribute.h:51
void EnableDlPhyTraces(void)
Definition: lte-helper.cc:1282
void SetUeAntennaModelAttribute(std::string n, const AttributeValue &v)
Definition: lte-helper.cc:246
void SetFadingModel(std::string model)
Definition: lte-helper.cc:253
void EnableRlcTraces(void)
Definition: lte-helper.cc:829
void SetUeAntennaModelType(std::string type)
Definition: lte-helper.cc:239
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Definition: lte-helper.cc:837
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Definition: lte-helper.cc:773
void EnableUlRxPhyTraces(void)
Definition: lte-helper.cc:1159
void SetSchedulerType(std::string type)
Definition: lte-helper.cc:183
void EnablePdcpTraces(void)
Definition: lte-helper.cc:1339
void AttachToClosestEnb(NetDeviceContainer ueDevices, NetDeviceContainer enbDevices)
Definition: lte-helper.cc:597
void EnableTraces(void)
Definition: lte-helper.cc:820
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Definition: lte-helper.cc:191
void Attach(NetDeviceContainer ueDevices, Ptr< NetDevice > enbDevice)
Definition: lte-helper.cc:562
holds a vector of ns3::NetDevice pointers
void EnablePhyTraces(void)
Definition: lte-helper.cc:1127
void SetEnbAntennaModelType(std::string type)
Definition: lte-helper.cc:225
void SetSpectrumChannelType(std::string type)
Definition: lte-helper.cc:271
void SetFadingModelAttribute(std::string n, const AttributeValue &v)
Definition: lte-helper.cc:265
void EnableDlMacTraces(void)
Definition: lte-helper.cc:1212
void ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Definition: lte-helper.cc:629
keep track of a set of node pointers.
void EnableUlTxPhyTraces(void)
Definition: lte-helper.cc:1145
void AddX2Interface(NodeContainer enbNodes)
Definition: lte-helper.cc:727
void EnableUlPhyTraces(void)
Definition: lte-helper.cc:1322
void EnableDlTxPhyTraces(void)
Definition: lte-helper.cc:1138
void EnableUlMacTraces(void)
Definition: lte-helper.cc:1253
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
Definition: lte-helper.cc:1333
NetDeviceContainer InstallUeDevice(NodeContainer c)
Definition: lte-helper.cc:300
Ptr< RadioBearerStatsCalculator > GetPdcpStats(void)
Definition: lte-helper.cc:1347
virtual void DoDispose(void)
Definition: lte-helper.cc:166
instantiate subclasses of ns3::Object.
void SetEpcHelper(Ptr< EpcHelper > h)
Definition: lte-helper.cc:176
void SetPathlossModelType(std::string type)
Definition: lte-helper.cc:199
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
Definition: lte-helper.cc:232
void SetSpectrumChannelAttribute(std::string n, const AttributeValue &v)
Definition: lte-helper.cc:278
virtual void DoInitialize(void)
Definition: lte-helper.cc:76
void EnableMacTraces(void)
Definition: lte-helper.cc:1204
a base class which provides memory management and object aggregation
Definition: object.h:63
a unique identifier for an interface.
Definition: type-id.h:44
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Definition: lte-helper.cc:217