26 #include <ns3/string.h>
28 #include <ns3/abort.h>
29 #include <ns3/pointer.h>
30 #include <ns3/lte-enb-rrc.h>
31 #include <ns3/epc-ue-nas.h>
32 #include <ns3/epc-enb-application.h>
33 #include <ns3/lte-ue-rrc.h>
34 #include <ns3/lte-ue-mac.h>
35 #include <ns3/lte-enb-mac.h>
36 #include <ns3/lte-enb-net-device.h>
37 #include <ns3/lte-enb-phy.h>
38 #include <ns3/lte-ue-phy.h>
39 #include <ns3/lte-spectrum-phy.h>
40 #include <ns3/lte-chunk-processor.h>
41 #include <ns3/multi-model-spectrum-channel.h>
42 #include <ns3/friis-spectrum-propagation-loss.h>
43 #include <ns3/trace-fading-loss-model.h>
44 #include <ns3/isotropic-antenna-model.h>
45 #include <ns3/lte-enb-net-device.h>
46 #include <ns3/lte-ue-net-device.h>
47 #include <ns3/ff-mac-scheduler.h>
48 #include <ns3/lte-ffr-algorithm.h>
49 #include <ns3/lte-handover-algorithm.h>
50 #include <ns3/lte-enb-component-carrier-manager.h>
51 #include <ns3/lte-ue-component-carrier-manager.h>
52 #include <ns3/lte-anr.h>
53 #include <ns3/lte-rlc.h>
54 #include <ns3/lte-rlc-um.h>
55 #include <ns3/lte-rlc-am.h>
56 #include <ns3/epc-enb-s1-sap.h>
57 #include <ns3/lte-rrc-protocol-ideal.h>
58 #include <ns3/lte-rrc-protocol-real.h>
59 #include <ns3/mac-stats-calculator.h>
60 #include <ns3/phy-stats-calculator.h>
61 #include <ns3/phy-tx-stats-calculator.h>
62 #include <ns3/phy-rx-stats-calculator.h>
63 #include <ns3/epc-helper.h>
65 #include <ns3/buildings-propagation-loss-model.h>
66 #include <ns3/lte-spectrum-value-helper.h>
67 #include <ns3/epc-x2.h>
68 #include <ns3/pointer.h>
69 #include <ns3/object-map.h>
70 #include <ns3/object-factory.h>
79 : m_fadingStreamsAssigned (false),
96 m_phyStats = CreateObject<PhyStatsCalculator> ();
99 m_macStats = CreateObject<MacStatsCalculator> ();
115 .AddConstructor<LteHelper> ()
116 .AddAttribute (
"Scheduler",
117 "The type of scheduler to be used for eNBs. "
118 "The allowed values for this attributes are the type names "
119 "of any class inheriting from ns3::FfMacScheduler.",
124 .AddAttribute (
"FfrAlgorithm",
125 "The type of FFR algorithm to be used for eNBs. "
126 "The allowed values for this attributes are the type names "
127 "of any class inheriting from ns3::LteFfrAlgorithm.",
132 .AddAttribute (
"HandoverAlgorithm",
133 "The type of handover algorithm to be used for eNBs. "
134 "The allowed values for this attributes are the type names "
135 "of any class inheriting from ns3::LteHandoverAlgorithm.",
140 .AddAttribute (
"PathlossModel",
141 "The type of pathloss model to be used. "
142 "The allowed values for this attributes are the type names "
143 "of any class inheriting from ns3::PropagationLossModel.",
147 .AddAttribute (
"FadingModel",
148 "The type of fading model to be used."
149 "The allowed values for this attributes are the type names "
150 "of any class inheriting from ns3::SpectrumPropagationLossModel."
151 "If the type is set to an empty string, no fading model is used.",
155 .AddAttribute (
"UseIdealRrc",
156 "If true, LteRrcProtocolIdeal will be used for RRC signaling. "
157 "If false, LteRrcProtocolReal will be used.",
161 .AddAttribute (
"AnrEnabled",
162 "Activate or deactivate Automatic Neighbour Relation function",
166 .AddAttribute (
"UsePdschForCqiGeneration",
167 "If true, DL-CQI will be calculated from PDCCH as signal and PDSCH as interference "
168 "If false, DL-CQI will be calculated from PDCCH as signal and PDCCH as interference ",
172 .AddAttribute (
"EnbComponentCarrierManager",
173 "The type of Component Carrier Manager to be used for eNBs. "
174 "The allowed values for this attributes are the type names "
175 "of any class inheriting ns3::LteEnbComponentCarrierManager.",
180 .AddAttribute (
"UeComponentCarrierManager",
181 "The type of Component Carrier Manager to be used for UEs. "
182 "The allowed values for this attributes are the type names "
183 "of any class inheriting ns3::LteUeComponentCarrierManager.",
184 StringValue (
"ns3::SimpleUeComponentCarrierManager"),
188 .AddAttribute (
"UseCa",
189 "If true, Carrier Aggregation feature is enabled and a valid Component Carrier Map is expected."
190 "If false, single carrier simulation.",
194 .AddAttribute (
"NumberOfComponentCarriers",
195 "Set the number of Component carrier to use "
196 "If it is more than one and m_useCa is false, it will raise an error ",
240 NS_LOG_LOGIC (
this <<
" using a SpectrumPropagationLossModel in DL");
245 NS_LOG_LOGIC (
this <<
" using a PropagationLossModel in DL");
247 NS_ASSERT_MSG (dlPlm != 0,
" " << m_downlinkPathlossModel <<
" is neither PropagationLossModel nor SpectrumPropagationLossModel");
255 NS_LOG_LOGIC (
this <<
" using a SpectrumPropagationLossModel in UL");
260 NS_LOG_LOGIC (
this <<
" using a PropagationLossModel in UL");
493 devices.
Add (device);
507 devices.
Add (device);
528 std::map<uint8_t,Ptr<ComponentCarrierEnb> > ccMap;
532 cc->SetUlBandwidth(it->second.GetUlBandwidth());
533 cc->SetDlBandwidth(it->second.GetDlBandwidth());
534 cc->SetDlEarfcn(it->second.GetDlEarfcn());
535 cc->SetUlEarfcn(it->second.GetUlEarfcn());
536 cc->SetAsPrimary(it->second.IsPrimary());
539 ccMap [it->first] = cc;
541 NS_ABORT_MSG_IF (
m_useCa && ccMap.size()<2,
"You have to either specify carriers or disable carrier aggregation");
546 NS_LOG_DEBUG (
this <<
"component carrier map size " << (uint16_t) ccMap.size ());
552 dlPhy->SetHarqPhyModule (harq);
553 ulPhy->SetHarqPhyModule (harq);
554 phy->SetHarqPhyModule (harq);
558 ulPhy->AddCtrlSinrChunkProcessor (pCtrl);
563 ulPhy->AddDataSinrChunkProcessor (pData);
567 ulPhy->AddInterferenceDataChunkProcessor (pInterf);
573 NS_ASSERT_MSG (mm,
"MobilityModel needs to be set on node before calling LteHelper::InstallEnbDevice ()");
574 dlPhy->SetMobility (mm);
575 ulPhy->SetMobility (mm);
578 NS_ASSERT_MSG (antenna,
"error in creating the AntennaModel object");
579 dlPhy->SetAntenna (antenna);
580 ulPhy->SetAntenna (antenna);
585 it->second->SetMac (mac);
586 it->second->SetFfMacScheduler (sched);
587 it->second->SetFfrAlgorithm (ffrAlgorithm);
589 it->second->SetPhy (phy);
595 rrc->ConfigureCarriers (ccMap);
598 rrc->SetLteCcmRrcSapProvider (ccmEnbManager->GetLteCcmRrcSapProvider ());
599 ccmEnbManager->SetLteCcmRrcSapUser (rrc->GetLteCcmRrcSapUser ());
600 ccmEnbManager->SetNumberOfComponentCarriers (
m_noOfCcs);
601 ccmEnbManager->SetRrc(rrc);
606 rrcProtocol->SetLteEnbRrcSapProvider (rrc->GetLteEnbRrcSapProvider ());
607 rrc->SetLteEnbRrcSapUser (rrcProtocol->GetLteEnbRrcSapUser ());
608 rrc->AggregateObject (rrcProtocol);
609 rrcProtocol->SetCellId (cellId);
614 rrcProtocol->SetLteEnbRrcSapProvider (rrc->GetLteEnbRrcSapProvider ());
615 rrc->SetLteEnbRrcSapUser (rrcProtocol->GetLteEnbRrcSapUser ());
616 rrc->AggregateObject (rrcProtocol);
617 rrcProtocol->SetCellId (cellId);
623 rrc->GetAttribute (
"EpsBearerToRlcMapping", epsBearerToRlcMapping);
631 rrc->SetLteHandoverManagementSapProvider (handoverAlgorithm->GetLteHandoverManagementSapProvider ());
632 handoverAlgorithm->SetLteHandoverManagementSapUser (rrc->GetLteHandoverManagementSapUser ());
642 rrc->SetLteMacSapProvider (ccmEnbManager->GetLteMacSapProvider ());
647 it->second->GetPhy ()->SetLteEnbCphySapUser (rrc->GetLteEnbCphySapUser (it->first));
648 rrc->SetLteEnbCphySapProvider (it->second->GetPhy ()->GetLteEnbCphySapProvider (), it->first);
650 rrc->SetLteEnbCmacSapProvider (it->second->GetMac ()->GetLteEnbCmacSapProvider (),it->first );
651 it->second->GetMac ()->SetLteEnbCmacSapUser (rrc->GetLteEnbCmacSapUser (it->first));
653 it->second->GetPhy ()->SetComponentCarrierId (it->first);
654 it->second->GetMac ()->SetComponentCarrierId (it->first);
656 it->second->GetFfMacScheduler ()->SetLteFfrSapProvider (it->second->GetFfrAlgorithm ()->GetLteFfrSapProvider ());
657 it->second->GetFfrAlgorithm ()->SetLteFfrSapUser (it->second->GetFfMacScheduler ()->GetLteFfrSapUser ());
658 rrc->SetLteFfrRrcSapProvider (it->second->GetFfrAlgorithm ()->GetLteFfrRrcSapProvider (), it->first);
659 it->second->GetFfrAlgorithm ()->SetLteFfrRrcSapUser (rrc->GetLteFfrRrcSapUser (it->first));
663 it->second->GetPhy ()->SetLteEnbPhySapUser (it->second->GetMac ()->GetLteEnbPhySapUser ());
664 it->second->GetMac ()->SetLteEnbPhySapProvider (it->second->GetPhy ()->GetLteEnbPhySapProvider ());
668 it->second->GetMac ()->SetFfMacSchedSapProvider (it->second->GetFfMacScheduler ()->GetFfMacSchedSapProvider ());
669 it->second->GetMac ()->SetFfMacCschedSapProvider (it->second->GetFfMacScheduler ()->GetFfMacCschedSapProvider ());
671 it->second->GetFfMacScheduler ()->SetFfMacSchedSapUser (it->second->GetMac ()->GetFfMacSchedSapUser ());
672 it->second->GetFfMacScheduler ()->SetFfMacCschedSapUser (it->second->GetMac ()->GetFfMacCschedSapUser ());
675 it->second->GetMac ()->SetLteCcmMacSapUser (ccmEnbManager->GetLteCcmMacSapUser ());
676 ccmEnbManager->SetCcmMacSapProviders (it->first, it->second->GetMac ()->GetLteCcmMacSapProvider ());
679 ccmTest = ccmEnbManager->SetMacSapProvider (it->first, it->second->GetMac ()->GetLteMacSapProvider());
681 if (ccmTest ==
false)
693 std::map<uint8_t,Ptr<ComponentCarrierEnb> >::iterator it = ccMap.begin ();
701 rrc->SetLteAnrSapProvider (anr->GetLteAnrSapProvider ());
702 anr->SetLteAnrSapUser (rrc->GetLteAnrSapUser ());
706 for (it = ccMap.begin (); it != ccMap.end (); ++it)
709 ccPhy->SetDevice (dev);
710 ccPhy->GetUlSpectrumPhy ()->SetDevice (dev);
711 ccPhy->GetDlSpectrumPhy ()->SetDevice (dev);
721 NS_LOG_WARN (
"DL propagation model does not have a Frequency attribute");
730 NS_LOG_WARN (
"UL propagation model does not have a Frequency attribute");
737 for (it = ccMap.begin (); it != ccMap.end (); ++it)
747 NS_ASSERT_MSG (enbApp != 0,
"cannot retrieve EpcEnbApplication");
750 rrc->SetS1SapProvider (enbApp->GetS1SapProvider ());
751 enbApp->SetS1SapUser (rrc->GetS1SapUser ());
755 x2->SetEpcX2SapUser (rrc->GetEpcX2SapUser ());
756 rrc->SetEpcX2SapProvider (x2->GetEpcX2SapProvider ());
770 std::map<uint8_t, Ptr<ComponentCarrierUe> > ueCcMap;
775 cc->SetUlBandwidth ( it->second.GetUlBandwidth ());
776 cc->SetDlBandwidth ( it->second.GetDlBandwidth ());
777 cc->SetDlEarfcn ( it->second.GetDlEarfcn ());
778 cc->SetUlEarfcn ( it->second.GetUlEarfcn ());
779 cc->SetAsPrimary (it->second.IsPrimary());
794 dlPhy->SetHarqPhyModule (harq);
795 ulPhy->SetHarqPhyModule (harq);
796 phy->SetHarqPhyModule (harq);
800 dlPhy->AddRsPowerChunkProcessor (pRs);
804 dlPhy->AddInterferenceCtrlChunkProcessor (pInterf);
808 dlPhy->AddCtrlSinrChunkProcessor (pCtrl);
812 dlPhy->AddDataSinrChunkProcessor (pData);
820 dlPhy->AddInterferenceDataChunkProcessor (pDataInterf);
832 NS_ASSERT_MSG (mm,
"MobilityModel needs to be set on node before calling LteHelper::InstallUeDevice ()");
833 dlPhy->SetMobility (mm);
834 ulPhy->SetMobility (mm);
837 NS_ASSERT_MSG (antenna,
"error in creating the AntennaModel object");
838 dlPhy->SetAntenna (antenna);
839 ulPhy->SetAntenna (antenna);
841 it->second->SetPhy(phy);
844 ccmUe->SetNumberOfComponentCarriers (
m_noOfCcs);
847 rrc->m_numberOfComponentCarriers =
m_noOfCcs;
849 rrc->InitializeSap();
850 rrc->SetLteMacSapProvider (ccmUe->GetLteMacSapProvider ());
852 rrc->SetLteCcmRrcSapProvider (ccmUe->GetLteCcmRrcSapProvider ());
853 ccmUe->SetLteCcmRrcSapUser (rrc->GetLteCcmRrcSapUser ());
858 rrcProtocol->SetUeRrc (rrc);
859 rrc->AggregateObject (rrcProtocol);
860 rrcProtocol->SetLteUeRrcSapProvider (rrc->GetLteUeRrcSapProvider ());
861 rrc->SetLteUeRrcSapUser (rrcProtocol->GetLteUeRrcSapUser ());
866 rrcProtocol->SetUeRrc (rrc);
867 rrc->AggregateObject (rrcProtocol);
868 rrcProtocol->SetLteUeRrcSapProvider (rrc->GetLteUeRrcSapProvider ());
869 rrc->SetLteUeRrcSapUser (rrcProtocol->GetLteUeRrcSapUser ());
874 rrc->SetUseRlcSm (
false);
878 nas->SetAsSapProvider (rrc->GetAsSapProvider ());
879 rrc->SetAsSapUser (nas->GetAsSapUser ());
883 rrc->SetLteUeCmacSapProvider (it->second->GetMac ()->GetLteUeCmacSapProvider (), it->first);
884 it->second->GetMac ()->SetLteUeCmacSapUser (rrc->GetLteUeCmacSapUser (it->first));
885 it->second->GetMac ()->SetComponentCarrierId (it->first);
887 it->second->GetPhy ()->SetLteUeCphySapUser (rrc->GetLteUeCphySapUser (it->first));
888 rrc->SetLteUeCphySapProvider (it->second->GetPhy ()->GetLteUeCphySapProvider (), it->first);
889 it->second->GetPhy ()->SetComponentCarrierId (it->first);
891 it->second->GetPhy ()->SetLteUePhySapUser (it->second->GetMac ()->GetLteUePhySapUser ());
892 it->second->GetMac ()->SetLteUePhySapProvider (it->second->GetPhy ()->GetLteUePhySapProvider ());
894 bool ccmTest = ccmUe->SetComponentCarrierMacSapProviders (it->first, it->second->GetMac ()->GetLteMacSapProvider());
896 if (ccmTest ==
false)
908 dev->SetCcMap (ueCcMap);
911 dev->SetAttribute (
"LteUeComponentCarrierManager",
PointerValue (ccmUe));
916 ccPhy->SetDevice (dev);
917 ccPhy->GetUlSpectrumPhy ()->SetDevice (dev);
918 ccPhy->GetDlSpectrumPhy ()->SetDevice (dev);
925 nas->SetDevice (dev);
959 NS_FATAL_ERROR (
"This function is not valid without properly configured EPC");
963 if (ueLteDevice == 0)
965 NS_FATAL_ERROR (
"The passed NetDevice must be an LteUeNetDevice");
971 uint32_t dlEarfcn = ueLteDevice->GetDlEarfcn ();
972 ueNas->StartCellSelection (dlEarfcn);
978 m_epcHelper->ActivateEpsBearer (ueDevice, ueLteDevice->GetImsi (),
1003 ueNas->Connect (enbLteDevice->GetCellId (), enbLteDevice->GetDlEarfcn ());
1034 double minDistance = std::numeric_limits<double>::infinity ();
1040 if (distance < minDistance)
1042 minDistance = distance;
1043 closestEnbDevice = *i;
1047 Attach (ueDevice, closestEnbDevice);
1070 uint64_t imsi = ueDevice->GetObject<
LteUeNetDevice> ()->GetImsi ();
1071 uint8_t bearerId =
m_epcHelper->ActivateEpsBearer (ueDevice, imsi, tft, bearer);
1117 void ActivateDrb (uint64_t imsi, uint16_t cellId, uint16_t rnti);
1141 m_ueDevice (ueDevice),
1151 a->ActivateDrb (imsi, cellId, rnti);
1162 uint16_t rnti = ueRrc->GetRnti ();
1172 params.bearerId = 0;
1174 enbRrc->GetS1SapUser ()->DataRadioBearerSetupRequest (params);
1194 std::ostringstream path;
1195 path <<
"/NodeList/" << enbLteDevice->
GetNode ()->
GetId ()
1196 <<
"/DeviceList/" << enbLteDevice->
GetIfIndex ()
1197 <<
"/LteEnbRrc/ConnectionEstablished";
1231 NS_ASSERT_MSG (
m_epcHelper,
"Handover requires the use of the EPC - did you forget to call LteHelper::SetEpcHelper () ?");
1232 uint16_t targetCellId = targetEnbDev->GetObject<
LteEnbNetDevice> ()->GetCellId ();
1240 NS_ASSERT_MSG (
m_epcHelper,
"Handover requires the use of the EPC - did you forget to call LteHelper::SetEpcHelper () ?");
1250 uint16_t rnti = ueDev->GetObject<
LteUeNetDevice> ()->GetRrc ()->GetRnti ();
1251 sourceRrc->SendHandoverRequest (rnti, targetCellId);
1259 NS_ASSERT_MSG (bearerId != 1,
"Default bearer cannot be de-activated until and unless and UE is released");
1270 uint64_t imsi = ueDevice->GetObject<
LteUeNetDevice> ()->GetImsi ();
1271 uint16_t rnti = ueDevice->GetObject<
LteUeNetDevice> ()->GetRrc ()->GetRnti ();
1276 enbRrc->DoSendReleaseDataRadioBearer (imsi,rnti,bearerId);
1284 ccHelper->SetNumberOfComponentCarriers (
m_noOfCcs);
1285 ccHelper->SetUlEarfcn (ulEarfcn);
1286 ccHelper->SetDlEarfcn (dlEarfcn);
1287 ccHelper->SetDlBandwidth (dlbw);
1288 ccHelper->SetUlBandwidth (ulbw);
1353 m_rlcStats = CreateObject<RadioBearerStatsCalculator> (
"RLC");
1360 int64_t currentStream = stream;
1377 std::map< uint8_t, Ptr <ComponentCarrierEnb> > tmpMap = lteEnb->
GetCcMap ();
1378 std::map< uint8_t, Ptr <ComponentCarrierEnb> >::iterator it;
1379 it = tmpMap.begin ();
1382 currentStream += dlPhy->AssignStreams (currentStream);
1383 currentStream += ulPhy->AssignStreams (currentStream);
1388 std::map< uint8_t, Ptr <ComponentCarrierUe> > tmpMap = lteUe->GetCcMap ();
1389 std::map< uint8_t, Ptr <ComponentCarrierUe> >::iterator it;
1390 it = tmpMap.begin ();
1394 currentStream += dlPhy->AssignStreams (currentStream);
1395 currentStream += ulPhy->AssignStreams (currentStream);
1396 currentStream += ueMac->AssignStreams (currentStream);
1399 return (currentStream - stream);
1417 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/DlPhyTransmission",
1424 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/UlPhyTransmission",
1431 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/DlSpectrumPhy/DlPhyReception",
1438 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/UlSpectrumPhy/UlPhyReception",
1455 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/DlScheduling",
1463 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbMac/UlScheduling",
1471 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMapUe/*/LteUePhy/ReportCurrentCellRsrpSinr",
1479 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportUeSinr",
1481 Config::Connect (
"/NodeList/*/DeviceList/*/ComponentCarrierMap/*/LteEnbPhy/ReportInterference",
1496 m_pdcpStats = CreateObject<RadioBearerStatsCalculator> (
"PDCP");
void SetFadingModel(std::string type)
Set the type of fading model to be used in both DL and UL.
Ptr< const AttributeChecker > MakeStringChecker(void)
Parameters passed to DataRadioBearerSetupRequest ()
Iterator Begin(void) const
Get an iterator which refers to the first NetDevice in the container.
TypeId GetTypeId(void) const
Get the TypeId which will be created by this ObjectFactory.
Ptr< Object > m_uplinkPathlossModel
The path loss model used in the uplink channel.
virtual void DoInitialize(void)
Initialize() implementation.
Simulation virtual time values and global simulation resolution.
void SetPathlossModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the path loss models to be created.
virtual void AddPropagationLossModel(Ptr< PropagationLossModel > loss)=0
Add the single-frequency propagation loss model to be used.
void EnableDlRxPhyTraces(void)
Enable trace sinks for DL reception PHY layer.
Smart pointer class similar to boost::intrusive_ptr.
RadioBearerStatsConnector m_radioBearerStatsConnector
Connects RLC and PDCP statistics containers to appropriate trace sources.
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
Ptr< NetDevice > InstallSingleEnbDevice(Ptr< Node > n)
Create an eNodeB device (LteEnbNetDevice) on the given node.
The abstract base class of a handover algorithm that operates using the Handover Management SAP inter...
static TypeId GetTypeId(void)
Register this type.
AttributeValue implementation for Boolean.
NetDeviceContainer InstallEnbDevice(NodeContainer c)
Create a set of eNodeB devices.
virtual void GenerateMixedCqiReport(const SpectrumValue &sinr)
Create the mixed CQI report.
#define NS_OBJECT_ENSURE_REGISTERED(type)
Register an Object subclass with the TypeId system.
uint16_t GetCellId() const
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
std::vector< Ptr< Node > >::const_iterator Iterator
Node container iterator.
void SetCcPhyParams(std::map< uint8_t, ComponentCarrier > ccmap)
This method is used to send the ComponentCarrier map created with CcHelper to the helper...
void EnableLogComponents(void)
Enables full-blown logging for major components of the LENA architecture.
Ptr< T > GetObject(void) const
Get a pointer to the requested aggregated Object.
Hold variables of type string.
void HandoverRequest(Time hoTime, Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, Ptr< NetDevice > targetEnbDev)
Manually trigger an X2-based handover.
bool m_fadingStreamsAssigned
True if a random variable stream number has been assigned for the fading model.
ObjectFactory m_fadingModelFactory
Factory of fading model object for both the downlink and uplink channels.
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...
uint8_t GetUlBandwidth() const
virtual void SetNode(Ptr< Node > node)
Hold a value for an Attribute.
void EnableDlPhyTraces(void)
Enable trace sinks for DL PHY layer.
uint16_t rnti
the RNTI identifying the UE for which the DataRadioBearer is to be created
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > >)
PhySpectrum received a new list of LteControlMessage.
Ptr< const AttributeAccessor > MakeBooleanAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
Callback< R > MakeBoundCallback(R(*fnPtr)(TX), ARG a1)
Make Callbacks with one bound argument.
static Vector GetPosition(Ptr< Node > node)
DrbActivator(Ptr< NetDevice > ueDevice, EpsBearer bearer)
DrbActivator Constructor.
Ptr< SpectrumChannel > GetUplinkSpectrumChannel(void) const
void DoComponentCarrierConfigure(uint32_t ulEarfcn, uint32_t dlEarfcn, uint8_t ulbw, uint8_t dlbw)
A private function used for component carrier configuration.
void SetUeAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the UE antenna model to be created.
static Ptr< EpcTft > Default()
creates a TFT matching any traffic
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
std::map< uint8_t, ComponentCarrier > m_componentCarrierPhyParams
This contains all the information about each component carrier.
void Attach(NetDeviceContainer ueDevices)
Enables automatic attachment of a set of UE devices to a suitable cell using Idle mode initial cell s...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
void SetEnbComponentCarrierManagerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the enb component carrier manager to be created.
void EnableRlcTraces(void)
Enable trace sinks for RLC layer.
bool m_usePdschForCqiGeneration
The UsePdschForCqiGeneration attribute.
void SetTypeId(TypeId tid)
Set the TypeId of the Objects to be created by this factory.
Ptr< PhyStatsCalculator > m_phyStats
Container of PHY layer statistics.
void EnablePdcpStats(Ptr< RadioBearerStatsCalculator > pdcpStats)
Enables trace sinks for PDCP layer.
Ptr< PhyRxStatsCalculator > m_phyRxStats
Container of PHY layer statistics related to reception.
std::string m_fadingModelType
Name of fading model type, e.g., "ns3::TraceFadingLossModel".
Iterator End(void) const
Get an iterator which indicates past-the-last Node in the container.
bool SetAttributeFailSafe(std::string name, const AttributeValue &value)
Set a single attribute without raising errors.
void SetUeDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the UE devices (LteUeNetDevice) to be created.
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
void SetUeAntennaModelType(std::string type)
Set the type of antenna model to be used by UE devices.
ObjectFactory m_enbComponentCarrierManagerFactory
Factory of enb component carrier manager object.
virtual void DoDispose(void)
Destructor implementation.
#define NS_LOG_FUNCTION_NOARGS()
Output the name of the function.
Ptr< MacStatsCalculator > m_macStats
Container of MAC layer statistics.
int64_t AssignStreams(NetDeviceContainer c, int64_t stream)
Assign a fixed random variable stream number to the random variables used.
void ActivateDataRadioBearer(NetDeviceContainer ueDevices, EpsBearer bearer)
Activate a Data Radio Bearer on a given UE devices (for LTE-only simulation).
void SetEnbComponentCarrierManagerType(std::string type)
Set the type of carrier component algorithm to be used by eNodeB devices.
ObjectFactory m_channelFactory
Factory of both the downlink and uplink LTE channels.
uint8_t ActivateDedicatedEpsBearer(NetDeviceContainer ueDevices, EpsBearer bearer, Ptr< EpcTft > tft)
Activate a dedicated EPS bearer on a given set of UE devices.
void ChannelModelInitialization(void)
Function that performs a channel model initialization of all component carriers.
std::string GetUeComponentCarrierManagerType() const
void SetHandoverAlgorithmType(std::string type)
Set the type of handover algorithm to be used by eNodeB devices.
void EnableUlRxPhyTraces(void)
Enable trace sinks for UL reception PHY layer.
void SetFfrAlgorithmType(std::string type)
Set the type of FFR algorithm to be used by eNodeB devices.
static TypeId GetTypeId(void)
Get the type ID.
void SetSchedulerType(std::string type)
Set the type of scheduler to be used by eNodeB devices.
uint32_t GetN(void) const
Get the number of Ptr stored in this container.
uint32_t GetUlEarfcn() const
Ptr< RadioBearerStatsCalculator > m_rlcStats
Container of RLC layer statistics.
std::string GetHandoverAlgorithmType() const
void EnablePdcpTraces(void)
Enable trace sinks for PDCP layer.
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...
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.
virtual Ptr< Node > GetNode(void) const
virtual void GenerateCtrlCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Ctrl frame
Ptr< Object > m_downlinkPathlossModel
The path loss model used in the downlink channel.
This class contains the specification of EPS Bearers.
ObjectFactory m_pathlossModelFactory
Factory of path loss model object.
void DeActivateDedicatedEpsBearer(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice, uint8_t bearerId)
Manually trigger dedicated bearer de-activation at specific simulation time.
Ptr< Application > GetApplication(uint32_t index) const
Retrieve the index-th Application associated to this node.
void LogComponentEnable(char const *name, enum LogLevel level)
Enable the logging output associated with that log component.
Ptr< NetDevice > m_ueDevice
UeNetDevice for which bearer will be activated.
void SetHandoverAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the handover algorithm to be created.
Hold variables of type enum.
static EventId Schedule(Time const &delay, MEM mem_ptr, OBJ obj)
Schedule an event to expire after delay.
virtual uint32_t GetIfIndex(void) const
void SetUeComponentCarrierManagerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the ue component carrier manager to be created.
virtual void GenerateDataCqiReport(const SpectrumValue &sinr)
generate a CQI report based on the given SINR of Data frame (used for PUSCH CQIs) ...
double CalculateDistance(const Vector3D &a, const Vector3D &b)
Ptr< Object > Create(void) const
Create an Object instance of the configured TypeId.
void Add(NetDeviceContainer other)
Append the contents of another NetDeviceContainer to the end of this container.
ObjectFactory m_ueComponentCarrierManagerFactory
Factory of ue component carrier manager object.
uint64_t m_imsi
imsi the unique UE identifier
void EnableRlcStats(Ptr< RadioBearerStatsCalculator > rlcStats)
Enables trace sinks for RLC layer.
void EnableTraces(void)
Enables trace sinks for PHY, MAC, RLC and PDCP.
virtual void ReceiveLteUlHarqFeedback(UlInfoListElement_s mes)
PhySpectrum generated a new UL HARQ feedback.
Hold an unsigned integer type.
void SetSchedulerAttribute(std::string n, const AttributeValue &v)
Set an attribute for the scheduler to be created.
Ptr< NetDevice > InstallSingleUeDevice(Ptr< Node > n)
Create a UE device (LteUeNetDevice) on the given node.
static TypeId GetTypeId(void)
Get the type ID.
uint64_t m_imsiCounter
Keep track of the number of IMSI allocated.
ObjectFactory m_enbAntennaModelFactory
Factory of antenna object for eNodeB.
holds a vector of ns3::NetDevice pointers
void SetPathlossModelType(TypeId type)
Set the type of path loss model to be used for both DL and UL channels.
virtual void AddSpectrumPropagationLossModel(Ptr< SpectrumPropagationLossModel > loss)=0
Add the frequency-dependent propagation loss model to be used.
AttributeValue implementation for TypeId.
uint16_t m_cellIdCounter
Keep track of the number of cell ID allocated.
void EnablePhyTraces(void)
Enable trace sinks for PHY layer.
bool m_isAnrEnabled
The AnrEnabled attribute.
Callback< R > MakeCallback(R(T::*memPtr)(void), OBJ objPtr)
void SetUeComponentCarrierManagerType(std::string type)
Set the type of Component Carrier Manager to be used by Ue devices.
ObjectFactory m_handoverAlgorithmFactory
Factory of handover algorithm object.
fading loss model based on precalculated fading traces
DrbActivatior allows user to activate bearers for UEs when EPC is not used.
void Connect(std::string path, const CallbackBase &cb)
void SetEnbAntennaModelType(std::string type)
Set the type of antenna model to be used by eNodeB devices.
virtual void ReportInterference(const SpectrumValue &interf)
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
static TypeId GetTypeId()
static double GetCarrierFrequency(uint32_t earfcn)
Calculates the carrier frequency from the E-UTRA Absolute Radio Frequency Channel Number (EARFCN) acc...
void SetSpectrumChannelType(std::string type)
Set the type of spectrum channel to be used in both DL and UL.
static TypeId GetTypeId(void)
Get the type ID.
void SetFadingModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the fading model to be created (both DL and UL).
void EnableDlMacTraces(void)
Enable trace sinks for DL MAC layer.
virtual void ReportDataInterference(const SpectrumValue &interf)
Create the mixed CQI report.
virtual void ReceiveLteDlHarqFeedback(DlInfoListElement_s mes)
PhySpectrum generated a new DL HARQ feedback.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
The abstract base class of a Frequency Reuse algorithm.
keep track of a set of node pointers.
uint32_t GetDlEarfcn() const
Hold objects of type Ptr.
This entity is installed inside an eNB and provides the functionality for the X2 interface.
void EnableUlTxPhyTraces(void)
Enable trace sinks for UL transmission PHY layer.
uint16_t m_noOfCcs
Number of component carriers that will be installed by default at eNodeB and UE devices.
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.
Ptr< const AttributeChecker > MakeBooleanChecker(void)
Ptr< SpectrumChannel > m_uplinkChannel
The uplink LTE channel used in the simulation.
static void DlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
Iterator Begin(void) const
Get an iterator which refers to the first Node in the container.
void AddX2Interface(NodeContainer enbNodes)
Create an X2 interface between all the eNBs in a given set.
std::string GetName(void) const
Get the name.
void Set(std::string name, const AttributeValue &value)
Set an attribute to be set during construction.
ObjectFactory m_schedulerFactory
Factory of MAC scheduler object.
void EnableUlPhyTraces(void)
Enable trace sinks for UL PHY layer.
void EnableDlTxPhyTraces(void)
Enable trace sinks for DL transmission PHY layer.
friend class ObjectFactory
Ptr< SpectrumPropagationLossModel > m_fadingModule
The fading model used in both the downlink and uplink channels.
static void DlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
void Receive(Ptr< Packet > p)
receive a packet from the lower layers in order to forward it to the upper layers ...
void EnableUlMacTraces(void)
Enable trace sinks for UL MAC layer.
static void UlPhyReceptionCallback(Ptr< PhyRxStatsCalculator > phyRxStats, std::string path, PhyReceptionStatParameters params)
trace sink
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
void SetCcMap(std::map< uint8_t, Ptr< ComponentCarrierEnb > > ccm)
Set the ComponentCarrier Map of the Enb.
This abstract base class identifies the interface by means of which the helper object can plug on the...
#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< EpcHelper > m_epcHelper
Helper which provides implementation of core network.
Ptr< RadioBearerStatsCalculator > GetRlcStats(void)
NetDeviceContainer InstallUeDevice(NodeContainer c)
Create a set of UE devices.
Ptr< PhyTxStatsCalculator > m_phyTxStats
Container of PHY layer statistics related to transmission.
Ptr< RadioBearerStatsCalculator > GetPdcpStats(void)
static void UlPhyTransmissionCallback(Ptr< PhyTxStatsCalculator > phyTxStats, std::string path, PhyTransmissionStatParameters params)
trace sink
Ptr< SpectrumChannel > GetDownlinkSpectrumChannel(void) const
virtual void DoDispose(void)
Destructor implementation.
The abstract base class of a Component Carrier Manager* for UE that operates using the component carr...
Ptr< const AttributeAccessor > MakeTypeIdAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
virtual void ReceiveLteControlMessageList(std::list< Ptr< LteControlMessage > > msgList)
Receive LTE control message list function.
ObjectFactory m_ffrAlgorithmFactory
Factory of FFR (frequency reuse) algorithm object.
This application is installed inside eNBs and provides the bridge functionality for user data plane p...
void DoHandoverRequest(Ptr< NetDevice > ueDev, Ptr< NetDevice > sourceEnbDev, uint16_t targetCellId)
The actual function to trigger a manual handover.
Models the propagation loss through a transmission medium.
static TypeId GetTypeId(void)
Get the type ID.
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 ...
uint32_t AddDevice(Ptr< NetDevice > device)
Associate a NetDevice to this node.
#define NS_ABORT_MSG_IF(cond, msg)
Abnormal program termination if a condition is true, with a message.
uint32_t GetId(void) const
EpsBearer m_bearer
Configuration of bearer which will be activated.
#define NS_LOG_WARN(msg)
Use NS_LOG to output a message of level LOG_WARN.
The class implements Component Carrier Manager (CCM) that operates using the Component Carrier Manage...
std::vector< Ptr< NetDevice > >::const_iterator Iterator
NetDevice container iterator.
#define NS_LOG_DEBUG(msg)
Use NS_LOG to output a message of level LOG_DEBUG.
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...
virtual void ReceivePss(uint16_t cellId, Ptr< SpectrumValue > p)
Receive PSS function.
void SetEnbAntennaModelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB antenna model to be created.
ObjectFactory m_ueNetDeviceFactory
Factory for LteUeNetDevice objects.
void SetSpectrumChannelAttribute(std::string n, const AttributeValue &v)
Set an attribute for the spectrum channel to be created (both DL and UL).
static void ReportCurrentCellRsrpSinrCallback(Ptr< PhyStatsCalculator > phyStats, std::string path, uint16_t cellId, uint16_t rnti, double rsrp, double sinr, uint8_t componentCarrierId)
trace sink
Defines the interface for spectrum-aware channel implementations.
uint8_t GetDlBandwidth() const
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
static void DlSchedulingCallback(Ptr< MacStatsCalculator > macStats, std::string path, DlSchedulingCallbackInfo dlSchedulingCallbackInfo)
Trace sink for the ns3::LteEnbMac::DlScheduling trace source.
void ReportInterference(uint16_t cellId, Ptr< SpectrumValue > interference)
Notifies the stats calculator that an interference report has occurred.
virtual void DoInitialize(void)
Initialize() implementation.
bool m_useCa
The UseCa attribute.
spectrum-aware propagation loss model
void EnableMacTraces(void)
Enable trace sinks for MAC layer.
A base class which provides memory management and object aggregation.
bool m_active
Bearer can be activated only once.
Ptr< const AttributeAccessor > MakeStringAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
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 ...
Iterator End(void) const
Get an iterator which indicates past-the-last NetDevice in the container.
std::map< uint8_t, Ptr< ComponentCarrierEnb > > GetCcMap(void)
void DoDeActivateDedicatedEpsBearer(Ptr< NetDevice > ueDevice, Ptr< NetDevice > enbDevice, uint8_t bearerId)
The actual function to trigger a manual bearer de-activation.
Ptr< RadioBearerStatsCalculator > m_pdcpStats
Container of PDCP layer statistics.
This class can be used to hold variables of floating point type such as 'double' or 'float'...
Ptr< const AttributeChecker > MakeTypeIdChecker(void)
ObjectFactory m_ueAntennaModelFactory
Factory of antenna object for UE.
std::string GetFfrAlgorithmType() const
void SetAttribute(std::string name, const AttributeValue &value)
Set a single attribute, raising fatal errors if unsuccessful.
The eNodeB device implementation.
Ptr< const AttributeAccessor > MakeUintegerAccessor(T1 a1)
Create an AttributeAccessor for a class data member, or a lone class get functor or set method...
A template-based reference counting class.
void PhyPduReceived(Ptr< Packet > p)
PhySpectrum received a new PHY-PDU.
a unique identifier for an interface.
void SetFfrAlgorithmAttribute(std::string n, const AttributeValue &v)
Set an attribute for the FFR algorithm to be created.
ObjectFactory m_enbNetDeviceFactory
Factory of LteEnbNetDevice objects.
void UpdateSinrPerceived(const SpectrumValue &sinr)
Ptr< SpectrumChannel > m_downlinkChannel
This function create the component carrier based on provided configuration parameters.
TypeId SetParent(TypeId tid)
Set the parent TypeId.
void Initialize(void)
Invoke DoInitialize on all Objects aggregated to this one.
std::string GetSchedulerType() const
std::string GetEnbComponentCarrierManagerType() const
virtual void ReportInterference(const SpectrumValue &interf)
generate a report based on the linear interference and noise power perceived during DATA frame NOTE: ...
void SetEnbDeviceAttribute(std::string n, const AttributeValue &v)
Set an attribute for the eNodeB devices (LteEnbNetDevice) to be created.
bool m_useIdealRrc
The UseIdealRrc attribute.
The LteUeNetDevice class implements the UE net device.