ndnSIM中提供了幾種trace用來對仿真結果進行跟蹤,生成資料檔案txt
官網地址: https://ndnsim.net/current/metric.html#packet-trace-helper-example
1、L3RateTracer(官網示例檔案:ndn-tree-tracers.cpp)
L3RateTracer::InstallAll("rate-trace.txt", Seconds(1.0));跟蹤NDN節點轉發的興趣/資料包的位元組數和速率生成結果檔案rate-trace.txt,包含以下內容
Time Node FaceId FaceDescr Type Packets Kilobytes PacketRaw KilobytesRaw
0.5 leaf-1 1 internal:// InInterests 0 0 0 0
0.5 leaf-1 1 internal:// OutInterests 0 0 0 0
0.5 leaf-1 1 internal:// InData 0 0 0 0
0.5 leaf-1 1 internal:// OutData 0 0 0 0
0.5 leaf-1 1 internal:// InNacks 0 0 0 0
0.5 leaf-1 1 internal:// OutNacks 0 0 0 0CacheHits:“資料包”列指定快取中滿足的興趣數
CacheMisses:“資料包”列指定快取中未滿足的興趣數
0.5 leaf-1 1 internal:// InSatisfiedInterests 0 0 0 0
0.5 leaf-1 1 internal:// InTimedOutInterests 0 0 0 0
0.5 leaf-1 1 internal:// OutSatisfiedInterests 1.6 0 1 0
0.5 leaf-1 1 internal:// OutTimedOutInterests 0 0 0 0
2、L2RateTracer(官網示例檔案:ndn-simple-withl2tracer.cpp)
此跟蹤器在本質上與ndn :: L3RateTracer相似,但當前僅跟蹤第2層上的資料包丟棄
下圖是根據官網用R語言繪制的結果圖
ns3::L2RateTracer::InstallAll("rate-trace.txt", Seconds(1.0));
結果檔案包含以下內容:
Time Node Interface Type Packets Kilobytes PacketsRaw KilobytesRaw1 Rtr1 combined Drop 0 0 0 0
3、CsTracer(官網示例檔案:ndn-tree-cs-tracers.cpp)
僅當使用OldContentStore結構時,此跟蹤器才起作用!
通過使用ndn :: CsTracer,可以獲得仿真節點上快取命中/快取未命中的統計資訊
CsTracer::InstallAll("cs-trace.txt", Seconds(1));
結果檔案包含:
Time Node Type Packets
1 leaf-1 CacheHits 0
1 leaf-1 CacheMisses 11
1 leaf-2 CacheHits 0
1 leaf-2 CacheMisses 1
Type:CacheHits: “資料包”列指定快取中滿足的興趣數
CacheMisses:“資料包”列指定快取中未滿足的興趣數
Packets:該時間段內的資料包數量,其含義取決于“型別”列
4、AppDelayTracer(官網示例檔案:ndn-tree-app-delay-tracer.cpp)
通過使用ndn :: AppDelayTracer,可以獲取有關發出興趣和接收相應資料包之間的延遲的資料,
AppDelayTracer::InstallAll("app-delays-trace.txt");
結果檔案中包含:
Time Node AppId SeqNo Type DelayS DelayUS RetxCount HopCount
10.0058 leaf-1 0 0 LastDelay 0.0057904 5790.4 1 2
10.0058 leaf-1 0 0 FullDelay 9.00579 9.00579e+06 3 2
seqNo:興趣資料的序列號
Type: LastDelay表示DelayS和DelayUS表示最后發送的興趣和接收到的資料包之間的延遲
FullDelay表示DelayS和DelayUS代表發送的第一個興趣點和接收到的資料包之間的延遲(即,包括興趣點重傳的時間)
DelayS:延遲值,以秒為單位
DelayUS:延遲值,以微秒為單位(10 ^ -6)
RetxCount:重發興趣的次數(對于LastDelay始終等于1)
HopCount:檢索到的資料包在從生產者應用程式或快取回傳的途中經過的網路躍點數,
請注意,與ndnSIM 1.0相比,HopCount欄位的語意已更改,
剩下的作業就是將結果資料檔案處理后可視化
官方使用的R語言,這里資料處理的方法都可,我習慣用python,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/3817.html
標籤:其他
下一篇:1024程式員節日快樂
