22 #ifndef SIMPLE_OFDM_WIMAX_PHY_H 23 #define SIMPLE_OFDM_WIMAX_PHY_H 27 #include "ns3/callback.h" 28 #include "ns3/nstime.h" 29 #include "ns3/event-id.h" 30 #include "ns3/random-variable-stream.h" 33 #include "ns3/snr-to-block-error-rate-manager.h" 41 class SimpleOfdmWimaxChannel;
void SetNoiseFigure(double nf)
set the noise figure of the device
double GetRxGain(void) const
Get receive gain.
WimaxPhy::PhyType GetPhyType(void) const
returns the type this physical layer
void StartReceive(uint32_t burstSize, bool isFirstBlock, uint64_t frequency, WimaxPhy::ModulationType modulationType, uint8_t direction, double rxPower, Ptr< PacketBurst > burst)
start the reception of a fec block
Simulation virtual time values and global simulation resolution.
~SimpleOfdmWimaxPhy(void)
uint16_t m_blockSize
block size
Smart pointer class similar to boost::intrusive_ptr.
void SetSNRToBlockErrorRateTracesPath(char *tracesPath)
Set the path of the repository containing the traces.
TracedCallback< Ptr< PacketBurst > > m_phyRxEndTrace
The trace source fired when a packet ends the reception process from the medium.
uint32_t m_paddingBits
padding bits
uint32_t GetFecBlockSize(WimaxPhy::ModulationType type) const
Get FEC block size.
void EndReceiveFecBlock(uint32_t burstSize, WimaxPhy::ModulationType modulationType, uint8_t direction, uint8_t drop, Ptr< PacketBurst > burst)
End receive FEC block.
void Send(Ptr< PacketBurst > burst, WimaxPhy::ModulationType modulationType, uint8_t direction)
Sends a burst on the channel.
void NotifyRxDrop(Ptr< PacketBurst > burst)
Public method used to fire a PhyRxDrop trace.
void NotifyRxBegin(Ptr< PacketBurst > burst)
Public method used to fire a PhyRxBegin trace.
TracedCallback< Ptr< const PacketBurst > > m_traceRx
trace receive callback
int64_t AssignStreams(int64_t stream)
Assign a fixed random variable stream number to the random variables used by this model...
uint32_t m_dataRateQam64_23
data rate
Forward calls to a chain of Callback.
SimpleOfdmWimaxPhy class.
uint16_t GetNrBlocks(uint32_t burstSize, WimaxPhy::ModulationType modulationType) const
Get number of blocks.
void InitSimpleOfdmWimaxPhy(void)
Initialize simple OFDM WIMAX Phy.
uint16_t DoGetNfft(void) const
Get NFFT.
std::list< bvec > * m_receivedFecBlocks
a list of received FEC blocks until they are combined to recreate the full burst buffer ...
double GetTxGain(void) const
Get transmit gain.
SNRToBlockErrorRateManager * m_snrToBlockErrorRateManager
SNR to block error rate manager.
void NotifyTxDrop(Ptr< PacketBurst > burst)
Public method used to fire a PhyTxDrop trace.
uint16_t m_fecBlockSize
in bits, size of FEC block transmitted after PHY operations
uint32_t CalculateDataRate(WimaxPhy::ModulationType modulationType) const
Calculate data rate.
void NotifyTxBegin(Ptr< PacketBurst > burst)
Public method used to fire a PhyTxBegin trace.
void EndSend(void)
End send.
Time DoGetTransmissionTime(uint32_t size, WimaxPhy::ModulationType modulationType) const
Get transmission time.
void SetTraceFilePath(std::string path)
Set trace file path.
TracedCallback< Ptr< PacketBurst > > m_phyTxDropTrace
The trace source fired when the phy layer drops a packet as it tries to transmit it.
uint32_t GetBandwidth(void) const
void DoSetNfft(uint16_t nfft)
Set NFFT.
void SetBandwidth(uint32_t BW)
Set the bandwidth.
bvec RecreateBuffer()
Recreate buffer.
uint16_t DoGetRtg(void) const
Get RTG.
void CreateFecBlocks(const bvec &buffer, WimaxPhy::ModulationType modulationType)
Create FEC blocks.
void EndSendFecBlock(WimaxPhy::ModulationType modulationType, uint8_t direction)
End send FEC block.
TracedCallback< Ptr< PacketBurst > > m_phyTxBeginTrace
The trace source fired when a packet begins the transmission process on the medium.
Ptr< UniformRandomVariable > m_URNG
Provides uniform random variables.
double m_noiseFigure
noise figure
bvec ConvertBurstToBits(Ptr< const PacketBurst > burst)
Convert burst to bits.
void DoSetDataRates(void)
Set data rates.
Time m_blockTime
block time
uint16_t m_nrRecivedFecBlocks
number received FEC blocks
uint32_t m_nrFecBlocksSent
counting the number of FEC blocks sent (within a burst)
The SendParams class defines the parameters with which Send() function of a particular PHY is called...
void GetModulationFecParams(WimaxPhy::ModulationType modulationType, uint8_t &bitsPerSymbol, double &fecCode) const
Get moduleation FEC parameters.
double GetNoiseFigure(void) const
uint32_t m_dataRateQpsk12
data rate
void EndReceive(Ptr< const PacketBurst > burst)
End receive.
void DoSetGValue(double g)
Set G value.
uint8_t DoGetFrameDurationCode(void) const
Get frame duration code.
void SetRxGain(double rxgain)
Set receive gsain.
Time DoGetFrameDuration(uint8_t frameDurationCode) const
Get frame duration.
uint32_t m_dataRateQpsk34
data rate
Ptr< PacketBurst > m_currentBurst
current burst
void NotifyRxEnd(Ptr< PacketBurst > burst)
Public method used to fire a PhyRxEnd trace.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
uint64_t DoGetNrBytes(uint32_t symbols, WimaxPhy::ModulationType modulationType) const
Get number of bytes.
void StartSendDummyFecBlock(bool isFirstBlock, WimaxPhy::ModulationType modulationType, uint8_t direction)
Start end dummy FEC block.
std::string GetTraceFilePath(void) const
Get trace file path.
static TypeId GetTypeId(void)
Get the type ID.
double DoGetSamplingFrequency(void) const
Get sampling frequency.
void DoDispose(void)
Destructor implementation.
uint32_t m_currentBurstSize
current burst size
uint32_t DoGetDataRate(WimaxPhy::ModulationType modulationType) const
Get data rate.
void DoAttach(Ptr< WimaxChannel > channel)
Attach the physical layer to a channel.
void ActivateLoss(bool loss)
if called with true it will enable the loss model
void SetTxGain(double txgain)
Set transmit gain.
void NotifyTxEnd(Ptr< PacketBurst > burst)
Public method used to fire a PhyTxEnd trace.
uint32_t m_dataRateQam64_34
data rate
TracedCallback< Ptr< PacketBurst > > m_phyRxBeginTrace
The trace source fired when a packet begins the reception process from the medium.
void SetTxPower(double txPower)
set the transmission power
ModulationType
ModulationType enumeration.
TracedCallback< Ptr< PacketBurst > > m_phyTxEndTrace
The trace source fired when a packet ends the transmission process on the medium. ...
FrameDurationCode
Frame duration code enumeration.
double m_txPower
transmit power
uint32_t m_dataRateBpsk12
data rate
PhyType
PhyType enumeration.
std::vector< bool > bvec
boolean vector typedef
uint16_t m_nbErroneousBlock
erroneous blocks
Ptr< PacketBurst > ConvertBitsToBurst(bvec buffer)
Convert bits to burst.
uint16_t m_nrBlocks
number of blocks
uint32_t GetCodedFecBlockSize(WimaxPhy::ModulationType modulationType) const
Get coded FEC block size.
uint64_t DoGetNrSymbols(uint32_t size, WimaxPhy::ModulationType modulationType) const
Get number of symbols.
Time GetBlockTransmissionTime(WimaxPhy::ModulationType modulationType) const
Get block transmission time.
uint32_t m_dataRateQam16_34
data rate
void SetBlockParameters(uint32_t burstSize, WimaxPhy::ModulationType modulationType)
Set block parameters.
double m_bandWidth
bandwidth
double DoGetGValue(void) const
Get G value.
uint16_t DoGetTtg(void) const
Get TTG.
void SetReceiveCallback(Callback< void, Ptr< PacketBurst >, Ptr< WimaxConnection > > callback)
set the callback function to call when a burst is received
This class handles the SNR to BlcER traces.
void DoSetPhyParameters(void)
Set Phy parameters.
uint32_t m_dataRateQam16_12
data rate
uint16_t m_nrRemainingBlocksToSend
number of remaining blocks to send
a unique identifier for an interface.
double m_rxGain
receive gain
double m_txGain
transmit gain
double GetTxPower(void) const
double DoGetSamplingFactor(void) const
Get sampling factor.
TracedCallback< Ptr< PacketBurst > > m_phyRxDropTrace
The trace source fired when the phy layer drops a packet it has received.
TracedCallback< Ptr< const PacketBurst > > m_traceTx
trace transmit callback
std::list< bvec > * m_fecBlocks
the FEC blocks