A Discrete-Event Network Simulator
API
lena-distributed-ffr.cc
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2014 Piotr Gawlowicz
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: Piotr Gawlowicz <gawlowicz.p@gmail.com>
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/spectrum-module.h"
27#include "ns3/config-store.h"
28#include <ns3/buildings-helper.h>
29#include "ns3/point-to-point-epc-helper.h"
30#include "ns3/internet-module.h"
31#include "ns3/point-to-point-module.h"
32#include "ns3/applications-module.h"
33#include "ns3/log.h"
34
35using namespace ns3;
36
37NS_LOG_COMPONENT_DEFINE ("LenaDistributedFrequencyReuse");
38
39void
40PrintGnuplottableUeListToFile (std::string filename)
41{
42 std::ofstream outFile;
43 outFile.open (filename.c_str (), std::ios_base::out | std::ios_base::trunc);
44 if (!outFile.is_open ())
45 {
46 NS_LOG_ERROR ("Can't open file " << filename);
47 return;
48 }
49 for (NodeList::Iterator it = NodeList::Begin (); it != NodeList::End (); ++it)
50 {
51 Ptr<Node> node = *it;
52 int nDevs = node->GetNDevices ();
53 for (int j = 0; j < nDevs; j++)
54 {
56 if (uedev)
57 {
58 Vector pos = node->GetObject<MobilityModel> ()->GetPosition ();
59 outFile << "set label \"" << uedev->GetImsi ()
60 << "\" at " << pos.x << "," << pos.y << " left font \"Helvetica,4\" textcolor rgb \"grey\" front point pt 1 ps 0.3 lc rgb \"grey\" offset 0,0"
61 << std::endl;
62 }
63 }
64 }
65}
66
67void
68PrintGnuplottableEnbListToFile (std::string filename)
69{
70 std::ofstream outFile;
71 outFile.open (filename.c_str (), std::ios_base::out | std::ios_base::trunc);
72 if (!outFile.is_open ())
73 {
74 NS_LOG_ERROR ("Can't open file " << filename);
75 return;
76 }
77 for (NodeList::Iterator it = NodeList::Begin (); it != NodeList::End (); ++it)
78 {
79 Ptr<Node> node = *it;
80 int nDevs = node->GetNDevices ();
81 for (int j = 0; j < nDevs; j++)
82 {
84 if (enbdev)
85 {
86 Vector pos = node->GetObject<MobilityModel> ()->GetPosition ();
87 outFile << "set label \"" << enbdev->GetCellId ()
88 << "\" at " << pos.x << "," << pos.y
89 << " left font \"Helvetica,4\" textcolor rgb \"white\" front point pt 2 ps 0.3 lc rgb \"white\" offset 0,0"
90 << std::endl;
91 }
92 }
93 }
94}
95
96int main (int argc, char *argv[])
97{
98 Config::SetDefault ("ns3::LteSpectrumPhy::CtrlErrorModelEnabled", BooleanValue (true));
99 Config::SetDefault ("ns3::LteSpectrumPhy::DataErrorModelEnabled", BooleanValue (true));
100 Config::SetDefault ("ns3::LteHelper::UseIdealRrc", BooleanValue (true));
101 Config::SetDefault ("ns3::LteHelper::UsePdschForCqiGeneration", BooleanValue (true));
102
103 //Uplink Power Control
104 Config::SetDefault ("ns3::LteUePhy::EnableUplinkPowerControl", BooleanValue (true));
105 Config::SetDefault ("ns3::LteUePowerControl::ClosedLoop", BooleanValue (true));
106 Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
107
108 uint32_t runId = 3;
109 uint16_t numberOfRandomUes = 0;
110 double simTime = 5.000;
111 bool generateSpectrumTrace = false;
112 bool generateRem = false;
113 int32_t remRbId = -1;
114 uint16_t bandwidth = 25;
115 double distance = 1000;
116 Box macroUeBox = Box (-distance * 0.5, distance * 1.5, -distance * 0.5, distance * 1.5, 1.5, 1.5);
117
118 // Command line arguments
119 CommandLine cmd (__FILE__);
120 cmd.AddValue ("numberOfUes", "Number of UEs", numberOfRandomUes);
121 cmd.AddValue ("simTime", "Total duration of the simulation (in seconds)", simTime);
122 cmd.AddValue ("generateSpectrumTrace", "if true, will generate a Spectrum Analyzer trace", generateSpectrumTrace);
123 cmd.AddValue ("generateRem", "if true, will generate a REM and then abort the simulation", generateRem);
124 cmd.AddValue ("remRbId", "Resource block Id, for which REM will be generated,"
125 "default value is -1, what means REM will be averaged from all RBs", remRbId);
126 cmd.AddValue ("runId", "runId", runId);
127 cmd.Parse (argc, argv);
128
129 RngSeedManager::SetSeed (1);
130 RngSeedManager::SetRun (runId);
131
132 Ptr<LteHelper> lteHelper = CreateObject<LteHelper> ();
133 Ptr<PointToPointEpcHelper> epcHelper = CreateObject<PointToPointEpcHelper> ();
134 lteHelper->SetEpcHelper (epcHelper);
135 lteHelper->SetHandoverAlgorithmType ("ns3::NoOpHandoverAlgorithm"); // disable automatic handover
136
137 Ptr<Node> pgw = epcHelper->GetPgwNode ();
138
139 // Create a single RemoteHost
140 NodeContainer remoteHostContainer;
141 remoteHostContainer.Create (1);
142 Ptr<Node> remoteHost = remoteHostContainer.Get (0);
143 InternetStackHelper internet;
144 internet.Install (remoteHostContainer);
145
146 // Create the Internet
148 p2ph.SetDeviceAttribute ("DataRate", DataRateValue (DataRate ("100Gb/s")));
149 p2ph.SetDeviceAttribute ("Mtu", UintegerValue (1500));
150 p2ph.SetChannelAttribute ("Delay", TimeValue (Seconds (0.010)));
151 NetDeviceContainer internetDevices = p2ph.Install (pgw, remoteHost);
152 Ipv4AddressHelper ipv4h;
153 ipv4h.SetBase ("1.0.0.0", "255.0.0.0");
154 Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign (internetDevices);
155 Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress (1);
156
157 // Routing of the Internet Host (towards the LTE network)
158 Ipv4StaticRoutingHelper ipv4RoutingHelper;
159 Ptr<Ipv4StaticRouting> remoteHostStaticRouting = ipv4RoutingHelper.GetStaticRouting (remoteHost->GetObject<Ipv4> ());
160 // interface 0 is localhost, 1 is the p2p device
161 remoteHostStaticRouting->AddNetworkRouteTo (Ipv4Address ("7.0.0.0"), Ipv4Mask ("255.0.0.0"), 1);
162
163 // Create Nodes: eNodeB and UE
164 NodeContainer enbNodes;
165 NodeContainer randomUeNodes;
166 enbNodes.Create (3);
167 randomUeNodes.Create (numberOfRandomUes);
168
169 /* the topology is the following:
170 * eNB3
171 * / \
172 * / \
173 * / \
174 * / \
175 * distance / \ distance
176 * / UEs \
177 * / \
178 * / \
179 * / \
180 * / \
181 * eNB1-------------------------eNB2
182 * distance
183 */
184
185 // Install Mobility Model
186 Ptr<ListPositionAllocator> enbPositionAlloc = CreateObject<ListPositionAllocator> ();
187 enbPositionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
188 enbPositionAlloc->Add (Vector (distance, 0.0, 0.0)); // eNB2
189 enbPositionAlloc->Add (Vector (distance * 0.5, distance * 0.866, 0.0)); // eNB3
191 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
192 mobility.SetPositionAllocator (enbPositionAlloc);
193 mobility.Install (enbNodes);
194
195 Ptr<RandomBoxPositionAllocator> randomUePositionAlloc = CreateObject<RandomBoxPositionAllocator> ();
196 Ptr<UniformRandomVariable> xVal = CreateObject<UniformRandomVariable> ();
197 xVal->SetAttribute ("Min", DoubleValue (macroUeBox.xMin));
198 xVal->SetAttribute ("Max", DoubleValue (macroUeBox.xMax));
199 randomUePositionAlloc->SetAttribute ("X", PointerValue (xVal));
200 Ptr<UniformRandomVariable> yVal = CreateObject<UniformRandomVariable> ();
201 yVal->SetAttribute ("Min", DoubleValue (macroUeBox.yMin));
202 yVal->SetAttribute ("Max", DoubleValue (macroUeBox.yMax));
203 randomUePositionAlloc->SetAttribute ("Y", PointerValue (yVal));
204 Ptr<UniformRandomVariable> zVal = CreateObject<UniformRandomVariable> ();
205 zVal->SetAttribute ("Min", DoubleValue (macroUeBox.zMin));
206 zVal->SetAttribute ("Max", DoubleValue (macroUeBox.zMax));
207 randomUePositionAlloc->SetAttribute ("Z", PointerValue (zVal));
208 mobility.SetPositionAllocator (randomUePositionAlloc);
209 mobility.Install (randomUeNodes);
210
211 // Create Devices and install them in the Nodes (eNB and UE)
212 NetDeviceContainer enbDevs;
213 NetDeviceContainer randomUeDevs;
214 lteHelper->SetSchedulerType ("ns3::PfFfMacScheduler");
215 lteHelper->SetSchedulerAttribute ("HarqEnabled", BooleanValue (true));
216
217 lteHelper->SetEnbDeviceAttribute ("DlBandwidth", UintegerValue (bandwidth));
218 lteHelper->SetEnbDeviceAttribute ("UlBandwidth", UintegerValue (bandwidth));
219
220 lteHelper->SetFfrAlgorithmType ("ns3::LteFfrDistributedAlgorithm");
221 lteHelper->SetFfrAlgorithmAttribute ("CalculationInterval", TimeValue (MilliSeconds (200)));
222 lteHelper->SetFfrAlgorithmAttribute ("RsrpDifferenceThreshold", UintegerValue (5));
223 lteHelper->SetFfrAlgorithmAttribute ("RsrqThreshold", UintegerValue (25));
224 lteHelper->SetFfrAlgorithmAttribute ("EdgeRbNum", UintegerValue (6));
225 lteHelper->SetFfrAlgorithmAttribute ("CenterPowerOffset",
226 UintegerValue (LteRrcSap::PdschConfigDedicated::dB_3));
227 lteHelper->SetFfrAlgorithmAttribute ("EdgePowerOffset",
228 UintegerValue (LteRrcSap::PdschConfigDedicated::dB3));
229
230 lteHelper->SetFfrAlgorithmAttribute ("CenterAreaTpc", UintegerValue (0));
231 lteHelper->SetFfrAlgorithmAttribute ("EdgeAreaTpc", UintegerValue (3));
232
233 //ns3::LteFfrDistributedAlgorithm works with Absolute Mode Uplink Power Control
234 Config::SetDefault ("ns3::LteUePowerControl::AccumulationEnabled", BooleanValue (false));
235
236 enbDevs = lteHelper->InstallEnbDevice (enbNodes);
237 randomUeDevs = lteHelper->InstallUeDevice (randomUeNodes);
238
239 // Add X2 interface
240 lteHelper->AddX2Interface (enbNodes);
241
242
243 NodeContainer ueNodes;
244 ueNodes.Add (randomUeNodes);
245 NetDeviceContainer ueDevs;
246 ueDevs.Add (randomUeDevs);
247
248 // Install the IP stack on the UEs
249 internet.Install (ueNodes);
250 Ipv4InterfaceContainer ueIpIfaces;
251 ueIpIfaces = epcHelper->AssignUeIpv4Address (NetDeviceContainer (ueDevs));
252
253 // Attach a UE to a eNB
254 lteHelper->AttachToClosestEnb (ueDevs, enbDevs);
255
256 // Install and start applications on UEs and remote host
257 uint16_t dlPort = 10000;
258 uint16_t ulPort = 20000;
259
260 // randomize a bit start times to avoid simulation artifacts
261 // (e.g., buffer overflows due to packet transmissions happening
262 // exactly at the same time)
263 Ptr<UniformRandomVariable> startTimeSeconds = CreateObject<UniformRandomVariable> ();
264 startTimeSeconds->SetAttribute ("Min", DoubleValue (0));
265 startTimeSeconds->SetAttribute ("Max", DoubleValue (0.010));
266
267 for (uint32_t u = 0; u < ueNodes.GetN (); ++u)
268 {
269 Ptr<Node> ue = ueNodes.Get (u);
270 // Set the default gateway for the UE
271 Ptr<Ipv4StaticRouting> ueStaticRouting = ipv4RoutingHelper.GetStaticRouting (ue->GetObject<Ipv4> ());
272 ueStaticRouting->SetDefaultRoute (epcHelper->GetUeDefaultGatewayAddress (), 1);
273
274 for (uint32_t b = 0; b < 1; ++b)
275 {
276 ++dlPort;
277 ++ulPort;
278
281
282 UdpClientHelper dlClientHelper (ueIpIfaces.GetAddress (u), dlPort);
283 dlClientHelper.SetAttribute ("MaxPackets", UintegerValue (1000000));
284 dlClientHelper.SetAttribute ("Interval", TimeValue (MilliSeconds (1.0)));
285 clientApps.Add (dlClientHelper.Install (remoteHost));
286 PacketSinkHelper dlPacketSinkHelper ("ns3::UdpSocketFactory",
287 InetSocketAddress (Ipv4Address::GetAny (), dlPort));
288 serverApps.Add (dlPacketSinkHelper.Install (ue));
289
290
291 UdpClientHelper ulClientHelper (remoteHostAddr, ulPort);
292 ulClientHelper.SetAttribute ("MaxPackets", UintegerValue (1000000));
293 ulClientHelper.SetAttribute ("Interval", TimeValue (MilliSeconds (1.0)));
294 clientApps.Add (ulClientHelper.Install (ue));
295 PacketSinkHelper ulPacketSinkHelper ("ns3::UdpSocketFactory",
296 InetSocketAddress (Ipv4Address::GetAny (), ulPort));
297 serverApps.Add (ulPacketSinkHelper.Install (remoteHost));
298
299 Ptr<EpcTft> tft = Create<EpcTft> ();
301 dlpf.localPortStart = dlPort;
302 dlpf.localPortEnd = dlPort;
303 tft->Add (dlpf);
305 ulpf.remotePortStart = ulPort;
306 ulpf.remotePortEnd = ulPort;
307 tft->Add (ulpf);
308 EpsBearer bearer (EpsBearer::NGBR_VIDEO_TCP_DEFAULT);
309 lteHelper->ActivateDedicatedEpsBearer (ueDevs.Get (u), bearer, tft);
310
311 Time startTime = Seconds (startTimeSeconds->GetValue ());
312 serverApps.Start (startTime);
313 clientApps.Start (startTime);
314 }
315 }
316
317 //Spectrum analyzer
318 NodeContainer spectrumAnalyzerNodes;
319 spectrumAnalyzerNodes.Create (1);
320 SpectrumAnalyzerHelper spectrumAnalyzerHelper;
321
322 if (generateSpectrumTrace)
323 {
324 Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
325 //position of Spectrum Analyzer
326 positionAlloc->Add (Vector (0.0, 0.0, 0.0)); // eNB1
327// positionAlloc->Add (Vector (distance, 0.0, 0.0)); // eNB2
328// positionAlloc->Add (Vector (distance*0.5, distance*0.866, 0.0)); // eNB3
329
331 mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
332 mobility.SetPositionAllocator (positionAlloc);
333 mobility.Install (spectrumAnalyzerNodes);
334
335 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
336 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
337
338 spectrumAnalyzerHelper.SetChannel (dlChannel);
339 Ptr<SpectrumModel> sm = LteSpectrumValueHelper::GetSpectrumModel (100, bandwidth);
340 spectrumAnalyzerHelper.SetRxSpectrumModel (sm);
341 spectrumAnalyzerHelper.SetPhyAttribute ("Resolution", TimeValue (MicroSeconds (10)));
342 spectrumAnalyzerHelper.SetPhyAttribute ("NoisePowerSpectralDensity", DoubleValue (1e-15)); // -120 dBm/Hz
343 spectrumAnalyzerHelper.EnableAsciiAll ("spectrum-analyzer-output");
344 spectrumAnalyzerHelper.Install (spectrumAnalyzerNodes);
345 }
346
348 if (generateRem)
349 {
352
353 remHelper = CreateObject<RadioEnvironmentMapHelper> ();
354 Ptr<LteSpectrumPhy> enbDlSpectrumPhy = enbDevs.Get (0)->GetObject<LteEnbNetDevice> ()->GetPhy ()->GetDownlinkSpectrumPhy ()->GetObject<LteSpectrumPhy> ();
355 Ptr<SpectrumChannel> dlChannel = enbDlSpectrumPhy->GetChannel ();
356 uint32_t dlChannelId = dlChannel->GetId ();
357 NS_LOG_INFO ("DL ChannelId: " << dlChannelId);
358 remHelper->SetAttribute ("Channel", PointerValue (dlChannel));
359 remHelper->SetAttribute ("OutputFile", StringValue ("lena-distributed-ffr.rem"));
360 remHelper->SetAttribute ("XMin", DoubleValue (macroUeBox.xMin));
361 remHelper->SetAttribute ("XMax", DoubleValue (macroUeBox.xMax));
362 remHelper->SetAttribute ("YMin", DoubleValue (macroUeBox.yMin));
363 remHelper->SetAttribute ("YMax", DoubleValue (macroUeBox.yMax));
364 remHelper->SetAttribute ("Z", DoubleValue (1.5));
365 remHelper->SetAttribute ("XRes", UintegerValue (500));
366 remHelper->SetAttribute ("YRes", UintegerValue (500));
367
368 if (remRbId >= 0)
369 {
370 remHelper->SetAttribute ("UseDataChannel", BooleanValue (true));
371 remHelper->SetAttribute ("RbId", IntegerValue (remRbId));
372 }
373
374 remHelper->Install ();
375 // simulation will stop right after the REM has been generated
376 }
377 else
378 {
379 Simulator::Stop (Seconds (simTime));
380 }
381
382 Simulator::Run ();
383 Simulator::Destroy ();
384 return 0;
385}
holds a vector of ns3::Application pointers.
AttributeValue implementation for Boolean.
Definition: boolean.h:37
a 3d box
Definition: box.h:35
double yMax
The y coordinate of the top bound of the box.
Definition: box.h:116
double xMin
The x coordinate of the left bound of the box.
Definition: box.h:110
double yMin
The y coordinate of the bottom bound of the box.
Definition: box.h:114
double xMax
The x coordinate of the right bound of the box.
Definition: box.h:112
double zMin
The z coordinate of the down bound of the box.
Definition: box.h:118
double zMax
The z coordinate of the up bound of the box.
Definition: box.h:120
Parse command-line arguments.
Definition: command-line.h:229
Class for representing data rates.
Definition: data-rate.h:89
AttributeValue implementation for DataRate.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition: double.h:41
This class contains the specification of EPS Bearers.
Definition: eps-bearer.h:92
an Inet address class
Hold a signed integer type.
Definition: integer.h:44
aggregate IP/TCP/UDP functionality to existing Nodes.
void Install(std::string nodeName) const
Aggregate implementations of the ns3::Ipv4, ns3::Ipv6, ns3::Udp, and ns3::Tcp classes onto the provid...
A helper class to make life easier while doing simple IPv4 address assignment in scripts.
void SetBase(Ipv4Address network, Ipv4Mask mask, Ipv4Address base="0.0.0.1")
Set the base network number, network mask and base address.
Ipv4InterfaceContainer Assign(const NetDeviceContainer &c)
Assign IP addresses to the net devices specified in the container based on the current network prefix...
Ipv4 addresses are stored in host order in this class.
Definition: ipv4-address.h:41
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition: ipv4.h:77
holds a vector of std::pair of Ptr<Ipv4> and interface index.
Ipv4Address GetAddress(uint32_t i, uint32_t j=0) const
a class to represent an Ipv4 address mask
Definition: ipv4-address.h:256
Helper class that adds ns3::Ipv4StaticRouting objects.
Ptr< Ipv4StaticRouting > GetStaticRouting(Ptr< Ipv4 > ipv4) const
Try and find the static routing protocol as either the main routing protocol or in the list of routin...
The eNodeB device implementation.
uint16_t GetCellId() const
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:306
void SetEpcHelper(Ptr< EpcHelper > h)
Set the EpcHelper to be used to setup the EPC network in conjunction with the setup of the LTE radio ...
Definition: lte-helper.cc:272
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Definition: lte-helper.cc:293
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
Definition: lte-helper.cc:474
void SetHandoverAlgorithmType(std::string type)
Set the type of handover algorithm to be used by eNodeB devices.
Definition: lte-helper.cc:327
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
Definition: lte-helper.cc:314
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
Definition: lte-helper.cc:279
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
Definition: lte-helper.cc:400
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Definition: lte-helper.cc:489
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
Definition: lte-helper.cc:1220
void AttachToClosestEnb(NetDeviceContainer ueDevices, NetDeviceContainer enbDevices)
Manual attachment of a set of UE devices to the network via the closest eNodeB (with respect to dista...
Definition: lte-helper.cc:1036
uint8_t ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
Definition: lte-helper.cc:1068
The LteSpectrumPhy models the physical layer of LTE.
The LteUeNetDevice class implements the UE net device.
Helper class used to assign positions and mobility models to nodes.
Keep track of the current position and velocity of an object.
holds a vector of ns3::NetDevice pointers
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
virtual Ipv4Address GetUeDefaultGatewayAddress()
virtual Ptr< Node > GetPgwNode() const
Get the PGW node.
virtual Ipv4InterfaceContainer AssignUeIpv4Address(NetDeviceContainer ueDevices)
Assign IPv4 addresses to UE devices.
keep track of a set of node pointers.
uint32_t GetN(void) const
Get the number of Ptr<Node> stored in this container.
void Create(uint32_t n)
Create n nodes and append pointers to them to the end of this NodeContainer.
void Add(NodeContainer other)
Append the contents of another NodeContainer to the end of this container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
uint32_t GetNDevices(void) const
Definition: node.cc:152
Ptr< NetDevice > GetDevice(uint32_t index) const
Retrieve the index-th NetDevice associated to this node.
Definition: node.cc:144
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
Definition: node-list.h:44
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Definition: object-base.cc:256
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Definition: object.h:470
A helper to make it easier to instantiate an ns3::PacketSinkApplication on a set of nodes.
Build a set of PointToPointNetDevice objects.
void SetDeviceAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each NetDevice created by the helper.
void SetChannelAttribute(std::string name, const AttributeValue &value)
Set an attribute value to be propagated to each Channel created by the helper.
NetDeviceContainer Install(NodeContainer c)
Hold objects of type Ptr<T>.
Definition: pointer.h:37
Class to allow the Spectrum Analysis.
NetDeviceContainer Install(NodeContainer c) const
void SetPhyAttribute(std::string name, const AttributeValue &v)
void SetChannel(Ptr< SpectrumChannel > channel)
Set the SpectrumChannel that will be used by SpectrumPhy instances created by this helper.
void EnableAsciiAll(std::string prefix)
Enable ASCII output.
void SetRxSpectrumModel(Ptr< SpectrumModel > m)
Set the spectrum model used by the created SpectrumAnalyzer instances to represent incoming signals.
Hold variables of type string.
Definition: string.h:41
Simulation virtual time values and global simulation resolution.
Definition: nstime.h:103
AttributeValue implementation for Time.
Definition: nstime.h:1308
Create a client application which sends UDP packets carrying a 32bit sequence number and a 64 bit tim...
Hold an unsigned integer type.
Definition: uinteger.h:44
double GetValue(double min, double max)
Get the next random value, as a double in the specified range .
Vector3D Vector
Vector alias typedef for compatibility with mobility models.
Definition: vector.h:324
void SetDefault(std::string name, const AttributeValue &value)
Definition: config.cc:849
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition: log.h:257
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:205
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition: log.h:281
Time MicroSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1260
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition: nstime.h:1244
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition: nstime.h:1252
void PrintGnuplottableEnbListToFile(std::string filename)
void PrintGnuplottableUeListToFile(std::string filename)
serverApps
Definition: first.py:52
clientApps
Definition: first.py:61
Every class exported by the ns3 library is enclosed in the ns3 namespace.
cmd
Definition: second.py:35
mobility
Definition: third.py:107
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition: epc-tft.h:75
uint16_t localPortEnd
end of the port number range of the UE
Definition: epc-tft.h:140
uint16_t remotePortEnd
end of the port number range of the remote host
Definition: epc-tft.h:138
uint16_t remotePortStart
start of the port number range of the remote host
Definition: epc-tft.h:137
uint16_t localPortStart
start of the port number range of the UE
Definition: epc-tft.h:139
static Vector GetPosition(Ptr< Node > node)
Definition: wifi-ap.cc:96