简单了解一下ndnSIM中的APP
来源:互联网 发布:用友软件 编辑:程序博客网 时间:2024/04/29 09:36
Application helper
Application helper是创建、配置、安装ndnSIM application的入口。
基本用法:
- 创建一个特定类型的app:
// Create helper for the consumer generating Interests with constant rateAppHelper consumerHelper("ns3::ndn::ConsumerCbr");
- 设置前缀
前缀是interest请求数据的时候用的,返回data的时候也会用到
consumerHelper.SetPrefix(prefix);
- 设置特定的属性
// Set frequency parameterconsumerHelper.SetAttribute("Frequency", StringValue ("10")); // 10 interests a second
- 安装
NodeContainer nodes;...consumerHelper.Install(nodes)
各种apps
ConsumerCbr
以预定义的模式来产生Interest包,比如固定频率,指数随机等。
// Create application using the app helperAppHelper helper("ns3::ndn::ConsumerCbr");
- 固定频率
// Set attribute using the app helperhelper.SetAttribute("Frequency", DoubleValue (1.0));
- 随机
参数选项- ”none”没有随机化
- “uniform” (0, 1/Frequency)范围内的均匀分布
- “exponential”平均值为1/Frequency的指数分布
// Set attribute using the app helperhelper.SetAttribute("Randomize", StringValue("uniform"));
ConsumerZipfMandelbrot
产生服从Zipf-Mandelbrot分布的interest
// Create application using the app helperndn::AppHelper helper("ns3::ndn::ConsumerZipfMandelbrot");
ConsumerBatches
ConsumerBatches是一种开关风格的应用,它可以在特定的节点产生指定数量的interest。
// Create application using the app helperndn::AppHelper consumerHelper("ns3::ndn::ConsumerBatches");
主要参数
Batches
用于指定interest包的模式,默认为空,模式是指,有多少interest包在什么时候被发送。如1个Interest在时间点1秒时,被发送,5个Interest在2秒时被发送,2个Interest在10秒时被发送。
// Set attribute using the app helperconsumerHelper.SetAttribute("Batches", StringValue("1s 1 2s 5 10s 2"));
由于Interest包不是瞬发的,ConsumerBatches仅仅是在指定时间开始数据包的发送,有可能出现如下结果:
1s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 02s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 12s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 22.2s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 32.4s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 42.6s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 510s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 610.2s 0 ndn.Consumer:SendPacket(): [INFO ] > Interest for 7
ConsumerWindow
ConsumerWindow是一种产生变化速率Interest包的app。
// Create application using the app helperAppHelper 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 helperAppHelper consumerHelper("ns3::ndn::Producer");
Custom applications
APP通过AppLinkService 与系统的核心进行交互,为了简化NDN中APP的实现, ndnSIM提供了一个基本的App类, 它已经将AppLinkService 创建好并注册到NDN的协议栈中,同时,提供了默认的处理Interest和Data包的方法。
研究代码中。。。更多详细待补充
0 0
- 简单了解一下ndnSIM中的APP
- 简单了解一下xml
- 简单了解一下--谓词(NSPredicate)
- 简单的了解一下单片机
- android中的权限,了解一下
- ndnSIM中概率缓存的简单实现
- ndnSIM中LCD的简单实现
- 通过书中的一个小例子来了解一下简单的python基础
- 简单了解一下JavaScript正则表达式
- 了解一下java系统中的OSCache配置
- APP测试、WEB测试简单了解
- 简单介绍一下sap fico入门凭证,有兴趣的可以简单了解一下哦!
- 策略模式 刚刚学习 大家简单了解一下
- 简单了解了一下 Java线程池 ThreadPoolExecutor
- 简单的了解一下 异或 运算符 ^
- C语言学习:简单了解一下ctype.h
- 简单分析一下socket中的bind
- 简单分析一下socket中的bind
- 29. Divide Two Integers(Java)
- css中单位px、pt、em和rem的区别
- JVM学习系列(三)——垃圾收集器与内存分配策略
- EventBus 用法详解
- CodeForces-714C - Sonya and Queries【状压 】
- 简单了解一下ndnSIM中的APP
- Eclispe配置JDK
- php开发规范1
- 用python数据分析和机器学习
- 【MongDB】NoSQL了解,初识MongDB
- 从SetTimer看Windows消息处理机制
- 数据结构实验之排序二:交换排序
- 最大流建图+拆点
- 后台分页控件重复查询数据问题