25 #include <ns3/string.h>
27 #include <ns3/abort.h>
28 #include <ns3/pointer.h>
29 #include <ns3/lte-enb-rrc.h>
30 #include <ns3/epc-ue-nas.h>
31 #include <ns3/epc-enb-application.h>
32 #include <ns3/lte-ue-rrc.h>
33 #include <ns3/lte-ue-mac.h>
34 #include <ns3/lte-enb-mac.h>
35 #include <ns3/lte-enb-net-device.h>
36 #include <ns3/lte-enb-phy.h>
37 #include <ns3/lte-ue-phy.h>
38 #include <ns3/lte-spectrum-phy.h>
39 #include <ns3/lte-chunk-processor.h>
40 #include <ns3/multi-model-spectrum-channel.h>
41 #include <ns3/friis-spectrum-propagation-loss.h>
42 #include <ns3/trace-fading-loss-model.h>
43 #include <ns3/isotropic-antenna-model.h>
44 #include <ns3/lte-ue-net-device.h>
45 #include <ns3/ff-mac-scheduler.h>
46 #include <ns3/lte-ffr-algorithm.h>
47 #include <ns3/lte-handover-algorithm.h>
48 #include <ns3/lte-enb-component-carrier-manager.h>
49 #include <ns3/lte-ue-component-carrier-manager.h>
50 #include <ns3/lte-anr.h>
51 #include <ns3/lte-rlc.h>
52 #include <ns3/lte-rlc-um.h>
53 #include <ns3/lte-rlc-am.h>
54 #include <ns3/epc-enb-s1-sap.h>
55 #include <ns3/lte-rrc-protocol-ideal.h>
56 #include <ns3/lte-rrc-protocol-real.h>
57 #include <ns3/mac-stats-calculator.h>
58 #include <ns3/phy-stats-calculator.h>
59 #include <ns3/phy-tx-stats-calculator.h>
60 #include <ns3/phy-rx-stats-calculator.h>
61 #include <ns3/epc-helper.h>
63 #include <ns3/buildings-propagation-loss-model.h>
64 #include <ns3/lte-spectrum-value-helper.h>
65 #include <ns3/epc-x2.h>
66 #include <ns3/object-map.h>
67 #include <ns3/object-factory.h>
76 : m_fadingStreamsAssigned (false),
93 m_phyStats = CreateObject<PhyStatsCalculator> ();
96 m_macStats = CreateObject<MacStatsCalculator> ();
112 .AddConstructor<LteHelper> ()
113 .AddAttribute (
"Scheduler",
114 "The type of scheduler to be used for eNBs. "
115 "The allowed values for this attributes are the type names "
116 "of any class inheriting from ns3::FfMacScheduler.",
121 .AddAttribute (
"FfrAlgorithm",
122 "The type of FFR algorithm to be used for eNBs. "
123 "The allowed values for this attributes are the type names "
124 "of any class inheriting from ns3::LteFfrAlgorithm.",
129 .AddAttribute (
"HandoverAlgorithm",
130 "The type of handover algorithm to be used for eNBs. "
131 "The allowed values for this attributes are the type names "
132 "of any class inheriting from ns3::LteHandoverAlgorithm.",
137 .AddAttribute (
"PathlossModel",
138 "The type of pathloss model to be used. "
139 "The allowed values for this attributes are the type names "
140 "of any class inheriting from ns3::PropagationLossModel.",
144 .AddAttribute (
"FadingModel",
145 "The type of fading model to be used."
146 "The allowed values for this attributes are the type names "
147 "of any class inheriting from ns3::SpectrumPropagationLossModel."
148 "If the type is set to an empty string, no fading model is used.",
152 .AddAttribute (
"UseIdealRrc",
153 "If true, LteRrcProtocolIdeal will be used for RRC signaling. "
154 "If false, LteRrcProtocolReal will be used.",
158 .AddAttribute (
"AnrEnabled",
159 "Activate or deactivate Automatic Neighbour Relation function",
163 .AddAttribute (
"UsePdschForCqiGeneration",
164 "If true, DL-CQI will be calculated from PDCCH as signal and PDSCH as interference "
165 "If false, DL-CQI will be calculated from PDCCH as signal and PDCCH as interference ",
169 .AddAttribute (
"EnbComponentCarrierManager",
170 "The type of Component Carrier Manager to be used for eNBs. "
171 "The allowed values for this attributes are the type names "
172 "of any class inheriting ns3::LteEnbComponentCarrierManager.",
177 .AddAttribute (
"UeComponentCarrierManager",
178 "The type of Component Carrier Manager to be used for UEs. "
179 "The allowed values for this attributes are the type names "
180 "of any class inheriting ns3::LteUeComponentCarrierManager.",
181 StringValue (
"ns3::SimpleUeComponentCarrierManager"),
185 .AddAttribute (
"UseCa",
186 "If true, Carrier Aggregation feature is enabled and a valid Component Carrier Map is expected."
187 "If false, single carrier simulation.",
191 .AddAttribute (
"NumberOfComponentCarriers",
192 "Set the number of Component carrier to use "
193 "If it is more than one and m_useCa is false, it will raise an error ",
237 NS_LOG_LOGIC (
this <<
" using a SpectrumPropagationLossModel in DL");
242 NS_LOG_LOGIC (
this <<
" using a PropagationLossModel in DL");
252 NS_LOG_LOGIC (
this <<
" using a SpectrumPropagationLossModel in UL");
257 NS_LOG_LOGIC (
this <<
" using a PropagationLossModel in UL");
517 ") must be equal to number of carriers (" <<
521 std::map<uint8_t,Ptr<ComponentCarrierBaseStation> > ccMap;
527 cc->SetUlBandwidth (it->second.GetUlBandwidth ());
528 cc->SetDlBandwidth (it->second.GetDlBandwidth ());
529 cc->SetDlEarfcn (it->second.GetDlEarfcn ());
530 cc->SetUlEarfcn (it->second.GetUlEarfcn ());
531 cc->SetAsPrimary (it->second.IsPrimary ());
534 ccMap [it->first] = cc;
539 NS_ABORT_MSG_IF (
m_useCa && ccMap.size()<2,
"You have to either specify carriers or disable carrier aggregation");
542 for (
auto it = ccMap.begin (); it != ccMap.end (); ++it)
544 NS_LOG_DEBUG (
this <<
"component carrier map size " << (uint16_t) ccMap.size ());
550 dlPhy->SetHarqPhyModule (harq);
551 ulPhy->SetHarqPhyModule (harq);
552 phy->SetHarqPhyModule (harq);
556 ulPhy->AddCtrlSinrChunkProcessor (pCtrl);
561 ulPhy->AddDataSinrChunkProcessor (pData);
565 ulPhy->AddInterferenceDataChunkProcessor (pInterf);
571 NS_ASSERT_MSG (mm,
"MobilityModel needs to be set on node before calling LteHelper::InstallEnbDevice ()");
572 dlPhy->SetMobility (mm);
573 ulPhy->SetMobility (mm);
576 NS_ASSERT_MSG (antenna,
"error in creating the AntennaModel object");
577 dlPhy->SetAntenna (antenna);
578 ulPhy->SetAntenna (antenna);
583 DynamicCast<ComponentCarrierEnb> (it->second)->SetMac (
mac);
584 DynamicCast<ComponentCarrierEnb> (it->second)->SetFfMacScheduler (sched);
585 DynamicCast<ComponentCarrierEnb> (it->second)->SetFfrAlgorithm (ffrAlgorithm);
586 DynamicCast<ComponentCarrierEnb> (it->second)->SetPhy (
phy);
593 rrc->SetLteCcmRrcSapProvider (ccmEnbManager->GetLteCcmRrcSapProvider ());
594 ccmEnbManager->SetLteCcmRrcSapUser (rrc->GetLteCcmRrcSapUser ());
597 ccmEnbManager->SetNumberOfComponentCarriers (
m_noOfCcs);
599 rrc->ConfigureCarriers (ccMap);
604 rrcProtocol->SetLteEnbRrcSapProvider (rrc->GetLteEnbRrcSapProvider ());
605 rrc->SetLteEnbRrcSapUser (rrcProtocol->GetLteEnbRrcSapUser ());
606 rrc->AggregateObject (rrcProtocol);
607 rrcProtocol->SetCellId (cellId);
612 rrcProtocol->SetLteEnbRrcSapProvider (rrc->GetLteEnbRrcSapProvider ());
613 rrc->SetLteEnbRrcSapUser (rrcProtocol->GetLteEnbRrcSapUser ());
614 rrc->AggregateObject (rrcProtocol);
615 rrcProtocol->SetCellId (cellId);
621 rrc->GetAttribute (
"EpsBearerToRlcMapping", epsBearerToRlcMapping);
629 rrc->SetLteHandoverManagementSapProvider (handoverAlgorithm->GetLteHandoverManagementSapProvider ());
630 handoverAlgorithm->SetLteHandoverManagementSapUser (rrc->GetLteHandoverManagementSapUser ());
640 rrc->SetLteMacSapProvider (ccmEnbManager->GetLteMacSapProvider ());
643 for (
auto it = ccMap.begin (); it != ccMap.end (); ++it)
645 DynamicCast<ComponentCarrierEnb> (it->second)->GetPhy ()->SetLteEnbCphySapUser (rrc->GetLteEnbCphySapUser (it->first));
646 rrc->SetLteEnbCphySapProvider (DynamicCast<ComponentCarrierEnb> (it->second)->GetPhy ()->GetLteEnbCphySapProvider (), it->first);
648 rrc->SetLteEnbCmacSapProvider (DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->GetLteEnbCmacSapProvider (),it->first );
649 DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->SetLteEnbCmacSapUser (rrc->GetLteEnbCmacSapUser (it->first));
651 DynamicCast<ComponentCarrierEnb> (it->second)->GetPhy ()->SetComponentCarrierId (it->first);
652 DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->SetComponentCarrierId (it->first);
654 DynamicCast<ComponentCarrierEnb> (it->second)->GetFfMacScheduler ()->SetLteFfrSapProvider (DynamicCast<ComponentCarrierEnb> (it->second)->GetFfrAlgorithm ()->GetLteFfrSapProvider ());
655 DynamicCast<ComponentCarrierEnb> (it->second)->GetFfrAlgorithm ()->SetLteFfrSapUser (DynamicCast<ComponentCarrierEnb> (it->second)->GetFfMacScheduler ()->GetLteFfrSapUser ());
656 rrc->SetLteFfrRrcSapProvider (DynamicCast<ComponentCarrierEnb> (it->second)->GetFfrAlgorithm ()->GetLteFfrRrcSapProvider (), it->first);
657 DynamicCast<ComponentCarrierEnb> (it->second)->GetFfrAlgorithm ()->SetLteFfrRrcSapUser (rrc->GetLteFfrRrcSapUser (it->first));
661 DynamicCast<ComponentCarrierEnb> (it->second)->GetPhy ()->SetLteEnbPhySapUser (DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->GetLteEnbPhySapUser ());
662 DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->SetLteEnbPhySapProvider (DynamicCast<ComponentCarrierEnb> (it->second)->GetPhy ()->GetLteEnbPhySapProvider ());
666 DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->SetFfMacSchedSapProvider (DynamicCast<ComponentCarrierEnb> (it->second)->GetFfMacScheduler ()->GetFfMacSchedSapProvider ());
667 DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->SetFfMacCschedSapProvider (DynamicCast<ComponentCarrierEnb> (it->second)->GetFfMacScheduler ()->GetFfMacCschedSapProvider ());
669 DynamicCast<ComponentCarrierEnb> (it->second)->GetFfMacScheduler ()->SetFfMacSchedSapUser (DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->GetFfMacSchedSapUser ());
670 DynamicCast<ComponentCarrierEnb> (it->second)->GetFfMacScheduler ()->SetFfMacCschedSapUser (DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->GetFfMacCschedSapUser ());
673 DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->SetLteCcmMacSapUser (ccmEnbManager->GetLteCcmMacSapUser ());
674 ccmEnbManager->SetCcmMacSapProviders (it->first, DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->GetLteCcmMacSapProvider ());
677 ccmTest = ccmEnbManager->SetMacSapProvider (it->first, DynamicCast<ComponentCarrierEnb> (it->second)->GetMac ()->GetLteMacSapProvider());
679 if (ccmTest ==
false)
691 std::map<uint8_t,Ptr<ComponentCarrierBaseStation> >::iterator it = ccMap.begin ();
694 dev->
SetAttribute (
"LteFfrAlgorithm",
PointerValue (DynamicCast<ComponentCarrierEnb> (it->second)->GetFfrAlgorithm ()));
699 rrc->SetLteAnrSapProvider (anr->GetLteAnrSapProvider ());
700 anr->SetLteAnrSapUser (rrc->GetLteAnrSapUser ());
704 for (it = ccMap.begin (); it != ccMap.end (); ++it)
706 Ptr<LteEnbPhy> ccPhy = DynamicCast<ComponentCarrierEnb> (it->second)->GetPhy ();
707 ccPhy->SetDevice (dev);
708 ccPhy->GetUlSpectrumPhy ()->SetDevice (dev);
709 ccPhy->GetDlSpectrumPhy ()->SetDevice (dev);
719 NS_LOG_WARN (
"DL propagation model does not have a Frequency attribute");
728 NS_LOG_WARN (
"UL propagation model does not have a Frequency attribute");
735 for (it = ccMap.begin (); it != ccMap.end (); ++it)
737 m_uplinkChannel->AddRx (DynamicCast<ComponentCarrierEnb>(it->second)->GetPhy ()->GetUlSpectrumPhy ());
745 NS_ASSERT_MSG (enbApp != 0,
"cannot retrieve EpcEnbApplication");
748 rrc->SetS1SapProvider (enbApp->GetS1SapProvider ());
749 enbApp->SetS1SapUser (rrc->GetS1SapUser ());
753 x2->SetEpcX2SapUser (rrc->GetEpcX2SapUser ());
754 rrc->SetEpcX2SapProvider (x2->GetEpcX2SapProvider ());
775 ") must be equal to number of carriers (" <<
778 std::map<uint8_t, Ptr<ComponentCarrierUe> > ueCcMap;
785 cc->SetUlBandwidth (it->second.GetUlBandwidth ());
786 cc->SetDlBandwidth (it->second.GetDlBandwidth ());
787 cc->SetDlEarfcn (it->second.GetDlEarfcn ());
788 cc->SetUlEarfcn (it->second.GetUlEarfcn ());
789 cc->SetAsPrimary (it->second.IsPrimary ());
806 dlPhy->SetHarqPhyModule (harq);
807 ulPhy->SetHarqPhyModule (harq);
808 phy->SetHarqPhyModule (harq);
812 dlPhy->AddRsPowerChunkProcessor (pRs);
816 dlPhy->AddInterferenceCtrlChunkProcessor (pInterf);
820 dlPhy->AddCtrlSinrChunkProcessor (pCtrl);
824 dlPhy->AddDataSinrChunkProcessor (pData);
834 dlPhy->AddInterferenceDataChunkProcessor (pDataInterf);
846 NS_ASSERT_MSG (mm,
"MobilityModel needs to be set on node before calling LteHelper::InstallUeDevice ()");
847 dlPhy->SetMobility (mm);
848 ulPhy->SetMobility (mm);
851 NS_ASSERT_MSG (antenna,
"error in creating the AntennaModel object");
852 dlPhy->SetAntenna (antenna);
853 ulPhy->SetAntenna (antenna);
855 it->second->SetPhy(
phy);
860 rrc->SetLteMacSapProvider (ccmUe->GetLteMacSapProvider ());
862 rrc->SetLteCcmRrcSapProvider (ccmUe->GetLteCcmRrcSapProvider ());
863 ccmUe->SetLteCcmRrcSapUser (rrc->GetLteCcmRrcSapUser ());
866 ccmUe->SetNumberOfComponentCarriers (
m_noOfCcs);
869 rrc->InitializeSap();
874 rrcProtocol->SetUeRrc (rrc);
875 rrc->AggregateObject (rrcProtocol);
876 rrcProtocol->SetLteUeRrcSapProvider (rrc->GetLteUeRrcSapProvider ());
877 rrc->SetLteUeRrcSapUser (rrcProtocol->GetLteUeRrcSapUser ());
882 rrcProtocol->SetUeRrc (rrc);
883 rrc->AggregateObject (rrcProtocol);
884 rrcProtocol->SetLteUeRrcSapProvider (rrc->GetLteUeRrcSapProvider ());
885 rrc->SetLteUeRrcSapUser (rrcProtocol->GetLteUeRrcSapUser ());
890 rrc->SetUseRlcSm (
false);
894 nas->SetAsSapProvider (rrc->GetAsSapProvider ());
895 rrc->SetAsSapUser (nas->GetAsSapUser ());
899 rrc->SetLteUeCmacSapProvider (it->second->GetMac ()->GetLteUeCmacSapProvider (), it->first);
900 it->second->GetMac ()->SetLteUeCmacSapUser (rrc->GetLteUeCmacSapUser (it->first));
901 it->second->GetMac ()->SetComponentCarrierId (it->first);
903 it->second->GetPhy ()->SetLteUeCphySapUser (rrc->GetLteUeCphySapUser (it->first));
904 rrc->SetLteUeCphySapProvider (it->second->GetPhy ()->GetLteUeCphySapProvider (), it->first);
905 it->second->GetPhy ()->SetComponentCarrierId (it->first);
906 it->second->GetPhy ()->SetLteUePhySapUser (it->second->GetMac ()->GetLteUePhySapUser ());
907 it->second->GetMac ()->SetLteUePhySapProvider (it->second->GetPhy ()->GetLteUePhySapProvider ());
909 bool ccmTest = ccmUe->SetComponentCarrierMacSapProviders (it->first, it->second->GetMac ()->GetLteMacSapProvider());
911 if (ccmTest ==
false)
923 dev->SetCcMap (ueCcMap);
926 dev->SetAttribute (
"LteUeComponentCarrierManager",
PointerValue (ccmUe));
934 ccPhy->SetDevice (dev);
935 ccPhy->GetUlSpectrumPhy ()->SetDevice (dev);
936 ccPhy->GetDlSpectrumPhy ()->SetDevice (dev);
943 nas->SetDevice (dev);
977 NS_FATAL_ERROR (
"This function is not valid without properly configured EPC");
981 if (ueLteDevice == 0)
983 NS_FATAL_ERROR (
"The passed NetDevice must be an LteUeNetDevice");
989 uint32_t dlEarfcn = ueLteDevice->GetDlEarfcn ();
990 ueNas->StartCellSelection (dlEarfcn);
996 m_epcHelper->ActivateEpsBearer (ueDevice, ueLteDevice->GetImsi (),
1021 ueNas->Connect (enbLteDevice->GetCellId (), enbLteDevice->GetDlEarfcn ());
1052 double minDistance = std::numeric_limits<double>::infinity ();
1058 if (distance < minDistance)
1060 minDistance = distance;
1061 closestEnbDevice = *i;
1065 Attach (ueDevice, closestEnbDevice);
1088 uint64_t imsi = ueDevice->GetObject<
LteUeNetDevice> ()->GetImsi ();
1089 uint8_t bearerId =
m_epcHelper->ActivateEpsBearer (ueDevice, imsi, tft, bearer);
1135 void ActivateDrb (uint64_t imsi, uint16_t cellId, uint16_t rnti);
1159 m_ueDevice (ueDevice),
1169 a->ActivateDrb (imsi, cellId, rnti);
1180 uint16_t rnti = ueRrc->GetRnti ();
1192 enbRrc->GetS1SapUser ()->DataRadioBearerSetupRequest (params);
1212 std::ostringstream path;
1213 path <<
"/NodeList/" << enbLteDevice->
GetNode ()->
GetId ()
1214 <<
"/DeviceList/" << enbLteDevice->
GetIfIndex ()
1215 <<
"/LteEnbRrc/ConnectionEstablished";
1249 NS_ASSERT_MSG (
m_epcHelper,
"Handover requires the use of the EPC - did you forget to call LteHelper::SetEpcHelper () ?");
1250 uint16_t targetCellId = targetEnbDev->GetObject<
LteEnbNetDevice> ()->GetCellId ();
1258 NS_ASSERT_MSG (
m_epcHelper,
"Handover requires the use of the EPC - did you forget to call LteHelper::SetEpcHelper () ?");
1268 uint16_t rnti = ueDev->GetObject<
LteUeNetDevice> ()->GetRrc ()->GetRnti ();
1269 sourceRrc->SendHandoverRequest (rnti, targetCellId);
1277 NS_ASSERT_MSG (bearerId != 1,
"Default bearer cannot be de-activated until and unless and UE is released");
1288 uint64_t imsi = ueDevice->GetObject<
LteUeNetDevice> ()->GetImsi ();
1289 uint16_t rnti = ueDevice->GetObject<
LteUeNetDevice> ()->GetRrc ()->GetRnti ();
1294 enbRrc->DoSendReleaseDataRadioBearer (imsi,rnti,bearerId);
1304 ccHelper->SetNumberOfComponentCarriers (
m_noOfCcs);
1305 ccHelper->SetUlEarfcn (ulEarfcn);
1306 ccHelper->SetDlEarfcn (dlEarfcn);
1307 ccHelper->SetDlBandwidth (dlbw);
1308 ccHelper->SetUlBandwidth (ulbw);
1439 m_rlcStats = CreateObject<RadioBearerStatsCalculator> (
"RLC");
1446 int64_t currentStream = stream;
1452 currentStream += tflm->AssignStreams (currentStream);
1463 std::map< uint8_t, Ptr <ComponentCarrierBaseStation> > tmpMap = lteEnb->
GetCcMap ();
1464 std::map< uint8_t, Ptr <ComponentCarrierBaseStation> >::iterator it;
1465 it = tmpMap.begin ();
1466 Ptr<LteSpectrumPhy> dlPhy = DynamicCast<ComponentCarrierEnb> (it->second)->GetPhy ()->GetDownlinkSpectrumPhy ();
1467 Ptr<LteSpectrumPhy> ulPhy = DynamicCast<ComponentCarrierEnb> (it->second)->GetPhy ()->GetUplinkSpectrumPhy ();
1468 currentStream += dlPhy->AssignStreams (currentStream);
1469 currentStream += ulPhy->AssignStreams (currentStream);
1474 std::map< uint8_t, Ptr <ComponentCarrierUe> > tmpMap = lteUe->GetCcMap ();
1475 std::map< uint8_t, Ptr <ComponentCarrierUe> >::iterator it;
1476 it = tmpMap.begin ();
1480 currentStream += dlPhy->AssignStreams (currentStream);
1481 currentStream += ulPhy->AssignStreams (currentStream);
1482 currentStream += ueMac->AssignStreams (currentStream);
1485 return (currentStream - stream);
1503 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission",
1510 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission",
1517 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception",
1524 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception",
1541 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
1549 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
1557 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr",
1565 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr",
1567 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportInterference",
1582 m_pdcpStats = CreateObject<RadioBearerStatsCalculator> (
"PDCP");
Hold a value for an Attribute.
AttributeValue implementation for Boolean.
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(void)
Get the type ID.
static TypeId GetTypeId()
The class implements Component Carrier Manager (CCM) that operates using the Component Carrier Manage...
The eNodeB device implementation.
void SetCcMap(std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > ccm)
Set the ComponentCarrier Map of the Enb.
static TypeId GetTypeId(void)
Get the type ID.
uint16_t GetDlBandwidth() const
uint32_t GetUlEarfcn() const
uint32_t GetDlEarfcn() const
uint16_t GetUlBandwidth() const
uint16_t GetCellId() const
std::map< uint8_t, Ptr< ComponentCarrierBaseStation > > GetCcMap(void) const
virtual void ReportUlHarqFeedback(UlInfoListElement_s mes)
Report the uplink HARQ feedback generated by LteSpectrumPhy to MAC.
virtual void ReportInterference(const SpectrumValue &interf)
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)
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.
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > >)
PhySpectrum received a new list of LteControlMessage.
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
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...
Ptr< SpectrumChannel > GetDownlinkSpectrumChannel(void) const
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
void EnableUlPhyTraces(void)
Enable trace sinks for UL PHY layer.
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.
Ptr< RadioBearerStatsCalculator > GetPdcpStats(void)
void SetEnbComponentCarrierManagerType(std::string type)
Set the type of carrier component algorithm to be used by eNodeB devices.
void EnableLogComponents(void)
Enables full-blown logging for major components of the LENA architecture.
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.
void EnableUlTxPhyTraces(void)
Enable trace sinks for UL transmission PHY layer.
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 ...
ObjectFactory m_handoverAlgorithmFactory
Factory of handover algorithm object.
std::string m_fadingModelType
Name of fading model type, e.g., "ns3::TraceFadingLossModel".
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.
void ChannelModelInitialization(void)
Function that performs a channel model initialization of all component carriers.
virtual void DoInitialize(void)
Initialize() implementation.
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 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.
Ptr< PhyTxStatsCalculator > m_phyTxStats
Container of PHY layer statistics related to transmission.
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
void SetEnbAntennaModelType(std::string type)
Set the type of antenna model to be used by eNodeB devices.
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.
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.
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.
Ptr< SpectrumChannel > GetUplinkSpectrumChannel(void) const
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 EnableDlPhyTraces(void)
Enable trace sinks for DL PHY layer.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
ObjectFactory m_enbNetDeviceFactory
Factory of LteEnbNetDevice objects.
std::string GetHandoverAlgorithmType() const
Ptr< PhyStatsCalculator > m_phyStats
Container of PHY layer statistics.
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the path loss models to be created.
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 EnableUlRxPhyTraces(void)
Enable trace sinks for UL reception PHY layer.
void EnableRlcTraces(void)
Enable trace sinks for RLC 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(void)
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.
void EnableDlMacTraces(void)
Enable trace sinks for DL MAC layer.
uint64_t m_imsiCounter
Keep track of the number of IMSI allocated.
ObjectFactory m_ueNetDeviceFactory
Factory for LteUeNetDevice objects.
virtual void DoDispose(void)
Destructor implementation.
ObjectFactory m_ueAntennaModelFactory
Factory of antenna object for UE.
Ptr< SpectrumChannel > m_uplinkChannel
The uplink LTE channel used in the simulation.
void EnableUlMacTraces(void)
Enable trace sinks for UL MAC layer.
void EnablePhyTraces(void)
Enable trace sinks for PHY layer.
void SetSpectrumChannelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the spectrum channel to be created (both DL and UL).
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
void EnablePdcpTraces(void)
Enable trace sinks for PDCP layer.
void EnableDlRxPhyTraces(void)
Enable trace sinks for DL reception PHY layer.
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 EnableTraces(void)
Enables trace sinks for PHY, MAC, RLC and PDCP.
std::map< uint8_t, ComponentCarrier > m_componentCarrierPhyParams
This contains all the information about each component carrier.
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
void EnableDlTxPhyTraces(void)
Enable trace sinks for DL transmission PHY layer.
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 EnableMacTraces(void)
Enable trace sinks for MAC layer.
virtual uint32_t GetIfIndex(void) const
void Receive(Ptr< Packet > p)
receive a packet from the lower layers in order to forward it to the upper layers
virtual Ptr< Node > GetNode(void) const
virtual void SetNode(Ptr< Node > node)
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(void)
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.
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > > msgList)
Receive LTE control message list function.
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
virtual void ReportInterference(const SpectrumValue &interf)
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
virtual void ReportRsReceivedPower(const SpectrumValue &power)
generate a report based on the linear RS power perceived during CTRL frame NOTE: used only by UE for ...
virtual void EnqueueDlHarqFeedback(DlInfoListElement_s mes)
Enqueue the downlink HARQ feedback generated by LteSpectrumPhy.
virtual void GenerateMixedCqiReport(const SpectrumValue &sinr)
Create the mixed CQI report.
static Mac64Address Allocate(void)
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(void)
Get the type ID.
holds a vector of ns3::NetDevice pointers
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
uint32_t GetN(void) const
Get the number of Ptr<NetDevice> stored in this container.
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
keep track of a set of node pointers.
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
uint32_t GetId(void) const
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.
void Set(const std::string &name, const AttributeValue &value, Args &&... args)
Set an attribute to be set during construction.
TypeId GetTypeId(void) const
Get the TypeId which will be created by this ObjectFactory.
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
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.
friend class ObjectFactory
Friends.
virtual void DoDispose(void)
Destructor implementation.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
virtual void DoInitialize(void)
Initialize() 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(Time const &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(void) const
Get the name.
AttributeValue implementation for TypeId.
@ 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...
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeStringChecker(void)
Ptr< const AttributeAccessor > MakeTypeIdAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
Ptr< const AttributeChecker > MakeTypeIdChecker(void)
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method.
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.
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
#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.
@ 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.
double CalculateDistance(const Vector3D &a, const Vector3D &b)
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
void LogComponentEnableAll(enum LogLevel level)
Enable the logging output for all registered log components.
Callback< R, Ts... > MakeCallback(R(T::*memPtr)(Ts...), OBJ objPtr)
Build Callbacks for class method members which take varying numbers of arguments and potentially retu...
Parameters passed to DataRadioBearerSetupRequest ()
EpsBearer bearer
the characteristics of the bearer to be setup
uint16_t rnti
the RNTI identifying the UE for which the DataRadioBearer is to be created
uint32_t gtpTeid
S1-bearer GTP tunnel endpoint identifier, see 36.423 9.2.1.
uint8_t bearerId
the EPS Bearer Identifier
static Vector GetPosition(Ptr< Node > node)