标签:
./waf --run lena-dual-stripe --command-template="%s --PrintGlobals"
下面小节给出了运行仿真程序的例子。
void NotifyHandoverEndOkUe (std::string context, uint64_t imsi, uint16_t cellId, uint16_t rnti) { std::cout << "Handover IMSI " << imsi << std::endl; } int main (int argc, char *argv[]) { /*** SNIP ***/ Config::Connect ("/NodeList/*/DeviceList/*/LteUeRrc/HandoverEndOk", MakeCallback (&NotifyHandoverEndOkUe)); lteHelper->EnablePhyTraces (); lteHelper->EnableRlcTraces (); Ptr<RadioBearerStatsCalculator> rlcStats = lteHelper->GetRlcStats (); rlcStats->SetAttribute ("StartTime", TimeValue (Seconds (0))); rlcStats->SetAttribute ("EpochDuration", TimeValue (Seconds (simTime))); Simulator::Run (); Simulator::Destroy (); return 0; }
Parameter name | Value | Description |
simTime | 50 | 50 seconds simulation duration |
nBlocks | 0 | Disabling apartment buildings and femtocells |
nMacroEnbSites | 7 | Number of macrocell sites (each site has 3 cells) |
nMacroEnbSitesX | 2 | The macrocell sites will be positioned in a 2-3-2 formation |
interSiteDistance | 500 | 500 m distance between adjacent macrocell sites |
macroEnbTxPowerDbm | 46 | 46 dBm Tx power for each macrocell |
epc | 1 | Enable EPC mode |
epcDl | 1 | Enable full-buffer DL traffic |
epcUl | 1 | Enable full-buffer UL traffic |
useUdp | 0 | Disable UDP traffic and enable TCP instead |
macroUeDensity | 0.00002 | Determines number of UEs (translates to 48 UEs in our simulation) |
outdoorUeMinSpeed | 16.6667 | Minimum UE movement speed in m/s (60 kmph) |
outdoorUeMaxSpeed | 16.6667 | Maximum UE movement speed in m/s (60 kmph) |
macroEnbBandwidth | 25 | 5 MHz DL and UL bandwidth |
generateRem | 1 | (Optional) For plotting the Radio Environment Map |
Default value name | Value | Description |
ns3::LteHelper::HandoverAlgorithm | ns3::NoOpHandoverAlgorithm,ns3::A3RsrpHandoverAlgorithm, orns3::A2A4RsrqHandoverAlgorithm | Choice of handover algorithm |
ns3::LteHelper::Scheduler | ns3::PfFfMacScheduler | Proportional Fair scheduler |
ns3::LteHelper::UseIdealRrc | 1 | Ideal RRC protocol |
ns3::RadioBearerStatsCalculator::DlRlcOutputFilename | <run>-DlRlcStats.txt | File name for DL RLC trace output |
ns3::RadioBearerStatsCalculator::UlRlcOutputFilename | <run>-UlRlcStats.txt | File name for UL RLC trace output |
ns3::PhyStatsCalculator::DlRsrpSinrFilename | <run>-DlRsrpSinrStats.txt | File name for DL PHY RSRP/SINR trace output |
ns3::PhyStatsCalculator::UlSinrFilename | <run>-UlSinrStats.txt | File name for UL PHY SINR trace output |
$ ./waf --run="lena-dual-stripe --simTime=50 --nBlocks=0 --nMacroEnbSites=7 --nMacroEnbSitesX=2 --epc=1 --useUdp=0 --outdoorUeMinSpeed=16.6667 --outdoorUeMaxSpeed=16.6667 --ns3::LteHelper::HandoverAlgorithm=ns3::NoOpHandoverAlgorithm --ns3::RadioBearerStatsCalculator::DlRlcOutputFilename=no-op-DlRlcStats.txt --ns3::RadioBearerStatsCalculator::UlRlcOutputFilename=no-op-UlRlcStats.txt --ns3::PhyStatsCalculator::DlRsrpSinrFilename=no-op-DlRsrpSinrStats.txt --ns3::PhyStatsCalculator::UlSinrFilename=no-op-UlSinrStats.txt --RngRun=1" > no-op.txt $ ./waf --run="lena-dual-stripe --simTime=50 --nBlocks=0 --nMacroEnbSites=7 --nMacroEnbSitesX=2 --epc=1 --useUdp=0 --outdoorUeMinSpeed=16.6667 --outdoorUeMaxSpeed=16.6667 --ns3::LteHelper::HandoverAlgorithm=ns3::A3RsrpHandoverAlgorithm --ns3::RadioBearerStatsCalculator::DlRlcOutputFilename=a3-rsrp-DlRlcStats.txt --ns3::RadioBearerStatsCalculator::UlRlcOutputFilename=a3-rsrp-UlRlcStats.txt --ns3::PhyStatsCalculator::DlRsrpSinrFilename=a3-rsrp-DlRsrpSinrStats.txt --ns3::PhyStatsCalculator::UlSinrFilename=a3-rsrp-UlSinrStats.txt --RngRun=1" > a3-rsrp.txt $ ./waf --run="lena-dual-stripe --simTime=50 --nBlocks=0 --nMacroEnbSites=7 --nMacroEnbSitesX=2 --epc=1 --useUdp=0 --outdoorUeMinSpeed=16.6667 --outdoorUeMaxSpeed=16.6667 --ns3::LteHelper::HandoverAlgorithm=ns3::A2A4RsrqHandoverAlgorithm --ns3::RadioBearerStatsCalculator::DlRlcOutputFilename=a2-a4-rsrq-DlRlcStats.txt --ns3::RadioBearerStatsCalculator::UlRlcOutputFilename=a2-a4-rsrq-UlRlcStats.txt --ns3::PhyStatsCalculator::DlRsrpSinrFilename=a2-a4-rsrq-DlRsrpSinrStats.txt --ns3::PhyStatsCalculator::UlSinrFilename=a2-a4-rsrq-UlSinrStats.txt --RngRun=1" > a2-a4-rsrq.txt
% RxBytes is the 10th column DlRxBytes = load ("no-op-DlRlcStats.txt") (:,10); DlAverageThroughputKbps = sum (DlRxBytes) * 8 / 1000 / 50 % RxBytes is the 10th column UlRxBytes = load ("no-op-UlRlcStats.txt") (:,10); UlAverageThroughputKbps = sum (UlRxBytes) * 8 / 1000 / 50 % Sinr is the 6th column DlSinr = load ("no-op-DlRsrpSinrStats.txt") (:,6); % eliminate NaN values idx = isnan (DlSinr); DlSinr (idx) = 0; DlAverageSinrDb = 10 * log10 (mean (DlSinr)) % convert to dB % Sinr is the 5th column UlSinr = load ("no-op-UlSinrStats.txt") (:,5); % eliminate NaN values idx = isnan (UlSinr); UlSinr (idx) = 0; UlAverageSinrDb = 10 * log10 (mean (UlSinr)) % convert to dB
$ grep "Handover" no-op.txt | wc -l
Statistics | No-op | A2-A4-RSRQ | Strongest cell |
Average DL system throughput | 6 615 kbps | 20 509 kbps | 19 709 kbps |
Average UL system throughput | 4 095 kbps | 5 705 kbps | 6 627 kbps |
Average DL SINR | -0.10 dB | 5.19 dB | 5.24 dB |
Average UL SINR | 9.54 dB | 81.57 dB | 79.65 dB |
Number of handovers per UE per second | 0 | 0.05694 | 0.04771 |
$ ./waf --run "lena-frequency-reuse --ns3::LteHelper::FfrAlgorithm=ns3::LteFrSoftAlgorithm"
$ ./waf --run "lena-frequency-reuse --ns3::LteHelper::FfrAlgorithm=ns3::LteFrSoftAlgorithm --generateRem=true --remRbId=1"
$ ./waf --run "lena-frequency-reuse --ns3::LteHelper::FfrAlgorithm=ns3::LteFfrSoftAlgorithm --generateSpectrumTrace=true"
$ ./waf --run="lena-dual-stripe --simTime=50 --nBlocks=0 --nMacroEnbSites=7 --nMacroEnbSitesX=2 --epc=1 --useUdp=0 --outdoorUeMinSpeed=16.6667 --outdoorUeMaxSpeed=16.6667 --ns3::LteHelper::HandoverAlgorithm=ns3::NoOpHandoverAlgorithm --ns3::LteHelper::FfrAlgorithm=ns3::LteFrHardAlgorithm --ns3::RadioBearerStatsCalculator::DlRlcOutputFilename=no-op-DlRlcStats.txt --ns3::RadioBearerStatsCalculator::UlRlcOutputFilename=no-op-UlRlcStats.txt --ns3::PhyStatsCalculator::DlRsrpSinrFilename=no-op-DlRsrpSinrStats.txt --ns3::PhyStatsCalculator::UlSinrFilename=no-op-UlSinrStats.txt --RngRun=1" > no-op.txt
$ ./waf --run="lena-dual-stripe --simTime=50 --nBlocks=0 --nMacroEnbSites=7 --nMacroEnbSitesX=2 --epc=0 --useUdp=0 --outdoorUeMinSpeed=16.6667 --outdoorUeMaxSpeed=16.6667 --ns3::LteHelper::HandoverAlgorithm=ns3::NoOpHandoverAlgorithm --ns3::LteHelper::FfrAlgorithm=ns3::LteFrHardAlgorithm --ns3::RadioBearerStatsCalculator::DlRlcOutputFilename=no-op-DlRlcStats.txt --ns3::RadioBearerStatsCalculator::UlRlcOutputFilename=no-op-UlRlcStats.txt --ns3::PhyStatsCalculator::DlRsrpSinrFilename=no-op-DlRsrpSinrStats.txt --ns3::PhyStatsCalculator::UlSinrFilename=no-op-UlSinrStats.txt --RngRun=1 --generateRem=true --remRbId=1" > no-op.txt
参考文献
LTE Module User Documentation(翻译15)——示例程序、参考场景以及故障检测和调试技巧
标签:
原文地址:http://www.cnblogs.com/alice123/p/5511482.html