5G-LENA nr-v3.3-81-g75c7590d
The 5G/NR module for the ns-3 simulator
Loading...
Searching...
No Matches

The base class for gNb and UE physical layer. More...

#include "nr-phy.h"

+ Inheritance diagram for ns3::NrPhy:
+ Collaboration diagram for ns3::NrPhy:

Public Member Functions

 NrPhy ()
 NrPhy constructor.
 
 ~NrPhy () override
 ~NrPhy
 
void DoSetCellId (uint16_t cellId)
 Set the cell ID.
 
void EncodeCtrlMsg (const Ptr< NrControlMessage > &msg)
 Take the control messages, and put it in a list that will be sent at the first occasion.
 
void EnqueueCtrlMessage (const Ptr< NrControlMessage > &m)
 Enqueue a ctrl message, keeping in consideration L1L2CtrlDelay.
 
virtual BeamId GetBeamId (uint16_t rnti) const =0
 Get the beam id for the specified user.
 
uint16_t GetBwpId () const
 
uint16_t GetCellId () const
 
double GetCentralFrequency () const
 Retrieve the frequency (in Hz) of this PHY's channel.
 
uint32_t GetChannelBandwidth () const
 Retrieve the channel bandwidth, in Hz.
 
virtual const SfnSfGetCurrentSfnSf () const =0
 Get the current SfnSf.
 
uint32_t GetL1L2CtrlLatency () const
 
double GetNoiseFigure () const
 Get the NoiseFigure value.
 
uint16_t GetNumerology () const
 Get the configured numerology.
 
NrPhySapProviderGetPhySapProvider ()
 Retrieve a pointer to an instance of NrPhySapProvider.
 
enum NrSpectrumValueHelper::PowerAllocationType GetPowerAllocationType () const
 Get the power allocation type.
 
uint32_t GetRbNum () const
 Get the number of Resource block configured.
 
double GetRbOverhead () const
 Get the bandwidth overhead used when calculating the usable RB number.
 
Time GetSlotPeriod () const
 Get the slot period.
 
Ptr< const SpectrumModel > GetSpectrumModel ()
 Get the spectrum model of the PHY.
 
Ptr< NrSpectrumPhyGetSpectrumPhy () const
 Retrieve the SpectrumPhy pointer.
 
uint32_t GetSubcarrierSpacing () const
 Retrieve the subcarrier spacing in Hz. Subcarrier spacing is updated when the numerology is being updated.
 
Time GetSymbolPeriod () const
 Get SymbolPeriod.
 
uint32_t GetSymbolsPerSlot () const
 Get the number of symbols in a slot.
 
virtual Time GetTbDecodeLatency () const
 Returns Transport Block decode latency.
 
virtual double GetTxPower () const =0
 Retrieve the Tx power.
 
bool HasDlSlot () const
 Go through the current pattern and see if at least one slot is DL, F or S.
 
bool HasUlSlot () const
 Go through the current pattern and see if at least one slot is UL, F or S.
 
void InstallCentralFrequency (double f)
 Install the PHY over a particular central frequency.
 
void InstallSpectrumPhy (const Ptr< NrSpectrumPhy > &spectrumPhy)
 Set the SpectrumPhy associated with this PHY.
 
void NotifyConnectionSuccessful ()
 Notify PHY about the successful RRC connection establishment.
 
void PushBackSlotAllocInfo (const SlotAllocInfo &slotAllocInfo)
 Store the slot allocation info.
 
virtual void ScheduleStartEventLoop (uint32_t nodeId, uint16_t frame, uint8_t subframe, uint16_t slot)=0
 Schedule the start of the NR event loop.
 
virtual void SendRachPreamble (uint32_t PreambleId, uint32_t Rnti)
 Send the RachPreamble.
 
void SetBwpId (uint16_t bwpId)
 Set the bwp id. Called by helper.
 
void SetDevice (Ptr< NrNetDevice > d)
 Set the owner device.
 
void SetMacPdu (const Ptr< Packet > &p, const SfnSf &sfn, uint8_t symStart, uint16_t rnti)
 Store a MAC PDU.
 
void SetNoiseFigure (double d)
 Set the NoiseFigure value.
 
void SetNumerology (uint16_t numerology)
 Set GNB or UE numerology.
 
void SetPowerAllocationType (enum NrSpectrumValueHelper::PowerAllocationType powerAllocationType)
 Set power allocation type. There are currently supported two types: one that distributes uniformly energy among all bandwidth (all RBs), and another only over used or active RBs.
 
void SetRbOverhead (double oh)
 Set the bandwidth overhead for calculating the usable RB number.
 
void SetSymbolsPerSlot (uint16_t symbolsPerSlot)
 Set the number of symbol per slot.
 
virtual void SetTbDecodeLatency (const Time &us)
 Configures TB decode latency.
 

Static Public Member Functions

static std::string GetPattern (const std::vector< LteNrTddSlotType > &pattern)
 Get a string representation of a pattern.
 
static TypeId GetTypeId ()
 Get the TypeId of the Object.
 
static bool HasDlSlot (const std::vector< LteNrTddSlotType > &pattern)
 See if at least one slot is DL, F or S.
 
static bool HasUlSlot (const std::vector< LteNrTddSlotType > &pattern)
 See if at least one slot is UL, F or S.
 

Protected Member Functions

void DoDispose () override
 DoDispose method inherited from Object.
 
void DoInitialize () override
 DoInitialize method inherited from Object.
 
void DoUpdateRbNum ()
 Update the number of RB. Usually called after bandwidth changes.
 
void EnqueueCtrlMsgNow (const Ptr< NrControlMessage > &msg)
 Enqueue a CTRL message without considering L1L2CtrlLatency.
 
void EnqueueCtrlMsgNow (const std::list< Ptr< NrControlMessage > > &listOfMsgs)
 Enqueue a CTRL message without considering L1L2CtrlLatency.
 
std::vector< int > FromRBGBitmaskToRBAssignment (const std::vector< bool > rbgBitmask) const
 Transform a MAC-made vector of RBG to a PHY-ready vector of SINR indices.
 
Ptr< SpectrumValue > GetNoisePowerSpectralDensity ()
 Create Noise Power Spectral density.
 
virtual uint32_t GetNumRbPerRbg () const =0
 Protected function that is used to get the number of resource blocks per resource block group.
 
Ptr< PacketBurst > GetPacketBurst (SfnSf sf, uint8_t sym, uint16_t rnti)
 Retrieve the PacketBurst at the slot/symbol specified.
 
Ptr< SpectrumValue > GetTxPowerSpectralDensity (const std::vector< int > &rbIndexVector)
 
void InitializeMessageList ()
 Initialize the message list.
 
bool IsCtrlMsgListEmpty () const
 Check if there are no control messages queued for this slot.
 
SlotAllocInfoPeekSlotAllocInfo (const SfnSf &sfnsf)
 Peek the SlotAllocInfo at the SfnSf specified.
 
virtual std::list< Ptr< NrControlMessage > > PopCurrentSlotCtrlMsgs ()
 Extract and return the message list that is at the beginning of the queue.
 
void PushFrontSlotAllocInfo (const SfnSf &newSfnSf, const SlotAllocInfo &slotAllocInfo)
 Store the slot allocation info at the front.
 
SlotAllocInfo RetrieveSlotAllocInfo ()
 Get the head for the slot allocation info, and delete it from the internal list.
 
SlotAllocInfo RetrieveSlotAllocInfo (const SfnSf &sfnsf)
 Get the SlotAllocationInfo for the specified slot, and delete it from the internal list.
 
void SetChannelBandwidth (uint16_t bandwidth)
 Function to set the channel bandwidth, used also by child classes, i.e., see functions DoSetDlBanwidth in NrUePhy and DoSetBandwidth in NrGnbPhy. This function is also called by NrHelper when creating gNB and UE devices. See CreateGnbPhy and CreateUePhy in NrHelper. This function updates the number of RBs and thus the spectrum model, i.e., for noise PSD and for future transmissions.
 
bool SlotAllocInfoExists (const SfnSf &sfnsf) const
 Check if the SlotAllocationInfo for that slot exists.
 
size_t SlotAllocInfoSize () const
 Retrieve the size of the SlotAllocInfo list.
 

Static Protected Member Functions

static bool IsTdd (const std::vector< LteNrTddSlotType > &pattern)
 Check if a pattern is TDD.
 

Protected Attributes

std::list< Ptr< NrControlMessage > > m_ctrlMsgs
 CTRL messages to be sent.
 
SlotAllocInfo m_currSlotAllocInfo
 Current slot allocation.
 
Ptr< NrNetDevicem_netDevice
 Pointer to the owner netDevice.
 
double m_noiseFigure {0.0}
 Noise figure (attribute)
 
std::unordered_map< uint64_t, Ptr< PacketBurst > > m_packetBurstMap
 Map between SfnSf and PacketBurst.
 
NrPhySapProviderm_phySapProvider
 Pointer to the MAC.
 
uint32_t m_raPreambleId {0}
 Preamble ID.
 
Ptr< NrSpectrumPhym_spectrumPhy
 Pointer to the (owned) spectrum phy.
 
std::vector< LteNrTddSlotTypem_tddPattern = {F, F, F, F, F, F, F, F, F, F}
 Pattern.
 
double m_txPower {0.0}
 Transmission power (attribute)
 

Detailed Description

The base class for gNb and UE physical layer.

From this class descends NrGnbPhy and NrUePhy, the physical layer classes for the gNb and the UE. This class has four main duties:

Management of the control message list

The control message list is maintained as a list that has, always, a number of element equals to the latency between PHY and MAC, plus one. The list is initialized by a call to InitializeMessageList(). The messages are enqueued by MAC at the end of the list through the method EnqueueCtrlMessage(). If the PHY has the necessity of adding a message, then it can use the no-latency version of it, namely EnqueueCtrlMsgNow(). The messages for the current slot (i.e., the messages at the front of the list) can be retrieved with PopCurrentSlotCtrlMsgs(). To know if there are messages for the current slot, use IsCtrlMsgListEmpty(). The list is stored in the variable m_controlMessageQueue.

Management of the slot allocation list

At the gNb, After the MAC does the slot allocation, it is saved in the PHY with the method PushBackSlotAllocInfo(), and if an allocation for the same slot is already present, the two will be merged together. The slot allocation is stored inside the variable m_slotAllocInfo.

Management of the MAC PDU that waits to be transmitted

With each allocation, will come also one (or more) MAC PDU, that are stored within the method SetMacPdu(). The storage is based on the SfnSf inside the variable m_packetBurstMap.

Configuration of the numerology and the related settings

When the numerology is configured, quite a lot of parameters change as well. The entire process of updating the relative parameters is done inside the function SetNumerology().

Antenna and BeamManager object installation

Introspection did not find any typical Config paths.

Attributes

No TraceSources are defined for this type.
Size of this type is 456 bytes (on a 64-bit architecture).

Definition at line 66 of file nr-phy.h.

Constructor & Destructor Documentation

◆ NrPhy()

ns3::NrPhy::NrPhy ( )

NrPhy constructor.

Definition at line 185 of file nr-phy.cc.

References m_phySapProvider, and SetNumerology().

+ Here is the call graph for this function:

◆ ~NrPhy()

ns3::NrPhy::~NrPhy ( )
override

~NrPhy

Definition at line 194 of file nr-phy.cc.

Member Function Documentation

◆ DoDispose()

void ns3::NrPhy::DoDispose ( )
overrideprotected

DoDispose method inherited from Object.

Definition at line 200 of file nr-phy.cc.

References m_ctrlMsgs, m_netDevice, m_packetBurstMap, m_phySapProvider, m_spectrumPhy, and m_tddPattern.

Referenced by ns3::NrGnbPhy::DoDispose(), and ns3::NrUePhy::DoDispose().

+ Here is the caller graph for this function:

◆ DoInitialize()

void ns3::NrPhy::DoInitialize ( )
overrideprotected

DoInitialize method inherited from Object.

Definition at line 218 of file nr-phy.cc.

References m_spectrumPhy.

◆ DoSetCellId()

void ns3::NrPhy::DoSetCellId ( uint16_t  cellId)

Set the cell ID.

Parameters
cellIdthe cell id.

Called by lte-gnb-cphy-sap only.

Definition at line 329 of file nr-phy.cc.

Referenced by ns3::NrUePhy::RegisterToGnb().

+ Here is the caller graph for this function:

◆ DoUpdateRbNum()

void ns3::NrPhy::DoUpdateRbNum ( )
protected

Update the number of RB. Usually called after bandwidth changes.

Definition at line 534 of file nr-phy.cc.

References GetChannelBandwidth(), GetNoisePowerSpectralDensity(), GetRbNum(), m_spectrumPhy, and ns3::NrSpectrumValueHelper::SUBCARRIERS_PER_RB.

Referenced by SetChannelBandwidth(), and SetNumerology().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ EncodeCtrlMsg()

void ns3::NrPhy::EncodeCtrlMsg ( const Ptr< NrControlMessage > &  msg)

Take the control messages, and put it in a list that will be sent at the first occasion.

Parameters
msgMessage to "encode" and transmit

Definition at line 470 of file nr-phy.cc.

References m_ctrlMsgs.

Referenced by ns3::NrUePhy::FinishSlotProcessing().

+ Here is the caller graph for this function:

◆ EnqueueCtrlMessage()

void ns3::NrPhy::EnqueueCtrlMessage ( const Ptr< NrControlMessage > &  m)

Enqueue a ctrl message, keeping in consideration L1L2CtrlDelay.

Parameters
mthe message to enqueue

Definition at line 445 of file nr-phy.cc.

◆ EnqueueCtrlMsgNow() [1/2]

void ns3::NrPhy::EnqueueCtrlMsgNow ( const Ptr< NrControlMessage > &  msg)
protected

Enqueue a CTRL message without considering L1L2CtrlLatency.

Parameters
msgThe message to enqueue

Definition at line 453 of file nr-phy.cc.

◆ EnqueueCtrlMsgNow() [2/2]

void ns3::NrPhy::EnqueueCtrlMsgNow ( const std::list< Ptr< NrControlMessage > > &  listOfMsgs)
protected

Enqueue a CTRL message without considering L1L2CtrlLatency.

Parameters
listOfMsgsThe list of messages to enqueue

Definition at line 461 of file nr-phy.cc.

◆ FromRBGBitmaskToRBAssignment()

std::vector< int > ns3::NrPhy::FromRBGBitmaskToRBAssignment ( const std::vector< bool >  rbgBitmask) const
protected

Transform a MAC-made vector of RBG to a PHY-ready vector of SINR indices.

Parameters
rbgBitmaskBitmask which indicates with 1 the RBG in which there is a transmission, with 0 a RBG in which there is not a transmission
Returns
a vector of indices.

Example (4 RB per RBG, 4 total RBG assignable): rbgBitmask = <0,1,1,0> output = <4,5,6,7,8,9,10,11>

(the rbgBitmask expressed as rbBitmask would be: <0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0> , and therefore the places in which there is a 1 are from the 4th to the 11th, and that is reflected in the output)

Definition at line 165 of file nr-phy.cc.

◆ GetBeamId()

virtual BeamId ns3::NrPhy::GetBeamId ( uint16_t  rnti) const
pure virtual

Get the beam id for the specified user.

Parameters
rntiRNTI
Returns
the BeamId associated to the specified RNTI

Implemented in ns3::NrGnbPhy, and ns3::NrUePhy.

◆ GetBwpId()

◆ GetCellId()

uint16_t ns3::NrPhy::GetCellId ( ) const

◆ GetCentralFrequency()

double ns3::NrPhy::GetCentralFrequency ( ) const

Retrieve the frequency (in Hz) of this PHY's channel.

Returns
the frequency of the channel in Hz

The function will assert if it is called without having set a frequency first.

Definition at line 406 of file nr-phy.cc.

Referenced by GetSpectrumModel().

+ Here is the caller graph for this function:

◆ GetChannelBandwidth()

uint32_t ns3::NrPhy::GetChannelBandwidth ( ) const

Retrieve the channel bandwidth, in Hz.

Returns
the channel bandwidth in Hz

Definition at line 521 of file nr-phy.cc.

Referenced by DoUpdateRbNum(), and SetChannelBandwidth().

+ Here is the caller graph for this function:

◆ GetCurrentSfnSf()

virtual const SfnSf & ns3::NrPhy::GetCurrentSfnSf ( ) const
pure virtual

Get the current SfnSf.

Returns
the current SfnSf

Implemented in ns3::NrGnbPhy, and ns3::NrUePhy.

◆ GetL1L2CtrlLatency()

uint32_t ns3::NrPhy::GetL1L2CtrlLatency ( ) const
Returns
the latency (in n. of slots) between L1 and L2 layers. Default to 2.

Before it was an attribute; as we are unsure if it works for values different from 2, we decided to make it static until the need to have it different from 2 arises.

Definition at line 664 of file nr-phy.cc.

Referenced by InitializeMessageList().

+ Here is the caller graph for this function:

◆ GetNoiseFigure()

double ns3::NrPhy::GetNoiseFigure ( ) const

Get the NoiseFigure value.

Returns
the noise figure

Definition at line 877 of file nr-phy.cc.

References m_noiseFigure.

Referenced by ns3::NrGnbPhy::GetTypeId(), and ns3::NrUePhy::GetTypeId().

+ Here is the caller graph for this function:

◆ GetNoisePowerSpectralDensity()

Ptr< SpectrumValue > ns3::NrPhy::GetNoisePowerSpectralDensity ( )
protected

Create Noise Power Spectral density.

Returns
A SpectrumValue array with fixed size, in which a value is update to a particular value of the noise

Definition at line 388 of file nr-phy.cc.

References ns3::NrSpectrumValueHelper::CreateNoisePowerSpectralDensity(), GetSpectrumModel(), and m_noiseFigure.

Referenced by DoUpdateRbNum(), and SetNoiseFigure().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetNumerology()

uint16_t ns3::NrPhy::GetNumerology ( ) const

Get the configured numerology.

Returns
the configured numerology

Definition at line 290 of file nr-phy.cc.

Referenced by GetPacketBurst(), ns3::NrGnbPhy::GetTypeId(), PeekSlotAllocInfo(), ns3::NrUePhy::ReceivePss(), RetrieveSlotAllocInfo(), SetMacPdu(), SetNumerology(), and SlotAllocInfoExists().

+ Here is the caller graph for this function:

◆ GetNumRbPerRbg()

virtual uint32_t ns3::NrPhy::GetNumRbPerRbg ( ) const
protectedpure virtual

Protected function that is used to get the number of resource blocks per resource block group.

Returns
Returns the number of RBs per RBG

Implemented in ns3::NrGnbPhy, and ns3::NrUePhy.

◆ GetPacketBurst()

Ptr< PacketBurst > ns3::NrPhy::GetPacketBurst ( SfnSf  sf,
uint8_t  sym,
uint16_t  rnti 
)
protected

Retrieve the PacketBurst at the slot/symbol specified.

Parameters
sfSystem frame and slot number
symSymbol at which the PacketBurst should be sent
rntiThe RNTI associated with this burst
Returns
a pointer to the burst, if present, otherwise nullptr

Definition at line 365 of file nr-phy.cc.

References ns3::SfnSf::GetEncodingWithSymStartRnti(), GetNumerology(), ns3::SfnSf::GetNumerology(), and m_packetBurstMap.

Referenced by PushFrontSlotAllocInfo().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetPattern()

std::string ns3::NrPhy::GetPattern ( const std::vector< LteNrTddSlotType > &  pattern)
static

Get a string representation of a pattern.

Parameters
patternthe TDD pattern
Returns
a string representation of the pattern, such as "F|F|F|F|..."

Definition at line 414 of file nr-phy.cc.

References ns3::DL, ns3::F, ns3::S, and ns3::UL.

Referenced by ns3::NrGnbPhy::GetPattern().

+ Here is the caller graph for this function:

◆ GetPhySapProvider()

NrPhySapProvider * ns3::NrPhy::GetPhySapProvider ( )

Retrieve a pointer to an instance of NrPhySapProvider.

Returns
NrPhySapProvider pointer, that points at this instance

Definition at line 676 of file nr-phy.cc.

References m_phySapProvider.

◆ GetPowerAllocationType()

enum NrSpectrumValueHelper::PowerAllocationType ns3::NrPhy::GetPowerAllocationType ( ) const

Get the power allocation type.

Definition at line 439 of file nr-phy.cc.

Referenced by ns3::NrGnbPhy::GetTypeId(), ns3::NrUePhy::GetTypeId(), and ns3::NrGnbPhy::SetSubChannels().

+ Here is the caller graph for this function:

◆ GetRbNum()

uint32_t ns3::NrPhy::GetRbNum ( ) const

Get the number of Resource block configured.

It changes with the numerology and the channel bandwidth

Definition at line 515 of file nr-phy.cc.

Referenced by DoUpdateRbNum(), GetSpectrumModel(), SetNoiseFigure(), and SetNumerology().

+ Here is the caller graph for this function:

◆ GetRbOverhead()

double ns3::NrPhy::GetRbOverhead ( ) const

Get the bandwidth overhead used when calculating the usable RB number.

Returns
the bandwidth overhead

Definition at line 310 of file nr-phy.cc.

Referenced by ns3::NrGnbPhy::GetTypeId().

+ Here is the caller graph for this function:

◆ GetSlotPeriod()

Time ns3::NrPhy::GetSlotPeriod ( ) const

Get the slot period.

Returns
the slot period (depend on the numerology)

Definition at line 322 of file nr-phy.cc.

Referenced by ns3::NrUePhy::EnqueueDlHarqFeedback(), and SetNumerology().

+ Here is the caller graph for this function:

◆ GetSpectrumModel()

Ptr< const SpectrumModel > ns3::NrPhy::GetSpectrumModel ( )

Get the spectrum model of the PHY.

Returns
a pointer to the spectrum model

Definition at line 848 of file nr-phy.cc.

References GetCentralFrequency(), GetRbNum(), ns3::NrSpectrumValueHelper::GetSpectrumModel(), and GetSubcarrierSpacing().

Referenced by GetNoisePowerSpectralDensity(), and GetTxPowerSpectralDensity().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetSpectrumPhy()

Ptr< NrSpectrumPhy > ns3::NrPhy::GetSpectrumPhy ( ) const

Retrieve the SpectrumPhy pointer.

As this function is used mainly to get traced values out of Spectrum, it should be removed and the traces connected (and redirected) here.

Returns
A pointer to the SpectrumPhy of this UE

Definition at line 670 of file nr-phy.cc.

References m_spectrumPhy.

Referenced by ns3::NrGnbPhy::GetTypeId(), and ns3::NrUePhy::GetTypeId().

+ Here is the caller graph for this function:

◆ GetSubcarrierSpacing()

uint32_t ns3::NrPhy::GetSubcarrierSpacing ( ) const

Retrieve the subcarrier spacing in Hz. Subcarrier spacing is updated when the numerology is being updated.

Returns
the sucarrier spacing in Hz

Definition at line 528 of file nr-phy.cc.

Referenced by GetSpectrumModel(), and SetNumerology().

+ Here is the caller graph for this function:

◆ GetSymbolPeriod()

Time ns3::NrPhy::GetSymbolPeriod ( ) const

Get SymbolPeriod.

Returns
the symbol period; the value changes every time the user changes the numerology

Definition at line 859 of file nr-phy.cc.

Referenced by ns3::NrUePhy::FinishSlotProcessing(), SetNumerology(), and ns3::NrUePhy::SetSubChannelsForTransmission().

+ Here is the caller graph for this function:

◆ GetSymbolsPerSlot()

uint32_t ns3::NrPhy::GetSymbolsPerSlot ( ) const

Get the number of symbols in a slot.

Returns
the number of symbol per slot

Definition at line 316 of file nr-phy.cc.

Referenced by ns3::NrGnbPhy::GetTypeId().

+ Here is the caller graph for this function:

◆ GetTbDecodeLatency()

Time ns3::NrPhy::GetTbDecodeLatency ( ) const
virtual

Returns Transport Block decode latency.

Returns
The TB decode latency

Definition at line 889 of file nr-phy.cc.

Referenced by ns3::NrGnbPhy::GetTypeId(), ns3::NrUePhy::GetTypeId(), ns3::NrGnbPhy::PhyDataPacketReceived(), and ns3::NrUePhy::PhyDataPacketReceived().

+ Here is the caller graph for this function:

◆ GetTxPower()

virtual double ns3::NrPhy::GetTxPower ( ) const
pure virtual

Retrieve the Tx power.

Returns
the Tx power

Implemented in ns3::NrGnbPhy, and ns3::NrUePhy.

◆ GetTxPowerSpectralDensity()

Ptr< SpectrumValue > ns3::NrPhy::GetTxPowerSpectralDensity ( const std::vector< int > &  rbIndexVector)
protected

Create Tx Power Spectral Density

Parameters
rbIndexVectorvector of the index of the RB (in SpectrumValue array) in which there is a transmission
Returns
A SpectrumValue array with fixed size, in which each value is updated to a particular value if the correspond RB index was inside the rbIndexVector, or is left untouched otherwise.
See also
NrSpectrumValueHelper::CreateTxPowerSpectralDensity

Definition at line 395 of file nr-phy.cc.

References ns3::NrSpectrumValueHelper::CreateTxPowerSpectralDensity(), GetSpectrumModel(), and m_txPower.

Referenced by ns3::NrGnbPhy::SetSubChannels(), and ns3::NrUePhy::SetSubChannelsForTransmission().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetTypeId()

TypeId ns3::NrPhy::GetTypeId ( )
static

Get the TypeId of the Object.

Returns
the TypeId of the Object

Definition at line 151 of file nr-phy.cc.

◆ HasDlSlot() [1/2]

bool ns3::NrPhy::HasDlSlot ( ) const

Go through the current pattern and see if at least one slot is DL, F or S.

Returns
true if at least one slot is DL, F or S.

Definition at line 477 of file nr-phy.cc.

References HasDlSlot(), and m_tddPattern.

Referenced by HasDlSlot(), and ns3::NrGnbPhy::RegisterUe().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasDlSlot() [2/2]

bool ns3::NrPhy::HasDlSlot ( const std::vector< LteNrTddSlotType > &  pattern)
static

See if at least one slot is DL, F or S.

Parameters
patternPattern to check
Returns
true if at least one slot is DL, F or S.

Definition at line 489 of file nr-phy.cc.

References ns3::DL, ns3::F, and ns3::S.

◆ HasUlSlot() [1/2]

bool ns3::NrPhy::HasUlSlot ( ) const

Go through the current pattern and see if at least one slot is UL, F or S.

Returns
true if at least one slot is UL, F or S.

Definition at line 483 of file nr-phy.cc.

References HasUlSlot(), and m_tddPattern.

Referenced by HasUlSlot().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ HasUlSlot() [2/2]

bool ns3::NrPhy::HasUlSlot ( const std::vector< LteNrTddSlotType > &  pattern)
static

See if at least one slot is UL, F or S.

Parameters
patternPattern to check
Returns
true if at least one slot is UL, F or S.

Definition at line 502 of file nr-phy.cc.

References ns3::F, ns3::S, and ns3::UL.

◆ InitializeMessageList()

void ns3::NrPhy::InitializeMessageList ( )
protected

Initialize the message list.

Definition at line 599 of file nr-phy.cc.

References GetL1L2CtrlLatency().

Referenced by ns3::NrUePhy::RegisterToGnb().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ InstallCentralFrequency()

void ns3::NrPhy::InstallCentralFrequency ( double  f)

Install the PHY over a particular central frequency.

Parameters
fthe frequency in Hz The helper will call this function, making sure it is equal to the value of the channel.

Definition at line 235 of file nr-phy.cc.

◆ InstallSpectrumPhy()

void ns3::NrPhy::InstallSpectrumPhy ( const Ptr< NrSpectrumPhy > &  spectrumPhy)

Set the SpectrumPhy associated with this PHY.

Parameters
spectrumPhythe spectrumPhy

Definition at line 639 of file nr-phy.cc.

References m_spectrumPhy.

◆ IsCtrlMsgListEmpty()

bool ns3::NrPhy::IsCtrlMsgListEmpty ( ) const
protected

Check if there are no control messages queued for this slot.

Returns
true if there are no control messages queued for this slot

Definition at line 841 of file nr-phy.cc.

◆ IsTdd()

bool ns3::NrPhy::IsTdd ( const std::vector< LteNrTddSlotType > &  pattern)
staticprotected

Check if a pattern is TDD.

Parameters
patternthe pattern to check
Returns
true if the pattern has at least one mixed DL/UL

Definition at line 572 of file nr-phy.cc.

References ns3::DL, ns3::F, and ns3::UL.

◆ NotifyConnectionSuccessful()

void ns3::NrPhy::NotifyConnectionSuccessful ( )

Notify PHY about the successful RRC connection establishment.

Definition at line 359 of file nr-phy.cc.

◆ PeekSlotAllocInfo()

SlotAllocInfo & ns3::NrPhy::PeekSlotAllocInfo ( const SfnSf sfnsf)
protected

Peek the SlotAllocInfo at the SfnSf specified.

Parameters
sfnsf(existing) SfnSf to look for
Returns
a reference to the SlotAllocInfo

The method will assert if sfnsf does not exits (please check with SlotExists())

Definition at line 818 of file nr-phy.cc.

References GetNumerology(), and ns3::SfnSf::GetNumerology().

+ Here is the call graph for this function:

◆ PopCurrentSlotCtrlMsgs()

std::list< Ptr< NrControlMessage > > ns3::NrPhy::PopCurrentSlotCtrlMsgs ( )
protectedvirtual

Extract and return the message list that is at the beginning of the queue.

Returns
a list of control messages that are meant to be sent in the current slot

Definition at line 611 of file nr-phy.cc.

Referenced by ns3::NrUePhy::FinishSlotProcessing().

+ Here is the caller graph for this function:

◆ PushBackSlotAllocInfo()

void ns3::NrPhy::PushBackSlotAllocInfo ( const SlotAllocInfo slotAllocInfo)

Store the slot allocation info.

Parameters
slotAllocInfothe allocation to store

This method expect that the sfn of the allocation will match the sfn when the allocation will be retrieved.

Definition at line 683 of file nr-phy.cc.

References ns3::SlotAllocInfo::m_sfnSf.

◆ PushFrontSlotAllocInfo()

void ns3::NrPhy::PushFrontSlotAllocInfo ( const SfnSf newSfnSf,
const SlotAllocInfo slotAllocInfo 
)
protected

Store the slot allocation info at the front.

Parameters
slotAllocInfothe allocation to store

Increase the sfn of all allocations to be chronologically "in order".

Definition at line 718 of file nr-phy.cc.

References ns3::SfnSf::Add(), ns3::DciInfoElementTdma::DATA, ns3::SfnSf::Decode(), ns3::SfnSf::GetEncodingWithSymStartRnti(), GetPacketBurst(), and m_packetBurstMap.

+ Here is the call graph for this function:

◆ RetrieveSlotAllocInfo() [1/2]

SlotAllocInfo ns3::NrPhy::RetrieveSlotAllocInfo ( )
protected

Get the head for the slot allocation info, and delete it from the internal list.

Returns
the Slot allocation info head

Definition at line 789 of file nr-phy.cc.

Referenced by ns3::NrUePhy::FinishSlotProcessing().

+ Here is the caller graph for this function:

◆ RetrieveSlotAllocInfo() [2/2]

SlotAllocInfo ns3::NrPhy::RetrieveSlotAllocInfo ( const SfnSf sfnsf)
protected

Get the SlotAllocationInfo for the specified slot, and delete it from the internal list.

Parameters
sfnsfslot specified
Returns
the SlotAllocationInfo

Definition at line 798 of file nr-phy.cc.

References GetNumerology(), and ns3::SfnSf::GetNumerology().

+ Here is the call graph for this function:

◆ ScheduleStartEventLoop()

virtual void ns3::NrPhy::ScheduleStartEventLoop ( uint32_t  nodeId,
uint16_t  frame,
uint8_t  subframe,
uint16_t  slot 
)
pure virtual

Schedule the start of the NR event loop.

Parameters
nodeIdnode id (for log messages)
frameStarting frame number
subframeStarting subframe number
slotStarting slot number

The method is scheduling the start of the first slot at time 0.0.

Implemented in ns3::NrGnbPhy, and ns3::NrUePhy.

◆ SendRachPreamble()

void ns3::NrPhy::SendRachPreamble ( uint32_t  PreambleId,
uint32_t  Rnti 
)
virtual

Send the RachPreamble.

The RACH PREAMBLE is sent ASAP, without applying any delay, since it is sent in the PRACH channel

Parameters
PreambleIdpreamble ID
RntiRNTI

Definition at line 336 of file nr-phy.cc.

◆ SetBwpId()

void ns3::NrPhy::SetBwpId ( uint16_t  bwpId)

Set the bwp id. Called by helper.

Definition at line 646 of file nr-phy.cc.

◆ SetChannelBandwidth()

void ns3::NrPhy::SetChannelBandwidth ( uint16_t  bandwidth)
protected

Function to set the channel bandwidth, used also by child classes, i.e., see functions DoSetDlBanwidth in NrUePhy and DoSetBandwidth in NrGnbPhy. This function is also called by NrHelper when creating gNB and UE devices. See CreateGnbPhy and CreateUePhy in NrHelper. This function updates the number of RBs and thus the spectrum model, i.e., for noise PSD and for future transmissions.

Parameters
bandwidthchannel bandwidth in kHz * 100

Definition at line 243 of file nr-phy.cc.

References DoUpdateRbNum(), and GetChannelBandwidth().

+ Here is the call graph for this function:

◆ SetDevice()

void ns3::NrPhy::SetDevice ( Ptr< NrNetDevice d)

Set the owner device.

Parameters
dthe owner device

Definition at line 228 of file nr-phy.cc.

References m_netDevice.

◆ SetMacPdu()

void ns3::NrPhy::SetMacPdu ( const Ptr< Packet > &  p,
const SfnSf sfn,
uint8_t  symStart,
uint16_t  rnti 
)

Store a MAC PDU.

Parameters
pthe MAC PDU
sfnThe SfnSf at which store the PDU
symStartThe symbol inside the SfnSf at which the data will be transmitted
rntiThe RNTI of the UE, to create separate DL PHY signals towards different UEs

It will be saved in the PacketBurst map following the SfnSf present in the tag.

Definition at line 342 of file nr-phy.cc.

References ns3::SfnSf::GetEncodingWithSymStartRnti(), GetNumerology(), ns3::SfnSf::GetNumerology(), and m_packetBurstMap.

+ Here is the call graph for this function:

◆ SetNoiseFigure()

void ns3::NrPhy::SetNoiseFigure ( double  d)

Set the NoiseFigure value.

Parameters
dthe Noise figure value

Definition at line 866 of file nr-phy.cc.

References GetNoisePowerSpectralDensity(), GetRbNum(), m_noiseFigure, and m_spectrumPhy.

Referenced by ns3::NrGnbPhy::GetTypeId(), and ns3::NrUePhy::GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetNumerology()

void ns3::NrPhy::SetNumerology ( uint16_t  numerology)

Set GNB or UE numerology.

Parameters
numerologynumerology

For the GNB, this is an attribute that can be changed at any time; for the UE, it is set by the helper at the attachment, and then is not changed anymore.

Definition at line 262 of file nr-phy.cc.

References DoUpdateRbNum(), GetNumerology(), GetRbNum(), GetSlotPeriod(), GetSubcarrierSpacing(), and GetSymbolPeriod().

Referenced by NrPhy(), and ns3::NrGnbPhy::GetTypeId().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SetPowerAllocationType()

void ns3::NrPhy::SetPowerAllocationType ( enum NrSpectrumValueHelper::PowerAllocationType  powerAllocationType)

Set power allocation type. There are currently supported two types: one that distributes uniformly energy among all bandwidth (all RBs), and another only over used or active RBs.

Parameters
powerAllocationTypea type of power allocation to be used

Definition at line 433 of file nr-phy.cc.

Referenced by ns3::NrGnbPhy::GetTypeId(), and ns3::NrUePhy::GetTypeId().

+ Here is the caller graph for this function:

◆ SetRbOverhead()

void ns3::NrPhy::SetRbOverhead ( double  oh)

Set the bandwidth overhead for calculating the usable RB number.

Parameters
ohthe overhead

Definition at line 304 of file nr-phy.cc.

Referenced by ns3::NrGnbPhy::GetTypeId().

+ Here is the caller graph for this function:

◆ SetSymbolsPerSlot()

void ns3::NrPhy::SetSymbolsPerSlot ( uint16_t  symbolsPerSlot)

Set the number of symbol per slot.

Parameters
symbolsPerSlotthe value of symbol per slot (12 or 14)

Definition at line 296 of file nr-phy.cc.

Referenced by ns3::NrGnbPhy::GetTypeId().

+ Here is the caller graph for this function:

◆ SetTbDecodeLatency()

void ns3::NrPhy::SetTbDecodeLatency ( const Time &  us)
virtual

Configures TB decode latency.

Parameters
usdecode latency

Definition at line 883 of file nr-phy.cc.

Referenced by ns3::NrGnbPhy::GetTypeId(), and ns3::NrUePhy::GetTypeId().

+ Here is the caller graph for this function:

◆ SlotAllocInfoExists()

bool ns3::NrPhy::SlotAllocInfoExists ( const SfnSf sfnsf) const
protected

Check if the SlotAllocationInfo for that slot exists.

Parameters
sfnsfslot to check
Returns
true if the allocation exists

Definition at line 774 of file nr-phy.cc.

References GetNumerology(), and ns3::SfnSf::GetNumerology().

+ Here is the call graph for this function:

◆ SlotAllocInfoSize()

size_t ns3::NrPhy::SlotAllocInfoSize ( ) const
protected

Retrieve the size of the SlotAllocInfo list.

Returns
the allocation list size

Definition at line 834 of file nr-phy.cc.

Member Data Documentation

◆ m_ctrlMsgs

std::list<Ptr<NrControlMessage> > ns3::NrPhy::m_ctrlMsgs
protected

CTRL messages to be sent.

Definition at line 571 of file nr-phy.h.

Referenced by DoDispose(), and EncodeCtrlMsg().

◆ m_currSlotAllocInfo

SlotAllocInfo ns3::NrPhy::m_currSlotAllocInfo
protected

Current slot allocation.

Definition at line 566 of file nr-phy.h.

Referenced by ns3::NrUePhy::FinishSlotProcessing().

◆ m_netDevice

Ptr<NrNetDevice> ns3::NrPhy::m_netDevice
protected

◆ m_noiseFigure

double ns3::NrPhy::m_noiseFigure {0.0}
protected

Noise figure (attribute)

Definition at line 561 of file nr-phy.h.

Referenced by GetNoiseFigure(), GetNoisePowerSpectralDensity(), and SetNoiseFigure().

◆ m_packetBurstMap

std::unordered_map<uint64_t, Ptr<PacketBurst> > ns3::NrPhy::m_packetBurstMap
protected

Map between SfnSf and PacketBurst.

Definition at line 564 of file nr-phy.h.

Referenced by DoDispose(), GetPacketBurst(), PushFrontSlotAllocInfo(), and SetMacPdu().

◆ m_phySapProvider

NrPhySapProvider* ns3::NrPhy::m_phySapProvider
protected

Pointer to the MAC.

Definition at line 568 of file nr-phy.h.

Referenced by NrPhy(), DoDispose(), and GetPhySapProvider().

◆ m_raPreambleId

uint32_t ns3::NrPhy::m_raPreambleId {0}
protected

Preamble ID.

Definition at line 570 of file nr-phy.h.

◆ m_spectrumPhy

◆ m_tddPattern

◆ m_txPower


The documentation for this class was generated from the following files: