#include <lte-spectrum-phy.h>
Public Types | |
enum | State { IDLE, TX, RX } |
Public Member Functions | |
LteSpectrumPhy () | |
virtual | ~LteSpectrumPhy () |
void | AddExpectedTb (uint16_t rnti, uint16_t size, uint8_t mcs, std::vector< int > map, uint8_t layer) |
void | AddSinrChunkProcessor (Ptr< LteSinrChunkProcessor > p) |
int64_t | AssignStreams (int64_t stream) |
virtual void | DoDispose () |
Ptr< NetDevice > | GetDevice () |
Ptr< MobilityModel > | GetMobility () |
Ptr< AntennaModel > | GetRxAntenna () |
Ptr< const SpectrumModel > | GetRxSpectrumModel () const |
void | SetAntenna (Ptr< AntennaModel > a) |
void | SetCellId (uint16_t cellId) |
void | SetChannel (Ptr< SpectrumChannel > c) |
void | SetDevice (Ptr< NetDevice > d) |
void | SetGenericPhyRxEndErrorCallback (GenericPhyRxEndErrorCallback c) |
void | SetGenericPhyRxEndOkCallback (GenericPhyRxEndOkCallback c) |
void | SetGenericPhyTxEndCallback (GenericPhyTxEndCallback c) |
void | SetMobility (Ptr< MobilityModel > m) |
void | SetNoisePowerSpectralDensity (Ptr< const SpectrumValue > noisePsd) |
set the noise power spectral density | |
void | SetState (State newState) |
Set the state of the phy layer. | |
void | SetTransmissionMode (uint8_t txMode) |
void | SetTxPowerSpectralDensity (Ptr< SpectrumValue > txPsd) |
void | StartRx (Ptr< SpectrumSignalParameters > params) |
bool | StartTx (Ptr< PacketBurst > pb) |
void | UpdateSinrPerceived (const SpectrumValue &sinr) |
![]() | |
SpectrumPhy () | |
virtual | ~SpectrumPhy () |
![]() | |
Object () | |
virtual | ~Object () |
void | AggregateObject (Ptr< Object > other) |
void | Dispose (void) |
AggregateIterator | GetAggregateIterator (void) const |
virtual TypeId | GetInstanceTypeId (void) const |
template<typename T > | |
Ptr< T > | GetObject (void) const |
template<typename T > | |
Ptr< T > | GetObject (TypeId tid) const |
void | Start (void) |
![]() | |
SimpleRefCount () | |
SimpleRefCount (const SimpleRefCount &o) | |
uint32_t | GetReferenceCount (void) const |
SimpleRefCount & | operator= (const SimpleRefCount &o) |
void | Ref (void) const |
void | Unref (void) const |
![]() | |
virtual | ~ObjectBase () |
void | GetAttribute (std::string name, AttributeValue &value) const |
bool | GetAttributeFailSafe (std::string name, AttributeValue &attribute) const |
void | SetAttribute (std::string name, const AttributeValue &value) |
bool | SetAttributeFailSafe (std::string name, const AttributeValue &value) |
bool | TraceConnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceConnectWithoutContext (std::string name, const CallbackBase &cb) |
bool | TraceDisconnect (std::string name, std::string context, const CallbackBase &cb) |
bool | TraceDisconnectWithoutContext (std::string name, const CallbackBase &cb) |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
This method returns the TypeId associated to ns3::LteSpectrumPhy. |
Private Member Functions | |
void | ChangeState (State newState) |
void | EndRx () |
void | EndTx () |
void | SetTxModeGain (uint8_t txMode, double gain) |
Friends | |
class | LteUePhy |
Additional Inherited Members | |
![]() | |
Object (const Object &o) | |
virtual void | DoStart (void) |
virtual void | NotifyNewAggregate (void) |
The LteSpectrumPhy models the physical layer of LTE
It supports a single antenna model instance which is used for both transmission and reception.
Definition at line 79 of file lte-spectrum-phy.h.
ns3::LteSpectrumPhy::LteSpectrumPhy | ( | ) |
Definition at line 70 of file lte-spectrum-phy.cc.
References m_interference, m_random, m_txModeGain, NS_LOG_FUNCTION, and ns3::ObjectBase::SetAttribute().
|
virtual |
Definition at line 86 of file lte-spectrum-phy.cc.
References m_expectedTbs, m_txModeGain, and NS_LOG_FUNCTION.
void ns3::LteSpectrumPhy::AddExpectedTb | ( | uint16_t | rnti, |
uint16_t | size, | ||
uint8_t | mcs, | ||
std::vector< int > | map, | ||
uint8_t | layer | ||
) |
rnti | the rnti of the source of the TB |
size | the size of the TB |
mcs | the MCS of the TB |
map | the map of RB(s) used |
layer | the layer (in case of MIMO tx) |
Definition at line 455 of file lte-spectrum-phy.cc.
References m_expectedTbs, ns3::TbId_t::m_layer, ns3::TbId_t::m_rnti, and NS_LOG_LOGIC.
Referenced by ns3::LteUePhy::ReceiveIdealControlMessage(), and ns3::LteEnbPhy::StartSubFrame().
void ns3::LteSpectrumPhy::AddSinrChunkProcessor | ( | Ptr< LteSinrChunkProcessor > | p | ) |
p | the new LteSinrChunkProcessor to be added to the processing chain |
Definition at line 554 of file lte-spectrum-phy.cc.
References ns3::LteInterference::AddSinrChunkProcessor(), and m_interference.
Referenced by ns3::LteLinkAdaptationTestCase::DoRun(), ns3::LteEnbAntennaTestCase::DoRun(), and ns3::LteInterferenceTestCase::DoRun().
int64_t ns3::LteSpectrumPhy::AssignStreams | ( | int64_t | stream | ) |
Assign a fixed random variable stream number to the random variables used by this model. Return the number of streams (possibly zero) that have been assigned.
stream | first stream index to use |
Definition at line 595 of file lte-spectrum-phy.cc.
References m_random, NS_LOG_FUNCTION, and ns3::RandomVariableStream::SetStream().
Referenced by ns3::LteHelper::AssignStreams().
|
private |
Definition at line 269 of file lte-spectrum-phy.cc.
References m_state, and NS_LOG_LOGIC.
Referenced by EndRx(), EndTx(), SetState(), StartRx(), and StartTx().
|
virtual |
This method is called by Object::Dispose or by the object's destructor, whichever comes first.
Subclasses are expected to implement their real destruction code in an overriden version of this method and chain up to their parent's implementation once they are done. i.e., for simplicity, the destructor of every subclass should be empty and its content should be moved to the associated DoDispose method.
It is safe to call GetObject from within this method.
Reimplemented from ns3::Object.
Definition at line 93 of file lte-spectrum-phy.cc.
References ns3::Object::Dispose(), m_channel, m_device, m_genericPhyRxEndErrorCallback, m_genericPhyRxEndOkCallback, m_genericPhyTxEndCallback, m_interference, m_mobility, and NS_LOG_FUNCTION.
|
private |
Definition at line 475 of file lte-spectrum-phy.cc.
References ChangeState(), ns3::LteInterference::EndRx(), ns3::LteRadioBearerTag::GetLayer(), ns3::LteRadioBearerTag::GetRnti(), ns3::LteMiErrorModel::GetTbError(), ns3::UniformRandomVariable::GetValue(), IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), list, m_expectedTbs, m_genericPhyRxEndOkCallback, m_interference, ns3::TbId_t::m_layer, m_pemEnabled, m_phyRxEndErrorTrace, m_phyRxEndOkTrace, m_random, ns3::TbId_t::m_rnti, m_rxPacketBurstList, m_sinrPerceived, m_state, m_transmissionMode, m_txModeGain, NS_ASSERT, NS_LOG_DEBUG, NS_LOG_FUNCTION, NS_LOG_INFO, NS_LOG_LOGIC, and RX.
Referenced by StartRx().
|
private |
Definition at line 337 of file lte-spectrum-phy.cc.
References ns3::PacketBurst::Begin(), ChangeState(), ns3::Packet::Copy(), ns3::PacketBurst::End(), IDLE, ns3::Callback< R, T1, T2, T3, T4, T5, T6, T7, T8, T9 >::IsNull(), list, m_genericPhyTxEndCallback, m_phyTxEndTrace, m_state, m_txPacketBurst, NS_ASSERT, NS_LOG_FUNCTION, NS_LOG_LOGIC, and TX.
Referenced by StartTx().
get the associated NetDevice instance
Implements ns3::SpectrumPhy.
Definition at line 160 of file lte-spectrum-phy.cc.
References m_device, and NS_LOG_FUNCTION.
|
virtual |
get the associated MobilityModel instance
Implements ns3::SpectrumPhy.
Definition at line 168 of file lte-spectrum-phy.cc.
References m_mobility, and NS_LOG_FUNCTION.
|
virtual |
get the AntennaModel used by the NetDevice for reception
Implements ns3::SpectrumPhy.
Definition at line 249 of file lte-spectrum-phy.cc.
References m_antenna.
|
virtual |
Implements ns3::SpectrumPhy.
Definition at line 199 of file lte-spectrum-phy.cc.
References m_rxSpectrumModel.
|
static |
This method returns the TypeId associated to ns3::LteSpectrumPhy.
Attributes defined for this type:
TraceSources defined for this type:
Reimplemented from ns3::SpectrumPhy.
Definition at line 129 of file lte-spectrum-phy.cc.
References m_pemEnabled, m_phyRxEndErrorTrace, m_phyRxEndOkTrace, m_phyRxStartTrace, m_phyTxEndTrace, m_phyTxStartTrace, ns3::MakeTraceSourceAccessor(), and ns3::TypeId::SetParent().
void ns3::LteSpectrumPhy::SetAntenna | ( | Ptr< AntennaModel > | a | ) |
set the AntennaModel to be used
a | the Antenna Model |
Definition at line 255 of file lte-spectrum-phy.cc.
References m_antenna, and NS_LOG_FUNCTION.
void ns3::LteSpectrumPhy::SetCellId | ( | uint16_t | cellId | ) |
cellId | the Cell Identifier |
Definition at line 548 of file lte-spectrum-phy.cc.
References m_cellId.
Referenced by ns3::LtePhy::DoSetCellId(), and ns3::LteUePhy::SetEnbCellId().
|
virtual |
Set the channel attached to this device.
c | the channel |
Implements ns3::SpectrumPhy.
Definition at line 192 of file lte-spectrum-phy.cc.
References m_channel, and NS_LOG_FUNCTION.
Referenced by ns3::LtePhy::SetDownlinkChannel(), and ns3::LtePhy::SetUplinkChannel().
set the associated NetDevice instance
d | the NetDevice instance |
Implements ns3::SpectrumPhy.
Definition at line 176 of file lte-spectrum-phy.cc.
References m_device, and NS_LOG_FUNCTION.
void ns3::LteSpectrumPhy::SetGenericPhyRxEndErrorCallback | ( | GenericPhyRxEndErrorCallback | c | ) |
set the callback for the end of a RX in error, as part of the interconnections betweenthe PHY and the MAC
c | the callback |
Definition at line 234 of file lte-spectrum-phy.cc.
References m_genericPhyRxEndErrorCallback, and NS_LOG_FUNCTION.
void ns3::LteSpectrumPhy::SetGenericPhyRxEndOkCallback | ( | GenericPhyRxEndOkCallback | c | ) |
set the callback for the successful end of a RX, as part of the interconnections betweenthe PHY and the MAC
c | the callback |
Definition at line 242 of file lte-spectrum-phy.cc.
References m_genericPhyRxEndOkCallback, and NS_LOG_FUNCTION.
void ns3::LteSpectrumPhy::SetGenericPhyTxEndCallback | ( | GenericPhyTxEndCallback | c | ) |
set the callback for the end of a TX, as part of the interconnections betweenthe PHY and the MAC
c | the callback |
Definition at line 226 of file lte-spectrum-phy.cc.
References m_genericPhyTxEndCallback, and NS_LOG_FUNCTION.
|
virtual |
Set the mobility model associated with this device.
m | the mobility model |
Implements ns3::SpectrumPhy.
Definition at line 184 of file lte-spectrum-phy.cc.
References m_mobility, and NS_LOG_FUNCTION.
void ns3::LteSpectrumPhy::SetNoisePowerSpectralDensity | ( | Ptr< const SpectrumValue > | noisePsd | ) |
set the noise power spectral density
noisePsd | the Noise Power Spectral Density in power units (Watt, Pascal...) per Hz. |
Definition at line 215 of file lte-spectrum-phy.cc.
References ns3::SpectrumValue::GetSpectrumModel(), m_interference, m_rxSpectrumModel, NS_ASSERT, NS_LOG_FUNCTION, and ns3::LteInterference::SetNoisePowerSpectralDensity().
Referenced by ns3::LteEnbPhy::DoStart(), and ns3::LteUePhy::DoStart().
void ns3::LteSpectrumPhy::SetState | ( | State | newState | ) |
Set the state of the phy layer.
newState | the state |
Definition at line 262 of file lte-spectrum-phy.cc.
References ChangeState().
void ns3::LteSpectrumPhy::SetTransmissionMode | ( | uint8_t | txMode | ) |
txMode | UE transmission mode (SISO, MIMO tx diversity, ...) |
Definition at line 560 of file lte-spectrum-phy.cc.
References m_transmissionMode, m_txModeGain, NS_ASSERT_MSG, and NS_LOG_FUNCTION.
Referenced by ns3::LteUePhy::DoSetTransmissionMode().
|
private |
Definition at line 569 of file lte-spectrum-phy.cc.
References m_txModeGain, and NS_LOG_FUNCTION.
Referenced by ns3::LteUePhy::SetTxModeGain().
void ns3::LteSpectrumPhy::SetTxPowerSpectralDensity | ( | Ptr< SpectrumValue > | txPsd | ) |
set the Power Spectral Density of outgoing signals in W/Hz.
txPsd |
Definition at line 206 of file lte-spectrum-phy.cc.
References m_txPsd, NS_ASSERT, and NS_LOG_FUNCTION.
Referenced by ns3::LteEnbPhy::DoSetDownlinkSubChannels(), and ns3::LteUePhy::SetSubChannelsForTransmission().
|
virtual |
Notify the SpectrumPhy instance of an incoming signal
params | the parameters of the signals being received |
Implements ns3::SpectrumPhy.
Definition at line 362 of file lte-spectrum-phy.cc.
References ns3::LteInterference::AddSignal(), ChangeState(), EndRx(), IDLE, m_cellId, m_firstRxDuration, m_firstRxStart, m_interference, m_phyRxStartTrace, m_rxPacketBurstList, m_state, ns3::Now(), ns3::Simulator::Now(), NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Packet::RemovePacketTag(), RX, ns3::Simulator::Schedule(), ns3::LteInterference::StartRx(), and TX.
Referenced by ns3::LteDownlinkSinrTestCase::DoRun(), and ns3::LteUplinkSinrTestCase::DoRun().
bool ns3::LteSpectrumPhy::StartTx | ( | Ptr< PacketBurst > | pb | ) |
Start a transmission
pb | the burst of packets to be transmitted |
Definition at line 277 of file lte-spectrum-phy.cc.
References ns3::Packet::AddPacketTag(), ns3::PacketBurst::Begin(), ChangeState(), ns3::PacketBurst::End(), EndTx(), IDLE, m_antenna, m_cellId, m_channel, m_phyTxStartTrace, m_state, m_txPacketBurst, m_txPsd, NS_ASSERT, NS_FATAL_ERROR, NS_LOG_FUNCTION, NS_LOG_LOGIC, RX, ns3::Simulator::Schedule(), ns3::Seconds(), ns3::SpectrumChannel::StartTx(), and TX.
Referenced by ns3::LteEnbPhy::StartSubFrame(), and ns3::LteUePhy::SubframeIndication().
void ns3::LteSpectrumPhy::UpdateSinrPerceived | ( | const SpectrumValue & | sinr | ) |
sinr | vector of sinr perceived per each RB |
Definition at line 447 of file lte-spectrum-phy.cc.
References m_sinrPerceived, and NS_LOG_FUNCTION.
Referenced by ns3::LtePemSinrChunkProcessor::End().
|
friend |
Definition at line 211 of file lte-spectrum-phy.h.
|
private |
Definition at line 232 of file lte-spectrum-phy.h.
Referenced by GetRxAntenna(), SetAntenna(), and StartTx().
|
private |
Definition at line 258 of file lte-spectrum-phy.h.
Referenced by SetCellId(), StartRx(), and StartTx().
|
private |
Definition at line 235 of file lte-spectrum-phy.h.
Referenced by DoDispose(), SetChannel(), and StartTx().
Definition at line 233 of file lte-spectrum-phy.h.
Referenced by DoDispose(), GetDevice(), and SetDevice().
|
private |
Definition at line 260 of file lte-spectrum-phy.h.
Referenced by AddExpectedTb(), EndRx(), and ~LteSpectrumPhy().
|
private |
Definition at line 244 of file lte-spectrum-phy.h.
Referenced by StartRx().
|
private |
Definition at line 243 of file lte-spectrum-phy.h.
Referenced by StartRx().
|
private |
Definition at line 253 of file lte-spectrum-phy.h.
Referenced by DoDispose(), and SetGenericPhyRxEndErrorCallback().
|
private |
Definition at line 254 of file lte-spectrum-phy.h.
Referenced by DoDispose(), EndRx(), and SetGenericPhyRxEndOkCallback().
|
private |
Definition at line 252 of file lte-spectrum-phy.h.
Referenced by DoDispose(), EndTx(), and SetGenericPhyTxEndCallback().
|
private |
Definition at line 256 of file lte-spectrum-phy.h.
Referenced by AddSinrChunkProcessor(), DoDispose(), EndRx(), LteSpectrumPhy(), SetNoisePowerSpectralDensity(), and StartRx().
|
private |
Definition at line 231 of file lte-spectrum-phy.h.
Referenced by DoDispose(), GetMobility(), and SetMobility().
|
private |
Definition at line 265 of file lte-spectrum-phy.h.
Referenced by EndRx(), and GetTypeId().
|
private |
Definition at line 250 of file lte-spectrum-phy.h.
Referenced by EndRx(), and GetTypeId().
|
private |
Definition at line 249 of file lte-spectrum-phy.h.
Referenced by EndRx(), and GetTypeId().
|
private |
Definition at line 248 of file lte-spectrum-phy.h.
Referenced by GetTypeId(), and StartRx().
|
private |
Definition at line 247 of file lte-spectrum-phy.h.
Referenced by EndTx(), and GetTypeId().
|
private |
Definition at line 246 of file lte-spectrum-phy.h.
Referenced by GetTypeId(), and StartTx().
|
private |
Provides uniform random variables.
Definition at line 264 of file lte-spectrum-phy.h.
Referenced by AssignStreams(), EndRx(), and LteSpectrumPhy().
|
private |
Definition at line 240 of file lte-spectrum-phy.h.
|
private |
Definition at line 237 of file lte-spectrum-phy.h.
Referenced by GetRxSpectrumModel(), and SetNoisePowerSpectralDensity().
|
private |
Definition at line 261 of file lte-spectrum-phy.h.
Referenced by EndRx(), and UpdateSinrPerceived().
|
private |
Definition at line 242 of file lte-spectrum-phy.h.
Referenced by ChangeState(), EndRx(), EndTx(), StartRx(), and StartTx().
|
private |
Definition at line 267 of file lte-spectrum-phy.h.
Referenced by EndRx(), and SetTransmissionMode().
|
private |
Definition at line 268 of file lte-spectrum-phy.h.
Referenced by EndRx(), LteSpectrumPhy(), SetTransmissionMode(), SetTxModeGain(), and ~LteSpectrumPhy().
|
private |
Definition at line 239 of file lte-spectrum-phy.h.
|
private |
Definition at line 238 of file lte-spectrum-phy.h.
Referenced by SetTxPowerSpectralDensity(), and StartTx().