LTE Module User Documentation(翻譯15)——示例程序、參考場景以及故障檢測和調試技巧


 LTE用戶文檔

(如有不當的地方,歡迎指正!)

 
 

21 Examples Programs(示例程序)

 
路徑 src/lte/examples/ 包含一些示例仿真程序,這些例子表明如何仿真不同的LTE場景。
 
 

22 Reference scenarios(參考場景)

 
文獻中可以找到大量的參考仿真場景。下面我們列出了其中一部分:
 
  • [TR36814] 的 A.2 節提到的系統仿真場景。
  • dual stripe model [R4-092042], 在示例程序  src/lte/examples/lena-dual-stripe.cc 中有部分提及。該示例程序的特點是有很多可配置的參數,可以通過修改相關的全局變量來自定義。可以使用下列命令來獲取所有這些全局變量的列表:

 

  • ./waf --run lena-dual-stripe --command-template="%s --PrintGlobals"

 

下面小節給出了運行仿真程序的例子。

 

22.1 Handover simulation campaign

 
在本小節,我們演示了使用 ns-3 的 LTE 模塊運行仿真 campaign 的例子。 campaign 的目標是比較 LTE 模塊每一個內置的切換算法的效果。
 
campaign 使用 lena-dual-stripe 示例程序。首先,我們必須修改示例程序來產生我們需要的輸出。這種情況下,我們想要的輸出為:產生切換的次數、用戶平均吞吐量以及平均  SINR。
 
切換次數可以通過計算 HandoverEndOk Handover traces is fired 的次數獲得。然后用戶平均吞吐量可以通過使能 RLC Simulation Output 獲得。最后,SINR 可以通過使能 PHY 仿真輸出獲得。下列樣本代碼片段顯示了獲得上述輸出的一種可能方式:
 
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;
}
 
然后我們必須配置程序的參數來滿足我們的仿真需求。我們在仿真中尋求下列假設:
 
  • 將六邊形小區划分為3個扇區,每個扇區有 7 個宏基站站點(例如,21個宏小區),站點間的距離為 500 m 。
  • 盡管 lena-dual-stripe 最初用於兩層網絡( macrocell 和 femtocell)仿真,我們簡化為只有一層(macrocell)。
  • 用戶隨機部署在站點周圍,使用空閑模式小區選擇自動連接到網絡。此后,用戶以 60 kmph 的移動速度在仿真環境中移動。
  • 仿真持續時間為 50 秒,因此用戶有足夠的時間來觸發一些切換。
  • 宏小區傳輸功率為 46 dBm ,用戶傳輸功率為 10 dBm。
  • 使用 EPC 模式(因為 X2 切換需要)。
  • 下行和上行業務為全緩存,5 MHz 帶寬,使用 TCP 協議和 Proportional Fair (比例公平)調度器。
  • 理想的 RRC 協議。
 
下面的表格 lena-dual-stripe parameter configuration for handover campaign 表明我們如何配置  lena-dual-stripe 參數來實現上述假設。
 
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
 
有些要求的假設不能用作 lena-dual-stripe 的參數。 這種情況下,我們可以 override 默認屬性。見下面的表格 Overriding default attributes for handover campaign 。
 
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
 
 
ns-3 提供了很多方法用於傳遞配置值到仿真中。在本例中,我們使用命令行參數。 當開始每個單獨的仿真時,它通過附加參數及其值到  waf 調用中來實現。 因此,waf 調用請求 ns-3 的仿真類似於:
 
$ ./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
 
仿真過程中的注意事項:
 
  • 注意,有些參數沒有指定,因為它們和默認值一樣,我們也保持切換算法為各自的默認設置。
  • 注意仿真輸出的文件名,例如 RLC traces 和 PHY traces,因為我們必須確保它們不被下一次仿真運行覆蓋。在本例中,我們通過使用命令行參數來命名。
  • --RngRun=1 參數在最后是用於設置被 random number generator(隨機數字產生器)使用的運行次數。 我們使用不同的 RngRun 值再次運行仿真, 因此會創建同一仿真的幾個獨立副本。然后我們把這些副本所得結果進行平均,實現統計意義上的confidence 。
  • 我們可以增加一個參數  --generateRem=1 來生成必要的文件——生成仿真的 REM。 結果如下圖 REM obtained from a simulation in handover campaign, 產生的步驟參見前面的章節 Radio Environment Maps 。該圖也表明在仿真開始使用RngRun = 1 時基站和用戶的位置。其他的 RngRun 值可能產生不同的用戶位置。

 

_images/lte-handover-campaign-rem.png
                REM obtained from a simulation in handover campaign
 
在幾個小時的運行后,仿真 campaign 最終結束。接下來我們對產生的仿真輸出進行一些后續處理來獲得一些有用的信息。
 
本例中,我們使用 GNU Octave 來幫助處理吞吐量和 SINR 數據,如下演示了一個示例 GNU Octave 腳本:
 
% 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 
 
至於切換的次數,我們可以使用簡單的 shell 腳本計算日志文件中出現字符串 “Handover” 的次數:
 
$ grep "Handover" no-op.txt | wc -l
 
下面的表格 Results of handover campaign  是一些完整的統計數據(對每個單獨的仿真運行完成后續處理時所得結果)。下面的值是 RngRun 為 1、2、3 和 4 時所得結果的平均值。
 
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
 
 
結果表明,在移動仿真環境中使用切換算法可以顯著提高用戶的吞吐量和 SINR 。該 campaign 場景中的兩種切換算法基本上沒什么差異。觀察它們在不同的場景下的性能將是一件有趣的事,例如有家庭基站部署的場景。
 

22.2 Frequency Reuse examples(頻率復用例子)

 
下面的兩個例子表明頻率復用算法的功能。
 
lena-frequency-reuse 是一個簡單的例子。3個基站位於一個三角形的布局中,3個小區邊緣用戶位於該三角形的中心,有3個小區中心用戶(每個靠近每個基站)。使用者也可以指定隨機布置的用戶數。FR 算法安裝在基站上,每個基站有不同的 FrCellTypeId,這意味着每個基站使用不同的  FR 配置。用戶可以使用 6 種不同的 FR 算法運行  lena-frequency-reuse : NoOp、 Hard FR、 Strict FR、 Soft FR、 Soft FFR 和 Enhanced FFR 。 為了運行 Distributed FFR 算法的仿真場景,用戶應使用  lena-distributed-ffr。這兩個例子非常相似,但是它們不同,因為 Distributed FFR 要求使用 EPC ,而其他算法不需要。
 
為了使用不同的頻率復用算法運行 lena-frequency-reuse , 用戶需要通過覆蓋默認屬 ns3::LteHelper::FfrAlgorithm 來指定 FR 算法。使用 Soft FR 算法運行  lena-frequency-reuse 的命令如下:
 
$ ./waf --run "lena-frequency-reuse --ns3::LteHelper::FfrAlgorithm=ns3::LteFrSoftAlgorithm"
 
這些例子添加的功能有:產生 REM 和 spectrum analyzer trace 。 用戶可以通過設置  generateRem 和 generateSpectrumTrace 屬性來使能它們的生成。
 
 (1)在 lena-frequency-reuse 場景使用 Soft FR 算法生成 REM (RB 1 in data channel )的命令如下:
 
$ ./waf --run "lena-frequency-reuse --ns3::LteHelper::FfrAlgorithm=ns3::LteFrSoftAlgorithm
  --generateRem=true --remRbId=1"
 
 
_images/lte-fr-soft-1-rem.png
REM for RB 1 obtained from lena-frequency-reuse example with Soft FR algorithm enabled
 
 (2)在 lena-frequency-reuse 場景使用 Soft FFR 算法生成頻譜 trace 的命令如下(Spectrum Analyzer 位置需要配置在腳本內):
 
$ ./waf --run "lena-frequency-reuse --ns3::LteHelper::FfrAlgorithm=ns3::LteFfrSoftAlgorithm
  --generateSpectrumTrace=true"
 
例子 spectrum analyzer trace 見圖 Spectrum Analyzer trace obtained from lena-frequency-reuse example with Soft FFR algorithm enabled. Spectrum Analyzer was located need eNB with FrCellTypeId 2.。正如我們看到的,不同的數據信道子帶以不同的功率等級發射(根據配置),與此同時,控制信道以相同的功率沿着整個系統帶寬傳輸。
_images/lte-ffr-soft-2-spectrum-trace.png
Spectrum Analyzer trace obtained from lena-frequency-reuse example with Soft FFR algorithm enabled. Spectrum Analyzer was located need eNB with FrCellTypeId 2.
 
也可以使用安裝在所有宏基站上的頻率復用算法運行 lena-dual-stripe。 用戶需要通過覆蓋默認屬性 ns3::LteHelper::FfrAlgorithm來指定 FR 算法。 使用 Hard FR 算法運行 lena-dual-stripe 的命令如下:
 
$ ./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 
 
在 lena-dual-stripe 場景使用 Hard FR 算法生成 REM ( RB 1 in data channel )的命令如下:
 
$ ./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
 
在 lena-dual-stripe 場景使用 Hard Frequency Reuse 算法生成 REM (RB= 1,10 和20 )的結果如下圖。選擇這些 RB 的原因是每一個使用不同的 FR 小區類型。
 
_images/lte-fr-hard-1-rem.png
REM for RB 1 obtained from lena-dual-stripe simulation with Hard FR algorithm enabled
 
_images/lte-fr-hard-2-rem.png
REM for RB 10 obtained from lena-dual-stripe simulation with Hard FR algorithm enabled
 
_images/lte-fr-hard-3-rem.png
REM for RB 20 obtained from lena-dual-stripe simulation with Hard FR algorithm enabled
 
 
 

23 故障檢測和調試技巧

 
很多用戶在 ns-3-users 論壇上發郵件詢問,例如,為什么他們在仿真中沒有得到任何業務,或者可能只有上行業務沒有下行業務等。大多數情況下,這是用戶仿真程序的 bug 。這里有一些調試程序和找到問題原因的建議:
 
一般的方法是選擇性地和遞增地使能相關LTE模塊組件的日志功能, 驗證每次激活——輸出能按預期輸出。具體地:
 
  • 首先檢查控制面,特別是 RRC 連接建立過程,通過使能日志組件 LteUeRrcLteEnbRrc。
  • 然后檢查數據面的數據包傳輸,首先使能日志組件 LteUeNetDeviceEpcSgwPgwApplication,然后是 EpcEnbApplication,接着向下移動到 LTE 無線協議棧 (PDCP, RLC, MAC, 和 PHY), 直到你找到數據包停止處理/轉發的位置(All his until you find where packets stop being processed / forwarded)。
 (完)
 
 

參考文獻

https://www.nsnam.org/docs/models/html/lte-user.html


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM