5#include "lena-lte-comparison.h"
7#include "flow-monitor-output-stats.h"
8#include "lena-v1-utils.h"
9#include "lena-v2-utils.h"
10#include "power-output-stats.h"
11#include "rb-output-stats.h"
12#include "sinr-output-stats.h"
13#include "slot-output-stats.h"
15#include "ns3/antenna-module.h"
16#include "ns3/applications-module.h"
17#include "ns3/config-store-module.h"
18#include "ns3/config-store.h"
19#include "ns3/core-module.h"
20#include "ns3/flow-monitor-module.h"
21#include "ns3/internet-apps-module.h"
22#include "ns3/internet-module.h"
23#include "ns3/lte-module.h"
24#include "ns3/mobility-module.h"
25#include "ns3/network-module.h"
26#include "ns3/point-to-point-module.h"
27#include "ns3/radio-environment-map-helper.h"
28#include "ns3/sqlite-output.h"
43NS_LOG_COMPONENT_DEFINE(
"LenaLteComparison");
48const Time appStartWindow = MilliSeconds(50);
52CreateLowLatTft(uint16_t start, uint16_t end, std::string dir)
55 lowLatTft = Create<T>();
56 typename T::PacketFilter dlpfLowLat;
59 dlpfLowLat.localPortStart = start;
60 dlpfLowLat.localPortEnd = end;
61 dlpfLowLat.direction = T::DOWNLINK;
65 dlpfLowLat.remotePortStart = start;
66 dlpfLowLat.remotePortEnd = end;
67 dlpfLowLat.direction = T::UPLINK;
69 lowLatTft->Add(dlpfLowLat);
73template Ptr<ns3::EpcTft> CreateLowLatTft<ns3::EpcTft>(uint16_t, uint16_t, std::string);
74template Ptr<ns3::NrEpcTft> CreateLowLatTft<ns3::NrEpcTft>(uint16_t, uint16_t, std::string);
76static std::pair<ApplicationContainer, Time>
77InstallApps(
const Ptr<Node>& ue,
78 const Ptr<NetDevice>& ueDevice,
79 const Address& ueAddress,
80 const std::string& direction,
81 UdpClientHelper* dlClientLowLat,
82 const Ptr<Node>& remoteHost,
83 const Ipv4Address& remoteHostAddr,
85 uint16_t dlPortLowLat,
86 const Ptr<UniformRandomVariable>& x,
87 Time appGenerationTime,
88 const Ptr<LteHelper>& lteHelper,
89 const Ptr<NrHelper>& nrHelper)
91 ApplicationContainer app;
94 EpsBearer lowLatBearer(EpsBearer::NGBR_VIDEO_TCP_DEFAULT);
98 Ptr<EpcTft> lowLatTft = CreateLowLatTft<EpcTft>(dlPortLowLat, dlPortLowLat, direction);
99 Ptr<NrEpcTft> nrLowLatTft = CreateLowLatTft<NrEpcTft>(dlPortLowLat, dlPortLowLat, direction);
103 if (direction ==
"DL")
105 dlClientLowLat->SetAttribute(
107 AddressValue(addressUtils::ConvertToSocketAddress(ueAddress, dlPortLowLat)));
108 app = dlClientLowLat->Install(remoteHost);
112 dlClientLowLat->SetAttribute(
114 AddressValue(addressUtils::ConvertToSocketAddress(remoteHostAddr, dlPortLowLat)));
115 app = dlClientLowLat->Install(ue);
118 double start = x->GetValue(udpAppStartTime.GetMilliSeconds(),
119 (udpAppStartTime + appStartWindow).GetMilliSeconds());
120 Time startTime = MilliSeconds(start);
121 app.Start(startTime);
122 app.Stop(startTime + appGenerationTime);
124 std::cout <<
"\tStarts at time " << startTime.As(Time::MS) <<
" and ends at "
125 << (startTime + appGenerationTime).As(Time::MS) << std::endl;
128 if (lteHelper !=
nullptr)
130 lteHelper->ActivateDedicatedEpsBearer(ueDevice, lowLatBearer, lowLatTft);
132 else if (nrHelper !=
nullptr)
134 nrHelper->ActivateDedicatedEpsBearer(ueDevice, nrLowLatBearer, nrLowLatTft);
137 return std::make_pair(app, startTime);
141Parameters::Validate()
const
143 NS_ABORT_MSG_IF(bandwidthMHz != 20 && bandwidthMHz != 10 && bandwidthMHz != 5,
144 "Valid bandwidth values are 20, 10, 5, you set " << bandwidthMHz);
146 NS_ABORT_MSG_IF(trafficScenario > 3,
147 "Traffic scenario " << trafficScenario
148 <<
" not valid. Valid values are 0 1 2 3");
150 NS_ABORT_MSG_IF(numerologyBwp > 4,
"At most 4 bandwidth parts supported.");
152 NS_ABORT_MSG_IF(direction !=
"DL" && direction !=
"UL",
153 "Flow direction can only be DL or UL: " << direction);
154 NS_ABORT_MSG_IF(operationMode !=
"TDD" && operationMode !=
"FDD",
155 "Operation mode can only be TDD or FDD: " << operationMode);
156 NS_ABORT_MSG_IF(radioNetwork !=
"LTE" && radioNetwork !=
"NR",
157 "Unrecognized radio network technology: " << radioNetwork);
158 NS_ABORT_MSG_IF(radioNetwork ==
"LTE" && operationMode !=
"FDD",
159 "Operation mode must be FDD in a 4G LTE network: " << operationMode);
160 NS_ABORT_MSG_IF(simulator !=
"LENA" && simulator !=
"5GLENA",
161 "Unrecognized simulator: " << simulator);
162 NS_ABORT_MSG_IF(scheduler !=
"PF" && scheduler !=
"RR",
163 "Unrecognized scheduler: " << scheduler);
167 NS_ABORT_MSG_IF(simulator !=
"5GLENA",
168 "Cannot do the REM with the simulator " << simulator);
169 NS_ABORT_MSG_IF(dlRem && ulRem,
"You selected both DL and UL REM, that is not supported");
170 NS_ABORT_MSG_IF(remSector > 3,
"Only three sectors supported for REM");
172 NS_ABORT_MSG_IF(remSector == 0 && freqScenario != 1,
173 "RemSector == 0 makes sense only in a OVERLAPPING scenario");
180LenaLteComparison(
const Parameters& params)
185 uint32_t udpPacketSize = 1000;
187 uint32_t packetCount;
189 std::cout <<
"\n----------------------------------------\n"
190 <<
"Configuring scenario" << std::endl;
192 std::cout <<
" traffic parameters\n";
193 switch (params.trafficScenario)
196 packetCount = 0xFFFFFFFF;
197 switch (params.bandwidthMHz)
200 udpPacketSize = 1000;
209 udpPacketSize = 1000;
211 lambda = 10000 / params.ueNumPergNb;
219 packetCount = 0xFFFFFFFF;
220 switch (params.bandwidthMHz)
234 lambda = 1000 / params.ueNumPergNb;
237 packetCount = 0xFFFFFFFF;
238 switch (params.bandwidthMHz)
252 lambda = 10000 / params.ueNumPergNb;
255 NS_FATAL_ERROR(
"Traffic scenario " << params.trafficScenario
256 <<
" not valid. Valid values are 0 1 2 3");
259 std::cout <<
" statistics\n";
260 SQLiteOutput db(params.outputDir +
"/" + params.simTag +
".db");
261 SinrOutputStats sinrStats;
262 PowerOutputStats ueTxPowerStats;
263 PowerOutputStats gnbRxPowerStats;
264 SlotOutputStats slotStats;
265 RbOutputStats rbStats;
267 sinrStats.SetDb(&db);
268 ueTxPowerStats.SetDb(&db,
"ueTxPower");
269 slotStats.SetDb(&db);
271 gnbRxPowerStats.SetDb(&db,
"gnbRxPower");
277 std::cout <<
" checking frequency and numerology\n";
289 std::cout <<
" logging\n";
292 LogComponentEnable(
"UdpClient", LOG_LEVEL_INFO);
293 LogComponentEnable(
"UdpServer", LOG_LEVEL_INFO);
294 LogComponentEnable(
"LtePdcp", LOG_LEVEL_INFO);
302 std::cout <<
" max tx buffer size\n";
303 Config::SetDefault(
"ns3::LteRlcUm::MaxTxBufferSize", UintegerValue(999999999));
304 Config::SetDefault(
"ns3::NrRlcUm::MaxTxBufferSize", UintegerValue(999999999));
312 ScenarioParameters scenarioParams;
313 scenarioParams.SetScenarioParameters(params.scenario);
318 uint32_t gnbSites = 0;
319 NodeContainer gnbNodes;
320 NodeContainer ueNodes;
321 double sector0AngleRad = 0;
322 const uint32_t sectors = 3;
325 NodeDistributionScenarioInterface* scenario{
nullptr};
326 FileScenarioHelper fileScenario;
327 HexagonalGridScenarioHelper gridScenario;
329 if (!params.baseStationFile.empty() and params.useSiteFile)
331 std::cout <<
" using tower positions from " << params.baseStationFile << std::endl;
332 std::cout <<
" setting sectorization" << std::endl;
333 fileScenario.SetSectorization(sectors);
334 std::cout <<
" adding site file" << std::endl;
335 fileScenario.Add(params.baseStationFile);
336 std::cout <<
" setting scenario" << std::endl;
337 fileScenario.SetScenarioParameters(params.scenario);
338 std::cout <<
" getting number of sites..." << std::flush;
339 gnbSites = fileScenario.GetNumSites();
340 std::cout << gnbSites << std::endl;
341 std::cout <<
" getting number of cells..." << std::flush;
342 uint32_t gnbNum = fileScenario.GetNumCells();
343 std::cout << gnbNum << std::endl;
344 uint32_t ueNum = params.ueNumPergNb * gnbNum;
345 std::cout <<
" setting number of UEs..." << ueNum << std::endl;
346 fileScenario.SetUtNumber(ueNum);
347 std::cout <<
" getting sector 0 angle..." << std::flush;
348 sector0AngleRad = fileScenario.GetAntennaOrientationRadians(0);
349 std::cout << sector0AngleRad << std::endl;
352 std::cout <<
" creating scenario" << std::endl;
353 fileScenario.CreateScenario();
354 std::cout <<
" getting gnbNodes..." << std::flush;
355 gnbNodes = fileScenario.GetBaseStations();
356 std::cout << gnbNodes.GetN() << std::endl;
357 std::cout <<
" getting ueNodes..." << std::flush;
358 ueNodes = fileScenario.GetUserTerminals();
359 std::cout << ueNodes.GetN() << std::endl;
360 std::cout <<
" setting scenario pointer..." << std::flush;
361 scenario = &fileScenario;
362 std::cout <<
"0x" << std::hex << scenario << std::dec << std::endl;
366 std::cout <<
" hexagonal grid: ";
367 gridScenario.SetScenarioParameters(scenarioParams);
368 gridScenario.SetNumRings(params.numOuterRings);
369 gnbSites = gridScenario.GetNumSites();
370 uint32_t ueNum = params.ueNumPergNb * gnbSites * sectors;
371 gridScenario.SetUtNumber(ueNum);
372 sector0AngleRad = gridScenario.GetAntennaOrientationRadians(0);
373 std::cout << sector0AngleRad << std::endl;
376 gridScenario.CreateScenario();
377 gnbNodes = gridScenario.GetBaseStations();
378 ueNodes = gridScenario.GetUserTerminals();
379 scenario = &gridScenario;
383 std::cout <<
"\n Topology configuration: " << gnbSites <<
" sites, " << sectors
384 <<
" sectors/site, " << gnbNodes.GetN() <<
" cells, " << ueNodes.GetN() <<
" UEs\n";
400 NodeContainer gnbSector1Container;
401 NodeContainer gnbSector2Container;
402 NodeContainer gnbSector3Container;
403 std::vector<NodeContainer*> gnbNodesBySector{&gnbSector1Container,
404 &gnbSector2Container,
405 &gnbSector3Container};
406 for (uint32_t cellId = 0; cellId < gnbNodes.GetN(); ++cellId)
408 Ptr<Node> gnb = gnbNodes.Get(cellId);
409 auto sector = scenario->GetSectorIndex(cellId);
410 gnbNodesBySector[sector]->Add(gnb);
412 std::cout <<
" gNb containers: " << gnbSector1Container.GetN() <<
", "
413 << gnbSector2Container.GetN() <<
", " << gnbSector3Container.GetN() << std::endl;
423 NodeContainer ueSector1Container;
424 NodeContainer ueSector2Container;
425 NodeContainer ueSector3Container;
426 std::vector<NodeContainer*> ueNodesBySector{&ueSector1Container,
428 &ueSector3Container};
429 for (uint32_t ueId = 0; ueId < ueNodes.GetN(); ++ueId)
431 Ptr<Node> ue = ueNodes.Get(ueId);
432 auto cellId = scenario->GetCellIndex(ueId);
433 auto sector = scenario->GetSectorIndex(cellId);
434 ueNodesBySector[sector]->Add(ue);
436 std::cout <<
" UE containers: " << ueSector1Container.GetN() <<
", "
437 << ueSector2Container.GetN() <<
", " << ueSector3Container.GetN() << std::endl;
443 std::cout <<
" helpers\n";
444 Ptr<PointToPointEpcHelper> epcHelper;
445 Ptr<NrPointToPointEpcHelper> nrEpcHelper;
447 NetDeviceContainer gnbSector1NetDev;
448 NetDeviceContainer gnbSector2NetDev;
449 NetDeviceContainer gnbSector3NetDev;
450 std::vector<NetDeviceContainer*> gnbNdBySector{&gnbSector1NetDev,
453 NetDeviceContainer ueSector1NetDev;
454 NetDeviceContainer ueSector2NetDev;
455 NetDeviceContainer ueSector3NetDev;
456 std::vector<NetDeviceContainer*> ueNdBySector{&ueSector1NetDev,
460 Ptr<LteHelper> lteHelper =
nullptr;
461 Ptr<NrHelper> nrHelper =
nullptr;
463 if (params.simulator ==
"LENA")
465 epcHelper = CreateObject<PointToPointEpcHelper>();
466 LenaV1Utils::SetLenaV1SimulatorParameters(sector0AngleRad,
489 params.downtiltAngle);
491 else if (params.simulator ==
"5GLENA")
493 nrEpcHelper = CreateObject<NrPointToPointEpcHelper>();
498 params.operationMode,
500 params.numerologyBwp,
518 params.powerAllocation,
527 params.downtiltAngle);
531 if ((lteHelper ==
nullptr) && (nrHelper ==
nullptr))
533 NS_ABORT_MSG(
"Programming error: no valid helper");
541 std::cout <<
" pgw and internet\n";
543 if (params.simulator ==
"LENA")
545 pgw = epcHelper->GetPgwNode();
549 pgw = nrEpcHelper->GetPgwNode();
551 NodeContainer remoteHostContainer;
552 remoteHostContainer.Create(1);
553 Ptr<Node> remoteHost = remoteHostContainer.Get(0);
554 InternetStackHelper internet;
555 internet.Install(remoteHostContainer);
558 PointToPointHelper p2ph;
559 p2ph.SetDeviceAttribute(
"DataRate", DataRateValue(DataRate(
"100Gb/s")));
560 p2ph.SetDeviceAttribute(
"Mtu", UintegerValue(2500));
561 p2ph.SetChannelAttribute(
"Delay", TimeValue(Seconds(0.000)));
562 NetDeviceContainer internetDevices = p2ph.Install(pgw, remoteHost);
563 Ipv4AddressHelper ipv4h;
564 Ipv4StaticRoutingHelper ipv4RoutingHelper;
565 ipv4h.SetBase(
"1.0.0.0",
"255.0.0.0");
566 Ipv4InterfaceContainer internetIpIfaces = ipv4h.Assign(internetDevices);
567 Ptr<Ipv4StaticRouting> remoteHostStaticRouting =
568 ipv4RoutingHelper.GetStaticRouting(remoteHost->GetObject<Ipv4>());
569 remoteHostStaticRouting->AddNetworkRouteTo(Ipv4Address(
"7.0.0.0"), Ipv4Mask(
"255.0.0.0"), 1);
570 internet.Install(ueNodes);
572 NetDeviceContainer gnbNetDevs(gnbSector1NetDev, gnbSector2NetDev);
573 gnbNetDevs.Add(gnbSector3NetDev);
574 NetDeviceContainer ueNetDevs(ueSector1NetDev, ueSector2NetDev);
575 ueNetDevs.Add(ueSector3NetDev);
577 Ipv4InterfaceContainer ueIpIfaces;
578 Ipv4Address gatewayAddress;
579 if (params.simulator ==
"LENA")
581 ueIpIfaces = epcHelper->AssignUeIpv4Address(ueNetDevs);
582 gatewayAddress = epcHelper->GetUeDefaultGatewayAddress();
586 ueIpIfaces = nrEpcHelper->AssignUeIpv4Address(ueNetDevs);
587 gatewayAddress = nrEpcHelper->GetUeDefaultGatewayAddress();
590 Ipv4Address remoteHostAddr = internetIpIfaces.GetAddress(1);
593 std::cout <<
" default gateway\n";
594 for (
auto ue = ueNodes.Begin(); ue != ueNodes.End(); ++ue)
596 Ptr<Ipv4StaticRouting> ueStaticRouting =
597 ipv4RoutingHelper.GetStaticRouting((*ue)->GetObject<Ipv4>());
598 ueStaticRouting->SetDefaultRoute(gatewayAddress, 1);
602 std::cout <<
" attach UEs to gNBs\n" << std::endl;
603 for (uint32_t ueId = 0; ueId < ueNodes.GetN(); ++ueId)
605 auto cellId = scenario->GetCellIndex(ueId);
606 Ptr<NetDevice> gnbNetDev = gnbNodes.Get(cellId)->GetDevice(0);
607 Ptr<NetDevice> ueNetDev = ueNodes.Get(ueId)->GetDevice(0);
608 if (lteHelper !=
nullptr)
610 lteHelper->Attach(ueNetDev, gnbNetDev);
612 else if (nrHelper !=
nullptr)
614 nrHelper->AttachToGnb(ueNetDev, gnbNetDev);
615 auto uePhyBwp0{nrHelper->GetUePhy(ueNetDev, 0)};
616 auto gnbPhyBwp0{nrHelper->GetGnbPhy(gnbNetDev, 0)};
617 Vector gnbpos = gnbNetDev->GetNode()->GetObject<MobilityModel>()->GetPosition();
618 Vector uepos = ueNetDev->GetNode()->GetObject<MobilityModel>()->GetPosition();
619 double distance = CalculateDistance(gnbpos, uepos);
620 std::cout <<
"ueId " << ueId <<
", cellIndex " << cellId <<
", ue freq "
621 << uePhyBwp0->GetCentralFrequency() / 1e9 <<
", gnb freq "
622 << gnbPhyBwp0->GetCentralFrequency() / 1e9 <<
", sector "
623 << scenario->GetSectorIndex(cellId) <<
", distance " << distance
624 <<
", azimuth gnb->ue:"
625 << RadiansToDegrees(Angles(gnbpos, uepos).GetAzimuth()) << std::endl;
633 std::cout <<
" server factory\n";
634 uint16_t dlPortLowLat = 1234;
636 ApplicationContainer serverApps;
639 UdpServerHelper dlPacketSinkLowLat(dlPortLowLat);
642 if (params.direction ==
"DL")
644 serverApps.Add(dlPacketSinkLowLat.Install(ueNodes));
648 serverApps.Add(dlPacketSinkLowLat.Install(remoteHost));
652 serverApps.Start(params.udpAppStartTime);
660 Time interval = Seconds(1.0 / lambda);
661 std::cout <<
" client factory:"
662 <<
"\n packet size: " << udpPacketSize <<
"\n interval: " << interval
663 <<
"\n max packets: " << packetCount << std::endl;
665 UdpClientHelper dlClientLowLat;
666 dlClientLowLat.SetAttribute(
"MaxPackets", UintegerValue(packetCount));
667 dlClientLowLat.SetAttribute(
"PacketSize", UintegerValue(udpPacketSize));
668 dlClientLowLat.SetAttribute(
"Interval", TimeValue(interval));
673 std::cout <<
" applications\n";
674 ApplicationContainer clientApps;
675 Ptr<UniformRandomVariable> startRng = CreateObject<UniformRandomVariable>();
676 startRng->SetStream(RngSeedManager::GetRun());
679 for (uint32_t ueId = 0; ueId < ueNodes.GetN(); ++ueId)
681 auto cellId = scenario->GetCellIndex(ueId);
682 auto sector = scenario->GetSectorIndex(cellId);
683 auto siteId = scenario->GetSiteIndex(cellId);
684 Ptr<Node> node = ueNodes.Get(ueId);
685 Ptr<NetDevice> dev = ueNetDevs.Get(ueId);
686 Address addr = ueIpIfaces.GetAddress(ueId);
688 std::cout <<
"app for ue " << ueId <<
", cellId " << cellId <<
", sector " << sector
689 <<
", siteId " << siteId;
692 auto app = InstallApps(node,
699 params.udpAppStartTime,
702 params.appGenerationTime,
705 maxStartTime = std::max(app.second, maxStartTime);
706 clientApps.Add(app.first);
708 std::cout << clientApps.GetN() <<
" apps\n";
711 std::cout <<
" tracing\n";
714 if (lteHelper !=
nullptr)
716 lteHelper->EnableTraces();
718 else if (nrHelper !=
nullptr)
720 nrHelper->EnableTraces();
724 std::cout <<
" flowmon\n";
725 FlowMonitorHelper flowmonHelper;
726 NodeContainer endpointNodes;
727 endpointNodes.Add(remoteHost);
728 endpointNodes.Add(ueNodes);
730 Ptr<FlowMonitor> monitor = flowmonHelper.Install(endpointNodes);
731 monitor->SetAttribute(
"DelayBinWidth", DoubleValue(0.001));
732 monitor->SetAttribute(
"JitterBinWidth", DoubleValue(0.001));
733 monitor->SetAttribute(
"PacketSizeBinWidth", DoubleValue(20));
735 std::string tableName =
"e2e";
737 Ptr<NrRadioEnvironmentMapHelper>
743 if (params.dlRem || params.ulRem)
745 std::cout <<
" rem helper\n";
747 uint16_t remPhyIndex = 0;
748 if (params.operationMode ==
"FDD" && params.direction ==
"UL")
753 NetDeviceContainer remNd;
754 Ptr<NetDevice> remDevice;
757 std::vector<NetDeviceContainer*> remNdBySector{ueNdBySector};
758 std::vector<NetDeviceContainer*> remDevBySector{gnbNdBySector};
762 remNdBySector = gnbNdBySector;
763 remDevBySector = ueNdBySector;
766 uint32_t sectorIndex = 0;
768 for (uint32_t sector = sectors; sector > 0; --sector)
770 if (params.remSector == sector || params.remSector == 0)
772 sectorIndex = sector - 1;
773 remNd.Add(*remNdBySector[sectorIndex]);
774 remDevice = remDevBySector[sectorIndex]->Get(0);
781 DynamicCast<NrGnbNetDevice>(remDevice)->GetPhy(0)->GetSpectrumPhy()->GetAntenna();
782 auto antenna = DynamicCast<UniformPlanarArray>(antArray);
783 antenna->SetAttribute(
"AntennaElement",
784 PointerValue(CreateObject<IsotropicAntennaModel>()));
788 remHelper = CreateObject<NrRadioEnvironmentMapHelper>();
789 remHelper->SetMinX(params.xMinRem);
790 remHelper->SetMaxX(params.xMaxRem);
791 remHelper->SetResX(params.xResRem);
792 remHelper->SetMinY(params.yMinRem);
793 remHelper->SetMaxY(params.yMaxRem);
794 remHelper->SetResY(params.yResRem);
795 remHelper->SetZ(params.zRem);
798 for (uint32_t sector = sectors; sector > 0; --sector)
800 if ((params.remSector == sector) || (params.remSector == 0))
802 sectorIndex = sector - 1;
803 for (uint32_t siteId = 0; siteId < gnbSites; ++siteId)
805 gnbNdBySector[sectorIndex]
807 ->GetObject<NrGnbNetDevice>()
808 ->GetPhy(remPhyIndex)
809 ->ChangeBeamformingVector(
810 DynamicCast<NrUeNetDevice>(ueNdBySector[sectorIndex]->Get(siteId)));
815 remHelper->CreateRem(remNd, remDevice, remPhyIndex);
818 std::cout <<
"\n----------------------------------------\n"
819 <<
"Start simulation" << std::endl;
821 const Time appStopWindow = MilliSeconds(50);
822 Time stopTime = maxStartTime + params.appGenerationTime + appStopWindow;
823 Simulator::Stop(stopTime);
826 sinrStats.EmptyCache();
827 ueTxPowerStats.EmptyCache();
828 gnbRxPowerStats.EmptyCache();
829 slotStats.EmptyCache();
830 rbStats.EmptyCache();
839 FlowMonitorOutputStats flowMonStats;
840 flowMonStats.SetDb(&db, tableName);
841 flowMonStats.Save(monitor, flowmonHelper, params.outputDir +
"/" + params.simTag);
843 std::cout <<
"\n----------------------------------------\n"
844 <<
"End simulation" << std::endl;
846 Simulator::Destroy();
850operator<<(std::ostream& os,
const Parameters& parameters)
856 os << "\n" << m << std::left << std::setw(40 - strlen(m)) << (strlen(m) > 0 ? ":" : "")
858 MSG(
"LENA LTE Scenario Parameters");
860 MSG(
"Model version") << p.simulator << (p.simulator ==
"LENA" ?
" (v1)" :
" (v2)");
861 if (p.simulator ==
"5GLENA")
863 MSG(
"LTE Standard") << p.radioNetwork << (p.radioNetwork ==
"LTE" ?
" (4G)" :
" (5G NR)");
864 MSG(
"4G-NR calibration mode") << (p.calibration ?
"ON" :
"off");
865 MSG(
"4G-NR ULPC mode") << (p.enableUlPc ?
"Enabled" :
"Disabled");
866 MSG(
"Operation mode") << p.operationMode;
867 if (p.operationMode ==
"TDD")
869 MSG(
"Numerology") << p.numerologyBwp;
870 MSG(
"TDD pattern") << p.pattern;
872 if (!p.errorModel.empty())
874 MSG(
"Error model") << p.errorModel;
876 else if (p.radioNetwork ==
"LTE")
878 MSG(
"Error model") <<
"ns3::LenaErrorModel";
880 else if (p.radioNetwork ==
"NR")
882 MSG(
"Error model") <<
"ns3::NrEesmCcT2";
888 p.operationMode =
"FDD";
889 MSG(
"LTE Standard") <<
"4G";
890 MSG(
"Calibration mode") << (p.calibration ?
"ON" :
"off");
891 MSG(
"LTE ULPC mode") << (p.enableUlPc ?
"Enabled" :
"Disabled");
892 MSG(
"Operation mode") << p.operationMode;
895 if (!p.baseStationFile.empty() and p.useSiteFile)
897 MSG(
"Base station positions") <<
"read from file " << p.baseStationFile;
901 MSG(
"Base station positions") <<
"regular hexaonal lay down";
902 MSG(
"Number of rings") << p.numOuterRings;
906 MSG(
"Channel bandwidth") << p.bandwidthMHz <<
" MHz";
907 MSG(
"Spectrum configuration") << (p.freqScenario == 0 ?
"non-" :
"") <<
"overlapping";
908 MSG(
"LTE Scheduler") << p.scheduler;
911 MSG(
"Basic scenario") << p.scenario;
912 if (p.scenario ==
"UMa")
914 os <<
"\n (ISD: 1.7 km, BS: 30 m, UE: 1.5 m, UE-BS min: 30.2 m)";
916 else if (p.scenario ==
"UMi")
918 os <<
"\n (ISD: 0.5 km, BS: 10 m, UE: 1.5 m, UE-BS min: 10 m)";
920 else if (p.scenario ==
"RMa")
922 os <<
"\n (ISD: 7.0 km, BS: 45 m, UE: 1.5 m, UE-BS min: 44.6 m)";
926 os <<
"\n (unknown configuration)";
928 if (p.baseStationFile.empty() and p.useSiteFile)
930 MSG(
"Number of outer rings") << p.numOuterRings;
932 MSG(
"Number of UEs per sector") << p.ueNumPergNb;
933 MSG(
"Antenna downtilt angle (deg)") << p.downtiltAngle;
936 MSG(
"Network loading") << p.trafficScenario;
937 switch (p.trafficScenario)
940 MSG(
" Max loading (80 Mbps/20 MHz)");
941 MSG(
" Number of packets") <<
"infinite";
943 switch (p.bandwidthMHz)
958 MSG(
" Inter-packet interval (per UE)") << p.ueNumPergNb / 10.0 <<
" ms";
963 MSG(
" Number of packets") << 1;
964 MSG(
" Packet size") <<
"12 bytes";
965 MSG(
" Inter-packet interval (per UE)") <<
"1 s";
969 MSG(
" Moderate loading");
970 MSG(
" Number of packets") <<
"infinite";
972 switch (p.bandwidthMHz)
987 MSG(
" Inter-packet interval (per UE)") << 1 / (1000 / p.ueNumPergNb) <<
" s";
992 MSG(
" Moderate-high loading");
993 MSG(
" Number of packets") <<
"infinite";
995 switch (p.bandwidthMHz)
1010 MSG(
" Inter-packet interval (per UE)") << 1 / (10000.0 / p.ueNumPergNb) <<
" s";
1014 os <<
"\n (Unknown configuration)";
1017 MSG(
"Application start window")
1018 << p.udpAppStartTime.As(Time::MS) <<
" + " << appStartWindow.As(Time::MS);
1019 MSG(
"Application on duration") << p.appGenerationTime.As(Time::MS);
1020 MSG(
"Traffic direction") << p.direction;
1023 MSG(
"Output file name") << p.simTag;
1024 MSG(
"Output directory") << p.outputDir;
1025 MSG(
"Logging") << (p.logging ?
"ON" :
"off");
1026 MSG(
"Trace file generation") << (p.traces ?
"ON" :
"off");
1028 MSG(
"Radio environment map") << (p.dlRem ?
"DL" : (p.ulRem ?
"UL" :
"off"));
1029 if (p.dlRem || p.ulRem)
1031 MSG(
" Sector to sample");
1032 if (p.remSector == 0)
1040 MSG(
" X range") << p.xMinRem <<
" - " << p.xMaxRem <<
", in " << p.xResRem <<
" m steps";
1041 MSG(
" Y range") << p.yMinRem <<
" - " << p.yMaxRem <<
", in " << p.yResRem <<
" m steps";
1042 MSG(
" Altitude (Z)") << p.zRem <<
" m";
static void SetLenaV2SimulatorParameters(const double sector0AngleRad, const std::string &scenario, const std::string &confType, const std::string &radioNetwork, std::string errorModel, const std::string &operationMode, const std::string &direction, uint16_t numerology, const std::string &pattern, const NodeContainer &gnbSector1Container, const NodeContainer &gnbSector2Container, const NodeContainer &gnbSector3Container, const NodeContainer &ueSector1Container, const NodeContainer &ueSector2Container, const NodeContainer &ueSector3Container, const Ptr< NrPointToPointEpcHelper > &baseEpcHelper, Ptr< NrHelper > &nrHelper, NetDeviceContainer &gnbSector1NetDev, NetDeviceContainer &gnbSector2NetDev, NetDeviceContainer &gnbSector3NetDev, NetDeviceContainer &ueSector1NetDev, NetDeviceContainer &ueSector2NetDev, NetDeviceContainer &ueSector3NetDev, bool enableFading, bool enableUlPc, std::string powerAllocation, SinrOutputStats *sinrStats, PowerOutputStats *ueTxPowerStats, PowerOutputStats *gnbRxPowerStats, SlotOutputStats *slotStats, RbOutputStats *rbStats, const std::string &scheduler, uint32_t bandwidthMHz, double startingFreq, uint32_t freqScenario, double gnbTxPower, double ueTxPower, double downtiltAngle, const uint32_t gnbNumRows, const uint32_t gnbNumColumns, const uint32_t ueNumRows, const uint32_t ueNumColumns, bool gnbEnable3gppElement, bool ueEnable3gppElement, const double gnbHSpacing, const double gnbVSpacing, const double ueHSpacing, const double ueVSpacing, const double gnbNoiseFigure, const double ueNoiseFigure, bool enableRealBF, bool enableShadowing, double o2iThreshold, double o2iLowLossThreshold, bool linkO2iConditionToAntennaHeight, bool crossPolarizedGnb, bool crossPolarizedUe, double polSlantAngleGnb1, double polSlantAngleGnb2, double polSlantAngleUe1, double polSlantAngleUe2, std::string bfMethod, uint16_t beamConfSector, double beamConfElevation, double isd, bool ueBearingAngle, double PolSlantAngleGnb, double PolSlantAngleUe, bool dualPolarizedGnb, bool dualPolarizedUe, uint8_t numVPortsGnb, uint8_t numHPortsGnb, uint8_t numVPortsUe, uint8_t numHPortsUe, bool enableMimo, NrHelper::MimoPmiParams mimoPmiParams, bool enableSubbandScheluder, bool m_subbandCqiClamping, EnumValue< NrMacSchedulerUeInfo::McsCsiSource > m_mcsCsiSource)
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)