21 #include <ns3/object.h> 
   22 #include <ns3/spectrum-interference.h> 
   23 #include <ns3/spectrum-error-model.h> 
   26 #include <ns3/simulator.h> 
   27 #include <ns3/packet.h> 
   29 #include <ns3/string.h> 
   32 #include <ns3/spectrum-model-ism2400MHz-res1MHz.h> 
   33 #include <ns3/spectrum-model-300kHz-300GHz-log.h> 
   34 #include <ns3/wifi-spectrum-value-helper.h> 
   35 #include <ns3/single-model-spectrum-channel.h> 
   36 #include <ns3/waveform-generator.h> 
   37 #include <ns3/spectrum-analyzer.h> 
   40 #include <ns3/friis-spectrum-propagation-loss.h> 
   41 #include <ns3/propagation-delay-model.h> 
   42 #include <ns3/spectrum-helper.h> 
   43 #include <ns3/adhoc-aloha-noack-ideal-phy-helper.h> 
   44 #include <ns3/mobility-helper.h> 
   45 #include <ns3/data-rate.h> 
   46 #include <ns3/uinteger.h> 
   47 #include <ns3/packet-socket-helper.h> 
   48 #include <ns3/packet-socket-address.h> 
   49 #include <ns3/on-off-helper.h> 
   50 #include <ns3/config.h> 
   73                 bool rateIsAchievable,
 
   74                 std::string channelType);
 
   78   virtual void DoRun (
void);
 
   79   static std::string 
Name (std::string channelType, 
double snrLinear, uint64_t phyRate);
 
   90   std::ostringstream oss;
 
   92       << 
" snr = " << snrLinear << 
" (linear), " 
   93       << 
" phyRate = " << phyRate << 
" bps";
 
  100                             bool rateIsAchievable,
 
  101                             std::string channelType)
 
  103     m_snrLinear (snrLinear),
 
  105     m_rateIsAchievable (rateIsAchievable),
 
  106     m_channelType (channelType)
 
  119   double txPowerW = 0.1; 
 
  122   const double k = 1.381e-23; 
 
  123   const double T = 290; 
 
  124   double noisePsdValue = k * T; 
 
  126   double lossDb = 10 * std::log10 (lossLinear);
 
  128   uint32_t pktSize = 50; 
 
  130   uint32_t numPkts = 200; 
 
  134   double testDuration = (numPkts * pktSize * 8.0) / phyRate;
 
  135   NS_LOG_INFO (
"test duration = " << std::fixed << testDuration);
 
  142   positionAlloc->Add (
Vector (0.0, 0.0, 0.0));
 
  143   positionAlloc->Add (
Vector (5.0, 0.0, 0.0));
 
  162   uint32_t channelNumber = 1;
 
  187   apps.
Start (Seconds (0.0));
 
  188   apps.
Stop (Seconds (testDuration));
 
  195   double throughputBps = (
g_rxBytes * 8.0) / testDuration;
 
  197   std::clog.unsetf(std::ios_base::floatfield);
 
  221   : 
TestSuite (
"spectrum-ideal-phy", SYSTEM)
 
  224   NS_LOG_INFO (
"creating SpectrumIdealPhyTestSuite");
 
  226   for (
double snr = 0.01; snr <= 10 ; snr *= 2)
 
  236   for (
double snr = 0.01; snr <= 10 ; snr *= 10)