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.h"
27 //#include "ns3/gtk-config-store.h"
28 
29 
30 using namespace ns3;
31 
32 int main (int argc, char *argv[])
33 {
34  // Command line arguments
35  CommandLine cmd;
36  cmd.Parse (argc, argv);
37 
38  ConfigStore inputConfig;
39  inputConfig.ConfigureDefaults ();
40 
41  // parse again so you can override default values from the command line
42  cmd.Parse (argc, argv);
43 
44  Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
45 
46  lteHelper->SetAttribute ("PathlossModel", StringValue ("ns3::FriisSpectrumPropagationLossModel"));
47  // Enable LTE log components
48  //lteHelper->EnableLogComponents ();
49  lteHelper->EnableRlcTraces();
50 
51  // Create Nodes: eNodeB and UE
52  NodeContainer enbNodes;
53  NodeContainer ueNodes;
54  enbNodes.Create (1);
55  ueNodes.Create (3);
56 
57  // Install Mobility Model
58  MobilityHelper mobility;
59  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
60  mobility.Install (enbNodes);
61  mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
62  mobility.Install (ueNodes);
63 
64  // Create Devices and install them in the Nodes (eNB and UE)
65  NetDeviceContainer enbDevs;
66  NetDeviceContainer ueDevs;
67  enbDevs = lteHelper->InstallEnbDevice (enbNodes);
68  ueDevs = lteHelper->InstallUeDevice (ueNodes);
69 
70  // Attach a UE to a eNB
71  lteHelper->Attach (ueDevs, enbDevs.Get (0));
72 
73  // Activate an EPS bearer
75  EpsBearer bearer (q);
76  lteHelper->ActivateEpsBearer (ueDevs, bearer, EpcTft::Default ());
77 
79 
80  lteHelper->EnableMacTraces ();
81  lteHelper->EnableRlcTraces ();
82 
83 
84  double distance_temp [] = { 10000,10000,10000};
85  std::vector<double> userDistance;
86  userDistance.assign (distance_temp, distance_temp + 3);
87  for (int i = 0; i < 3; i++)
88  {
90  mm->SetPosition (Vector (userDistance[i], 0.0, 0.0));
91  }
92 
93  Simulator::Run ();
94 
95  // Uncomment to show available paths
96  /*GtkConfigStore config;
97  config.ConfigureAttributes ();*/
98 
100 
101  return 0;
102 }