A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lena-rlc-traces.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Manuel Requena <manuel.requena@cttc.es>
7 */
8
9#include "ns3/config-store-module.h"
10#include "ns3/core-module.h"
11#include "ns3/lte-module.h"
12#include "ns3/mobility-module.h"
13#include "ns3/network-module.h"
14
15using namespace ns3;
16
17int
18main(int argc, char* argv[])
19{
20 // Command line arguments
22 cmd.Parse(argc, argv);
23
26
27 // parse again so you can override default values from the command line
28 cmd.Parse(argc, argv);
29
31
32 lteHelper->SetAttribute("PathlossModel", StringValue("ns3::FriisSpectrumPropagationLossModel"));
33 // Enable LTE log components
34 // lteHelper->EnableLogComponents ();
35
36 // Create Nodes: eNodeB and UE
40 ueNodes.Create(3);
41
42 // Install Mobility Model
44 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
45 mobility.Install(enbNodes);
46 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
47 mobility.Install(ueNodes);
48
49 // Create Devices and install them in the Nodes (eNB and UE)
52 enbDevs = lteHelper->InstallEnbDevice(enbNodes);
53 ueDevs = lteHelper->InstallUeDevice(ueNodes);
54
55 // Attach a UE to a eNB
56 lteHelper->Attach(ueDevs, enbDevs.Get(0));
57
58 // Activate an EPS bearer
60 EpsBearer bearer(q);
61 lteHelper->ActivateDataRadioBearer(ueDevs, bearer);
62
64
65 lteHelper->EnablePhyTraces();
66 lteHelper->EnableMacTraces();
67 lteHelper->EnableRlcTraces();
68
69 double distance_temp[] = {1000, 1000, 1000};
70 std::vector<double> userDistance;
72 for (int i = 0; i < 3; i++)
73 {
75 ueNodes.Get(i)->GetObject<ConstantPositionMobilityModel>();
76 mm->SetPosition(Vector(userDistance[i], 0.0, 0.0));
77 }
78
80
81 // Uncomment to show available paths
82 // GtkConfigStore config;
83 // config.ConfigureAttributes ();
84
86
87 return 0;
88}
Parse command-line arguments.
Introspection did not find any typical Config paths.
void ConfigureDefaults()
Configure the default values.
Mobility model for which the current position does not change once it has been set and until it is se...
This class contains the specification of EPS Bearers.
Definition eps-bearer.h:80
Qci
QoS Class Indicator.
Definition eps-bearer.h:95
@ GBR_CONV_VOICE
GBR Conversational Voice.
Definition eps-bearer.h:96
Helper class used to assign positions and mobility models to nodes.
void SetPosition(const Vector &position)
holds a vector of ns3::NetDevice pointers
keep track of a set of node pointers.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:66
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:131
static void Run()
Run the simulation.
Definition simulator.cc:167
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:175
Hold variables of type string.
Definition string.h:45
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:436
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1344
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mobility
Definition third.py:92