#include <half-duplex-ideal-phy.h>
Public Types | |
enum | State { IDLE, TX, RX } |
Static Public Member Functions | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::SpectrumPhy | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::Object | |
static TypeId | GetTypeId (void) |
Static Public Member Functions inherited from ns3::SimpleRefCount< Object, ObjectBase, ObjectDeleter > | |
static void | Cleanup (void) |
Static Public Member Functions inherited from ns3::ObjectBase | |
static TypeId | GetTypeId (void) |
Private Member Functions | |
void | AbortRx () |
void | ChangeState (State newState) |
virtual void | DoDispose (void) |
void | EndRx () |
void | EndTx () |
Private Attributes | |
Ptr< AntennaModel > | m_antenna |
Ptr< SpectrumChannel > | m_channel |
EventId | m_endRxEventId |
SpectrumInterference | m_interference |
Ptr< MobilityModel > | m_mobility |
Ptr< NetDevice > | m_netDevice |
GenericPhyRxEndErrorCallback | m_phyMacRxEndErrorCallback |
GenericPhyRxEndOkCallback | m_phyMacRxEndOkCallback |
GenericPhyRxStartCallback | m_phyMacRxStartCallback |
GenericPhyTxEndCallback | m_phyMacTxEndCallback |
TracedCallback< Ptr< const Packet > > | m_phyRxAbortTrace |
TracedCallback< Ptr< const Packet > > | m_phyRxEndErrorTrace |
TracedCallback< Ptr< const Packet > > | m_phyRxEndOkTrace |
TracedCallback< Ptr< const Packet > > | m_phyRxStartTrace |
TracedCallback< Ptr< const Packet > > | m_phyTxEndTrace |
TracedCallback< Ptr< const Packet > > | m_phyTxStartTrace |
DataRate | m_rate |
Ptr< Packet > | m_rxPacket |
Ptr< const SpectrumValue > | m_rxPsd |
State | m_state |
Ptr< Packet > | m_txPacket |
Ptr< SpectrumValue > | m_txPsd |
Additional Inherited Members | |
Protected Member Functions inherited from ns3::Object | |
Object (const Object &o) | |
virtual void | DoInitialize (void) |
virtual void | NotifyNewAggregate (void) |
Protected Member Functions inherited from ns3::ObjectBase | |
void | ConstructSelf (const AttributeConstructionList &attributes) |
virtual void | NotifyConstructionCompleted (void) |
This PHY layer implementation realizes an ideal OFDM PHY which transmits half-duplex (i.e., it can either receive or transmit at a given time). The device is ideal in the sense that: 1) it uses an error model based on the Shannon capacity, which assumes ideal channel coding; 2) it uses ideal signal acquisition, i.e., preamble detection and synchronization are always successful 3) it has no PHY layer overhead
Being half duplex, if a RX is ongoing but a TX is requested, the RX is aborted and the TX is started. Of course, no RX can be performed while there is an ongoing TX.
The use of OFDM is modeled by means of the Spectrum framework. By calling the method SetTxPowerSpectralDensity(), the user can specify how much of the spectrum is used, how many subcarriers are used, and what power is allocated to each subcarrier.
The user can also specify the PHY rate at which communications take place by using SetRate(). This is equivalent to choosing a particular modulation and coding scheme.
The use of the ShannonSpectrumErrorModel allows us to account for the following aspects in determining whether a transmission is successful or not:
This PHY model supports a single antenna model instance which is used for both transmission and reception.
Doxygen introspection did not find any typical Config paths.
Definition at line 78 of file half-duplex-ideal-phy.h.
PHY states
Definition at line 89 of file half-duplex-ideal-phy.h.
|
privatevirtual |
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 57 of file half-duplex-ideal-phy.cc.
References ns3::Object::DoDispose(), and NS_LOG_FUNCTION.
get the associated NetDevice instance
Implements ns3::SpectrumPhy.
Definition at line 132 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
|
virtual |
get the associated MobilityModel instance
Implements ns3::SpectrumPhy.
Definition at line 140 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
DataRate ns3::HalfDuplexIdealPhy::GetRate | ( | void | ) | const |
Definition at line 208 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
|
virtual |
get the AntennaModel used by the NetDevice for reception
Implements ns3::SpectrumPhy.
Definition at line 246 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
|
virtual |
Implements ns3::SpectrumPhy.
Definition at line 171 of file half-duplex-ideal-phy.cc.
void ns3::HalfDuplexIdealPhy::SetAntenna | ( | Ptr< AntennaModel > | a | ) |
set the AntennaModel to be used
a | the Antenna Model |
Definition at line 253 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
|
virtual |
Set the channel attached to this device.
c | the channel |
Implements ns3::SpectrumPhy.
Definition at line 164 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
set the associated NetDevice instance
d | the NetDevice instance |
Implements ns3::SpectrumPhy.
Definition at line 148 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
void ns3::HalfDuplexIdealPhy::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 231 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
void ns3::HalfDuplexIdealPhy::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 239 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
void ns3::HalfDuplexIdealPhy::SetGenericPhyRxStartCallback | ( | GenericPhyRxStartCallback | c | ) |
set the callback for the start of RX, as part of the interconnections betweenthe PHY and the MAC
c | the callback |
Definition at line 223 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
void ns3::HalfDuplexIdealPhy::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 216 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
|
virtual |
Set the mobility model associated with this device.
m | the mobility model |
Implements ns3::SpectrumPhy.
Definition at line 156 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
void ns3::HalfDuplexIdealPhy::SetNoisePowerSpectralDensity | ( | Ptr< const SpectrumValue > | noisePsd | ) |
noisePsd | the Noise Power Spectral Density in power units (Watt, Pascal...) per Hz. |
Definition at line 193 of file half-duplex-ideal-phy.cc.
References NS_ASSERT, NS_LOG_FUNCTION, and ns3::SpectrumInterference::SetNoisePowerSpectralDensity().
void ns3::HalfDuplexIdealPhy::SetRate | ( | DataRate | rate | ) |
set the PHY rate to be used by this PHY.
rate |
Definition at line 201 of file half-duplex-ideal-phy.cc.
References NS_LOG_FUNCTION.
void ns3::HalfDuplexIdealPhy::SetTxPowerSpectralDensity | ( | Ptr< SpectrumValue > | txPsd | ) |
set the Power Spectral Density of outgoing signals in power units (Watt, Pascal...) per Hz.
txPsd |
Definition at line 184 of file half-duplex-ideal-phy.cc.
References NS_ASSERT, NS_LOG_FUNCTION, and NS_LOG_INFO.
|
virtual |
Notify the SpectrumPhy instance of an incoming signal
params | the parameters of the signals being received |
Implements ns3::SpectrumPhy.
Definition at line 328 of file half-duplex-ideal-phy.cc.
References ns3::SpectrumInterference::AddSignal(), ns3::Integral(), NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), and ns3::SpectrumInterference::StartRx().
Start a transmission
p | the packet to be transmitted |
Definition at line 267 of file half-duplex-ideal-phy.cc.
References ns3::DataRate::CalculateTxTime(), ns3::Packet::GetSize(), ns3::Integral(), NS_LOG_FUNCTION, NS_LOG_LOGIC, ns3::Simulator::Schedule(), and ns3::Seconds().
Referenced by ns3::AdhocAlohaNoackIdealPhyHelper::Install().