简单了解一下ndnSIM中的APP
2016-12-06 20:57
441 查看
Application helper
Application helper是创建、配置、安装ndnSIM application的入口。基本用法:
创建一个特定类型的app:
// Create helper for the consumer generating Interests with constant rate AppHelper consumerHelper("ns3::ndn::ConsumerCbr");
设置前缀
前缀是interest请求数据的时候用的,返回data的时候也会用到
consumerHelper.SetPrefix(prefix);
设置特定的属性
// Set frequency parameter consumerHelper.SetAttribute("Frequency", StringValue ("10")); // 10 interests a second
安装
NodeContainer nodes; ... consumerHelper.Install(nodes)
各种apps
ConsumerCbr
以预定义的模式来产生Interest包,比如固定频率,指数随机等。// Create application using the app helper AppHelper helper("ns3::ndn::ConsumerCbr");
固定频率
// Set attribute using the app helper helper.SetAttribute("Frequency", DoubleValue (1.0));
随机
参数选项
”none”没有随机化
“uniform” (0, 1/Frequency)范围内的均匀分布
“exponential”平均值为1/Frequency的指数分布
// Set attribute using the app helper helper.SetAttribute("Randomize", StringValue("uniform"));
ConsumerZipfMandelbrot
产生服从Zipf-Mandelbrot分布的interest// Create application using the app helper ndn::AppHelper helper("ns3::ndn::ConsumerZipfMandelbrot");
ConsumerBatches
ConsumerBatches是一种开关风格的应用,它可以在特定的节点产生指定数量的interest。// Create application using the app helper ndn::AppHelper consumerHelper("ns3::ndn::ConsumerBatches");
主要参数
Batches用于指定interest包的模式,默认为空,模式是指,有多少interest包在什么时候被发送。如1个Interest在时间点1秒时,被发送,5个Interest在2秒时被发送,2个Interest在10秒时被发送。
// Set attribute using the app helper consumerHelper.SetAttribute("Batches", StringValue("1s 1 2s 5 10s 2"));
由于Interest包不是瞬发的,ConsumerBatches仅仅是在指定时间开始数据包的发送,有可能出现如下结果:
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
ConsumerWindow是一种产生变化速率Interest包的app。// Create application using the app helper AppHelper consumerHelper("ns3::ndn::ConsumerWindow");
参数:
window 它的值表示Initial number of Interests that will be send out without waiting for the data (number of outstanding Interests)PayloadSize data的payload
Size 默认-1,Amount of data to be requested (will stop issuing Interests after Size data is received) ,If Size is set to -1, Interests will be requested till the end of the simulation.
Producer
// Create application using the app helper AppHelper consumerHelper("ns3::ndn::Producer");
Custom applications
APP通过AppLinkService 与系统的核心进行交互,为了简化NDN中APP的实现, ndnSIM提供了一个基本的App类, 它已经将AppLinkService 创建好并注册到NDN的协议栈中,同时,提供了默认的处理Interest和Data包的方法。研究代码中。。。更多详细待补充
相关文章推荐
- 希望了解可用性和用户体验的简单发展 可以进来了解一下
- 四十五、基础框架(三)简单 了解一下 自动释放池
- 整理一下appintro的简单用法
- C语言_简单了解一下typedef
- 简单了解一下 Segment Tree 和 Fenwick Tree(Binary Indexed Tree)
- 总听见 squid 但一直不了解,从wikipedia简单了解一下
- 简单了解一下JavaScript正则表达式
- java基础讲解01-----简单了解一下java
- 简单的了解一下http请求的vary头部信息
- 从一个简单的WEB项目入手来简单地了解一下什么是Spring之持久层(Dao)
- 简单了解了一下 Java线程池 ThreadPoolExecutor
- 简单的了解一下单片机
- 简单了解一下xml
- strcpy()函数一个简单那程序来了解一下它。。
- 简单了解一下c编译过程
- 简单的了解一下 异或 运算符 ^
- 新人上手TensorFlow 之 简单了解一下Batch Normalization (BN)
- 简单了解一下什么是Django或者说Django是做什么的?
- Spring AOP详解 一.前言 在以前的项目中,很少去关注spring aop的具体实现与理论,只是简单了解了一下什么是aop具体怎么用,看到了一篇博文写得还不错,就转载来学习一下,博
- 创建定时器 和简单的了解了一下APC消息队列 14.4.29