ns-3 PLC model
 All Classes Functions Variables Enumerations
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes
ns3::PLC_HalfDuplexOfdmPhy Class Reference

Base class for half duplex OFDM PHY devices. More...

#include <plc-phy.h>

Inheritance diagram for ns3::PLC_HalfDuplexOfdmPhy:
ns3::PLC_Phy ns3::PLC_ErrorRatePhy ns3::PLC_InformationRatePhy ns3::PLC_ChaseCombiningPhy

List of all members.

Public Types

enum  State { IDLE, TX, RX }

Public Member Functions

 PLC_HalfDuplexOfdmPhy ()
void CreateInterfaces (Ptr< PLC_Outlet > outlet, Ptr< SpectrumValue > txPsd, Ptr< PLC_Impedance > rxImpedance=0, Ptr< PLC_Impedance > txImpedance=0)
Ptr< PLC_OutletGetOutlet (void)
void SetTxPowerSpectralDensity (Ptr< SpectrumValue > txPsd)
Ptr< const SpectrumValue > GetTxPowerSpectralDensity (void)
Ptr< PLC_TxInterfaceGetTxInterface (void)
Ptr< PLC_RxInterfaceGetRxInterface (void)
void SetShuntImpedance (Ptr< PLC_Impedance > shuntImpedance)
void SetRxImpedance (Ptr< PLC_Impedance > rxImpedance)
void SetTxImpedance (Ptr< PLC_Impedance > txImpedance)
Ptr< PLC_ImpedanceGetShuntImpedance (void)
Ptr< PLC_ImpedanceGetRxImpedance (void)
Ptr< PLC_ImpedanceGetTxImpedance (void)
void SetNoiseFloor (Ptr< const SpectrumValue > noiseFloor)
void CcaRequest (void)
void CancelCca (void)
void EndCca (void)
void SetCcaConfirmCallback (PLC_PhyCcaConfirmCallback c)
void ChangeState (State newState)
State GetState (void)
bool IsBusy (void)

Static Public Member Functions

static TypeId GetTypeId (void)
static void SetGuardIntervalDuration (Time duration)
static Time GetGuardIntervalDuration (void)

Protected Member Functions

virtual void DoStart (void)
virtual void DoDispose (void)
virtual void DoSetNoiseFloor (Ptr< const SpectrumValue > noiseFloor)=0
virtual PLC_ChannelTransferImplDoGetChannelTransferImpl (Ptr< PLC_Phy > rxPhy)
void ComputeEquivalentImpedances (void)
virtual PLC_PhyCcaResult ClearChannelAssessment (void)=0
Time CalculateTxDuration (size_t nSymbols)
void SwitchImpedance (State state)

Protected Attributes

Ptr< PLC_Outletm_outlet
Ptr< SpectrumValue > m_txPsd
Ptr< PLC_TxInterfacem_txInterface
Ptr< PLC_RxInterfacem_rxInterface
Ptr< PLC_Impedancem_shuntImpedance
Ptr< PLC_Impedancem_txImpedance
Ptr< PLC_Impedancem_rxImpedance
Ptr< PLC_Impedancem_eqRxImpedance
Ptr< PLC_Impedancem_eqTxImpedance
size_t m_numSubcarriers
uint32_t m_locked_txId
Ptr< Packet > m_incoming_packet
std::map< uint32_t, Ptr< const
SpectrumValue > > 
m_rxNoisePsdMap
EventId m_ccaEndEvent
PLC_PhyCcaConfirmCallback m_ccaConfirmCallback
State m_state
TracedCallback< Time, Statem_PhyStateLogger

Static Protected Attributes

static Time guard_interval_duration = Seconds(0)

Detailed Description

Base class for half duplex OFDM PHY devices.

Each half duplex PHY owns both a txInterface for transmitting and a rxInterface for receiving. Depending on the PHY's state the access impedance of the device may change, which influences channel transfer functions. The number of OFDM subbands to be used will be implicitly defined by the SpectrumModel of the transmit power spectral density.

TODO: masking subbands when not all of them are used (e.g. because of using pilot tones, bad snr)

The link layer performance between PHY devices is also depends on the Modulation and Coding Scheme and the error model used to abstract from real physical devices.


Member Enumeration Documentation

Three states of the half duplex phy


Constructor & Destructor Documentation

Constructor


Member Function Documentation

Cancel previous CcaRequest

Clear Channel Assessment request Typically called by MAC layer

Change the PHY's state to newState

Parameters:
newState
void ns3::PLC_HalfDuplexOfdmPhy::CreateInterfaces ( Ptr< PLC_Outlet outlet,
Ptr< SpectrumValue >  txPsd,
Ptr< PLC_Impedance rxImpedance = 0,
Ptr< PLC_Impedance txImpedance = 0 
)

Creates rx and tx interface, respectively, on outlet

If an impedance has been assigned previously to outlet, the value will be treated as shunt impedance to the device. By initializing txPsd the SpectrumModel and the OFDM subbands are defined

Parameters:
outlet
txPsd

Clear Channel Assessment listening end

Returns:
Outlet the device is attached to
Returns:
Access impedance used while receiving
Returns:
RX interface of the PHY
Returns:
Shunt impedance of the node the device is located on

Get current state of the PHY

Returns:
Current state
Returns:
Access impedance used while transmitting
Returns:
TX interface of the PHY
Ptr<const SpectrumValue> ns3::PLC_HalfDuplexOfdmPhy::GetTxPowerSpectralDensity ( void  ) [inline]
Returns:
PSD used for transmission
bool ns3::PLC_HalfDuplexOfdmPhy::IsBusy ( void  ) [inline]
Returns:
True if PHY is not IDLE
void ns3::PLC_HalfDuplexOfdmPhy::SetCcaConfirmCallback ( PLC_PhyCcaConfirmCallback  c)

Confirmation callback after Clear Channel Assessment request This is part of the interconnection between MAC and PHY layer

Parameters:
c

Set access impedance for the device being in receive state

Parameters:
rxImpedance

Set shunt impedance to the node the device is located on

Parameters:
shuntImpedance

Set access impedance for the device being in transmit state

Parameters:
rxImpedance
void ns3::PLC_HalfDuplexOfdmPhy::SetTxPowerSpectralDensity ( Ptr< SpectrumValue >  txPsd)

Set the power spectral density to be used for the outgoing waveform

Parameters:
txPsd

Switch access impedance of the device according to state

Warning:
will not change the state of the PHY, but only the impedance value; for a state change call ChangeState ()
Parameters:
state

The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations