the ONE simulation机会网络仿真工具教程及帮助
- 格式:pdf
- 大小:1.31 MB
- 文档页数:49
Proteus 仿真软件介绍与使用说明导读:Proteus 软件是常用的EDA 工具软件,用于单片机等数字电路仿真。
Proteus 分为两个版本:ISIS 和ARES,前面的主要用于仿真设计,后面的用户PCB 电路板设计。
Proteus 软件是英国Labcenter electronics 公司出版的EDA 工具软件。
常用于单片机等数字电路仿真,分为ISIS 和ARES 两个程序,前者用于仿真,后者用于设计PCB。
我们常使用ISIS 仿真软件,其界面如下图。
打开Proteus ISIS,会默认新建一个空白文档,我们也可以通过菜单File-New Design-Default 来新建。
点击按钮P(见下图方框处),我们可以打开元件库,添加需要的元件。
在搜索框中输入89C52,就能找到AT89C52 单片机(由于没有STC单片机,我们使用完全兼容的AT 系列单片机代替即可)。
选择需要的器件,点击OK 按钮即可将其添加到DEVICES 一栏。
在DEVICES 栏中选定需要的器件型号,然后在屏幕中间的空白区域点击,就可以添加元件到我们的电路设计图中。
然后用鼠标单击连接导线,单片机最小系统的电路图就能画出来了。
电路画完之后,双击单片机,弹出如下窗口,在Program File 中,我们选择我们编译完成的HEX 程序文件(后面将会介绍HEX 文件),就可以运行程序了。
另外,Proteus 在实际使用中,单片机即使不连接最小系统,即省略电源、晶振、复位电路,仍然能正常工作。
细心的读者可能已经发现,下图中Program File 的下一栏是Clock Frequency,即时钟频率,实际上在这里单片机的时钟正是由这个参数设定的,而和电路中连接的晶振并没有关系。
电路连接好并设置好相关参数后,我们可以运行按钮来仿真电路,运行的时候,程序就会模拟真实电路运作的情况。
我们可以看到LED 的亮灭、数码管和LCD 显示字符、电机的转动,听到蜂鸣器的响声等;还可以使用示波器、电压表电流表、逻辑分析仪等虚拟仪器来协助我们进行电路和程序的设计;调试程序的时候,利用Proteus 进行分析,非常方便。
•华为eNSP模拟器是一款由华为公司提供的仿真软件。
通过模拟器的使用,一方面可以熟悉产品特性,强化技能训练;另一方面模拟实际项目环境,测试方案设计,可以为后期工程项目的顺利实施做好准备。
•本次任务介绍eNSP模拟器的功能及使用方法。
ØeNSP 模拟器安装部署ØeNSP 功能介绍ØeNSP 基本操作(1)eNSP模拟器介绍ØeNSP(Enterprise Network Simulation Platform)是一款由华为公司提供的免费的、可扩展的、图形化的网络设备仿真平台,主要对企业网络的路由器、交换机、WLAN、防火墙等设备进行软件仿真,可以完美呈现真实设备部署场景,有效地开展实验练习。
ØeNSP模拟器主要功能特色如下:•图形化操作•高仿真度•可与真实设备对接•支持分布式部署(2)eNSP及依赖软件ØeNSP软件版本:eNSP-V100R003C00SPC100ØeNSP模拟器的正常使用除安装eNSP软件外,还需依赖WinPcap、Wireshark和VirtualBox 这三款软件:软件名称版本要求本课程使用版本WinPcap 4.1.3WinPcap-4.1.3Wireshark 2.6.6(或以上)Wireshark-win64-3.0.0VirtualBox 4.2.X-5.2.X VirtualBox-5.2.22(3)软件安装Ø环境要求•硬件:4核CPU,主频 3.2GHz,内存≥8GB,硬盘≥100GB•操作系统:Windows平台Ø安装顺序•建议安装eNSP前先安装好依赖软件,否则将会影响部分功能的使用。
(1)引导界面Ø说明:①快捷按钮:提供“新建”和“打开”拓扑的操作入口②样例:提供常用的拓扑案例③最近打开:显示最近已浏览的拓扑文件④学习:提供学习eNSP操作方法的入口(2)主界面Ø说明:①主菜单:提供文件、编辑、视图、工具、考试和帮助等菜单。
网络仿真软件OPNET介绍与实例网络仿真技术是一种通过建立网络设备和网络链路的统计模型, 并模拟网络流量的传输, 从而获取网络设计或优化所需要的网络性能数据的仿真技术。
由于仿真不是基于数学计算, 而是基于统计模型,因此,统计复用的随机性被精确地再现。
strong网络仿真技术具有以下特点:一, 全新的模拟实验机理使其具有在高度复杂的网络环境下得到高可信度结果的特点。
二, 网络仿真的预测功能是其他任何方法都无法比拟的;三,使用范围广, 既可以用于现有网络的优化和扩容,也可以用于新网络的设计,而且特别适用于中大型网络的设计和优化;四,初期应用成本不高, 而且建好的网络模型可以延续使用, 后期投资还会不断下降。
OPNET介绍OPNET产品主要面向专业人士,帮助客户进行网络结构、设备和应用的设计、建设、分析和管理。
OPNET的产品主要针对三类客户,分成四个系列。
三类客户是指:网络服务提供商;网络设备制造商和一般企业。
四个系列产品核心包括:1.ServiceProviderGuru:面向网络服务提供商的智能化网络管理软件。
是OPNET公司的最新产品。
2.OPNET Modeler:为技术人员(工程师)提供一个网络技术和产品开发平台。
可以帮助他们设计和分析网络、网络设备和通信协议。
3.ITGuru:帮助网络专业人士预测和分析网络和网络应用的性能,诊断问题,查找影响系统性能的瓶颈,提出并验证解决方案。
4.WDM Guru,用于波分复用光纤网络的分析、评测。
OPNET Technology公司的仿真软件OPNET具有下面的突出特点,使其能够满足大型复杂网络的仿真需要:1. 提供三层建模机制,最底层为Process模型,以状态机来描述协议;其次为Node模型,由相应的协议模型构成,反映设备特性;最上层为网络模型。
三层模型和实际的网络、设备、协议层次完全对应,全面反映了网络的相关特性;2. 提供了一个比较齐全的的基本模型库,包括:路由器、交换机、服务器、客户机、ATM设备、DSL设备、ISDN设备等等;3. 采用离散事件驱动的模拟机理(discrete event driven),与时间驱动相比,计算效率得到很大提高。
PROTEUS仿真教程本教程将介绍如何使用PROTEUS进行电子电路仿真。
2.打开PROTEUS并创建新项目运行PROTEUS软件后,单击“New Project”按钮创建一个新项目。
选择一个适当的文件夹路径,并为新项目命名。
3.添加电路原理图4.绘制电路原理图5.设置元件参数对于一些元件,您需要设置其参数,例如电源电压、电阻值等。
单击元件并在属性框中输入所需的参数。
6.添加信号发生器为了模拟电路中的信号输入,您可以添加信号发生器。
单击工具栏上的“Virtual Instrument”按钮,并选择“Signal Generator”。
将信号发生器拖放到原理图中,并通过连接线将其连至所需元件。
7.运行仿真绘制完电路原理图后,点击PROTEUS菜单中的“Run”选项卡,然后选择“Start Simulation”来运行仿真。
PROTEUS将模拟电路运行,并生成仿真结果。
8.查看仿真结果在仿真运行完成后,可以查看电路的性能参数和波形图。
单击工具栏上的“Digital Oscilloscope”按钮,并将其拖放到原理图中。
在仿真运行期间,您可以选择不同的信号波形进行查看。
9.保存和导出仿真结果在查看和分析仿真结果后,您可以将其保存到计算机中。
单击“File”菜单中的“Save As”选项,并选择所需的文件格式。
10.布局和打印电路原理图总结:PROTEUS是一款功能强大的电子电路仿真软件,可以帮助工程师快速设计和验证电路原理图。
以上简要介绍了使用PROTEUS进行电子电路仿真的基本步骤,包括创建新项目、绘制电路原理图、设置元件参数、添加信号发生器、运行仿真、查看仿真结果、保存和导出仿真结果以及布局和打印电路原理图。
希望这个教程对您有所帮助。
《LTE实训》课程实训指导书2020年10月19日目录一、总体要求二、实训项目实训一:网络拓扑规划实训二:无线接入网容量规划实训三:核心网容量规划实训四:无线侧设备配置实训五:BBU数据配置实训六:无线射频数据配置实训七:核心网设备配置实训八:MME数据配置实训九:SGW数据配置实训十:PGW数据配置实训十一:HSS数据配置实训十二:实验室模式联调一、总体要求1、课程实训目的1) 具备在单、双平面完成LTE网络拓扑连线的能力;2) 具备完成大型城市无线接入网的容量覆盖估算的能力(以运营商万绿市为具体例)3) 具备完成大型城市核心网MME、SGW、PGW这类核心网元容量规划的能力;4) 具备配置大型城市无线侧机房的设备的能力;5) 具备配置大型城市无线无线接入网的BBU数据配置的能力;6) 具备完成大型城市无线接入网的无线射频、小区和邻区数据配置的能力;7) 具备完成大型城市核心网机房的设备配置的能力;8) 具备完成大型城市核心网的MME数据配置的能力;9) 具备完成大型城市核心网的SGW数据配置的能力;10)具备完成大型城市核心网的PGW数据配置的能力;11)具备完成大型城市核心网的HSS数据配置的能力;12)具备完成LTE网络故障排除,实现在实验室环境下拨测成功以及切换成功的能力;13)具备撰写实验、实训报告的能力。
2、课程实训项目统计与学时分配3、课程实训资源1)配套教材:《IUV-4G移动通信技术》实训指导书,作者陈佳莹张溪林磊2)实训场地及条件:实训设备或平台:中兴IUV-4G 仿真平台4、课程考核方法参考实训课程教学大纲编写。
二、实训项目实训一:网络拓扑规划1、实训目的与要求1)掌握LTE核心网的各个主要网元;2)具备在单、双平面完成LTE网络拓扑连线的能力;3)理解配置双平面的作用;4)网络的拓扑结构与网络连线、站点数量和物理位置变化的关系2、实训内容1)单平面网络拓扑连线;2)双平面网络拓扑连线;3、实训准备(1)实训环境准备硬件:(含耗材)能够运行IUV-4G网络平台的台式机软件:中兴IUV-4G 仿真平台资料:4G LTE全网竞技系统操作视频教程(2)相关知识要点1.LTE核心网各个网元:MME、SGW、PGW、HSS与交换机;2.LTE网络拓扑结构。
Proteus仿真软件使用方法第二部分 Proteus ISIS快速入门一、简介Proteus软件是一款强大的单片机仿真软件,对于单片机学习和开发帮助极大。
Proteus ISIS是英国Labcenter公司开发的电路分析与实物仿真软件。
它运行于Windows操作系统上,可以仿真、分析(SPICE)各种模拟器件和数字集成电路,包括单片机。
在国内由广州的风标电子技术有限公司代理。
在单片机课程中我们主要利用它实现下列功能:1、绘制硬件原理图,并设置元件参数。
2、仿真单片机及其程序以及外部接口电路,验证设计的可行性与合理性,为实际的硬件实验做好准备。
3、如有必要可以利用它来设计电路板。
总之,该软件是一款集单片机和SPICE分析于一身的仿真软件,可以实现从构想到实际项目完成全部功能。
这里介绍Proteus ISIS软件的工作环境和一些基本操作,实现初学者入门。
至于更加详细的使用,请参考软件的帮助文件和其他有关书籍,还可以到网上找到许多参考资料。
二、界面介绍双击桌面上的ISIS 7 Professional图标或者单击屏幕左下方的“开始”?“程序”?“Proteus 7 Professional” ?“ISIS 7 Professional”,出现如图2-1所示屏幕,表明进入Proteus ISIS集成环境。
图2-1 Proteus ISIS集成环境进入之后的界面类似如图2- 2 所示。
图中已经标注各个部分的作用,我们现在就使用软件提供的功能进行工作。
图2-2 ISIS主窗口三、一个小项目的设计过程1、建立新项目启动软件之后,首先,新建一个项目:点击菜单:File?New Design,如图2-3所示,即可出现如图2-4所示的对话框,以选择设计模板。
一般选择A4图纸即可,点击OK,关闭对话框,完成设计图纸的模板选择,出现一个空白的设计空间。
图2-3 新设计图2-4 选模板这时设计名称为 UNTITLED (未命名),你可以点击菜单 file?save design 来给设计命名。
实验3:Opnet网络仿真软件的使用1实验题目Opnet网络仿真软件的使用2实验目的和要求1)采用Opnet构建网络拓扑2)采用Opnet分析网络的性能3实验设备及材料操作系统:Windows 2003/XP主机网络模拟器:OPNET4实验内容4.1 OPNET概述1) 软件版本:OPNET 14.02) OPNET介绍i) OPNET历史和现状OPNET公司起源于MIT(麻省理工学院),成立于1986年。
1987年OPNET 公司发布了其第一个商业化的网络性能仿真软件,提供了具有重要意义的网络性能优化工具,使得具有预测性的网络性能管理和仿真成为可能。
对于网络的设计和管理,一般分为3个阶段:第1阶段为设计阶段:包括网络拓扑结构的设计,协议的设计和配置以及网络中设备的设计和选择;第2阶段为发布阶段:设计出的网络能够具有一定性能,如吞吐率、响应时间等等;第3阶段为实际运营中的故障诊断、排错和升级优化。
OPNET公司的整个产品线正好能面向网络研发的不同阶段,即可以作网络的设计,也可以作为发布网络性能的依据,还可以作为已投入运营的网络的优化和故障诊断工具。
OPNET公司也是当前业界智能化网络管理分析解决方案的主要提供商。
ii) OPNET Modeler介绍Modeler主要面向研发,其宗旨是为了“Accelerating Network R&D(加速网络研发)。
Modeler的主要特征:●层次化的网络模型。
使用无限嵌套的子网来建立复杂的网络拓扑结构。
●简单明了的建模方法。
Modeler建模过程分为3个层次:进程(process)层次、节点(Node)层次以及网络(Network)层次。
在进程层次模拟单个对象的行为,在节点层次中将其互连成设备,在网络层次中将这些设备互连组成网络。
几个不同的网络场景组成“项目”,用以比较不同的设计方案。
这也是Modeler建模的重要机制,这种机制有利于项目的管理和分工。
使用XX软件进行模拟和仿真的步骤与技巧第一章:引言近年来,计算机仿真和模拟已经成为了许多领域的重要工具。
XX软件作为一种强大的模拟和仿真工具,被广泛应用于工程、科学、医学等领域。
本文将介绍使用XX软件进行模拟和仿真的步骤与技巧。
第二章:软件使用前准备在使用XX软件进行模拟和仿真之前,首先要进行软件的安装和配置。
一般来说,XX软件提供了完善的安装指南和用户手册。
在按照指南进行安装后,还需要根据具体的模拟和仿真需求进行软件的设置和参数调整。
第三章:模型建立和导入模拟和仿真的基础是建立一个准确的模型。
在XX软件中,可以通过绘制、导入等多种方式来建立模型。
如果需要对一个现有的物体或系统进行仿真,可以通过导入已经存在的数据或者图像文件来快速建立模型。
第四章:材料参数定义材料参数的定义对于模拟和仿真结果的准确性至关重要。
在XX软件中,可以为每一种材料定义其特定的物理属性和参数。
例如,对于一个弹性材料模型,可以定义它的弹性模量、泊松比等参数,以确保仿真结果准确可靠。
第五章:加载和约束条件设置在模拟和仿真中,模型需要受到外部的加载和约束条件。
在XX软件中,可以通过指定施加在模型上的力、压力、温度等物理量来模拟实际工作条件。
同时,还需要给定模型的约束条件,例如固定边界、悬臂支撑等。
第六章:仿真参数设置XX软件提供了丰富的仿真参数供用户调整和设置。
这些参数可以包括时间步长、收敛准则、网格密度等。
根据具体的仿真需求,可以进行适当的参数设置以提高仿真的效果和准确性。
第七章:运行仿真在所有参数设置完成后,即可启动XX软件进行仿真。
XX软件通常提供了多种运行模式,例如快速仿真模式、高精度仿真模式等。
根据具体的需求,选择合适的运行模式以确保仿真结果的准确性和效率。
第八章:结果分析与优化仿真完成后,需要对仿真结果进行分析和优化。
XX软件提供了丰富的结果可视化和分析工具,可以对模型的位移、应变、温度等参数进行可视化和对比分析。
如果结果不符合实际需求,可以根据分析结果进行模型的调整和优化。
网络仿真器NS-2之使用手册(草稿)目录安装手册....................................................................................01~091.使用需求 (01)2.在Windows Me/2000安装方式 (01)3.补充 (08)4.参考网址 (09)使用手册.....................................................................................10~18附录一、Output File Format...............................................................19~251.NAM各字段格式及范例.. (19)2.NEW TRACE FILE格式 (23)附录二、TCL语法整理…………………………………………………………26~33§安装手册§一、使用需求:‧计算机外设设备:⏹CPU:600MHz以上。
⏹内存:256M以上。
⏹硬盘容量:40GB以上。
‧宽带网络:NS2各组件需要快速的联机网络下载,各组件的档案总共数百Mega Bytes。
‧Visual C++ 6.0。
二、在WINDOW ME/2000的安装方式:1.在DOS环境下c:\program\Microsoft studio\VC98\bin执行vcvars32.bat的批次档,藉以设定Visual C++的路径以及环境变量;并且可以手动编辑autoexec.bat中路径或环境变量。
以下为一Autoexec.bat的范例,仅供参考,并不硬性规定需如此设定:@echo offvcvars32.batset PATH=%PATH%;c:\netsim\tclset PATH=%PATH%;c:\netsim\tkset PATH=%PATH%;c:\netsim\otclset PATH=%PATH%;c:\netsim\tclclset PATH=%PATH%;c:\netsim\ns2set PATH=%PATH%;c:\progra~1\tcl@echo on2.新增一个NetSim的资料夹在C:\里面。
网络模拟器的原理和应用1. 网络模拟器的定义网络模拟器是一种软件工具,用于创建和模拟各种网络环境,以便测试和验证网络应用程序、协议和设备的性能和可靠性。
通过模拟不同的网络参数和条件,网络模拟器可以帮助开发人员预测和识别网络中可能出现的问题,并优化网络性能。
2. 网络模拟器的原理网络模拟器的原理是通过模拟不同的网络条件和参数,包括带宽、延迟、丢包率、网络拓扑等,来创建一个真实网络环境的虚拟副本。
通过在虚拟网络环境中运行测试和实验,开发人员可以评估网络应用程序和设备在不同网络条件下的性能和可靠性。
网络模拟器通常基于软件定义网络(SDN)和虚拟化技术实现。
3. 网络模拟器的应用网络模拟器在各种场景下都有广泛的应用,以下列举了几个常见的应用场景:• 3.1 网络应用程序测试网络模拟器可以模拟各种网络条件,如高延迟、低带宽和不稳定的网络连接,以测试和评估网络应用程序的性能和稳定性。
开发人员可以通过模拟真实网络环境中的不同情况,例如网络拥塞、丢包和延迟,来评估应用程序在面对这些条件时的表现。
• 3.2 网络协议开发和测试网络模拟器可以用于开发和测试各种网络协议,如TCP/IP、UDP和HTTP等。
通过模拟各种网络条件和参数,开发人员可以评估协议的性能、可靠性和稳定性。
网络模拟器还可以帮助开发人员在复杂的网络环境中调试和验证协议的正确性。
• 3.3 网络设备性能评估网络模拟器可以帮助评估各种网络设备的性能和可靠性,如路由器、交换机和防火墙等。
通过模拟真实网络环境中的各种情况,开发人员可以评估设备在不同网络条件下的性能表现,并优化设备的配置和参数。
• 3.4 网络安全演练网络模拟器可以模拟各种网络攻击和恶意行为,如DDoS攻击、入侵和蠕虫传播等。
通过模拟真实的攻击场景,网络模拟器可以帮助安全人员评估系统的脆弱性和安全性,并提供相应的防护措施和建议。
• 3.5 网络故障诊断和排除网络模拟器可以帮助诊断和排除网络故障,如网络拥塞、丢包和延迟等。
QQ Group: 337113456 Opportunistic Network Environment simulatorAri Ker¨a nenari.keranen@tkk.fiHelsinki University of TechnologyDepartment of Communications and NetworkingSpecial assignmentSupervisor:Professor J¨o rg OttMay29,2008Contents1Introduction12Background33The Opportunistic Network Environment simulator63.1Mobility modeling (7)3.2Routing simulation (9)3.3External event and reporting frameworks (11)3.4Running simulations (12)3.4.1Graphical User Interface mode (12)3.4.2Batch mode (14)3.4.3Post-processing (15)3.4.4Configuring scenarios (16)3.5Software architecture (17)3.5.1Movement models (18)3.5.2Routing modules (19)3.5.3Extending the simulator (21)3.6Limitations (23)3.7Results (24)4Conclusions25 A The ONE ReadMe IIAcronymsAPI Application Programming InterfaceASCII American Standard Code for Information Interchange DTN Delay Tolerant NetworkingGIS Geographic Information SystemGPL GNU General Public LicenseGPS Global Positioning SystemGUI Graphical User InterfaceMAC Media Access ControlMANET Mobile Ad-hoc NETworkONE Opportunistic Network Environment simulatorPOI Point Of InterestRAM Random Access MemoryRWP Random WayPointTTL Time To LiveWKT Well Known TextWLAN Wireless Local Area NetworkIIChapter1IntroductionToday many personal mobile devices include capabilities to communicate with infrastructure networks but also with each other.The latter can be used to form ad-hoc networks where common infrastructure is no longer needed for communication among hosts participating in the network.Ad-hoc networks can also help mobile nodes to reach infrastructure if some node in the network is able and willing to act as a gateway and possibly other nodes as relays for the traffiworks can be formed this way as long as the node density is large enough so that there exists possible end-to-end paths between all nodes wanting to communicate.However,if the node density decreases or the connectivity breaks for some other reason(e.g.,the radios are switched offoccasionally),traditional network communication protocols are no longer able to provide means for multi-hop communication.Delay Tolerant Networking(DTN)[10,4]is a communication networking paradigm that enables communication in environments where there may be no end-to-end paths,communication opportunities come and go and their interval can be very long and not even known beforehand.Routing messages in this kind of environments can be quite different compared to traditional networks.This has created a need tofind new routing protocols that take efficiently into account the distinct nature of these networks.Different ap-proaches can be tested and evaluated by simulation,but the simulation results are really useful only if they are a result of somewhat credible simu-lation scenarios.1The goal of this study is to add more realism to the simulations of Delay Tolerant Networks.For this purpose we created a new simulation environ-ment called Opportunistic Network Environment simulator(ONE).Unlike other DTN simulators,which usually focus only on routing simulation,the ONE combines mobility modeling,DTN routing and visualization in one package that is easily extensible and provides a rich set of reporting and analyzing modules.2Chapter2BackgroundOne hindrance for research on DTNs is the lack of good simulators.Many simulators exist for MANETs(e.g.,ns2[19]and OMNeT++[27])and also for DTN routing(e.g.,dtnsim[13]and dtnsim2[20])but the former lack good DTN support and the latter concentrate solely on routing simulation. The DTN routing simulators have also seen little evolution since theirfirst public release and implementations of recent routing protocols don’t exist or are not publicly available.Another problem for a simulator that considers only routing is that it needs input data that tells the routing protocols when a network link be-tween two DTN nodes is up and when it is down.This data can be gen-erated based on some random process(e.g.,just drawing contact durations and endpoints from a pseudo random number generator),it can be derived from real-world trace(e.g.,using CRAWDAD[5]data)or it can be derived from mobility simulation.The problem with thefirst approach is that val-ues from some random distribution are hard to prove to have some validity behind them.For example,even if human interactions may seem some-what random,humans usually do have some purpose for their actions and for meeting certain people and visiting some places more often than others. Capturing this in a simple,or even complex,random number distribution would be challenging,to say the least.The real-world traces obviously capture real human behavior well but they have other kinds of problems.The number of usable traces has been3low even though the CRAWDAD project is bringing some relief into this. Unfortunately,the existing traces have low spatial and temporal granularity. To save battery life of the mobile devices that are used to track people,the interval the devices scan for others has been kept low[7].This results in missing possible contacts but also in that we don’t know how long the actual contacts lasted—we just know how many scanning intervals they were in contact with each other.This information can be of course used for many simulations,but if we are interested in utilizing even the shortest contacts, or want to experiment with different scanning intervals,these traces are not that useful anymore.If we had traces of the nodes’exact locations, we could derive contact times from that information by setting a simulated link between two nodes up when they are within certain distance(the radio range of the simulated device)of each other.Some of the wireless traces that are available support this to some extent because they have logs of the people who have been within the radius of some WLAN base stations whose location is known.From that information the nodes’approximate location can be estimated but the spatial granularity is not high enough for simulating devices with small or moderate radio range(e.g.,Bluetooth with10meter radius).Yet another problem with the gathered traces is that the population in them isfixed and often highly specialized.One cannot increase the number of people that participated in the trace after the trace is gathered and the number is often quite low because of practical reasons. Also,so far the traces consist of more or less selected group of people(e.g., people participating in a conference or working in a research laboratory) and their behavior is not likely to be representative of some other group of people in other kind of situation.For these reasons,the real-world traces do not provide comprehensive solution for the connectivity data problem.A third approach is to simulate the movement of the nodes and derive contact information from that.With this approach the temporal and spatial granularity can be set as high as what is needed for good simulation.Also, the number of nodes and their behavior is easily varied for different scenarios and sensitivity analysis.Even with simple mobility model the connectivity pattern is easily more realistic than with some random distribution.Then again,finding a good and somewhat realistic mobility model is a harder task.4One of the simplest ones that is commonly used is the Random Waypoint (RWP)[14].In RWP random coordinates in the simulation area are given to the node.Node moves directly to the given destination at constant speed, pauses for a while,and then gets a new,random,destination.This continues throughout the simulations and nodes using RWP move along these zig-zag paths.This creates simple,but quite artificial movement:hardly ever hu-mans can move unconstrained using direct paths or select their destinations randomly in a square area.Even if we had a good algorithm for a movement model,it would be hard to program and validate it without seeing how the nodes move if the model is used.The same goes for DTN routing simulation:even though the simulation progress can usually be followed from text output to the terminal console,it requires a considerable amount of expertise to be able to see and understand what is happening there.For this purpose a Graphical User Interface(GUI)is an efficient tool.For ns-2simulations,the iNSpect[16] addresses the visualization problem,but for the DTN routing simulators there have not been similar tools available.For these reasons,there appears to be a need for a simulator that has rea-sonable mobility modeling capabilities,integrated support for DTN routing, and ways for visualizing the simulation progress and results in an intuitive way.The next chapter presents our response to this need:the Opportunistic Network Environment simulator.5QQ Group: 337113456Chapter3The Opportunistic Network Environment simulatorTo make complex DTN simulations more feasible and understandable,wecreated a new simulation environment that combines movement modeling,routing simulation,visualization and reporting in one program.Movementmodeling can be done either on-demand using the integrated movementmodels or movement data can be imported from an external source.Thenode position data that the movement models provide is then used for deter-mining if two nodes can communicate and exchange messages.This infor-mation can be exported for routing simulation in external simulators(suchas dtnsim)or it can be given to the internal routing modules which im-plement several different DTN routing algorithms.The internal routingmodules perform operations on the messages on their own,but they canalso be commanded using event generator modules or external traces.Themovement modeling and routing simulation is interactively observable inthe simulator’s GUI and report modules can gather data of the simulationfor further analysis or interaction with other programs.An overview of thewhole process is depicted infigure3.1.The core of the ONE is an agent-based discrete event simulator.To makeit suitable and efficient enough for simultaneous movement and routing sim-ulation,it uses time slicing approach[2],so the simulation time is advancedinfixed time steps.The time slicing can be complemented by scheduling6QQ Group: 337113456update requests between thefixed time steps for higher simulation timeresolution.The simulations can contain any number of different types of agents,i.e.,wireless nodes.The nodes are grouped in node groups and a one groupshares a set of common parameters such as message buffer size,radio rangeand mobility model.Since different groups can have different configurations,creating e.g.,a simulation with pedestrians,cars and public transportationis possible.All movement models,report modules,routing algorithms andevent generators are dynamically loaded into the simulator so extendingand configuring the simulator with different type of plugins is made easy forusers and developers:just creating a new class and defining its name in theconfigurationfile is usually enough.3.1Mobility modelingMobility models dictate how the nodes move during the simulation.Threedifferent types of mobility models were initially implemented for ONE.Forreference purposes,even despite of its shortcomings,ONE includes the basicRandom Waypoint movement model.For more realistic mobility scenarios7QQ Group: 337113456ONE provides variety of map-based movement models which constrain thenode movement to predetermined paths.Finally,ONE also supports im-porting of mobility data from external sources.Map-based movement models accept map data that is described using asubset of the Well Known Text(WKT)format.WKT is an ASCII basedformat that is commonly used in Geographic Information System(GIS)programs.Since basically all the digital map data is available in some formatthat GIS programs understand,they are usually relatively easily convertableto the form supported by the ONE.Also,GIS programs can be used aspowerful map editors for the ONE.The free,Java-based,open source GISprogram OpenJUMP[21]was used for editing and converting the maps inour experiments.In map-based models,the nodes move using only the roadsand walkways of the map area.Different node groups can be configured touse only certain parts of the maps which can prevent,e.g.,cars driving onpedestrian paths or inside buildings(if paths in buildings are also defined).The simplest Map-Based Model,MBM,places nodes randomly in themap area and moves them forward on the path segments until they hit theend of the road and turn back or end up in an intersection.In intersec-tions,nodes using MBM select randomly a new direction but do not headback where they came from.When a node has traveled a configurable dis-tance,it stops for a(configurable)while,and then continues its journey.The more advanced version of MBM,Shortest Path Map-Based movementModel,SPMBM,also initially places the nodes in random places but selectsa certain destination in the map for all nodes and uses Dijkstra’s shortestpath algorithm[6]tofind the shortest path to the destination.When thedestination is reached,the node waits for a while and selects a new desti-nation.Normally all the places in the map have equal probability of beingchosen as the next destination,but the map data can also contain Pointsof Interest(POIs).POIs are grouped in POI groups and every node groupcan have configurable probability for choosing a POI in certain group asthe next destination.POIs are useful for modeling e.g.,restaurants,touristattractions and other places where people tend to gather.Some nodes canalso have predetermined routes that they travel on the map.This kind ofRoute-Based Models,RBMs,are good for simulating e.g.,bus and tram8QQ Group: 337113456routes.Routes consist of map points that model the stops on the route andnodes wait on every stop for some time before continuing,using the shortestpath,to the next stop.Both POIs and routes can be defined using the sameGIS programs that are used for converting the map data.The external mobility model takes a set of timestamped coordinates asthe input and moves the simulated nodes accordingly.This model can beused e.g.,with GPS traces of real users or synthetic mobility traces generatedby other programs.One program that is suitable for creating synthetictraces is the Transportation Analysis and Simulation System(TRANSIMS)[18].TRANSIMS contains an agent-based microsimulator that takes intoaccount activities of individuals and their interactions when they move insimulated metropolitan area and use different transportation options.Theagent movement data can be exported from TRANSIMS and imported intoONE’s external mobility model and used for DTN simulations.3.2Routing simulationWhile the mobility models decide where the nodes should move next,therouting modules get to decide where the messages,or bundles,end up.TheONE has six implementations of different well known routing algorithms andalso a passive routing module that can be used for interaction with externalDTN routing simulators.The active routing modules included in the ONE are:First Contact[13],Direct Delivery[24],Spray and Wait[25](normal and binary),Epidemic[26],PRoPHET[17]and MaxProp[3].When two(or more)nodes meetand there is a chance to exchange messages,all of the routing modulesfirstcheck if they have any messages that are destined for the other node andtry to send them.If the message was already earlier received by the node,itdeclines receiving it and other messages can be tried.After all,if any,suchmessages are exchanged,the behavior with rest of the messages depends onthe routing algorithm.The most simple routing modules are the Direct Delivery,Epidemic andFirst Contact.The Direct Delivery module does not start any further trans-actions after exchanging the deliverable messages since it will send messages9QQ Group: 337113456only if it is in contact with thefinal recipient.This saves buffer space andbandwidth but is not obviously an optimal approach in many cases if a highmessage delivery probability is the goal.The Epidemic routing module usesquite different approach since after two nodes have exchanged the deliv-erable messages,it tries to exchange also all the other messages until bothnodes have the same set of messages or the connection breaks.If we had un-limited buffer space and bandwidth,this would result in maximal spreadingof the messages throughout the nodes and therefore also to maximal deliv-ery probabilities.However,if the buffer space and/or bandwidth is limited,Epidemic routing is also likely to waste a lot of resources.For example,amessage that was delivered shortly after it was created could be transmittedand stored by all the nodes for a long time even if there is no longer use forit.This way the message is using resources that could be better used for themessages that are not yet delivered.While also the First Contact modulesends as many messages to the other node as it has time,it removes thelocal copy of the message after a successful transfer.This results in only asingle copy of every message in the network.To prevent two nodes who stayin contact for a long time exchanging the same messages back and forth,thereceiving node accepts a message only if the message has not passed throughit before.Unfortunately,there are no guarantees that thefirst node that ismet is a better candidate than the previous node carrying the message,soFirst Contact is not likely to achieve very high delivery probabilities either.The Spray and Wait works a bit like the Epidemic but is a bit morecomplex routing module since it restricts the amount of copies that arespread in the network.This is done by letting each created message toreplicate only a certain amount of times.A node that has more than onecopy of the message left,can give either a one copy to another node(thenormal mode)or half of the copies(the binary mode).If the node has onlya single copy of the message left,it is transmitted only to thefinal recipient.By using a different amount of initial copies,Spray and Wait can balancebetween high diffusion of messages and excess use of resources.PRoPHETand MaxProp take the complexity a bit further since they keep track ofwhich node has been in contact with which nodes.This information can beused to reason if a certain node is a good candidate for delivering a message10QQ Group: 337113456to another node by assuming that if two nodes have met before,they aremore likely to meet(soon)again.While PRoPHET checks if another node ismore likely to meet thefinal recipient,MaxProp takes this idea further anduses Dijkstra’s algorithm to calculate whole paths from node to node usingthe meeting probabilities.MaxProp also uses acknowledgments of deliveredmessages that helpflushing redundant messages from the network.The passive routing module can be used as an interface to other DTNrouting simulators.If a DTN routing simulator can output timestampedinformation about message related events(creating,relaying and removing messages),this data can be input to ONE for analysis and visualization.Forexample,dtnsim2’s debug trace can be converted to suitable form for theONE.If the contact schedule for dtnsim2’s input is created using the ONE,the message routing and mobility modeling can be visualized and inspectedin the GUI in similar way as if the routing was done by the ONE.3.3External event and reporting frameworksWhile the routing modules could spawn new messages whenever needed,it is often more convenient to have a routing module independent way ofcreating them.Also,for interaction with other programs,there needs to bea way to import message and connectivity related events to the simulation.The external events framework is the solution for this.There are two different ways to import events to the ONE:tracefilesand event generator modules.A tracefile is a simple textfile that has timestamped events such as creating a message,removing a message fromthe message buffer or setting up a new connection.The tracefiles can also besaved and loaded in binary mode to save time from parsing textfiles.Eventgenerator modules are normal Java classes that can dynamically create thesame events as the tracefiles.While the event traces are usually generatedwith a script or converted from some other program’s output,the eventmodules can be configured using the same settings system as the rest of thesimulator.The ONE supports multiple simultaneous event generators andtheir events are automatically interleaved in the simulation.While the external events provide input for the simulation,the most11important output is generated by the report modules.Report modules can register to connection,message,and/or movement related events.Whenever such an event happens in the simulation,the related method is called for all registered report modules and a reference to the relevant objects(e.g., nodes and messages)is given to the report module.The report modules usually either write information about the event to a report outputfile if it was relevant or just store the information to an internal data structure for creating a summary when the simulation is done.The ONE has already numerous reporting modules,for example,for message statistics(such as delivery probability and round-trip times),node contact and inter-contact times and message delivery delays and distances. Other interesting report modules are the ones used for communication with other programs.The node connectivity information can be directly reported in a suitable form for dtnsim2simulations so the ONE can be used as a mobility simulator for it.Also,another report module is able to output mobility traces suitable for ns2’s Monarch[23]mobile node extension.3.4Running simulationsThe ONE can be run in two different modes:batch and GUI.The GUI mode is especially useful for testing,debugging and demonstration purposes and the batch mode can be used for running large amount of simulations with different set of parameters.Both modes can include any number of report modules which produce statistics of the simulation.These statistics can be further analyzed with post-processing tools to create different kind of summaries,graphs and plots.3.4.1Graphical User Interface modeIn the GUI mode the simulation is visualized in real time as shown in the figure3.2.The largest part of the GUI is taken by the playfield view which contains a bird’s-eye view of the geographical simulation area.Node locations,their radio range,current paths,amount of messages etc.are visualized on the playfield view.If the current movement model is map-based,also the map path segments are drawn in the view.Additionally,a12background image,such as an aerial photograph or a raster map,can be displayed under the other graphics.The playfield view can be centered by clicking with a mouse button and zoomed with the mouse wheel.The simulation speed can be adjusted with the controls in the upper part of the GUI and any node can be selected for inspection with the node selector panel on the right side.When a node is selected for inspection,its current location and amount of messages is displayed.Any of the messages the node is carrying can be taken for further inspection and also routing module specific information can be retrieved.The GUI also keeps track of notable events and displays them in the event log panel.By clicking a node or message name in the log panel,more information will be shown about that node or message.The event log controls panel can be used to adjust which events are shown in the log and the simulation can also be made automatically pause in case of some type of event.Figure3.2:ONE screen shot(map data copyright:Maanmittauslaitos,2007)When a new movement model or routing module is created,the GUI can give an intuitive view on how it works and whether the operations13QQ Group: 337113456make much sense.Since node locations are shown on the map,by followingtheir movement for a while,the movement model’s creator can see if thenodes move like they were supposed to move and end up in places wherethey were expected to go.This also applies to the routing modules:thesimulation can be automatically paused when,e.g.,a message is transferredbetween two nodes.Then,the routing module’s state can be inspected tosee if the message was really supposed to be transferred or not.During the development of the ONE,these methods were extensively used to test anddebug the simulator.Also,when deciding on the simulation parameters,it may be sometimeshard to come up with reasonable values:for example,is1000nodes with a50meter radio range a lot in a10square kilometer urban area?Trying todeduce this analytically can be a tedious job,but running such a simulationwith the GUI gives immediately an intuitive overview,e.g.,on how wellconnected the nodes are and how fast the messages are spread in the network.Finally,the GUI can be useful for demonstration purposes.Seeing nodesmoving and messages being passed between them is often more intuitive thana text trace in a console window or seeing just thefinal result in a plot whenthe simulation is over.3.4.2Batch modeWhen the movement models and routing modules seem to work as expected,and if there is no need for real-time visualization,it is more efficient to runsimulations in the batch mode.The batch mode does not have a GUI so allthe processing power can be used for the simulation.In the beginning of every scenario the name of the scenario and theamount of scenarios left in this batch is printed to the console.If a scenariotakes more than one minute to run,a progress message is printed once everyminute that shows the current simulation time and the speed of the simu-lation(simulated seconds per second).All simulation results are gatheredusing the output of report modules.For scenario configuration,the batch mode has a useful feature calledrun indexing.This allows easily defining a set of scenarios with varying set14of parameters and trying out different parameter combinations with only one configurationfile.The idea in run indexing is that the user provides for some configuration parameters,instead of a single value,an array of values. The user also defines,with a command line parameter,how many simulation runs should be performed.When started,the simulatorfirst selects thefirst value on each settings array and runs a simulation using those values.When the simulation isfinished,the second value from each array is chosen for the next simulation and so forth.If an array’s length is smaller than the amount of runs,the indexing wraps around,so thefirst parameter is selected after the last one.Therefore,if the amount of arrays and their length is chosen so that all array lengths have one as their smallest common nominator(e.g., by using prime numbers),all setting combinations can be run with a single configurationfile.For example,three setting arrays with lengths of3,5and 7will result in3×5×7=105different combinations.3.4.3Post-processingWhen a set of reportfiles have been created,either with GUI or batch mode, they can be further post-processed with suitable programs.Two of the ONE’s ready-made report modules producefiles that are di-rectly suitable for Graphviz[1]input.The adjacency graphviz report module creates node adjacency graphs such as shown in thefigure3.3.In the graph the nodes that have been in contact more than once have an edge drawn between them and nodes that have been more often in contact are drawn closer to each other.For example,it can be seen from the graph that tram nodes(marked with t),that use the same route,meet quite often during the simulation.Another Graphviz suitable module is the message graphviz report module which produces directed graphs of the delivered messages’paths.An example of a message graph,with all the messages that were sent from the node p1to the node p2during a simulation,is shown in thefigure 3.4.The ONE includes also a set of post-processing scripts that can auto-matically create,for example,bar graphs of message delivery probabilities or plot cumulative distribution of inter-contact times using gnuplot[12].15。