32 #include <ns3/abort.h>
33 #include <ns3/buildings-propagation-loss-model.h>
34 #include <ns3/epc-enb-application.h>
35 #include <ns3/epc-enb-s1-sap.h>
36 #include <ns3/epc-ue-nas.h>
37 #include <ns3/epc-x2.h>
38 #include <ns3/ff-mac-scheduler.h>
39 #include <ns3/friis-spectrum-propagation-loss.h>
40 #include <ns3/isotropic-antenna-model.h>
42 #include <ns3/lte-anr.h>
43 #include <ns3/lte-chunk-processor.h>
44 #include <ns3/lte-common.h>
45 #include <ns3/lte-enb-component-carrier-manager.h>
46 #include <ns3/lte-enb-mac.h>
47 #include <ns3/lte-enb-net-device.h>
48 #include <ns3/lte-enb-phy.h>
49 #include <ns3/lte-enb-rrc.h>
50 #include <ns3/lte-ffr-algorithm.h>
51 #include <ns3/lte-handover-algorithm.h>
52 #include <ns3/lte-rlc-am.h>
53 #include <ns3/lte-rlc-um.h>
54 #include <ns3/lte-rlc.h>
55 #include <ns3/lte-rrc-protocol-ideal.h>
56 #include <ns3/lte-rrc-protocol-real.h>
57 #include <ns3/lte-spectrum-phy.h>
58 #include <ns3/lte-spectrum-value-helper.h>
59 #include <ns3/lte-ue-component-carrier-manager.h>
60 #include <ns3/lte-ue-mac.h>
61 #include <ns3/lte-ue-net-device.h>
62 #include <ns3/lte-ue-phy.h>
63 #include <ns3/lte-ue-rrc.h>
64 #include <ns3/multi-model-spectrum-channel.h>
65 #include <ns3/object-factory.h>
66 #include <ns3/object-map.h>
67 #include <ns3/pointer.h>
68 #include <ns3/string.h>
69 #include <ns3/trace-fading-loss-model.h>
81 : m_fadingStreamsAssigned(false),
98 m_phyStats = CreateObject<PhyStatsCalculator>();
101 m_macStats = CreateObject<MacStatsCalculator>();
116 .AddConstructor<LteHelper>()
119 "The type of scheduler to be used for eNBs. "
120 "The allowed values for this attributes are the type names "
121 "of any class inheriting from ns3::FfMacScheduler.",
125 .AddAttribute(
"FfrAlgorithm",
126 "The type of FFR algorithm to be used for eNBs. "
127 "The allowed values for this attributes are the type names "
128 "of any class inheriting from ns3::LteFfrAlgorithm.",
133 .AddAttribute(
"HandoverAlgorithm",
134 "The type of handover algorithm to be used for eNBs. "
135 "The allowed values for this attributes are the type names "
136 "of any class inheriting from ns3::LteHandoverAlgorithm.",
141 .AddAttribute(
"PathlossModel",
142 "The type of pathloss model to be used. "
143 "The allowed values for this attributes are the type names "
144 "of any class inheriting from ns3::PropagationLossModel.",
148 .AddAttribute(
"FadingModel",
149 "The type of fading model to be used."
150 "The allowed values for this attributes are the type names "
151 "of any class inheriting from ns3::SpectrumPropagationLossModel."
152 "If the type is set to an empty string, no fading model is used.",
156 .AddAttribute(
"UseIdealRrc",
157 "If true, LteRrcProtocolIdeal will be used for RRC signaling. "
158 "If false, LteRrcProtocolReal will be used.",
162 .AddAttribute(
"AnrEnabled",
163 "Activate or deactivate Automatic Neighbour Relation function",
167 .AddAttribute(
"UsePdschForCqiGeneration",
168 "If true, DL-CQI will be calculated from PDCCH as signal and PDSCH as "
170 "If false, DL-CQI will be calculated from PDCCH as signal and PDCCH as "
175 .AddAttribute(
"EnbComponentCarrierManager",
176 "The type of Component Carrier Manager to be used for eNBs. "
177 "The allowed values for this attributes are the type names "
178 "of any class inheriting ns3::LteEnbComponentCarrierManager.",
183 .AddAttribute(
"UeComponentCarrierManager",
184 "The type of Component Carrier Manager to be used for UEs. "
185 "The allowed values for this attributes are the type names "
186 "of any class inheriting ns3::LteUeComponentCarrierManager.",
187 StringValue(
"ns3::SimpleUeComponentCarrierManager"),
191 .AddAttribute(
"UseCa",
192 "If true, Carrier Aggregation feature is enabled and a valid Component "
193 "Carrier Map is expected. "
194 "If false, single carrier simulation.",
198 .AddAttribute(
"NumberOfComponentCarriers",
199 "Set the number of Component carrier to use. "
200 "If it is more than one and m_useCa is false, it will raise an error.",
244 NS_LOG_LOGIC(
this <<
" using a SpectrumPropagationLossModel in DL");
249 NS_LOG_LOGIC(
this <<
" using a PropagationLossModel in DL");
254 <<
" is neither PropagationLossModel nor SpectrumPropagationLossModel");
263 NS_LOG_LOGIC(
this <<
" using a SpectrumPropagationLossModel in UL");
268 NS_LOG_LOGIC(
this <<
" using a PropagationLossModel in UL");
272 <<
" is neither PropagationLossModel nor SpectrumPropagationLossModel");
490 for (
auto i = c.
Begin(); i != c.
End(); ++i)
504 for (
auto i = c.
Begin(); i != c.
End(); ++i)
530 <<
") must be equal to number of carriers (" <<
m_noOfCcs
533 std::map<uint8_t, Ptr<ComponentCarrierBaseStation>> ccMap;
538 cc->SetUlBandwidth(it->second.GetUlBandwidth());
539 cc->SetDlBandwidth(it->second.GetDlBandwidth());
540 cc->SetDlEarfcn(it->second.GetDlEarfcn());
541 cc->SetUlEarfcn(it->second.GetUlEarfcn());
542 cc->SetAsPrimary(it->second.IsPrimary());
545 ccMap[it->first] = cc;
551 "You have to either specify carriers or disable carrier aggregation");
554 for (
auto it = ccMap.begin(); it != ccMap.end(); ++it)
556 NS_LOG_DEBUG(
this <<
"component carrier map size " << (uint16_t)ccMap.size());
562 dlPhy->SetHarqPhyModule(harq);
563 ulPhy->SetHarqPhyModule(harq);
564 phy->SetHarqPhyModule(harq);
568 ulPhy->AddCtrlSinrChunkProcessor(pCtrl);
573 ulPhy->AddDataSinrChunkProcessor(pData);
577 ulPhy->AddInterferenceDataChunkProcessor(pInterf);
585 "MobilityModel needs to be set on node before calling LteHelper::InstallEnbDevice ()");
586 dlPhy->SetMobility(mm);
587 ulPhy->SetMobility(mm);
590 NS_ASSERT_MSG(antenna,
"error in creating the AntennaModel object");
591 dlPhy->SetAntenna(antenna);
592 ulPhy->SetAntenna(antenna);
597 DynamicCast<ComponentCarrierEnb>(it->second)->SetMac(
mac);
598 DynamicCast<ComponentCarrierEnb>(it->second)->SetFfMacScheduler(sched);
599 DynamicCast<ComponentCarrierEnb>(it->second)->SetFfrAlgorithm(ffrAlgorithm);
600 DynamicCast<ComponentCarrierEnb>(it->second)->SetPhy(
phy);
608 rrc->SetLteCcmRrcSapProvider(ccmEnbManager->GetLteCcmRrcSapProvider());
609 ccmEnbManager->SetLteCcmRrcSapUser(rrc->GetLteCcmRrcSapUser());
612 ccmEnbManager->SetNumberOfComponentCarriers(
m_noOfCcs);
614 rrc->ConfigureCarriers(ccMap);
619 rrcProtocol->SetLteEnbRrcSapProvider(rrc->GetLteEnbRrcSapProvider());
620 rrc->SetLteEnbRrcSapUser(rrcProtocol->GetLteEnbRrcSapUser());
621 rrc->AggregateObject(rrcProtocol);
622 rrcProtocol->SetCellId(cellId);
627 rrcProtocol->SetLteEnbRrcSapProvider(rrc->GetLteEnbRrcSapProvider());
628 rrc->SetLteEnbRrcSapUser(rrcProtocol->GetLteEnbRrcSapUser());
629 rrc->AggregateObject(rrcProtocol);
630 rrcProtocol->SetCellId(cellId);
636 rrc->GetAttribute(
"EpsBearerToRlcMapping", epsBearerToRlcMapping);
644 rrc->SetLteHandoverManagementSapProvider(
645 handoverAlgorithm->GetLteHandoverManagementSapProvider());
646 handoverAlgorithm->SetLteHandoverManagementSapUser(rrc->GetLteHandoverManagementSapUser());
657 rrc->SetLteMacSapProvider(ccmEnbManager->GetLteMacSapProvider());
660 for (
auto it = ccMap.begin(); it != ccMap.end(); ++it)
662 DynamicCast<ComponentCarrierEnb>(it->second)
664 ->SetLteEnbCphySapUser(rrc->GetLteEnbCphySapUser(it->first));
665 rrc->SetLteEnbCphySapProvider(
666 DynamicCast<ComponentCarrierEnb>(it->second)->GetPhy()->GetLteEnbCphySapProvider(),
669 rrc->SetLteEnbCmacSapProvider(
670 DynamicCast<ComponentCarrierEnb>(it->second)->GetMac()->GetLteEnbCmacSapProvider(),
672 DynamicCast<ComponentCarrierEnb>(it->second)
674 ->SetLteEnbCmacSapUser(rrc->GetLteEnbCmacSapUser(it->first));
676 DynamicCast<ComponentCarrierEnb>(it->second)->GetPhy()->SetComponentCarrierId(it->first);
677 DynamicCast<ComponentCarrierEnb>(it->second)->GetMac()->SetComponentCarrierId(it->first);
679 DynamicCast<ComponentCarrierEnb>(it->second)
680 ->GetFfMacScheduler()
681 ->SetLteFfrSapProvider(DynamicCast<ComponentCarrierEnb>(it->second)
683 ->GetLteFfrSapProvider());
684 DynamicCast<ComponentCarrierEnb>(it->second)
686 ->SetLteFfrSapUser(DynamicCast<ComponentCarrierEnb>(it->second)
687 ->GetFfMacScheduler()
688 ->GetLteFfrSapUser());
689 rrc->SetLteFfrRrcSapProvider(DynamicCast<ComponentCarrierEnb>(it->second)
691 ->GetLteFfrRrcSapProvider(),
693 DynamicCast<ComponentCarrierEnb>(it->second)
695 ->SetLteFfrRrcSapUser(rrc->GetLteFfrRrcSapUser(it->first));
699 DynamicCast<ComponentCarrierEnb>(it->second)
701 ->SetLteEnbPhySapUser(
702 DynamicCast<ComponentCarrierEnb>(it->second)->GetMac()->GetLteEnbPhySapUser());
703 DynamicCast<ComponentCarrierEnb>(it->second)
705 ->SetLteEnbPhySapProvider(
706 DynamicCast<ComponentCarrierEnb>(it->second)->GetPhy()->GetLteEnbPhySapProvider());
710 DynamicCast<ComponentCarrierEnb>(it->second)
712 ->SetFfMacSchedSapProvider(DynamicCast<ComponentCarrierEnb>(it->second)
713 ->GetFfMacScheduler()
714 ->GetFfMacSchedSapProvider());
715 DynamicCast<ComponentCarrierEnb>(it->second)
717 ->SetFfMacCschedSapProvider(DynamicCast<ComponentCarrierEnb>(it->second)
718 ->GetFfMacScheduler()
719 ->GetFfMacCschedSapProvider());
721 DynamicCast<ComponentCarrierEnb>(it->second)
722 ->GetFfMacScheduler()
723 ->SetFfMacSchedSapUser(
724 DynamicCast<ComponentCarrierEnb>(it->second)->GetMac()->GetFfMacSchedSapUser());
725 DynamicCast<ComponentCarrierEnb>(it->second)
726 ->GetFfMacScheduler()
727 ->SetFfMacCschedSapUser(
728 DynamicCast<ComponentCarrierEnb>(it->second)->GetMac()->GetFfMacCschedSapUser());
731 DynamicCast<ComponentCarrierEnb>(it->second)
733 ->SetLteCcmMacSapUser(ccmEnbManager->GetLteCcmMacSapUser());
734 ccmEnbManager->SetCcmMacSapProviders(
736 DynamicCast<ComponentCarrierEnb>(it->second)->GetMac()->GetLteCcmMacSapProvider());
740 ccmTest = ccmEnbManager->SetMacSapProvider(
742 DynamicCast<ComponentCarrierEnb>(it->second)->GetMac()->GetLteMacSapProvider());
754 auto it = ccMap.begin();
759 PointerValue(DynamicCast<ComponentCarrierEnb>(it->second)->GetFfrAlgorithm()));
764 rrc->SetLteAnrSapProvider(anr->GetLteAnrSapProvider());
765 anr->SetLteAnrSapUser(rrc->GetLteAnrSapUser());
769 for (it = ccMap.begin(); it != ccMap.end(); ++it)
771 Ptr<LteEnbPhy> ccPhy = DynamicCast<ComponentCarrierEnb>(it->second)->GetPhy();
772 ccPhy->SetDevice(dev);
773 ccPhy->GetUlSpectrumPhy()->SetDevice(dev);
774 ccPhy->GetDlSpectrumPhy()->SetDevice(dev);
775 ccPhy->GetUlSpectrumPhy()->SetLtePhyRxDataEndOkCallback(
777 ccPhy->GetUlSpectrumPhy()->SetLtePhyRxCtrlEndOkCallback(
779 ccPhy->GetUlSpectrumPhy()->SetLtePhyUlHarqFeedbackCallback(
788 NS_LOG_WARN(
"DL propagation model does not have a Frequency attribute");
798 NS_LOG_WARN(
"UL propagation model does not have a Frequency attribute");
805 for (it = ccMap.begin(); it != ccMap.end(); ++it)
808 DynamicCast<ComponentCarrierEnb>(it->second)->GetPhy()->GetUlSpectrumPhy());
819 rrc->SetS1SapProvider(enbApp->GetS1SapProvider());
820 enbApp->SetS1SapUser(rrc->GetS1SapUser());
824 x2->SetEpcX2SapUser(rrc->GetEpcX2SapUser());
825 rrc->SetEpcX2SapProvider(x2->GetEpcX2SapProvider());
846 <<
") must be equal to number of carriers (" <<
m_noOfCcs
848 std::map<uint8_t, Ptr<ComponentCarrierUe>> ueCcMap;
854 cc->SetUlBandwidth(it->second.GetUlBandwidth());
855 cc->SetDlBandwidth(it->second.GetDlBandwidth());
856 cc->SetDlEarfcn(it->second.GetDlEarfcn());
857 cc->SetUlEarfcn(it->second.GetUlEarfcn());
858 cc->SetAsPrimary(it->second.IsPrimary());
868 for (
auto it = ueCcMap.begin(); it != ueCcMap.end(); ++it)
876 dlPhy->SetHarqPhyModule(harq);
877 ulPhy->SetHarqPhyModule(harq);
878 phy->SetHarqPhyModule(harq);
882 dlPhy->AddRsPowerChunkProcessor(pRs);
886 dlPhy->AddInterferenceCtrlChunkProcessor(pInterf);
890 dlPhy->AddCtrlSinrChunkProcessor(pCtrl);
894 dlPhy->AddDataSinrChunkProcessor(pData);
904 dlPhy->AddInterferenceDataChunkProcessor(pDataInterf);
918 "MobilityModel needs to be set on node before calling LteHelper::InstallUeDevice ()");
919 dlPhy->SetMobility(mm);
920 ulPhy->SetMobility(mm);
923 NS_ASSERT_MSG(antenna,
"error in creating the AntennaModel object");
924 dlPhy->SetAntenna(antenna);
925 ulPhy->SetAntenna(antenna);
927 it->second->SetPhy(
phy);
933 rrc->SetLteMacSapProvider(ccmUe->GetLteMacSapProvider());
935 rrc->SetLteCcmRrcSapProvider(ccmUe->GetLteCcmRrcSapProvider());
936 ccmUe->SetLteCcmRrcSapUser(rrc->GetLteCcmRrcSapUser());
939 ccmUe->SetNumberOfComponentCarriers(
m_noOfCcs);
942 rrc->InitializeSap();
947 rrcProtocol->SetUeRrc(rrc);
948 rrc->AggregateObject(rrcProtocol);
949 rrcProtocol->SetLteUeRrcSapProvider(rrc->GetLteUeRrcSapProvider());
950 rrc->SetLteUeRrcSapUser(rrcProtocol->GetLteUeRrcSapUser());
955 rrcProtocol->SetUeRrc(rrc);
956 rrc->AggregateObject(rrcProtocol);
957 rrcProtocol->SetLteUeRrcSapProvider(rrc->GetLteUeRrcSapProvider());
958 rrc->SetLteUeRrcSapUser(rrcProtocol->GetLteUeRrcSapUser());
963 rrc->SetUseRlcSm(
false);
967 nas->SetAsSapProvider(rrc->GetAsSapProvider());
968 rrc->SetAsSapUser(nas->GetAsSapUser());
970 for (
auto it = ueCcMap.begin(); it != ueCcMap.end(); ++it)
972 rrc->SetLteUeCmacSapProvider(it->second->GetMac()->GetLteUeCmacSapProvider(), it->first);
973 it->second->GetMac()->SetLteUeCmacSapUser(rrc->GetLteUeCmacSapUser(it->first));
974 it->second->GetMac()->SetComponentCarrierId(it->first);
976 it->second->GetPhy()->SetLteUeCphySapUser(rrc->GetLteUeCphySapUser(it->first));
977 rrc->SetLteUeCphySapProvider(it->second->GetPhy()->GetLteUeCphySapProvider(), it->first);
978 it->second->GetPhy()->SetComponentCarrierId(it->first);
979 it->second->GetPhy()->SetLteUePhySapUser(it->second->GetMac()->GetLteUePhySapUser());
980 it->second->GetMac()->SetLteUePhySapProvider(
981 it->second->GetPhy()->GetLteUePhySapProvider());
984 ccmUe->SetComponentCarrierMacSapProviders(it->first,
985 it->second->GetMac()->GetLteMacSapProvider());
998 dev->SetCcMap(ueCcMap);
1001 dev->SetAttribute(
"LteUeComponentCarrierManager",
PointerValue(ccmUe));
1006 for (
auto it = ueCcMap.begin(); it != ueCcMap.end(); ++it)
1009 ccPhy->SetDevice(dev);
1010 ccPhy->GetUlSpectrumPhy()->SetDevice(dev);
1011 ccPhy->GetDlSpectrumPhy()->SetDevice(dev);
1012 ccPhy->GetDlSpectrumPhy()->SetLtePhyRxDataEndOkCallback(
1014 ccPhy->GetDlSpectrumPhy()->SetLtePhyRxCtrlEndOkCallback(
1016 ccPhy->GetDlSpectrumPhy()->SetLtePhyRxPssCallback(
1018 ccPhy->GetDlSpectrumPhy()->SetLtePhyDlHarqFeedbackCallback(
1022 nas->SetDevice(dev);
1042 for (
auto i = ueDevices.
Begin(); i != ueDevices.
End(); ++i)
1055 NS_FATAL_ERROR(
"This function is not valid without properly configured EPC");
1061 NS_FATAL_ERROR(
"The passed NetDevice must be an LteUeNetDevice");
1067 uint32_t dlEarfcn = ueLteDevice->GetDlEarfcn();
1068 ueNas->StartCellSelection(dlEarfcn);
1075 ueLteDevice->GetImsi(),
1084 for (
auto i = ueDevices.
Begin(); i != ueDevices.
End(); ++i)
1101 DynamicCast<ComponentCarrierEnb>(enbLteDevice->GetCcMap().at(componentCarrierId));
1102 ueNas->Connect(componentCarrier->GetCellId(), componentCarrier->GetDlEarfcn());
1108 ueLteDevice->GetImsi(),
1125 for (
auto i = ueDevices.
Begin(); i != ueDevices.
End(); ++i)
1136 Vector uepos = ueDevice->GetNode()->GetObject<
MobilityModel>()->GetPosition();
1137 double minDistance = std::numeric_limits<double>::infinity();
1139 for (
auto i = enbDevices.
Begin(); i != enbDevices.
End(); ++i)
1141 Vector enbpos = (*i)->GetNode()->GetObject<
MobilityModel>()->GetPosition();
1143 if (distance < minDistance)
1145 minDistance = distance;
1146 closestEnbDevice = *i;
1150 Attach(ueDevice, closestEnbDevice);
1159 for (
auto i = ueDevices.
Begin(); i != ueDevices.
End(); ++i)
1174 uint64_t imsi = ueDevice->GetObject<
LteUeNetDevice>()->GetImsi();
1175 uint8_t bearerId =
m_epcHelper->ActivateEpsBearer(ueDevice, imsi, tft, bearer);
1210 std::string context,
1225 void ActivateDrb(uint64_t imsi, uint16_t cellId, uint16_t rnti);
1250 m_ueDevice(ueDevice),
1258 std::string context,
1264 a->ActivateDrb(imsi, cellId, rnti);
1275 uint16_t rnti = ueRrc->GetRnti();
1287 enbRrc->GetS1SapUser()->DataRadioBearerSetupRequest(
params);
1305 std::ostringstream path;
1306 path <<
"/NodeList/" << enbLteDevice->
GetNode()->
GetId() <<
"/DeviceList/"
1307 << enbLteDevice->
GetIfIndex() <<
"/LteEnbRrc/ConnectionEstablished";
1319 for (
auto i = enbNodes.
Begin(); i != enbNodes.
End(); ++i)
1321 for (
auto j = i + 1; j != enbNodes.
End(); ++j)
1345 "Handover requires the use of the EPC - did you forget to call "
1346 "LteHelper::SetEpcHelper () ?");
1347 uint16_t targetCellId = targetEnbDev->GetObject<
LteEnbNetDevice>()->GetCellId();
1360 uint16_t targetCellId)
1364 "Handover requires the use of the EPC - did you forget to call "
1365 "LteHelper::SetEpcHelper () ?");
1377 uint16_t targetCellId)
1382 uint16_t rnti = ueDev->GetObject<
LteUeNetDevice>()->GetRrc()->GetRnti();
1383 sourceRrc->SendHandoverRequest(rnti, targetCellId);
1393 "Dedicated EPS bearers cannot be de-activated when the EPC is not used");
1395 "Default bearer cannot be de-activated until and unless and UE is released");
1408 uint64_t imsi = ueDevice->GetObject<
LteUeNetDevice>()->GetImsi();
1409 uint16_t rnti = ueDevice->GetObject<
LteUeNetDevice>()->GetRrc()->GetRnti();
1413 enbRrc->DoSendReleaseDataRadioBearer(imsi, rnti, bearerId);
1426 ccHelper->SetNumberOfComponentCarriers(
m_noOfCcs);
1427 ccHelper->SetUlEarfcn(ulEarfcn);
1428 ccHelper->SetDlEarfcn(dlEarfcn);
1429 ccHelper->SetDlBandwidth(dlbw);
1430 ccHelper->SetUlBandwidth(ulbw);
1439 for (
auto i = ueDevices.
Begin(); i != ueDevices.
End(); ++i)
1561 "please make sure that LteHelper::EnableRlcTraces is called at most once");
1562 m_rlcStats = CreateObject<RadioBearerStatsCalculator>(
"RLC");
1569 int64_t currentStream = stream;
1575 currentStream += tflm->AssignStreams(currentStream);
1580 for (
auto i = c.
Begin(); i != c.
End(); ++i)
1586 std::map<uint8_t, Ptr<ComponentCarrierBaseStation>> tmpMap = lteEnb->
GetCcMap();
1587 auto it = tmpMap.begin();
1589 DynamicCast<ComponentCarrierEnb>(it->second)->GetPhy()->GetDownlinkSpectrumPhy();
1591 DynamicCast<ComponentCarrierEnb>(it->second)->GetPhy()->GetUplinkSpectrumPhy();
1592 currentStream += dlPhy->AssignStreams(currentStream);
1593 currentStream += ulPhy->AssignStreams(currentStream);
1598 std::map<uint8_t, Ptr<ComponentCarrierUe>> tmpMap = lteUe->GetCcMap();
1599 auto it = tmpMap.begin();
1603 currentStream += dlPhy->AssignStreams(currentStream);
1604 currentStream += ulPhy->AssignStreams(currentStream);
1605 currentStream += ueMac->AssignStreams(currentStream);
1610 currentStream +=
m_epcHelper->AssignStreams(currentStream);
1612 return (currentStream - stream);
1630 "/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission",
1638 "/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission",
1646 "/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception",
1654 "/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception",
1669 Config::Connect(
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
1677 Config::Connect(
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
1686 "/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr",
1694 Config::Connect(
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr",
1696 Config::Connect(
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportInterference",
1710 "please make sure that LteHelper::EnablePdcpTraces is called at most once");
1711 m_pdcpStats = CreateObject<RadioBearerStatsCalculator>(
"PDCP");
Hold a value for an Attribute.
This class can be used to hold variables of floating point type such as 'double' or 'float'.
DrbActivatior allows user to activate bearers for UEs when EPC is not used.
EpsBearer m_bearer
Configuration of bearer which will be activated.
uint64_t m_imsi
imsi the unique UE identifier
DrbActivator(Ptr< NetDevice > ueDevice, EpsBearer bearer)
DrbActivator Constructor.
static void ActivateCallback(Ptr< DrbActivator > a, std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti)
Function hooked to the Enb RRC Connection Established trace source Fired upon successful RRC connecti...
Ptr< NetDevice > m_ueDevice
UeNetDevice for which bearer will be activated.
void ActivateDrb(uint64_t imsi, uint16_t cellId, uint16_t rnti)
Procedure firstly checks if bearer was not activated, if IMSI from trace source equals configured one...
bool m_active
Bearer can be activated only once.
Hold variables of type enum.
This application is installed inside eNBs and provides the bridge functionality for user data plane p...
static Ptr< EpcTft > Default()
creates a TFT matching any traffic
This entity is installed inside an eNB and provides the functionality for the X2 interface.
This class contains the specification of EPS Bearers.
@ NGBR_VIDEO_TCP_DEFAULT
Non-GBR TCP-based Video (Buffered Streaming, e.g., www, e-mail...)
This abstract base class identifies the interface by means of which the helper object can plug on the...
static TypeId GetTypeId()
Get the type ID.
static TypeId GetTypeId()
Get the type ID.
The class implements Component Carrier Manager (CCM) that operates using the Component Carrier Manage...
The eNodeB device implementation.
std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > GetCcMap() const
uint16_t GetDlBandwidth() const
uint32_t GetUlEarfcn() const
uint32_t GetDlEarfcn() const
void SetCcMap(std::map< uint8_t, Ptr< ComponentCarrierBaseStation >> ccm)
Set the ComponentCarrier Map of the Enb.
uint16_t GetUlBandwidth() const
std::vector< uint16_t > GetCellIds() const
static TypeId GetTypeId()
Get the type ID.
uint16_t GetCellId() const
virtual void ReportUlHarqFeedback(UlInfoListElement_s mes)
Report the uplink HARQ feedback generated by LteSpectrumPhy to MAC.
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage >> msgList)
PhySpectrum received a new list of LteControlMessage.
void GenerateCtrlCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Ctrl frame
void GenerateDataCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs)
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
void ReportInterference(const SpectrumValue &interf) override
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
The abstract base class of a Frequency Reuse algorithm.
The abstract base class of a handover algorithm that operates using the Handover Management SAP inter...
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
Ptr< SpectrumPropagationLossModel > m_fadingModel
The fading model used in both the downlink and uplink channels.
Ptr< Object > m_uplinkPathlossModel
The path loss model used in the uplink channel.
void EnableLogComponents()
Enables full-blown logging for major components of the LENA architecture.
Ptr< SpectrumChannel > GetUplinkSpectrumChannel() const
void SetEnbComponentCarrierManagerType(std::string type)
Set the type of carrier component algorithm to be used by eNodeB devices.
void EnableUlRxPhyTraces()
Enable trace sinks for UL reception PHY layer.
ObjectFactory m_schedulerFactory
Factory of MAC scheduler object.
void SetUeAntennaModelType(std::string type)
Set the type of antenna model to be used by UE devices.
ObjectFactory m_ffrAlgorithmFactory
Factory of FFR (frequency reuse) algorithm object.
ObjectFactory m_channelFactory
Factory of both the downlink and uplink LTE channels.
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 ...
Ptr< RadioBearerStatsCalculator > GetRlcStats()
ObjectFactory m_handoverAlgorithmFactory
Factory of handover algorithm object.
std::string m_fadingModelType
Name of fading model type, e.g., "ns3::TraceFadingLossModel".
Ptr< RadioBearerStatsCalculator > GetPdcpStats()
void EnableDlMacTraces()
Enable trace sinks for DL MAC layer.
ObjectFactory m_enbComponentCarrierManagerFactory
Factory of enb component carrier manager object.
void SetFadingModel(std::string type)
Set the type of fading model to be used in both DL and UL.
void DoDeActivateDedicatedEpsBearer(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice, uint8_t bearerId)
The actual function to trigger a manual bearer de-activation.
std::string GetEnbComponentCarrierManagerType() const
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Ptr< SpectrumChannel > GetDownlinkSpectrumChannel() const
std::map< uint8_t, ComponentCarrier > m_componentCarrierPhyParams
This contains all the information about each component carrier.
Ptr< MacStatsCalculator > m_macStats
Container of MAC layer statistics.
void SetHandoverAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the handover algorithm to be created.
void EnablePhyTraces()
Enable trace sinks for PHY layer.
void DeActivateDedicatedEpsBearer(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice, uint8_t bearerId)
Manually trigger dedicated bearer de-activation at specific simulation time.
void HandoverRequest(Time hoTime, Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
Manually trigger an X2-based handover.
Ptr< SpectrumChannel > m_downlinkChannel
This function create the component carrier based on provided configuration parameters.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
void SetUeComponentCarrierManagerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the ue component carrier manager to be created.
uint16_t m_cellIdCounter
Keep track of the number of cell ID allocated.
std::string GetFfrAlgorithmType() const
void SetHandoverAlgorithmType(std::string type)
Set the type of handover algorithm to be used by eNodeB devices.
void SetPathlossModelType(TypeId type)
Set the type of path loss model to be used for both DL and UL channels.
void EnablePdcpTraces()
Enable trace sinks for PDCP layer.
Ptr< PhyTxStatsCalculator > m_phyTxStats
Container of PHY layer statistics related to transmission.
void SetEnbAntennaModelType(std::string type)
Set the type of antenna model to be used by eNodeB devices.
void EnableTraces()
Enables trace sinks for PHY, MAC, RLC and PDCP.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
void DoHandoverRequest(Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, uint16_t targetCellId)
The actual function to trigger a manual handover.
bool m_isAnrEnabled
The AnrEnabled attribute.
void SetEnbComponentCarrierManagerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the enb component carrier manager to be created.
void DoInitialize() override
Initialize() implementation.
Ptr< PhyRxStatsCalculator > m_phyRxStats
Container of PHY layer statistics related to reception.
void SetSpectrumChannelType(std::string type)
Set the type of spectrum channel to be used in both DL and UL.
void EnableDlRxPhyTraces()
Enable trace sinks for DL reception PHY layer.
ObjectFactory m_pathlossModelFactory
Factory of path loss model object.
bool m_fadingStreamsAssigned
True if a random variable stream number has been assigned for the fading model.
std::string GetUeComponentCarrierManagerType() const
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
RadioBearerStatsConnector m_radioBearerStatsConnector
Connects RLC and PDCP statistics containers to appropriate trace sources.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
void DoDispose() override
Destructor implementation.
ObjectFactory m_enbNetDeviceFactory
Factory of LteEnbNetDevice objects.
void EnableUlMacTraces()
Enable trace sinks for UL MAC layer.
std::string GetHandoverAlgorithmType() const
Ptr< PhyStatsCalculator > m_phyStats
Container of PHY layer statistics.
void EnableUlPhyTraces()
Enable trace sinks for UL PHY layer.
void EnableDlTxPhyTraces()
Enable trace sinks for DL transmission PHY layer.
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the path loss models to be created.
void EnableRlcTraces()
Enable trace sinks for RLC layer.
bool m_useIdealRrc
The UseIdealRrc attribute.
ObjectFactory m_ueComponentCarrierManagerFactory
Factory of ue component carrier manager object.
void DoComponentCarrierConfigure(uint32_t ulEarfcn, uint32_t dlEarfcn, uint16_t ulbw, uint16_t dlbw)
Configure the component carriers.
Ptr< Object > m_downlinkPathlossModel
The path loss model used in the downlink channel.
Ptr< RadioBearerStatsCalculator > m_pdcpStats
Container of PDCP layer statistics.
void ChannelModelInitialization()
Function that performs a channel model initialization of all component carriers.
void EnableUlTxPhyTraces()
Enable trace sinks for UL transmission PHY layer.
bool m_usePdschForCqiGeneration
The UsePdschForCqiGeneration attribute.
void SetUeAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the UE antenna model to be created.
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB antenna model to be created.
static TypeId GetTypeId()
Register this type.
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
bool m_useCa
The UseCa attribute.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
uint64_t m_imsiCounter
Keep track of the number of IMSI allocated.
ObjectFactory m_ueNetDeviceFactory
Factory for LteUeNetDevice objects.
ObjectFactory m_ueAntennaModelFactory
Factory of antenna object for UE.
Ptr< SpectrumChannel > m_uplinkChannel
The uplink LTE channel used in the simulation.
void EnableMacTraces()
Enable trace sinks for MAC layer.
void SetSpectrumChannelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the spectrum channel to be created (both DL and UL).
void EnableDlPhyTraces()
Enable trace sinks for DL PHY layer.
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
void SetUeDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the UE devices (LteUeNetDevice) to be created.
uint16_t m_noOfCcs
Number of component carriers that will be installed by default at eNodeB and UE devices.
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used.
void SetFadingModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the fading model to be created (both DL and UL).
Ptr< EpcHelper > m_epcHelper
Helper which provides implementation of core network.
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...
uint8_t ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
ObjectFactory m_enbAntennaModelFactory
Factory of antenna object for eNodeB.
Ptr< RadioBearerStatsCalculator > m_rlcStats
Container of RLC layer statistics.
std::string GetSchedulerType() const
Ptr< NetDevice > InstallSingleUeDevice(Ptr< Node > n)
Create a UE device (LteUeNetDevice) on the given node.
Ptr< NetDevice > InstallSingleEnbDevice(Ptr< Node > n)
Create an eNodeB device (LteEnbNetDevice) on the given node.
void SetUeComponentCarrierManagerType(std::string type)
Set the type of Component Carrier Manager to be used by Ue devices.
ObjectFactory m_fadingModelFactory
Factory of fading model object for both the downlink and uplink channels.
void Receive(Ptr< Packet > p)
receive a packet from the lower layers in order to forward it to the upper layers
void SetNode(Ptr< Node > node) override
Ptr< Node > GetNode() const override
uint32_t GetIfIndex() const override
void UpdateSinrPerceived(const SpectrumValue &sinr)
static double GetCarrierFrequency(uint32_t earfcn)
Calculates the carrier frequency from the E-UTRA Absolute Radio Frequency Channel Number (EARFCN) acc...
The abstract base class of a Component Carrier Manager* for UE that operates using the component carr...
The LteUeNetDevice class implements the UE net device.
static TypeId GetTypeId()
Get the type ID.
virtual void ReportDataInterference(const SpectrumValue &interf)
Create the mixed CQI report.
virtual void ReceivePss(uint16_t cellId, Ptr< SpectrumValue > p)
Receive PSS function.
void ReportRsReceivedPower(const SpectrumValue &power) override
generate a report based on the linear RS power perceived during CTRL frame NOTE: used only by UE for ...
void GenerateCtrlCqiReport(const SpectrumValue &sinr) override
generate a CQI report based on the given SINR of Ctrl frame
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage >> msgList)
Receive LTE control message list function.
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
virtual void EnqueueDlHarqFeedback(DlInfoListElement_s mes)
Enqueue the downlink HARQ feedback generated by LteSpectrumPhy.
void ReportInterference(const SpectrumValue &interf) override
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
virtual void GenerateMixedCqiReport(const SpectrumValue &sinr)
Create the mixed CQI report.
static Mac64Address Allocate()
Allocate a new Mac64Address.
static void DlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, DlSchedulingCallbackInfo dlSchedulingCallbackInfo)
Trace sink for the ns3::LteEnbMac::DlScheduling trace source.
static void UlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, uint32_t frameNo, uint32_t subframeNo, uint16_t rnti, uint8_t mcs, uint16_t size, uint8_t componentCarrierId)
Trace sink for the ns3::LteEnbMac::UlScheduling trace source.
Keep track of the current position and velocity of an object.
static TypeId GetTypeId()
Get the type ID.
holds a vector of ns3::NetDevice pointers
uint32_t GetN() const
Get the number of Ptr<NetDevice> stored in this container.
Iterator Begin() const
Get an iterator which refers to the first NetDevice in the container.
Iterator End() const
Get an iterator which indicates past-the-last NetDevice in the container.
keep track of a set of node pointers.
Iterator End() const
Get an iterator which indicates past-the-last Node in the container.
Iterator Begin() const
Get an iterator which refers to the first Node in the container.
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
Ptr< Application > GetApplication(uint32_t index) const
Retrieve the index-th Application associated to this node.
bool SetAttributeFailSafe(std::string name, const AttributeValue &value)
Set a single attribute without raising errors.
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
Ptr< Object > Create() const
Create an Object instance of the configured TypeId.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
TypeId GetTypeId() const
Get the TypeId which will be created by this ObjectFactory.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
A base class which provides memory management and object aggregation.
void Initialize()
Invoke DoInitialize on all Objects aggregated to this one.
friend class ObjectFactory
Friends.
Ptr< T > GetObject() const
Get a pointer to the requested aggregated Object.
virtual void DoInitialize()
Initialize() implementation.
virtual void DoDispose()
Destructor implementation.
static void UlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
static void DlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
void ReportUeSinr(uint16_t cellId, uint64_t imsi, uint16_t rnti, double sinrLinear, uint8_t componentCarrierId)
Notifies the stats calculator that an UE SINR report has occurred.
void ReportInterference(uint16_t cellId, Ptr< SpectrumValue > interference)
Notifies the stats calculator that an interference report has occurred.
static void ReportCurrentCellRsrpSinrCallback(Ptr< PhyStatsCalculator > phyStats, std::string path, uint16_t cellId, uint16_t rnti, double rsrp, double sinr, uint8_t componentCarrierId)
trace sink
static void DlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
static void UlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
Hold objects of type Ptr<T>.
Models the propagation loss through a transmission medium.
Smart pointer class similar to boost::intrusive_ptr.
void EnablePdcpStats(Ptr< RadioBearerStatsCalculator > pdcpStats)
Enables trace sinks for PDCP layer.
void EnableRlcStats(Ptr< RadioBearerStatsCalculator > rlcStats)
Enables trace sinks for RLC layer.
A template-based reference counting class.
static EventId Schedule(const Time &delay, FUNC f, Ts &&... args)
Schedule an event to expire after delay.
Defines the interface for spectrum-aware channel implementations.
spectrum-aware propagation loss model
Hold variables of type string.
Simulation virtual time values and global simulation resolution.
fading loss model based on precalculated fading traces
a unique identifier for an interface.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
std::string GetName() const
Get the name.
@ CONNECTION_RECONFIGURATION
Hold an unsigned integer type.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#define NS_ASSERT_MSG(condition, message)
At runtime, in debugging builds, if this condition is not true, the program prints the message to out...
void Connect(std::string path, const CallbackBase &cb)
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
auto MakeBoundCallback(R(*fnPtr)(Args...), BArgs &&... bargs)
Make Callbacks with varying number of bound arguments.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Ptr< const AttributeChecker > MakeBooleanChecker()
void LogComponentEnable(const std::string &name, LogLevel level)
Enable the logging output associated with that log component.
Callback< R, Args... > MakeCallback(R(T::*memPtr)(Args...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Ptr< const AttributeChecker > MakeTypeIdChecker()
constexpr uint32_t MIN_NO_CC
Minimum number of carrier components allowed by 3GPP up to R13.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
constexpr uint32_t MAX_NO_CC
Maximum number of carrier components allowed by 3GPP up to R13.
Ptr< const AttributeAccessor > MakeTypeIdAccessor(T1 a1)
@ LOG_LEVEL_ALL
Print everything.
@ LOG_PREFIX_FUNC
Prefix all trace prints with function.
@ LOG_PREFIX_TIME
Prefix all trace prints with simulation time.
@ LOG_PREFIX_NODE
Prefix all trace prints with simulation node.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
double CalculateDistance(const Vector3D &a, const Vector3D &b)
Ptr< const AttributeChecker > MakeStringChecker()
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
void LogComponentEnableAll(LogLevel level)
Enable the logging output for all registered log components.
params
Fit Fluctuating Two Ray model to the 3GPP TR 38.901 using the Anderson-Darling goodness-of-fit ##.
Parameters passed to DataRadioBearerSetupRequest ()