A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
lena-dual-stripe.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Nicola Baldo <nbaldo@cttc.es>
7 */
8
9#include "ns3/applications-module.h"
10#include "ns3/buildings-module.h"
11#include "ns3/config-store-module.h"
12#include "ns3/core-module.h"
13#include "ns3/internet-module.h"
14#include "ns3/log.h"
15#include "ns3/lte-module.h"
16#include "ns3/mobility-module.h"
17#include "ns3/network-module.h"
18#include "ns3/point-to-point-helper.h"
19
20#include <iomanip>
21#include <ios>
22#include <string>
23#include <vector>
24
25// The topology of this simulation program is inspired from
26// 3GPP R4-092042, Section 4.2.1 Dual Stripe Model
27// note that the term "apartments" used in that document matches with
28// the term "room" used in the BuildingsMobilityModel
29//
30// A user can pass the command-line --ns3::LteHexGridEnbTopologyHelper::EnableWraparound=1
31// to setup and use the hexagonal wraparound model, which causes all cells to receive
32// similar interference, rather than central cells receiving a lot more than edge cells.
33
34using namespace ns3;
35
36NS_LOG_COMPONENT_DEFINE("LenaDualStripe");
37
38/**
39 * Check if two boxes are overlapping.
40 *
41 * @param a First box.
42 * @param b Second box.
43 * @return true if the boxes are overlapping, false otherwise.
44 */
45bool
47{
48 return !((a.xMin > b.xMax) || (b.xMin > a.xMax) || (a.yMin > b.yMax) || (b.yMin > a.yMax));
49}
50
51/**
52 * Class that takes care of installing blocks of the
53 * buildings in a given area. Buildings are installed in pairs
54 * as in dual stripe scenario.
55 */
57{
58 public:
59 /**
60 * Constructor
61 * @param area the total area
62 * @param nApartmentsX the number of apartments in the X direction
63 * @param nFloors the number of floors
64 */
65 FemtocellBlockAllocator(Box area, uint32_t nApartmentsX, uint32_t nFloors);
66 /**
67 * Function that creates building blocks.
68 * @param n the number of blocks to create
69 */
70 void Create(uint32_t n);
71 /// Create function
72 void Create();
73
74 private:
75 /**
76 * Function that checks if the box area is overlapping with some of previously created building
77 * blocks.
78 * @param box the area to check
79 * @returns true if there is an overlap
80 */
82 Box m_area; ///< Area
83 uint32_t m_nApartmentsX; ///< X apartments
84 uint32_t m_nFloors; ///< number of floors
85 std::list<Box> m_previousBlocks; ///< previous bocks
86 double m_xSize; ///< X size
87 double m_ySize; ///< Y size
88 Ptr<UniformRandomVariable> m_xMinVar; ///< X minimum variance
89 Ptr<UniformRandomVariable> m_yMinVar; ///< Y minimum variance
90};
91
93 : m_area(area),
94 m_nApartmentsX(nApartmentsX),
95 m_nFloors(nFloors),
96 m_xSize(nApartmentsX * 10 + 20),
97 m_ySize(70)
98{
100 m_xMinVar->SetAttribute("Min", DoubleValue(area.xMin));
101 m_xMinVar->SetAttribute("Max", DoubleValue(area.xMax - m_xSize));
103 m_yMinVar->SetAttribute("Min", DoubleValue(area.yMin));
104 m_yMinVar->SetAttribute("Max", DoubleValue(area.yMax - m_ySize));
105}
106
107void
109{
110 for (uint32_t i = 0; i < n; ++i)
111 {
112 Create();
113 }
114}
115
116void
118{
119 Box box;
120 uint32_t attempt = 0;
121 do
122 {
123 NS_ASSERT_MSG(attempt < 100,
124 "Too many failed attempts to position apartment block. Too many blocks? Too "
125 "small area?");
126 box.xMin = m_xMinVar->GetValue();
127 box.xMax = box.xMin + m_xSize;
128 box.yMin = m_yMinVar->GetValue();
129 box.yMax = box.yMin + m_ySize;
130 ++attempt;
131 } while (OverlapsWithAnyPrevious(box));
132
133 NS_LOG_LOGIC("allocated non overlapping block " << box);
134 m_previousBlocks.push_back(box);
135 Ptr<GridBuildingAllocator> gridBuildingAllocator;
136 gridBuildingAllocator = CreateObject<GridBuildingAllocator>();
137 gridBuildingAllocator->SetAttribute("GridWidth", UintegerValue(1));
138 gridBuildingAllocator->SetAttribute("LengthX", DoubleValue(10 * m_nApartmentsX));
139 gridBuildingAllocator->SetAttribute("LengthY", DoubleValue(10 * 2));
140 gridBuildingAllocator->SetAttribute("DeltaX", DoubleValue(10));
141 gridBuildingAllocator->SetAttribute("DeltaY", DoubleValue(10));
142 gridBuildingAllocator->SetAttribute("Height", DoubleValue(3 * m_nFloors));
143 gridBuildingAllocator->SetBuildingAttribute("NRoomsX", UintegerValue(m_nApartmentsX));
144 gridBuildingAllocator->SetBuildingAttribute("NRoomsY", UintegerValue(2));
145 gridBuildingAllocator->SetBuildingAttribute("NFloors", UintegerValue(m_nFloors));
146 gridBuildingAllocator->SetAttribute("MinX", DoubleValue(box.xMin + 10));
147 gridBuildingAllocator->SetAttribute("MinY", DoubleValue(box.yMin + 10));
148 gridBuildingAllocator->Create(2);
149}
150
151bool
153{
154 for (auto it = m_previousBlocks.begin(); it != m_previousBlocks.end(); ++it)
155 {
156 if (AreOverlapping(*it, box))
157 {
158 return true;
159 }
160 }
161 return false;
162}
163
164/**
165 * Print a list of buildings that can be plotted using Gnuplot.
166 *
167 * @param filename the output file name.
168 */
169void
171{
172 std::ofstream outFile;
173 outFile.open(filename, std::ios_base::out | std::ios_base::trunc);
174 if (!outFile.is_open())
175 {
176 NS_LOG_ERROR("Can't open file " << filename);
177 return;
178 }
179 uint32_t index = 0;
180 for (auto it = BuildingList::Begin(); it != BuildingList::End(); ++it)
181 {
182 ++index;
183 Box box = (*it)->GetBoundaries();
184 outFile << "set object " << index << " rect from " << box.xMin << "," << box.yMin << " to "
185 << box.xMax << "," << box.yMax << " front fs empty " << std::endl;
186 }
187}
188
189/**
190 * Print a list of UEs that can be plotted using Gnuplot.
191 *
192 * @param filename the output file name.
193 */
194void
195PrintGnuplottableUeListToFile(std::string filename)
196{
197 std::ofstream outFile;
198 outFile.open(filename, std::ios_base::out | std::ios_base::trunc);
199 if (!outFile.is_open())
200 {
201 NS_LOG_ERROR("Can't open file " << filename);
202 return;
203 }
204 for (auto it = NodeList::Begin(); it != NodeList::End(); ++it)
205 {
206 Ptr<Node> node = *it;
207 int nDevs = node->GetNDevices();
208 for (int j = 0; j < nDevs; j++)
209 {
210 Ptr<LteUeNetDevice> uedev = node->GetDevice(j)->GetObject<LteUeNetDevice>();
211 if (uedev)
212 {
213 Vector pos = node->GetObject<MobilityModel>()->GetPosition();
214 outFile << "set label \"" << uedev->GetImsi() << "\" at " << pos.x << "," << pos.y
215 << " left font \"Helvetica,4\" textcolor rgb \"grey\" front point pt 1 ps "
216 "0.3 lc rgb \"grey\" offset 0,0"
217 << std::endl;
218 }
219 }
220 }
221}
222
223/**
224 * Print a list of ENBs that can be plotted using Gnuplot.
225 *
226 * @param filename the output file name.
227 */
228void
230{
231 std::ofstream outFile;
232 outFile.open(filename, std::ios_base::out | std::ios_base::trunc);
233 if (!outFile.is_open())
234 {
235 NS_LOG_ERROR("Can't open file " << filename);
236 return;
237 }
238 for (auto it = NodeList::Begin(); it != NodeList::End(); ++it)
239 {
240 Ptr<Node> node = *it;
241 int nDevs = node->GetNDevices();
242 for (int j = 0; j < nDevs; j++)
243 {
244 Ptr<LteEnbNetDevice> enbdev = node->GetDevice(j)->GetObject<LteEnbNetDevice>();
245 if (enbdev)
246 {
247 Vector pos = node->GetObject<MobilityModel>()->GetPosition();
248 outFile << "set label \"" << enbdev->GetCellId() << "\" at " << pos.x << ","
249 << pos.y
250 << " left font \"Helvetica,4\" textcolor rgb \"white\" front point pt 2 "
251 "ps 0.3 lc rgb \"white\" offset 0,0"
252 << std::endl;
253 }
254 }
255 }
256}
257
258/// Number of femtocell blocks
260 "Number of femtocell blocks",
263
264/// Number of apartments along the X axis in a femtocell block
265static ns3::GlobalValue g_nApartmentsX("nApartmentsX",
266 "Number of apartments along the X axis in a femtocell block",
269
270/// Number of floors
272 "Number of floors",
275
276/// How many macro sites there are
277static ns3::GlobalValue g_nMacroEnbSites("nMacroEnbSites",
278 "How many macro sites there are",
281
282/// (minimum) number of sites along the X-axis of the hex grid
284 "nMacroEnbSitesX",
285 "(minimum) number of sites along the X-axis of the hex grid",
288
289/// min distance between two nearby macro cell sites
290static ns3::GlobalValue g_interSiteDistance("interSiteDistance",
291 "min distance between two nearby macro cell sites",
292 ns3::DoubleValue(500),
294
295/// how much the UE area extends outside the macrocell grid, expressed as fraction of the
296/// interSiteDistance
298 "areaMarginFactor",
299 "how much the UE area extends outside the macrocell grid, "
300 "expressed as fraction of the interSiteDistance",
301 ns3::DoubleValue(0.5),
303
304/// How many macrocell UEs there are per square meter
305static ns3::GlobalValue g_macroUeDensity("macroUeDensity",
306 "How many macrocell UEs there are per square meter",
307 ns3::DoubleValue(0.00002),
309
310/// The HeNB deployment ratio as per 3GPP R4-092042
311static ns3::GlobalValue g_homeEnbDeploymentRatio("homeEnbDeploymentRatio",
312 "The HeNB deployment ratio as per 3GPP R4-092042",
313 ns3::DoubleValue(0.2),
315
316/// The HeNB activation ratio as per 3GPP R4-092042
317static ns3::GlobalValue g_homeEnbActivationRatio("homeEnbActivationRatio",
318 "The HeNB activation ratio as per 3GPP R4-092042",
319 ns3::DoubleValue(0.5),
321
322/// How many (on average) home UEs per HeNB there are in the simulation
324 "homeUesHomeEnbRatio",
325 "How many (on average) home UEs per HeNB there are in the simulation",
326 ns3::DoubleValue(1.0),
328
329/// TX power [dBm] used by macro eNBs
330static ns3::GlobalValue g_macroEnbTxPowerDbm("macroEnbTxPowerDbm",
331 "TX power [dBm] used by macro eNBs",
332 ns3::DoubleValue(46.0),
334
335/// TX power [dBm] used by HeNBs
336static ns3::GlobalValue g_homeEnbTxPowerDbm("homeEnbTxPowerDbm",
337 "TX power [dBm] used by HeNBs",
338 ns3::DoubleValue(20.0),
340
341/// DL EARFCN used by macro eNBs
342static ns3::GlobalValue g_macroEnbDlEarfcn("macroEnbDlEarfcn",
343 "DL EARFCN used by macro eNBs",
346
347/// DL EARFCN used by HeNBs
348static ns3::GlobalValue g_homeEnbDlEarfcn("homeEnbDlEarfcn",
349 "DL EARFCN used by HeNBs",
352
353/// Bandwidth [num RBs] used by macro eNBs
354static ns3::GlobalValue g_macroEnbBandwidth("macroEnbBandwidth",
355 "bandwidth [num RBs] used by macro eNBs",
358
359/// Bandwidth [num RBs] used by HeNBs
360static ns3::GlobalValue g_homeEnbBandwidth("homeEnbBandwidth",
361 "bandwidth [num RBs] used by HeNBs",
364
365/// Total duration of the simulation [s]
367 "Total duration of the simulation [s]",
368 ns3::DoubleValue(0.25),
370
371/// If true, will generate a REM and then abort the simulation
373 "generateRem",
374 "if true, will generate a REM and then abort the simulation;"
375 "if false, will run the simulation normally (without generating any REM)",
376 ns3::BooleanValue(false),
378
379/// Resource Block Id of Data Channel, for which REM will be generated.
381 "remRbId",
382 "Resource Block Id of Data Channel, for which REM will be generated;"
383 "default value is -1, what means REM will be averaged from all RBs of "
384 "Control Channel",
387
388/// If true, will setup the EPC to simulate an end-to-end topology.
390 "epc",
391 "If true, will setup the EPC to simulate an end-to-end topology, "
392 "with real IP applications over PDCP and RLC UM (or RLC AM by changing "
393 "the default value of EpsBearerToRlcMapping e.g. to RLC_AM_ALWAYS). "
394 "If false, only the LTE radio access will be simulated with RLC SM.",
395 ns3::BooleanValue(false),
397
398/// if true, will activate data flows in the downlink when EPC is being used.
400 "epcDl",
401 "if true, will activate data flows in the downlink when EPC is being used. "
402 "If false, downlink flows won't be activated. "
403 "If EPC is not used, this parameter will be ignored.",
404 ns3::BooleanValue(true),
406
407/// if true, will activate data flows in the uplink when EPC is being used.
409 "epcUl",
410 "if true, will activate data flows in the uplink when EPC is being used. "
411 "If false, uplink flows won't be activated. "
412 "If EPC is not used, this parameter will be ignored.",
413 ns3::BooleanValue(true),
415
416/// if true, the UdpClient application will be used.
418 "useUdp",
419 "if true, the UdpClient application will be used. "
420 "Otherwise, the BulkSend application will be used over a TCP connection. "
421 "If EPC is not used, this parameter will be ignored.",
422 ns3::BooleanValue(true),
424
425/// The path of the fading trace (by default no fading trace is loaded, i.e., fading is not
426/// considered)
427static ns3::GlobalValue g_fadingTrace("fadingTrace",
428 "The path of the fading trace (by default no fading trace "
429 "is loaded, i.e., fading is not considered)",
432
433/// How many bearers per UE there are in the simulation
434static ns3::GlobalValue g_numBearersPerUe("numBearersPerUe",
435 "How many bearers per UE there are in the simulation",
438
439/// SRS Periodicity (has to be at least greater than the number of UEs per eNB)
440static ns3::GlobalValue g_srsPeriodicity("srsPeriodicity",
441 "SRS Periodicity (has to be at least "
442 "greater than the number of UEs per eNB)",
445
446/// Minimum speed value of macro UE with random waypoint model [m/s].
448 "outdoorUeMinSpeed",
449 "Minimum speed value of macro UE with random waypoint model [m/s].",
450 ns3::DoubleValue(0.0),
452
453/// Maximum speed value of macro UE with random waypoint model [m/s].
455 "outdoorUeMaxSpeed",
456 "Maximum speed value of macro UE with random waypoint model [m/s].",
457 ns3::DoubleValue(0.0),
459
460int
461main(int argc, char* argv[])
462{
463 // change some default attributes so that they are reasonable for
464 // this scenario, but do this before processing command line
465 // arguments, so that the user is allowed to override these settings
466 Config::SetDefault("ns3::UdpClient::Interval", TimeValue(MilliSeconds(1)));
467 Config::SetDefault("ns3::UdpClient::MaxPackets", UintegerValue(1000000));
468 Config::SetDefault("ns3::LteRlcUm::MaxTxBufferSize", UintegerValue(10 * 1024));
469
470 CommandLine cmd(__FILE__);
471 cmd.Parse(argc, argv);
472 ConfigStore inputConfig;
473 inputConfig.ConfigureDefaults();
474 // parse again so you can override input file default values via command line
475 cmd.Parse(argc, argv);
476
477 // the scenario parameters get their values from the global attributes defined above
478 UintegerValue uintegerValue;
479 IntegerValue integerValue;
480 DoubleValue doubleValue;
481 BooleanValue booleanValue;
482 StringValue stringValue;
483 GlobalValue::GetValueByName("nBlocks", uintegerValue);
484 uint32_t nBlocks = uintegerValue.Get();
485 GlobalValue::GetValueByName("nApartmentsX", uintegerValue);
486 uint32_t nApartmentsX = uintegerValue.Get();
487 GlobalValue::GetValueByName("nFloors", uintegerValue);
488 uint32_t nFloors = uintegerValue.Get();
489 GlobalValue::GetValueByName("nMacroEnbSites", uintegerValue);
490 uint32_t nMacroEnbSites = uintegerValue.Get();
491 GlobalValue::GetValueByName("nMacroEnbSitesX", uintegerValue);
492 uint32_t nMacroEnbSitesX = uintegerValue.Get();
493 GlobalValue::GetValueByName("interSiteDistance", doubleValue);
494 double interSiteDistance = doubleValue.Get();
495 GlobalValue::GetValueByName("areaMarginFactor", doubleValue);
496 double areaMarginFactor = doubleValue.Get();
497 GlobalValue::GetValueByName("macroUeDensity", doubleValue);
498 double macroUeDensity = doubleValue.Get();
499 GlobalValue::GetValueByName("homeEnbDeploymentRatio", doubleValue);
500 double homeEnbDeploymentRatio = doubleValue.Get();
501 GlobalValue::GetValueByName("homeEnbActivationRatio", doubleValue);
502 double homeEnbActivationRatio = doubleValue.Get();
503 GlobalValue::GetValueByName("homeUesHomeEnbRatio", doubleValue);
504 double homeUesHomeEnbRatio = doubleValue.Get();
505 GlobalValue::GetValueByName("macroEnbTxPowerDbm", doubleValue);
506 double macroEnbTxPowerDbm = doubleValue.Get();
507 GlobalValue::GetValueByName("homeEnbTxPowerDbm", doubleValue);
508 double homeEnbTxPowerDbm = doubleValue.Get();
509 GlobalValue::GetValueByName("macroEnbDlEarfcn", uintegerValue);
510 uint32_t macroEnbDlEarfcn = uintegerValue.Get();
511 GlobalValue::GetValueByName("homeEnbDlEarfcn", uintegerValue);
512 uint32_t homeEnbDlEarfcn = uintegerValue.Get();
513 GlobalValue::GetValueByName("macroEnbBandwidth", uintegerValue);
514 uint16_t macroEnbBandwidth = uintegerValue.Get();
515 GlobalValue::GetValueByName("homeEnbBandwidth", uintegerValue);
516 uint16_t homeEnbBandwidth = uintegerValue.Get();
517 GlobalValue::GetValueByName("simTime", doubleValue);
518 double simTime = doubleValue.Get();
519 GlobalValue::GetValueByName("epc", booleanValue);
520 bool epc = booleanValue.Get();
521 GlobalValue::GetValueByName("epcDl", booleanValue);
522 bool epcDl = booleanValue.Get();
523 GlobalValue::GetValueByName("epcUl", booleanValue);
524 bool epcUl = booleanValue.Get();
525 GlobalValue::GetValueByName("useUdp", booleanValue);
526 bool useUdp = booleanValue.Get();
527 GlobalValue::GetValueByName("generateRem", booleanValue);
528 bool generateRem = booleanValue.Get();
529 GlobalValue::GetValueByName("remRbId", integerValue);
530 int32_t remRbId = integerValue.Get();
531 GlobalValue::GetValueByName("fadingTrace", stringValue);
532 std::string fadingTrace = stringValue.Get();
533 GlobalValue::GetValueByName("numBearersPerUe", uintegerValue);
534 uint16_t numBearersPerUe = uintegerValue.Get();
535 GlobalValue::GetValueByName("srsPeriodicity", uintegerValue);
536 uint16_t srsPeriodicity = uintegerValue.Get();
537 GlobalValue::GetValueByName("outdoorUeMinSpeed", doubleValue);
538 uint16_t outdoorUeMinSpeed = doubleValue.Get();
539 GlobalValue::GetValueByName("outdoorUeMaxSpeed", doubleValue);
540 uint16_t outdoorUeMaxSpeed = doubleValue.Get();
541
542 Config::SetDefault("ns3::LteEnbRrc::SrsPeriodicity", UintegerValue(srsPeriodicity));
543
544 Box macroUeBox;
545 double ueZ = 1.5;
546 if (nMacroEnbSites > 0)
547 {
548 uint32_t currentSite = nMacroEnbSites - 1;
549 uint32_t biRowIndex = (currentSite / (nMacroEnbSitesX + nMacroEnbSitesX + 1));
550 uint32_t biRowRemainder = currentSite % (nMacroEnbSitesX + nMacroEnbSitesX + 1);
551 uint32_t rowIndex = biRowIndex * 2 + 1;
552 if (biRowRemainder >= nMacroEnbSitesX)
553 {
554 ++rowIndex;
555 }
556 uint32_t nMacroEnbSitesY = rowIndex;
557 NS_LOG_LOGIC("nMacroEnbSitesY = " << nMacroEnbSitesY);
558
559 macroUeBox = Box(-areaMarginFactor * interSiteDistance,
560 (nMacroEnbSitesX + areaMarginFactor) * interSiteDistance,
561 -areaMarginFactor * interSiteDistance,
562 (nMacroEnbSitesY - 1) * interSiteDistance * sqrt(0.75) +
563 areaMarginFactor * interSiteDistance,
564 ueZ,
565 ueZ);
566 }
567 else
568 {
569 // still need the box to place femtocell blocks
570 macroUeBox = Box(0, 150, 0, 150, ueZ, ueZ);
571 }
572
573 FemtocellBlockAllocator blockAllocator(macroUeBox, nApartmentsX, nFloors);
574 blockAllocator.Create(nBlocks);
575
576 uint32_t nHomeEnbs = round(4 * nApartmentsX * nBlocks * nFloors * homeEnbDeploymentRatio *
577 homeEnbActivationRatio);
578 NS_LOG_LOGIC("nHomeEnbs = " << nHomeEnbs);
579 uint32_t nHomeUes = round(nHomeEnbs * homeUesHomeEnbRatio);
580 NS_LOG_LOGIC("nHomeUes = " << nHomeUes);
581 double macroUeAreaSize =
582 (macroUeBox.xMax - macroUeBox.xMin) * (macroUeBox.yMax - macroUeBox.yMin);
583 uint32_t nMacroUes = round(macroUeAreaSize * macroUeDensity);
584 NS_LOG_LOGIC("nMacroUes = " << nMacroUes << " (density=" << macroUeDensity << ")");
585
586 NodeContainer homeEnbs;
587 homeEnbs.Create(nHomeEnbs);
588 NodeContainer macroEnbs;
589 macroEnbs.Create(3 * nMacroEnbSites);
590 NodeContainer homeUes;
591 homeUes.Create(nHomeUes);
592 NodeContainer macroUes;
593 macroUes.Create(nMacroUes);
594
596 mobility.SetMobilityModel("ns3::ConstantPositionMobilityModel");
597
599 lteHelper->SetAttribute("PathlossModel",
600 StringValue("ns3::HybridBuildingsPropagationLossModel"));
601 lteHelper->SetPathlossModelAttribute("ShadowSigmaExtWalls", DoubleValue(0));
602 lteHelper->SetPathlossModelAttribute("ShadowSigmaOutdoor", DoubleValue(1));
603 lteHelper->SetPathlossModelAttribute("ShadowSigmaIndoor", DoubleValue(1.5));
604 // use always LOS model
605 lteHelper->SetPathlossModelAttribute("Los2NlosThr", DoubleValue(1e6));
606 lteHelper->SetSpectrumChannelType("ns3::MultiModelSpectrumChannel");
607
608 // lteHelper->EnableLogComponents ();
609 // LogComponentEnable ("PfFfMacScheduler", LOG_LEVEL_ALL);
610
611 if (!fadingTrace.empty())
612 {
613 lteHelper->SetAttribute("FadingModel", StringValue("ns3::TraceFadingLossModel"));
614 lteHelper->SetFadingModelAttribute("TraceFilename", StringValue(fadingTrace));
615 }
616
618 if (epc)
619 {
620 NS_LOG_LOGIC("enabling EPC");
622 lteHelper->SetEpcHelper(epcHelper);
623 }
624
625 // Macro eNBs in 3-sector hex grid
626
627 mobility.Install(macroEnbs);
628 BuildingsHelper::Install(macroEnbs);
629 Ptr<LteHexGridEnbTopologyHelper> lteHexGridEnbTopologyHelper =
631 lteHexGridEnbTopologyHelper->SetLteHelper(lteHelper);
632 lteHexGridEnbTopologyHelper->SetAttribute("InterSiteDistance", DoubleValue(interSiteDistance));
633 lteHexGridEnbTopologyHelper->SetAttribute("MinX", DoubleValue(interSiteDistance / 2));
634 lteHexGridEnbTopologyHelper->SetAttribute("GridWidth", UintegerValue(nMacroEnbSitesX));
635 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(macroEnbTxPowerDbm));
636 lteHelper->SetEnbAntennaModelType("ns3::ParabolicAntennaModel");
637 lteHelper->SetEnbAntennaModelAttribute("Beamwidth", DoubleValue(70));
638 lteHelper->SetEnbAntennaModelAttribute("MaxAttenuation", DoubleValue(20.0));
639 lteHelper->SetEnbDeviceAttribute("DlEarfcn", UintegerValue(macroEnbDlEarfcn));
640 lteHelper->SetEnbDeviceAttribute("UlEarfcn", UintegerValue(macroEnbDlEarfcn + 18000));
641 lteHelper->SetEnbDeviceAttribute("DlBandwidth", UintegerValue(macroEnbBandwidth));
642 lteHelper->SetEnbDeviceAttribute("UlBandwidth", UintegerValue(macroEnbBandwidth));
643 NetDeviceContainer macroEnbDevs =
644 lteHexGridEnbTopologyHelper->SetPositionAndInstallEnbDevice(macroEnbs);
645 Ptr<WraparoundModel> wraparoundModel = lteHexGridEnbTopologyHelper->GetWraparoundModel();
646 if (wraparoundModel)
647 {
648 lteHelper->GetDownlinkSpectrumChannel()->UnidirectionalAggregateObject(wraparoundModel);
649 lteHelper->GetUplinkSpectrumChannel()->UnidirectionalAggregateObject(wraparoundModel);
650 }
651 if (epc)
652 {
653 // this enables handover for macro eNBs
654 lteHelper->AddX2Interface(macroEnbs);
655 }
656
657 // HomeEnbs randomly indoor
658
660 mobility.SetPositionAllocator(positionAlloc);
661 mobility.Install(homeEnbs);
662 BuildingsHelper::Install(homeEnbs);
663 Config::SetDefault("ns3::LteEnbPhy::TxPower", DoubleValue(homeEnbTxPowerDbm));
664 lteHelper->SetEnbAntennaModelType("ns3::IsotropicAntennaModel");
665 lteHelper->SetEnbDeviceAttribute("DlEarfcn", UintegerValue(homeEnbDlEarfcn));
666 lteHelper->SetEnbDeviceAttribute("UlEarfcn", UintegerValue(homeEnbDlEarfcn + 18000));
667 lteHelper->SetEnbDeviceAttribute("DlBandwidth", UintegerValue(homeEnbBandwidth));
668 lteHelper->SetEnbDeviceAttribute("UlBandwidth", UintegerValue(homeEnbBandwidth));
669 lteHelper->SetEnbDeviceAttribute("CsgId", UintegerValue(1));
670 lteHelper->SetEnbDeviceAttribute("CsgIndication", BooleanValue(true));
671 NetDeviceContainer homeEnbDevs = lteHelper->InstallEnbDevice(homeEnbs);
672
673 // home UEs located in the same apartment in which there are the Home eNBs
674 positionAlloc = CreateObject<SameRoomPositionAllocator>(homeEnbs);
675 mobility.SetPositionAllocator(positionAlloc);
676 mobility.Install(homeUes);
678 // set the home UE as a CSG member of the home eNodeBs
679 lteHelper->SetUeDeviceAttribute("CsgId", UintegerValue(1));
680 NetDeviceContainer homeUeDevs = lteHelper->InstallUeDevice(homeUes);
681
682 // macro Ues
683 NS_LOG_LOGIC("randomly allocating macro UEs in " << macroUeBox << " speedMin "
684 << outdoorUeMinSpeed << " speedMax "
685 << outdoorUeMaxSpeed);
686 if (outdoorUeMaxSpeed != 0.0)
687 {
688 mobility.SetMobilityModel("ns3::SteadyStateRandomWaypointMobilityModel");
689
690 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MinX",
691 DoubleValue(macroUeBox.xMin));
692 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MinY",
693 DoubleValue(macroUeBox.yMin));
694 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MaxX",
695 DoubleValue(macroUeBox.xMax));
696 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MaxY",
697 DoubleValue(macroUeBox.yMax));
698 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::Z", DoubleValue(ueZ));
699 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MaxSpeed",
700 DoubleValue(outdoorUeMaxSpeed));
701 Config::SetDefault("ns3::SteadyStateRandomWaypointMobilityModel::MinSpeed",
702 DoubleValue(outdoorUeMinSpeed));
703
704 // this is not used since SteadyStateRandomWaypointMobilityModel
705 // takes care of initializing the positions; however we need to
706 // reset it since the previously used PositionAllocator
707 // (SameRoom) will cause an error when used with homeDeploymentRatio=0
709 mobility.SetPositionAllocator(positionAlloc);
710 mobility.Install(macroUes);
711
712 // forcing initialization so we don't have to wait for Nodes to
713 // start before positions are assigned (which is needed to
714 // output node positions to file and to make AttachToClosestEnb work)
715 for (auto it = macroUes.Begin(); it != macroUes.End(); ++it)
716 {
717 (*it)->Initialize();
718 }
719 }
720 else
721 {
724 xVal->SetAttribute("Min", DoubleValue(macroUeBox.xMin));
725 xVal->SetAttribute("Max", DoubleValue(macroUeBox.xMax));
726 positionAlloc->SetAttribute("X", PointerValue(xVal));
728 yVal->SetAttribute("Min", DoubleValue(macroUeBox.yMin));
729 yVal->SetAttribute("Max", DoubleValue(macroUeBox.yMax));
730 positionAlloc->SetAttribute("Y", PointerValue(yVal));
732 zVal->SetAttribute("Min", DoubleValue(macroUeBox.zMin));
733 zVal->SetAttribute("Max", DoubleValue(macroUeBox.zMax));
734 positionAlloc->SetAttribute("Z", PointerValue(zVal));
735 mobility.SetPositionAllocator(positionAlloc);
736 mobility.Install(macroUes);
737 }
738 BuildingsHelper::Install(macroUes);
739
740 NetDeviceContainer macroUeDevs = lteHelper->InstallUeDevice(macroUes);
741
742 Ipv4Address remoteHostAddr;
743 NodeContainer ues;
744 Ipv4StaticRoutingHelper ipv4RoutingHelper;
745 Ipv4InterfaceContainer ueIpIfaces;
746 Ptr<Node> remoteHost;
747 NetDeviceContainer ueDevs;
748
749 if (epc)
750 {
751 NS_LOG_LOGIC("setting up internet and remote host");
752
753 // Create a single RemoteHost
754 NodeContainer remoteHostContainer;
755 remoteHostContainer.Create(1);
756 remoteHost = remoteHostContainer.Get(0);
758 internet.Install(remoteHostContainer);
759
760 // Create the Internet
762 p2ph.SetDeviceAttribute("DataRate", DataRateValue(DataRate("100Gb/s")));
763 p2ph.SetDeviceAttribute("Mtu", UintegerValue(1500));
764 p2ph.SetChannelAttribute("Delay", TimeValue(Seconds(0.010)));
765 Ptr<Node> pgw = epcHelper->GetPgwNode();
766 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
767 Ipv4AddressHelper ipv4h;
768 ipv4h.SetBase("1.0.0.0", "255.0.0.0");
769 Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
770 // in this container, interface 0 is the pgw, 1 is the remoteHost
771 remoteHostAddr = internetIpIfaces.GetAddress(1);
772
773 Ipv4StaticRoutingHelper ipv4RoutingHelper;
774 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
775 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
776 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address("7.0.0.0"),
777 Ipv4Mask("255.0.0.0"),
778 1);
779
780 // for internetworking purposes, consider together home UEs and macro UEs
781 ues.Add(homeUes);
782 ues.Add(macroUes);
783 ueDevs.Add(homeUeDevs);
784 ueDevs.Add(macroUeDevs);
785
786 // Install the IP stack on the UEs
787 internet.Install(ues);
788 ueIpIfaces = epcHelper->AssignUeIpv4Address(NetDeviceContainer(ueDevs));
789
790 // attachment (needs to be done after IP stack configuration)
791 // using initial cell selection
792 lteHelper->Attach(macroUeDevs);
793 lteHelper->Attach(homeUeDevs);
794 }
795 else
796 {
797 // macro UEs attached to the closest macro eNB
798 lteHelper->AttachToClosestEnb(macroUeDevs, macroEnbDevs);
799
800 // each home UE is attached explicitly to its home eNB
803 for (ueDevIt = homeUeDevs.Begin(), enbDevIt = homeEnbDevs.Begin();
804 ueDevIt != homeUeDevs.End();
805 ++ueDevIt, ++enbDevIt)
806 {
807 // this because of the order in which SameRoomPositionAllocator
808 // will place the UEs
809 if (enbDevIt == homeEnbDevs.End())
810 {
811 enbDevIt = homeEnbDevs.Begin();
812 }
813 lteHelper->Attach(*ueDevIt, *enbDevIt);
814 }
815 }
816
817 if (epc)
818 {
819 NS_LOG_LOGIC("setting up applications");
820
821 // Install and start applications on UEs and remote host
822 uint16_t dlPort = 10000;
823 uint16_t ulPort = 20000;
824
825 // randomize a bit start times to avoid simulation artifacts
826 // (e.g., buffer overflows due to packet transmissions happening
827 // exactly at the same time)
829 if (useUdp)
830 {
831 startTimeSeconds->SetAttribute("Min", DoubleValue(0));
832 startTimeSeconds->SetAttribute("Max", DoubleValue(0.010));
833 }
834 else
835 {
836 // TCP needs to be started late enough so that all UEs are connected
837 // otherwise TCP SYN packets will get lost
838 startTimeSeconds->SetAttribute("Min", DoubleValue(0.100));
839 startTimeSeconds->SetAttribute("Max", DoubleValue(0.110));
840 }
841
842 for (uint32_t u = 0; u < ues.GetN(); ++u)
843 {
844 Ptr<Node> ue = ues.Get(u);
845 // Set the default gateway for the UE
846 Ptr<Ipv4StaticRouting> ueStaticRouting =
847 ipv4RoutingHelper.GetStaticRouting(ue->GetObject<Ipv4>());
848 ueStaticRouting->SetDefaultRoute(epcHelper->GetUeDefaultGatewayAddress(), 1);
849
850 for (uint32_t b = 0; b < numBearersPerUe; ++b)
851 {
852 ++dlPort;
853 ++ulPort;
854
857
858 if (useUdp)
859 {
860 if (epcDl)
861 {
862 NS_LOG_LOGIC("installing UDP DL app for UE " << u);
863 UdpClientHelper dlClientHelper(ueIpIfaces.GetAddress(u), dlPort);
864 clientApps.Add(dlClientHelper.Install(remoteHost));
865 PacketSinkHelper dlPacketSinkHelper(
866 "ns3::UdpSocketFactory",
868 serverApps.Add(dlPacketSinkHelper.Install(ue));
869 }
870 if (epcUl)
871 {
872 NS_LOG_LOGIC("installing UDP UL app for UE " << u);
873 UdpClientHelper ulClientHelper(remoteHostAddr, ulPort);
874 clientApps.Add(ulClientHelper.Install(ue));
875 PacketSinkHelper ulPacketSinkHelper(
876 "ns3::UdpSocketFactory",
878 serverApps.Add(ulPacketSinkHelper.Install(remoteHost));
879 }
880 }
881 else // use TCP
882 {
883 if (epcDl)
884 {
885 NS_LOG_LOGIC("installing TCP DL app for UE " << u);
886 BulkSendHelper dlClientHelper(
887 "ns3::TcpSocketFactory",
888 InetSocketAddress(ueIpIfaces.GetAddress(u), dlPort));
889 dlClientHelper.SetAttribute("MaxBytes", UintegerValue(0));
890 clientApps.Add(dlClientHelper.Install(remoteHost));
891 PacketSinkHelper dlPacketSinkHelper(
892 "ns3::TcpSocketFactory",
894 serverApps.Add(dlPacketSinkHelper.Install(ue));
895 }
896 if (epcUl)
897 {
898 NS_LOG_LOGIC("installing TCP UL app for UE " << u);
899 BulkSendHelper ulClientHelper("ns3::TcpSocketFactory",
900 InetSocketAddress(remoteHostAddr, ulPort));
901 ulClientHelper.SetAttribute("MaxBytes", UintegerValue(0));
902 clientApps.Add(ulClientHelper.Install(ue));
903 PacketSinkHelper ulPacketSinkHelper(
904 "ns3::TcpSocketFactory",
906 serverApps.Add(ulPacketSinkHelper.Install(remoteHost));
907 }
908 }
909
911 if (epcDl)
912 {
914 dlpf.localPortStart = dlPort;
915 dlpf.localPortEnd = dlPort;
916 tft->Add(dlpf);
917 }
918 if (epcUl)
919 {
921 ulpf.remotePortStart = ulPort;
922 ulpf.remotePortEnd = ulPort;
923 tft->Add(ulpf);
924 }
925
926 if (epcDl || epcUl)
927 {
929 lteHelper->ActivateDedicatedEpsBearer(ueDevs.Get(u), bearer, tft);
930 }
931 Time startTime = Seconds(startTimeSeconds->GetValue());
932 serverApps.Start(startTime);
933 clientApps.Start(startTime);
934 }
935 }
936 }
937 else // (epc == false)
938 {
939 // for radio bearer activation purposes, consider together home UEs and macro UEs
940 NetDeviceContainer ueDevs;
941 ueDevs.Add(homeUeDevs);
942 ueDevs.Add(macroUeDevs);
943 for (uint32_t u = 0; u < ueDevs.GetN(); ++u)
944 {
945 Ptr<NetDevice> ueDev = ueDevs.Get(u);
946 for (uint32_t b = 0; b < numBearersPerUe; ++b)
947 {
949 EpsBearer bearer(q);
950 lteHelper->ActivateDataRadioBearer(ueDev, bearer);
951 }
952 }
953 }
954
956 if (generateRem)
957 {
961
963 remHelper->SetAttribute("Channel", PointerValue(lteHelper->GetDownlinkSpectrumChannel()));
964 remHelper->SetAttribute("OutputFile", StringValue("lena-dual-stripe.rem"));
965 remHelper->SetAttribute("XMin", DoubleValue(macroUeBox.xMin));
966 remHelper->SetAttribute("XMax", DoubleValue(macroUeBox.xMax));
967 remHelper->SetAttribute("YMin", DoubleValue(macroUeBox.yMin));
968 remHelper->SetAttribute("YMax", DoubleValue(macroUeBox.yMax));
969 remHelper->SetAttribute("Z", DoubleValue(1.5));
970
971 if (remRbId >= 0)
972 {
973 remHelper->SetAttribute("UseDataChannel", BooleanValue(true));
974 remHelper->SetAttribute("RbId", IntegerValue(remRbId));
975 }
976
977 remHelper->Install();
978 // simulation will stop right after the REM has been generated
979 }
980 else
981 {
982 Simulator::Stop(Seconds(simTime));
983 }
984
985 lteHelper->EnableMacTraces();
986 lteHelper->EnableRlcTraces();
987 if (epc)
988 {
989 lteHelper->EnablePdcpTraces();
990 }
991
993
994 // GtkConfigStore config;
995 // config.ConfigureAttributes ();
996
997 lteHelper = nullptr;
999 return 0;
1000}
Class that takes care of installing blocks of the buildings in a given area.
std::list< Box > m_previousBlocks
previous bocks
Ptr< UniformRandomVariable > m_xMinVar
X minimum variance.
Ptr< UniformRandomVariable > m_yMinVar
Y minimum variance.
uint32_t m_nApartmentsX
X apartments.
FemtocellBlockAllocator(Box area, uint32_t nApartmentsX, uint32_t nFloors)
Constructor.
uint32_t m_nFloors
number of floors
bool OverlapsWithAnyPrevious(Box box)
Function that checks if the box area is overlapping with some of previously created building blocks.
void Create()
Create function.
holds a vector of ns3::Application pointers.
AttributeValue implementation for Boolean.
Definition boolean.h:26
bool Get() const
Definition boolean.cc:44
a 3d box
Definition box.h:24
double yMax
The y coordinate of the top bound of the box.
Definition box.h:105
double xMin
The x coordinate of the left bound of the box.
Definition box.h:99
double yMin
The y coordinate of the bottom bound of the box.
Definition box.h:103
double xMax
The x coordinate of the right bound of the box.
Definition box.h:101
double zMin
The z coordinate of the down bound of the box.
Definition box.h:107
double zMax
The z coordinate of the up bound of the box.
Definition box.h:109
static Iterator End()
static Iterator Begin()
static void Install(Ptr< Node > node)
Install the MobilityBuildingInfo to a node.
A helper to make it easier to instantiate an ns3::BulkSendApplication on a set of nodes.
Parse command-line arguments.
Introspection did not find any typical Config paths
void ConfigureDefaults()
Configure the default values.
Class for representing data rates.
Definition data-rate.h:78
AttributeValue implementation for DataRate.
Definition data-rate.h:285
This class can be used to hold variables of floating point type such as 'double' or 'float'.
Definition double.h:31
double Get() const
Definition double.cc:26
This class contains the specification of EPS Bearers.
Definition eps-bearer.h:80
Qci
QoS Class Indicator.
Definition eps-bearer.h:95
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
Definition eps-bearer.h:115
Hold a so-called 'global value'.
static void GetValueByName(std::string name, AttributeValue &value)
Finds the GlobalValue with the given name and returns its value.
an Inet address class
Hold a signed integer type.
Definition integer.h:34
int64_t Get() const
Definition integer.cc:26
aggregate IP/TCP/UDP functionality to existing Nodes.
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.
static Ipv4Address GetAny()
Access to the IPv4 forwarding table, interfaces, and configuration.
Definition ipv4.h:69
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
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.
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
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
Ptr< NetDevice > Get(uint32_t i) const
Get the Ptr<NetDevice> stored in this container at a given index.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
uint32_t GetN() 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(const NodeContainer &nc)
Append the contents of another NodeContainer to the end of this container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
Ptr< Node > Get(uint32_t i) const
Get the Ptr<Node> stored in this container at a given index.
static Iterator Begin()
Definition node-list.cc:226
static Iterator End()
Definition node-list.cc:233
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)
AttributeValue implementation for Pointer.
Definition pointer.h:37
Smart pointer class similar to boost::intrusive_ptr.
Definition ptr.h:67
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
std::string Get() const
Definition string.cc:20
Simulation virtual time values and global simulation resolution.
Definition nstime.h:96
AttributeValue implementation for Time.
Definition nstime.h:1456
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:34
uint64_t Get() const
Definition uinteger.cc:26
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
Definition assert.h:75
Ptr< const AttributeChecker > MakeBooleanChecker()
Definition boolean.cc:114
Ptr< const AttributeChecker > MakeDoubleChecker()
Definition double.h:82
Ptr< const AttributeChecker > MakeIntegerChecker()
Definition integer.h:99
Ptr< const AttributeChecker > MakeStringChecker()
Definition string.cc:19
Ptr< const AttributeChecker > MakeUintegerChecker()
Definition uinteger.h:85
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:886
#define NS_LOG_ERROR(msg)
Use NS_LOG to output a message of level LOG_ERROR.
Definition log.h:243
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Ptr< T > Create(Ts &&... args)
Create class instances by constructors with varying numbers of arguments and return them by Ptr.
Definition ptr.h:439
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1369
Time MilliSeconds(uint64_t value)
Construct a Time in the indicated unit.
Definition nstime.h:1381
static ns3::GlobalValue g_macroEnbTxPowerDbm("macroEnbTxPowerDbm", "TX power [dBm] used by macro eNBs", ns3::DoubleValue(46.0), ns3::MakeDoubleChecker< double >())
TX power [dBm] used by macro eNBs.
bool AreOverlapping(Box a, Box b)
Check if two boxes are overlapping.
static ns3::GlobalValue g_generateRem("generateRem", "if true, will generate a REM and then abort the simulation;" "if false, will run the simulation normally (without generating any REM)", ns3::BooleanValue(false), ns3::MakeBooleanChecker())
If true, will generate a REM and then abort the simulation.
static ns3::GlobalValue g_homeEnbDeploymentRatio("homeEnbDeploymentRatio", "The HeNB deployment ratio as per 3GPP R4-092042", ns3::DoubleValue(0.2), ns3::MakeDoubleChecker< double >())
The HeNB deployment ratio as per 3GPP R4-092042.
static ns3::GlobalValue g_srsPeriodicity("srsPeriodicity", "SRS Periodicity (has to be at least " "greater than the number of UEs per eNB)", ns3::UintegerValue(80), ns3::MakeUintegerChecker< uint16_t >())
SRS Periodicity (has to be at least greater than the number of UEs per eNB)
static ns3::GlobalValue g_fadingTrace("fadingTrace", "The path of the fading trace (by default no fading trace " "is loaded, i.e., fading is not considered)", ns3::StringValue(""), ns3::MakeStringChecker())
The path of the fading trace (by default no fading trace is loaded, i.e., fading is not considered)
static ns3::GlobalValue g_outdoorUeMaxSpeed("outdoorUeMaxSpeed", "Maximum speed value of macro UE with random waypoint model [m/s].", ns3::DoubleValue(0.0), ns3::MakeDoubleChecker< double >())
Maximum speed value of macro UE with random waypoint model [m/s].
static ns3::GlobalValue g_macroUeDensity("macroUeDensity", "How many macrocell UEs there are per square meter", ns3::DoubleValue(0.00002), ns3::MakeDoubleChecker< double >())
How many macrocell UEs there are per square meter.
static ns3::GlobalValue g_homeEnbTxPowerDbm("homeEnbTxPowerDbm", "TX power [dBm] used by HeNBs", ns3::DoubleValue(20.0), ns3::MakeDoubleChecker< double >())
TX power [dBm] used by HeNBs.
static ns3::GlobalValue g_homeEnbBandwidth("homeEnbBandwidth", "bandwidth [num RBs] used by HeNBs", ns3::UintegerValue(25), ns3::MakeUintegerChecker< uint16_t >())
Bandwidth [num RBs] used by HeNBs.
static ns3::GlobalValue g_simTime("simTime", "Total duration of the simulation [s]", ns3::DoubleValue(0.25), ns3::MakeDoubleChecker< double >())
Total duration of the simulation [s].
static ns3::GlobalValue g_outdoorUeMinSpeed("outdoorUeMinSpeed", "Minimum speed value of macro UE with random waypoint model [m/s].", ns3::DoubleValue(0.0), ns3::MakeDoubleChecker< double >())
Minimum speed value of macro UE with random waypoint model [m/s].
static ns3::GlobalValue g_homeEnbDlEarfcn("homeEnbDlEarfcn", "DL EARFCN used by HeNBs", ns3::UintegerValue(100), ns3::MakeUintegerChecker< uint16_t >())
DL EARFCN used by HeNBs.
static ns3::GlobalValue g_nApartmentsX("nApartmentsX", "Number of apartments along the X axis in a femtocell block", ns3::UintegerValue(10), ns3::MakeUintegerChecker< uint32_t >())
Number of apartments along the X axis in a femtocell block.
void PrintGnuplottableEnbListToFile(std::string filename)
Print a list of ENBs that can be plotted using Gnuplot.
static ns3::GlobalValue g_homeEnbActivationRatio("homeEnbActivationRatio", "The HeNB activation ratio as per 3GPP R4-092042", ns3::DoubleValue(0.5), ns3::MakeDoubleChecker< double >())
The HeNB activation ratio as per 3GPP R4-092042.
static ns3::GlobalValue g_nMacroEnbSitesX("nMacroEnbSitesX", "(minimum) number of sites along the X-axis of the hex grid", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
(minimum) number of sites along the X-axis of the hex grid
static ns3::GlobalValue g_nFloors("nFloors", "Number of floors", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
Number of floors.
void PrintGnuplottableBuildingListToFile(std::string filename)
Print a list of buildings that can be plotted using Gnuplot.
static ns3::GlobalValue g_macroEnbBandwidth("macroEnbBandwidth", "bandwidth [num RBs] used by macro eNBs", ns3::UintegerValue(25), ns3::MakeUintegerChecker< uint16_t >())
Bandwidth [num RBs] used by macro eNBs.
static ns3::GlobalValue g_remRbId("remRbId", "Resource Block Id of Data Channel, for which REM will be generated;" "default value is -1, what means REM will be averaged from all RBs of " "Control Channel", ns3::IntegerValue(-1), MakeIntegerChecker< int32_t >())
Resource Block Id of Data Channel, for which REM will be generated.
static ns3::GlobalValue g_epcDl("epcDl", "if true, will activate data flows in the downlink when EPC is being used. " "If false, downlink flows won't be activated. " "If EPC is not used, this parameter will be ignored.", ns3::BooleanValue(true), ns3::MakeBooleanChecker())
if true, will activate data flows in the downlink when EPC is being used.
static ns3::GlobalValue g_homeUesHomeEnbRatio("homeUesHomeEnbRatio", "How many (on average) home UEs per HeNB there are in the simulation", ns3::DoubleValue(1.0), ns3::MakeDoubleChecker< double >())
How many (on average) home UEs per HeNB there are in the simulation.
static ns3::GlobalValue g_nBlocks("nBlocks", "Number of femtocell blocks", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint32_t >())
Number of femtocell blocks.
static ns3::GlobalValue g_useUdp("useUdp", "if true, the UdpClient application will be used. " "Otherwise, the BulkSend application will be used over a TCP connection. " "If EPC is not used, this parameter will be ignored.", ns3::BooleanValue(true), ns3::MakeBooleanChecker())
if true, the UdpClient application will be used.
static ns3::GlobalValue g_numBearersPerUe("numBearersPerUe", "How many bearers per UE there are in the simulation", ns3::UintegerValue(1), ns3::MakeUintegerChecker< uint16_t >())
How many bearers per UE there are in the simulation.
static ns3::GlobalValue g_epc("epc", "If true, will setup the EPC to simulate an end-to-end topology, " "with real IP applications over PDCP and RLC UM (or RLC AM by changing " "the default value of EpsBearerToRlcMapping e.g. to RLC_AM_ALWAYS). " "If false, only the LTE radio access will be simulated with RLC SM.", ns3::BooleanValue(false), ns3::MakeBooleanChecker())
If true, will setup the EPC to simulate an end-to-end topology.
static ns3::GlobalValue g_areaMarginFactor("areaMarginFactor", "how much the UE area extends outside the macrocell grid, " "expressed as fraction of the interSiteDistance", ns3::DoubleValue(0.5), ns3::MakeDoubleChecker< double >())
how much the UE area extends outside the macrocell grid, expressed as fraction of the interSiteDistan...
void PrintGnuplottableUeListToFile(std::string filename)
Print a list of UEs that can be plotted using Gnuplot.
static ns3::GlobalValue g_interSiteDistance("interSiteDistance", "min distance between two nearby macro cell sites", ns3::DoubleValue(500), ns3::MakeDoubleChecker< double >())
min distance between two nearby macro cell sites
static ns3::GlobalValue g_epcUl("epcUl", "if true, will activate data flows in the uplink when EPC is being used. " "If false, uplink flows won't be activated. " "If EPC is not used, this parameter will be ignored.", ns3::BooleanValue(true), ns3::MakeBooleanChecker())
if true, will activate data flows in the uplink when EPC is being used.
static ns3::GlobalValue g_macroEnbDlEarfcn("macroEnbDlEarfcn", "DL EARFCN used by macro eNBs", ns3::UintegerValue(100), ns3::MakeUintegerChecker< uint16_t >())
DL EARFCN used by macro eNBs.
static ns3::GlobalValue g_nMacroEnbSites("nMacroEnbSites", "How many macro sites there are", ns3::UintegerValue(7), ns3::MakeUintegerChecker< uint32_t >())
How many macro sites there are.
serverApps
Definition first.py:43
clientApps
Definition first.py:53
Every class exported by the ns3 library is enclosed in the ns3 namespace.
mobility
Definition third.py:92
Implement the data structure representing a TrafficFlowTemplate Packet Filter.
Definition epc-tft.h:60
uint16_t localPortEnd
end of the port number range of the UE
Definition epc-tft.h:121
uint16_t remotePortEnd
end of the port number range of the remote host
Definition epc-tft.h:119
uint16_t remotePortStart
start of the port number range of the remote host
Definition epc-tft.h:118
uint16_t localPortStart
start of the port number range of the UE
Definition epc-tft.h:120