ndnSIM applications

Reference applications

ndnSIM包含一些可用作NDN仿真基础的参考应用程序。

ConsumerCbr

一个以预定义模式(恒定频率,恒定平均速率,兴趣发布间隔均匀随机分布或者指数随机分布)产生兴趣业务的应用。

// 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)应用所请求的不同内容(序列)的数量
ConsumerBatches

在指定的模拟点生成指定数量的兴趣的开关式应用程序。

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

有以下属性:

  • Batches (默认:Empty)
    指定兴趣数据包的确切模式,指定何时以及应该发送多少兴趣数据包。
    下面的例子定义1s时应该请求一个兴趣,2s时请求5个兴趣,10S时请求2个兴趣。
/ /Set attribute using the app helper
consumerHelper.SetAttribute("Batches", StringValue("1s 1 2s 5 10s 2"));

兴趣不会在指定时间一起发出,而是会根据估计的重传时间分开发送:
所以,可能会导致以下的兴趣发送表:

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

一个生成可变速率兴趣包发送的app,实现了一个简单的基于滑动窗口的兴趣生成机制。

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

有以下属性:

  • Window(默认1):在不等待数据(未完成兴趣的数量)的情况下将被发送的初始兴趣数量
  • PayloadSize(默认1040):期望的数据包负载的大小
  • Size(默认-1):
    要请求的数据量(将在收到大小数据后停止发布兴趣)如果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");
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 136,280评论 19 139
  • 国家电网公司企业标准(Q/GDW)- 面向对象的用电信息数据交换协议 - 报批稿:20170802 前言: 排版 ...
    庭说阅读 14,092评论 6 13
  • 从三月份找实习到现在,面了一些公司,挂了不少,但最终还是拿到小米、百度、阿里、京东、新浪、CVTE、乐视家的研发岗...
    时芥蓝阅读 42,584评论 11 349
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 47,227评论 6 342
  • 1.渐进理论 把成功归功于努力用功和使用了正确方法上而不是天生能力,否则遇到失败时很容易否定自我。 考试拿高分的小...
    K王之姐阅读 1,450评论 0 0

友情链接更多精彩内容