22 #include "ns3/simulator.h" 
   23 #include "ns3/packet.h" 
   25 #include "ns3/uinteger.h" 
   26 #include "ns3/double.h" 
   27 #include "ns3/string.h" 
   28 #include "wimax-net-device.h" 
   29 #include "simple-ofdm-wimax-phy.h" 
   30 #include "wimax-channel.h" 
   31 #include "ns3/packet-burst.h" 
   32 #include "wimax-mac-header.h" 
   33 #include "simple-ofdm-wimax-channel.h" 
   34 #include "ns3/trace-source-accessor.h" 
   41 NS_OBJECT_ENSURE_REGISTERED (SimpleOfdmWimaxPhy);
 
   43 TypeId SimpleOfdmWimaxPhy::GetTypeId (
void)
 
   47     TypeId (
"ns3::SimpleOfdmWimaxPhy").SetParent<WimaxPhy> ()
 
   49     .AddAttribute (
"NoiseFigure",
 
   50                    "Loss (dB) in the Signal-to-Noise-Ratio due to non-idealities in the receiver.",
 
   53                    MakeDoubleChecker<double> ())
 
   55     .AddAttribute (
"TxPower",
 
   56                    "Transmission power (dB).",
 
   59                    MakeDoubleChecker<double> ())
 
   62                    "This is the ratio of CP time to useful time.",
 
   64                    MakeDoubleAccessor (&SimpleOfdmWimaxPhy::DoSetGValue, &SimpleOfdmWimaxPhy::DoGetGValue),
 
   65                    MakeDoubleChecker<double> ())
 
   67     .AddAttribute (
"TxGain",
 
   68                    "Transmission gain (dB).",
 
   70                    MakeDoubleAccessor (&SimpleOfdmWimaxPhy::SetTxGain, &SimpleOfdmWimaxPhy::GetTxGain),
 
   71                    MakeDoubleChecker<double> ())
 
   73     .AddAttribute (
"RxGain",
 
   74                    "Reception gain (dB).",
 
   76                    MakeDoubleAccessor (&SimpleOfdmWimaxPhy::SetRxGain, &SimpleOfdmWimaxPhy::GetRxGain),
 
   77                    MakeDoubleChecker<double> ())
 
   79     .AddAttribute (
"Nfft",
 
   82                    MakeUintegerAccessor (&SimpleOfdmWimaxPhy::DoSetNfft, &SimpleOfdmWimaxPhy::DoGetNfft),
 
   83                    MakeUintegerChecker<uint16_t> (256, 1024))
 
   85     .AddAttribute (
"TraceFilePath",
 
   86                    "Path to the directory containing SNR to block error rate files",
 
   88                    MakeStringAccessor (&SimpleOfdmWimaxPhy::GetTraceFilePath,
 
   89                                        &SimpleOfdmWimaxPhy::SetTraceFilePath),
 
   96     .AddTraceSource (
"PhyTxBegin",
 
   97                      "Trace source indicating a packet has begun transmitting over the channel medium",
 
  100     .AddTraceSource (
"PhyTxEnd",
 
  101                      "Trace source indicating a packet has been completely transmitted over the channel",
 
  104     .AddTraceSource (
"PhyTxDrop",
 
  105                      "Trace source indicating a packet has been dropped by the device during transmission",
 
  108     .AddTraceSource (
"PhyRxBegin",
 
  109                      "Trace source indicating a packet has begun being received from the channel medium by the device",
 
  112     .AddTraceSource (
"PhyRxEnd",
 
  113                      "Trace source indicating a packet has been completely received from the channel medium by the device",
 
  116     .AddTraceSource (
"PhyRxDrop",
 
  117                      "Trace source indicating a packet has been dropped by the device during reception",
 
  123 SimpleOfdmWimaxPhy::InitSimpleOfdmWimaxPhy (
void)
 
  126   m_nrFecBlocksSent = 0;
 
  127   m_dataRateBpsk12 = 0;
 
  128   m_dataRateQpsk12 = 0;
 
  129   m_dataRateQpsk34 = 0;
 
  130   m_dataRateQam16_12 = 0;
 
  132   m_dataRateQam16_34 = 0;
 
  133   m_dataRateQam64_23 = 0;
 
  134   m_dataRateQam64_34 = 0;
 
  142   m_g = (double) 1 / 4;
 
  144   m_fecBlocks = 
new std::list<bvec>;
 
  145   m_receivedFecBlocks = 
new std::list<bvec>;
 
  146   m_currentBurstSize = 0;
 
  150   m_nbErroneousBlock = 0;
 
  151   m_nrRecivedFecBlocks = 0;
 
  152   m_snrToBlockErrorRateManager = 
new SNRToBlockErrorRateManager ();
 
  155 SimpleOfdmWimaxPhy::SimpleOfdmWimaxPhy (
void)
 
  157   m_URNG = CreateObject<UniformRandomVariable> ();
 
  159   InitSimpleOfdmWimaxPhy ();
 
  164 SimpleOfdmWimaxPhy::SimpleOfdmWimaxPhy (
char * tracesPath)
 
  166   InitSimpleOfdmWimaxPhy ();
 
  171 SimpleOfdmWimaxPhy::~SimpleOfdmWimaxPhy (
void)
 
  215   return m_noiseFigure;
 
  220   m_noiseFigure = noiseFigure;
 
  226   delete m_receivedFecBlocks;
 
  228   m_receivedFecBlocks = 0;
 
  230   delete m_snrToBlockErrorRateManager;
 
  244   Send (o_params->GetBurst (),
 
  245         (WimaxPhy::ModulationType) o_params->GetModulationType (),
 
  246         o_params->GetDirection ());
 
  253   return WimaxPhy::simpleOfdmWimaxPhy;
 
  258                           WimaxPhy::ModulationType modulationType,
 
  264       m_currentBurstSize = burst->GetSize ();
 
  265       m_nrFecBlocksSent = 0;
 
  266       m_currentBurst = burst;
 
  267       SetBlockParameters (burst->GetSize (), modulationType);
 
  269       StartSendDummyFecBlock (
true, modulationType, direction);
 
  275 SimpleOfdmWimaxPhy::StartSendDummyFecBlock (
bool isFirstBlock,
 
  276                                             WimaxPhy::ModulationType modulationType,
 
  280   bool isLastFecBlock = 0;
 
  283       m_blockTime = GetBlockTransmissionTime (modulationType);
 
  286   SimpleOfdmWimaxChannel *channel = 
dynamic_cast<SimpleOfdmWimaxChannel*
> (PeekPointer (
GetChannel ()));
 
  288   if (m_nrRemainingBlocksToSend==1)
 
  290       isLastFecBlock = 
true;
 
  294       isLastFecBlock = 
false;
 
  296   channel->Send (m_blockTime,
 
  307   m_nrRemainingBlocksToSend--;
 
  308   Simulator::Schedule (m_blockTime, &SimpleOfdmWimaxPhy::EndSendFecBlock, 
this, modulationType, direction);
 
  313 SimpleOfdmWimaxPhy::EndSendFecBlock (WimaxPhy::ModulationType modulationType,
 
  319   if (m_nrFecBlocksSent * m_blockSize == m_currentBurstSize * 8 + m_paddingBits)
 
  322       NS_ASSERT_MSG (m_nrRemainingBlocksToSend == 0, 
"Error while sending a burst");
 
  327       StartSendDummyFecBlock (
false,modulationType,direction);
 
  332 SimpleOfdmWimaxPhy::EndSend (
void)
 
  341                                   WimaxPhy::ModulationType modulationType,
 
  348   double Nwb = -114 + m_noiseFigure + 10 * std::log (
GetBandwidth () / 1000000000.0) / 2.303;
 
  349   double SNR = rxPower - Nwb;
 
  352   double I1 = record->
GetI1 ();
 
  353   double I2 = record->
GetI2 ();
 
  359   if (rand < blockErrorRate)
 
  363   if (rand > blockErrorRate)
 
  368   if (blockErrorRate == 1.0)
 
  372   if (blockErrorRate == 0.0)
 
  378   NS_LOG_INFO (
"PHY: Receive rxPower=" << rxPower << 
", Nwb=" << Nwb << 
", SNR=" << SNR << 
", Modulation=" 
  379                                        << modulationType << 
", BlocErrorRate=" << blockErrorRate << 
", drop=" << (
int) drop);
 
  383     case PHY_STATE_SCANNING:
 
  398               m_receivedFecBlocks->clear ();
 
  399               m_nrRecivedFecBlocks=0;
 
  400               SetBlockParameters (burstSize, modulationType);
 
  401               m_blockTime = GetBlockTransmissionTime (modulationType);
 
  405                                &SimpleOfdmWimaxPhy::EndReceiveFecBlock,
 
  429 SimpleOfdmWimaxPhy::EndReceiveFecBlock (uint32_t burstSize,
 
  430                                         WimaxPhy::ModulationType modulationType,
 
  436   m_nrRecivedFecBlocks++;
 
  440       m_nbErroneousBlock++;
 
  443   if ((uint32_t) m_nrRecivedFecBlocks * m_blockSize == burstSize * 8 + m_paddingBits)
 
  446       if (m_nbErroneousBlock == 0)
 
  449                                &SimpleOfdmWimaxPhy::EndReceive,
 
  457       m_nbErroneousBlock = 0;
 
  458       m_nrRecivedFecBlocks = 0;
 
  463 SimpleOfdmWimaxPhy::EndReceive (Ptr<const PacketBurst> burst)
 
  465   Ptr<PacketBurst> b = burst->Copy ();
 
  471 SimpleOfdmWimaxPhy::ConvertBurstToBits (Ptr<const PacketBurst> burst)
 
  473   bvec buffer (burst->GetSize () * 8, 0);
 
  475   std::list<Ptr<Packet> > packets = burst->GetPackets ();
 
  478   for (std::list<Ptr<Packet> >::iterator iter = packets.begin (); iter != packets.end (); ++iter)
 
  480       Ptr<Packet> packet = *iter;
 
  481       uint8_t *pstart = (uint8_t*) std::malloc (packet->GetSize ());
 
  482       std::memset (pstart, 0, packet->GetSize ());
 
  483       packet->CopyData (pstart, packet->GetSize ());
 
  487       for (uint32_t i = 0; i < packet->GetSize (); i++)
 
  489           for (uint8_t l = 0; l < 8; l++)
 
  491               temp[l] = (bool)((((uint8_t) pstart[i]) >> (7 - l)) & 0x01);
 
  492               buffer.at (j * 8 + l) = temp[l];
 
  511 SimpleOfdmWimaxPhy::ConvertBitsToBurst (bvec buffer)
 
  513   uint8_t init[buffer.size () / 8];
 
  514   uint8_t *pstart = init;
 
  518   for (uint32_t i = 0; i < buffer.size (); i += 8)
 
  522       for (
int l = 0; l < 8; l++)
 
  524           bool bin = buffer.at (i + l);
 
  525           temp += (uint8_t)(bin * std::pow (2.0, (7 - l)));
 
  528       *(pstart + j) = temp;
 
  531   uint16_t bufferSize = buffer.size () / 8;
 
  533   Ptr<PacketBurst> RecvBurst = Create<PacketBurst> ();
 
  534   while (pos < bufferSize)
 
  536       uint16_t packetSize = 0;
 
  538       uint8_t ht = (pstart[pos] >> 7) & 0x01;
 
  547           uint8_t Len_MSB = pstart[pos + 1] & 0x07;
 
  548           packetSize = (uint16_t)((uint16_t)(Len_MSB << 8) | (uint16_t)(pstart[pos + 2]));
 
  555       Ptr<Packet> p = Create<Packet> (&(pstart[pos]), packetSize);
 
  556       RecvBurst->AddPacket (p);
 
  563 SimpleOfdmWimaxPhy::CreateFecBlocks (
const bvec &buffer, WimaxPhy::ModulationType modulationType)
 
  566   bvec fecBlock (m_blockSize);
 
  567   for (uint32_t i = 0, j = m_nrBlocks; j > 0; i += m_blockSize, j--)
 
  570       if (j == 1 && m_paddingBits > 0) 
 
  572           fecBlock = bvec (buffer.begin () + i, buffer.end ());
 
  573           fecBlock.resize (m_blockSize, 0);
 
  577           fecBlock = bvec (buffer.begin () + i, buffer.begin () + i + m_blockSize);
 
  580       m_fecBlocks->push_back (fecBlock);
 
  585 SimpleOfdmWimaxPhy::RecreateBuffer ()
 
  588   bvec buffer (m_blockSize * m_nrBlocks);
 
  589   bvec block (m_blockSize);
 
  591   for (uint32_t j = 0; j < m_nrBlocks; j++)
 
  593       bvec tmpRecFecBloc = m_receivedFecBlocks->front ();
 
  594       buffer.insert (buffer.begin () + i, tmpRecFecBloc.begin (), tmpRecFecBloc.end ());
 
  595       m_receivedFecBlocks->pop_front ();
 
  602 SimpleOfdmWimaxPhy::DoSetDataRates (
void)
 
  604   m_dataRateBpsk12 = CalculateDataRate (MODULATION_TYPE_BPSK_12); 
 
  605   m_dataRateQpsk12 = CalculateDataRate (MODULATION_TYPE_QPSK_12); 
 
  606   m_dataRateQpsk34 = CalculateDataRate (MODULATION_TYPE_QPSK_34); 
 
  607   m_dataRateQam16_12 = CalculateDataRate (MODULATION_TYPE_QAM16_12); 
 
  608   m_dataRateQam16_34 = CalculateDataRate (MODULATION_TYPE_QAM16_34); 
 
  609   m_dataRateQam64_23 = CalculateDataRate (MODULATION_TYPE_QAM64_23); 
 
  610   m_dataRateQam64_34 = CalculateDataRate (MODULATION_TYPE_QAM64_34); 
 
  614 SimpleOfdmWimaxPhy::GetModulationFecParams (WimaxPhy::ModulationType modulationType,
 
  615                                             uint8_t &bitsPerSymbol,
 
  616                                             double &fecCode)
 const 
  618   switch (modulationType)
 
  620     case MODULATION_TYPE_BPSK_12:
 
  622       fecCode = (double) 1 / 2;
 
  624     case MODULATION_TYPE_QPSK_12:
 
  626       fecCode = (double) 1 / 2;
 
  628     case MODULATION_TYPE_QPSK_34:
 
  630       fecCode = (double) 3 / 4;
 
  632     case MODULATION_TYPE_QAM16_12:
 
  634       fecCode = (double) 1 / 2;
 
  636     case MODULATION_TYPE_QAM16_34:
 
  638       fecCode = (double) 3 / 4;
 
  640     case MODULATION_TYPE_QAM64_23:
 
  642       fecCode = (double) 2 / 3;
 
  644     case MODULATION_TYPE_QAM64_34:
 
  652 SimpleOfdmWimaxPhy::CalculateDataRate (WimaxPhy::ModulationType modulationType)
 const 
  654   uint8_t bitsPerSymbol = 0;
 
  656   GetModulationFecParams (modulationType, bitsPerSymbol, fecCode);
 
  658   uint16_t bitsTransmittedPerSymbol = (uint16_t)(bitsPerSymbol * 
GetNrCarriers () * fecCode);
 
  661   return (uint32_t) symbolsPerSecond * bitsTransmittedPerSymbol;
 
  665 SimpleOfdmWimaxPhy::DoGetDataRate (WimaxPhy::ModulationType modulationType)
 const 
  667   switch (modulationType)
 
  669     case MODULATION_TYPE_BPSK_12:
 
  670       return m_dataRateBpsk12;
 
  672     case MODULATION_TYPE_QPSK_12:
 
  673       return m_dataRateQpsk12;
 
  675     case MODULATION_TYPE_QPSK_34:
 
  676       return m_dataRateQpsk34;
 
  678     case MODULATION_TYPE_QAM16_12:
 
  679       return m_dataRateQam16_12;
 
  681     case MODULATION_TYPE_QAM16_34:
 
  682       return m_dataRateQam16_34;
 
  684     case MODULATION_TYPE_QAM64_23:
 
  685       return m_dataRateQam64_23;
 
  687     case MODULATION_TYPE_QAM64_34:
 
  688       return m_dataRateQam64_34;
 
  696 SimpleOfdmWimaxPhy::GetBlockTransmissionTime (WimaxPhy::ModulationType modulationType)
 const 
  698   return Seconds ((
double) GetFecBlockSize (modulationType) / DoGetDataRate (modulationType));
 
  702 SimpleOfdmWimaxPhy::DoGetTransmissionTime (uint32_t size, WimaxPhy::ModulationType modulationType)
 const 
  711 SimpleOfdmWimaxPhy::DoGetNrSymbols (uint32_t size, WimaxPhy::ModulationType modulationType)
 const 
  713   Time transmissionTime = 
Seconds ((
double)(GetNrBlocks (size, modulationType) * GetFecBlockSize (modulationType))
 
  714                                    / DoGetDataRate (modulationType));
 
  719 SimpleOfdmWimaxPhy::DoGetNrBytes (uint32_t symbols, WimaxPhy::ModulationType modulationType)
 const 
  722   return (uint64_t) std::floor ((transmissionTime.GetSeconds () * DoGetDataRate (modulationType)) / 8);
 
  726 SimpleOfdmWimaxPhy::GetFecBlockSize (WimaxPhy::ModulationType modulationType)
 const 
  728   uint32_t blockSize = 0;
 
  729   switch (modulationType)
 
  731     case MODULATION_TYPE_BPSK_12:
 
  734     case MODULATION_TYPE_QPSK_12:
 
  737     case MODULATION_TYPE_QPSK_34:
 
  740     case MODULATION_TYPE_QAM16_12:
 
  743     case MODULATION_TYPE_QAM16_34:
 
  746     case MODULATION_TYPE_QAM64_23:
 
  749     case MODULATION_TYPE_QAM64_34:
 
  756   return blockSize * 8; 
 
  761 SimpleOfdmWimaxPhy::GetCodedFecBlockSize (WimaxPhy::ModulationType modulationType)
 const 
  763   uint32_t blockSize = 0;
 
  764   switch (modulationType)
 
  766     case MODULATION_TYPE_BPSK_12:
 
  769     case MODULATION_TYPE_QPSK_12:
 
  772     case MODULATION_TYPE_QPSK_34:
 
  775     case MODULATION_TYPE_QAM16_12:
 
  778     case MODULATION_TYPE_QAM16_34:
 
  781     case MODULATION_TYPE_QAM64_23:
 
  784     case MODULATION_TYPE_QAM64_34:
 
  791   return blockSize * 8; 
 
  795 SimpleOfdmWimaxPhy::SetBlockParameters (uint32_t burstSize, WimaxPhy::ModulationType modulationType)
 
  797   m_blockSize = GetFecBlockSize (modulationType);
 
  798   m_nrBlocks = GetNrBlocks (burstSize, modulationType);
 
  799   m_paddingBits = (m_nrBlocks * m_blockSize) - (burstSize * 8);
 
  800   m_nrRemainingBlocksToSend = m_nrBlocks;
 
  801   NS_ASSERT_MSG (static_cast<uint32_t> (m_nrBlocks * m_blockSize) >= (burstSize * 8), 
"Size of padding bytes < 0");
 
  805 SimpleOfdmWimaxPhy::DoGetTtg (
void)
 const 
  812 SimpleOfdmWimaxPhy::DoGetRtg (
void)
 const 
  819 SimpleOfdmWimaxPhy::DoGetFrameDurationCode (
void)
 const 
  821   uint16_t duration = 0;
 
  827         return FRAME_DURATION_2_POINT_5_MS;
 
  832         return FRAME_DURATION_4_MS;
 
  837         return FRAME_DURATION_5_MS;
 
  842         return FRAME_DURATION_8_MS;
 
  847         return FRAME_DURATION_10_MS;
 
  852         return FRAME_DURATION_12_POINT_5_MS;
 
  857         return FRAME_DURATION_20_MS;
 
  871 SimpleOfdmWimaxPhy::DoGetFrameDuration (uint8_t frameDurationCode)
 const 
  873   switch (frameDurationCode)
 
  875     case FRAME_DURATION_2_POINT_5_MS:
 
  878     case FRAME_DURATION_4_MS:
 
  881     case FRAME_DURATION_5_MS:
 
  884     case FRAME_DURATION_8_MS:
 
  887     case FRAME_DURATION_10_MS:
 
  890     case FRAME_DURATION_12_POINT_5_MS:
 
  893     case FRAME_DURATION_20_MS:
 
  907 SimpleOfdmWimaxPhy::GetNrBlocks (uint32_t burstSize, WimaxPhy::ModulationType modulationType)
 const 
  909   uint32_t blockSize = GetFecBlockSize (modulationType);
 
  910   uint16_t nrBlocks = (burstSize * 8) / blockSize;
 
  912   if ((burstSize * 8) % blockSize > 0)
 
  922 SimpleOfdmWimaxPhy::DoSetPhyParameters (
void)
 
  932   double samplingFrequency = DoGetSamplingFrequency ();
 
  933   Time psDuration = 
Seconds ((
double) 4 / samplingFrequency);
 
  938   double subcarrierSpacing = samplingFrequency / DoGetNfft ();
 
  939   double tb = (double) 1 / subcarrierSpacing; 
 
  940   double tg = DoGetGValue () * tb; 
 
  941   Time symbolDuration = 
Seconds (tb + tg); 
 
  943   uint16_t psPerSymbol = lrint (symbolDuration.GetSeconds () / psDuration.GetSeconds ());
 
  950 SimpleOfdmWimaxPhy::DoSetNfft (uint16_t nfft)
 
  957 SimpleOfdmWimaxPhy::DoGetNfft (
void)
 const 
  964 SimpleOfdmWimaxPhy::DoGetSamplingFactor (
void)
 const 
  970   if (channelBandwidth % 1750000 == 0)
 
  972       return (
double) 8 / 7;
 
  974   else if (channelBandwidth % 1500000 == 0)
 
  976       return (
double) 86 / 75;
 
  978   else if (channelBandwidth % 1250000 == 0)
 
  980       return (
double) 144 / 125;
 
  982   else if (channelBandwidth % 2750000 == 0)
 
  984       return (
double) 316 / 275;
 
  986   else if (channelBandwidth % 2000000 == 0)
 
  988       return (
double) 57 / 50;
 
  992       NS_LOG_DEBUG (
"Oops may be wrong channel bandwidth for OFDM PHY!");
 
  996   return (
double) 8 / 7;
 
 1000 SimpleOfdmWimaxPhy::DoGetSamplingFrequency (
void)
 const 
 1008 SimpleOfdmWimaxPhy::DoGetGValue (
void)
 const 
 1015 SimpleOfdmWimaxPhy::DoSetGValue (
double g)
 
 1022 SimpleOfdmWimaxPhy::SetTxGain (
double txGain)
 
 1028 SimpleOfdmWimaxPhy::SetRxGain (
double txRain)
 
 1034 SimpleOfdmWimaxPhy::GetTxGain (
void)
 const 
 1040 SimpleOfdmWimaxPhy::GetRxGain (
void)
 const 
 1046 SimpleOfdmWimaxPhy::GetTraceFilePath (
void)
 const 
 1052 SimpleOfdmWimaxPhy::SetTraceFilePath (std::string path)
 
void SetNoiseFigure(double nf)
set the noise figure of the device 
Time NanoSeconds(uint64_t ns)
create ns3::Time instances in units of nanoseconds. 
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 
Callback< void, Ptr< const PacketBurst > > GetReceiveCallback(void) const 
smart pointer class similar to boost::intrusive_ptr 
#define NS_LOG_FUNCTION(parameters)
void SetStream(int64_t stream)
Specifies the stream number for this RNG stream. 
void SetSNRToBlockErrorRateTracesPath(char *tracesPath)
Set the path of the repository containing the traces. 
TracedCallback< Ptr< PacketBurst > > m_phyRxEndTrace
void Send(Ptr< PacketBurst > burst, WimaxPhy::ModulationType modulationType, uint8_t direction)
Sends a burst on the channel. 
void NotifyRxDrop(Ptr< PacketBurst > burst)
virtual void DoDispose(void)
void NotifyRxBegin(Ptr< PacketBurst > burst)
int64_t AssignStreams(int64_t stream)
bool IsDuplex(void) const 
uint32_t GetChannelBandwidth(void) const 
std::string GetTraceFilePath(void)
#define NS_LOG_COMPONENT_DEFINE(name)
void SetSimplex(uint64_t frequency)
configure the physical layer in simplex mode 
void NotifyTxDrop(Ptr< PacketBurst > burst)
uint64_t GetRxFrequency(void) const 
static void Cancel(const EventId &id)
Time GetSymbolDuration(void) const 
void NotifyTxBegin(Ptr< PacketBurst > burst)
static EventId Schedule(Time const &time, MEM mem_ptr, OBJ obj)
void SetSymbolsPerFrame(uint32_t symbolsPerFrame)
set the number of symbols per frame 
TracedCallback< Ptr< PacketBurst > > m_phyTxDropTrace
void SetPsDuration(Time psDuration)
set the physical slot duration in seconds 
Time GetFrameDuration(void) const 
void SetBandwidth(uint32_t BW)
Set the bandwidth. 
#define NS_FATAL_ERROR(msg)
fatal error handling 
This class represents a record (handled by SnrToBlockErrorRate manager) that keeps a mapping between ...
TracedCallback< Ptr< PacketBurst > > m_phyTxBeginTrace
SNRToBlockErrorRateRecord * GetSNRToBlockErrorRateRecord(double SNR, uint8_t modulation)
returns a record of type SNRToBlockErrorRateRecord corresponding to a given modulation and SNR value ...
Ptr< UniformRandomVariable > m_URNG
Provides uniform random variables. 
double GetSeconds(void) const 
The SendParams class defines the parameters with which Send() function of a particular PHY is called...
void SetScanningCallback(void) const 
calls the scanning call back function 
void ActivateLoss(bool loss)
If activate loss is called with false, all the returned BlcER will be 0 (no losses) ...
void SetPsPerSymbol(uint16_t psPerSymbol)
set the number of physical slots per symbol 
void SetTraceFilePath(char *traceFilePath)
Set the path of the repository containing the traces. 
Ptr< WimaxChannel > GetChannel(void) const 
uint8_t GetNrCarriers(void) const 
void LoadTraces(void)
Loads the traces form the repository specified in the constructor or setted by SetTraceFilePath funct...
void NotifyRxEnd(Ptr< PacketBurst > burst)
void SetChannelBandwidth(uint32_t channelBandwidth)
Set the channel bandwidth. 
Ptr< const TraceSourceAccessor > MakeTraceSourceAccessor(T a)
double GetTxPower(void) const 
double GetNoiseFigure(void) const 
uint16_t GetPsPerSymbol(void) const 
void DoAttach(Ptr< WimaxChannel > channel)
void ActivateLoss(bool loss)
if called with true it will enable the loss model 
void NotifyTxEnd(Ptr< PacketBurst > burst)
#define NS_ASSERT_MSG(condition, message)
TracedCallback< Ptr< PacketBurst > > m_phyRxBeginTrace
void SetTxPower(double txPower)
set the transmission power 
TracedCallback< Ptr< PacketBurst > > m_phyTxEndTrace
void SetSymbolDuration(Time symbolDuration)
set the OFMD symbol duration in second 
Time Seconds(double seconds)
create ns3::Time instances in units of seconds. 
uint32_t GetBandwidth(void) const 
#define NS_LOG_DEBUG(msg)
void SetState(PhyState state)
set the state of the device 
WimaxPhy::PhyType GetPhyType(void) const 
returns the type this physical layer 
void SetNrCarriers(uint8_t nrCarriers)
Set the number of carriers in the physical frame. 
uint64_t GetTxFrequency(void) const 
void SetPsPerFrame(uint16_t psPerFrame)
set the number of physical slot per frame 
void ReLoadTraces(void)
Reloads the trace. 
PhyState GetState(void) const 
uint64_t GetScanningFrequency(void) const 
TracedCallback< Ptr< PacketBurst > > m_phyRxDropTrace