ndnSIM applications

Reference applications

ndnSIM包含一些可用作NDN仿真基礎的參考應用程序。

ConsumerCbr

一個以預定義模式(恒定頻率,恒定平均速率,興趣發(fā)布間隔均勻隨機分布或者指數(shù)隨機分布)產生興趣業(yè)務的應用。

// Create application using the app helper
AppHelper helper("ns3::ndn::ConsumerCbr");

這個應用有以下屬性:

  • 頻率(默認1Hz,1 per second),既是期望的頻率for randomized version也是準確的頻率for contant version
// Set attribute using the app helper
helper.SetAttribute("Frequency", DoubleValue (1.0));
  • Randomize (默認"none")
    明確是否要對興趣包的間隔進行隨機化。有以下幾個變量可以考慮:
    "none": no randomization
    "uniform": uniform distribution in range (0, 1/Frequency)
    "exponential": exponential distribution with mean 1/Frequency
// Set attribute using the app helper
helper.SetAttribute("Randomize", StringValue("uniform"));
ConsumerZipfMandelbrot

請求內容服從Zipf-Mandelbrot分布,繼承自ConsumerCbr

// Create application using the app helper
ndn::AppHelper helper("ns3::ndn::ConsumerZipfMandelbrot");

Frequency and Randomize屬性的設置和ComsumerCbr一致
多了一個屬性:

  • NumberOfContents(默認100)應用所請求的不同內容(序列)的數(shù)量
ConsumerBatches

在指定的模擬點生成指定數(shù)量的興趣的開關式應用程序。

// Create application using the app helper
ndn::AppHelper consumerHelper("ns3::ndn::ConsumerBatches");

有以下屬性:

  • Batches (默認:Empty)
    指定興趣數(shù)據包的確切模式,指定何時以及應該發(fā)送多少興趣數(shù)據包。
    下面的例子定義1s時應該請求一個興趣,2s時請求5個興趣,10S時請求2個興趣。
/ /Set attribute using the app helper
consumerHelper.SetAttribute("Batches", StringValue("1s 1 2s 5 10s 2"));

興趣不會在指定時間一起發(fā)出,而是會根據估計的重傳時間分開發(fā)送:
所以,可能會導致以下的興趣發(fā)送表:

1s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 0
2s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 1
2s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 2
2.2s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 3
2.4s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 4
2.6s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 5
10s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 6
10.2s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 7
ConsumerWindow

一個生成可變速率興趣包發(fā)送的app,實現(xiàn)了一個簡單的基于滑動窗口的興趣生成機制。

// Create application using the app helper
AppHelper consumerHelper("ns3::ndn::ConsumerWindow");

有以下屬性:

  • Window(默認1):在不等待數(shù)據(未完成興趣的數(shù)量)的情況下將被發(fā)送的初始興趣數(shù)量
  • PayloadSize(默認1040):期望的數(shù)據包負載的大小
  • Size(默認-1):
    要請求的數(shù)據量(將在收到大小數(shù)據后停止發(fā)布興趣)如果Size設置為-1,則將要求興趣直到模擬結束。
Producer

replying every incoming Interest with Data packet with a specified size and name same as in Interest.

// Create application using the app helper
AppHelper consumerHelper("ns3::ndn::Producer");
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

  • Spring Cloud為開發(fā)人員提供了快速構建分布式系統(tǒng)中一些常見模式的工具(例如配置管理,服務發(fā)現(xiàn),斷路器,智...
    卡卡羅2017閱讀 136,564評論 19 139
  • 國家電網公司企業(yè)標準(Q/GDW)- 面向對象的用電信息數(shù)據交換協(xié)議 - 報批稿:20170802 前言: 排版 ...
    庭說閱讀 12,417評論 6 13
  • 從三月份找實習到現(xiàn)在,面了一些公司,掛了不少,但最終還是拿到小米、百度、阿里、京東、新浪、CVTE、樂視家的研發(fā)崗...
    時芥藍閱讀 42,802評論 11 349
  • Spring Boot 參考指南 介紹 轉載自:https://www.gitbook.com/book/qbgb...
    毛宇鵬閱讀 47,273評論 6 342
  • 1.漸進理論 把成功歸功于努力用功和使用了正確方法上而不是天生能力,否則遇到失敗時很容易否定自我。 考試拿高分的小...
    K王之姐閱讀 211評論 0 0

友情鏈接更多精彩內容