Base class for half duplex OFDM PHY devices. More...
#include <plc-phy.h>
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_Outlet > | GetOutlet (void) |
void | SetTxPowerSpectralDensity (Ptr< SpectrumValue > txPsd) |
Ptr< const SpectrumValue > | GetTxPowerSpectralDensity (void) |
Ptr< PLC_TxInterface > | GetTxInterface (void) |
Ptr< PLC_RxInterface > | GetRxInterface (void) |
void | SetShuntImpedance (Ptr< PLC_Impedance > shuntImpedance) |
void | SetRxImpedance (Ptr< PLC_Impedance > rxImpedance) |
void | SetTxImpedance (Ptr< PLC_Impedance > txImpedance) |
Ptr< PLC_Impedance > | GetShuntImpedance (void) |
Ptr< PLC_Impedance > | GetRxImpedance (void) |
Ptr< PLC_Impedance > | GetTxImpedance (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_ChannelTransferImpl * | DoGetChannelTransferImpl (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_Outlet > | m_outlet |
Ptr< SpectrumValue > | m_txPsd |
Ptr< PLC_TxInterface > | m_txInterface |
Ptr< PLC_RxInterface > | m_rxInterface |
Ptr< PLC_Impedance > | m_shuntImpedance |
Ptr< PLC_Impedance > | m_txImpedance |
Ptr< PLC_Impedance > | m_rxImpedance |
Ptr< PLC_Impedance > | m_eqRxImpedance |
Ptr< PLC_Impedance > | m_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, State > | m_PhyStateLogger |
Static Protected Attributes | |
static Time | guard_interval_duration = Seconds(0) |
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.
Three states of the half duplex phy
Constructor
void ns3::PLC_HalfDuplexOfdmPhy::CancelCca | ( | void | ) |
Cancel previous CcaRequest
void ns3::PLC_HalfDuplexOfdmPhy::CcaRequest | ( | void | ) |
Clear Channel Assessment request Typically called by MAC layer
void ns3::PLC_HalfDuplexOfdmPhy::ChangeState | ( | State | newState | ) |
Change the PHY's state to newState
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
outlet | |
txPsd |
void ns3::PLC_HalfDuplexOfdmPhy::EndCca | ( | void | ) |
Clear Channel Assessment listening end
Ptr<PLC_Outlet> ns3::PLC_HalfDuplexOfdmPhy::GetOutlet | ( | void | ) | [inline] |
Ptr<PLC_Impedance> ns3::PLC_HalfDuplexOfdmPhy::GetRxImpedance | ( | void | ) | [inline] |
Ptr< PLC_RxInterface > ns3::PLC_HalfDuplexOfdmPhy::GetRxInterface | ( | void | ) |
Ptr<PLC_Impedance> ns3::PLC_HalfDuplexOfdmPhy::GetShuntImpedance | ( | void | ) | [inline] |
Get current state of the PHY
Ptr<PLC_Impedance> ns3::PLC_HalfDuplexOfdmPhy::GetTxImpedance | ( | void | ) | [inline] |
Ptr< PLC_TxInterface > ns3::PLC_HalfDuplexOfdmPhy::GetTxInterface | ( | void | ) |
Ptr<const SpectrumValue> ns3::PLC_HalfDuplexOfdmPhy::GetTxPowerSpectralDensity | ( | void | ) | [inline] |
bool ns3::PLC_HalfDuplexOfdmPhy::IsBusy | ( | void | ) | [inline] |
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
c |
void ns3::PLC_HalfDuplexOfdmPhy::SetRxImpedance | ( | Ptr< PLC_Impedance > | rxImpedance | ) |
Set access impedance for the device being in receive state
rxImpedance |
void ns3::PLC_HalfDuplexOfdmPhy::SetShuntImpedance | ( | Ptr< PLC_Impedance > | shuntImpedance | ) |
Set shunt impedance to the node the device is located on
shuntImpedance |
void ns3::PLC_HalfDuplexOfdmPhy::SetTxImpedance | ( | Ptr< PLC_Impedance > | txImpedance | ) |
Set access impedance for the device being in transmit state
rxImpedance |
void ns3::PLC_HalfDuplexOfdmPhy::SetTxPowerSpectralDensity | ( | Ptr< SpectrumValue > | txPsd | ) |
Set the power spectral density to be used for the outgoing waveform
txPsd |
void ns3::PLC_HalfDuplexOfdmPhy::SwitchImpedance | ( | State | state | ) | [protected] |
Switch access impedance of the device according to state
state |