A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
lena-rlc-traces.cc
Go to the documentation of this file.
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: Manuel Requena <manuel.requena@cttc.es>
19  */
20 
21 
22 #include "ns3/core-module.h"
23 #include "ns3/network-module.h"
24 #include "ns3/mobility-module.h"
25 #include "ns3/lte-module.h"
26 #include "ns3/config-store-module.h"
27 
28 
29 using namespace ns3;
30 
31 int main (int argc, char *argv[])
32 {
33  // Command line arguments
34  CommandLine cmd;
35  cmd.Parse (argc, argv);
36 
37  ConfigStore inputConfig;
38  inputConfig.ConfigureDefaults ();
39 
40  // parse again so you can override default values from the command line
41  cmd.Parse (argc, argv);
42 
43  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
44 
45  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
46  // Enable LTE log components
47  //lteHelper->EnableLogComponents ();
48 
49  // Create Nodes: eNodeB and UE
50  NodeContainer enbNodes;
51  NodeContainer ueNodes;
52  enbNodes.Create (1);
53  ueNodes.Create (3);
54 
55  // Install Mobility Model
56  MobilityHelper mobility;
57  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
58  mobility.Install (enbNodes);
59  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
60  mobility.Install (ueNodes);
61 
62  // Create Devices and install them in the Nodes (eNB and UE)
63  NetDeviceContainer enbDevs;
64  NetDeviceContainer ueDevs;
65  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
66  ueDevs = lteHelper->InstallUeDevice (ueNodes);
67 
68  // Attach a UE to a eNB
69  lteHelper->Attach (ueDevs, enbDevs.Get (0));
70 
71  // Activate an EPS bearer
73  EpsBearer bearer (q);
74  lteHelper->ActivateDataRadioBearer (ueDevs, bearer);
75 
76  Simulator::Stop (Seconds (0.5));
77 
78  lteHelper->EnablePhyTraces ();
79  lteHelper->EnableMacTraces ();
80  lteHelper->EnableRlcTraces ();
81 
82 
83  double distance_temp [] = { 1000,1000,1000};
84  std::vector<double> userDistance;
85  userDistance.assign (distance_temp, distance_temp + 3);
86  for (int i = 0; i < 3; i++)
87  {
89  mm->SetPosition (Vector (userDistance[i], 0.0, 0.0));
90  }
91 
92  Simulator::Run ();
93 
94  // Uncomment to show available paths
95  // GtkConfigStore config;
96  // config.ConfigureAttributes ();
97 
99 
100  return 0;
101 }
Doxygen introspection did not find any typical Config paths.
Definition: config-store.h:34
NetDeviceContainer InstallEnbDevice(NodeContainer c)
create a set of eNB devices
Definition: lte-helper.cc:346
hold variables of type string
Definition: string.h:18
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
Mobility model for which the current position does not change once it has been set and until it is se...
static void Run(void)
Run the simulation until one of:
Definition: simulator.cc:157
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
Definition: lte-helper.cc:646
void EnableRlcTraces(void)
Enable trace sinks for RLC layer.
Definition: lte-helper.cc:956
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Call ActivateDataRadioBearer (ueDevice, bearer) for each UE device in a given set.
Definition: lte-helper.cc:900
a 3d vector
Definition: vector.h:31
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:71
void Install(Ptr< Node > node) const
"Layout" a single node according to the current position allocator type.
holds a vector of ns3::NetDevice pointers
void EnablePhyTraces(void)
Enable trace sinks for PHY layer.
Definition: lte-helper.cc:1004
int main(int argc, char *argv[])
Parse command-line arguments.
Definition: command-line.h:177
static void Destroy(void)
Every event scheduled by the Simulator::insertAtDestroy method is invoked.
Definition: simulator.cc:121
void ConfigureDefaults(void)
keep track of a set of node pointers.
void SetMobilityModel(std::string type, std::string n1="", const AttributeValue &v1=EmptyAttributeValue(), std::string n2="", const AttributeValue &v2=EmptyAttributeValue(), std::string n3="", const AttributeValue &v3=EmptyAttributeValue(), std::string n4="", const AttributeValue &v4=EmptyAttributeValue(), std::string n5="", const AttributeValue &v5=EmptyAttributeValue(), std::string n6="", const AttributeValue &v6=EmptyAttributeValue(), std::string n7="", const AttributeValue &v7=EmptyAttributeValue(), std::string n8="", const AttributeValue &v8=EmptyAttributeValue(), std::string n9="", const AttributeValue &v9=EmptyAttributeValue())
void SetPosition(const Vector &position)
NetDeviceContainer InstallUeDevice(NodeContainer c)
create a set of UE devices
Definition: lte-helper.cc:361
Helper class used to assign positions and mobility models to nodes.
static void Stop(void)
If an event invokes this method, it will be the last event scheduled by the Simulator::run method bef...
Definition: simulator.cc:165
Ptr< Node > Get(uint32_t i) const
Get the Ptr stored in this container at a given index.
void Parse(int argc, char *argv[])
Parse the program arguments.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void EnableMacTraces(void)
Enable trace sinks for MAC layer.
Definition: lte-helper.cc:1044
void SetAttribute(std::string name, const AttributeValue &value)
Definition: object-base.cc:176
Ptr< T > GetObject(void) const
Definition: object.h:362
Qci
QoS Class Indicator.
Definition: eps-bearer.h:77