omnet++
发布日期:2021-05-08 04:51:34 浏览次数:16 分类:精选文章

本文共 1559 字,大约阅读时间需要 5 分钟。

在这篇文章以及接下来几篇关于无线传感网络仿真的文章,我想介绍一下omnet++,算是对我这几个月来对omnet++的学习总结。

omnet++是一个什么东西呢?我还是引用一下官方的声明吧。来自http://www.omnetpp.org/

"OMNeT++ is an extensible, modular, component-based C++ simulation library and framework, primarily for building network simulators. "Network" is meant in a broader sense that includes wired and wireless communication networks, on-chip networks, queueing networks, and so on. Domain-specific functionality such as support for sensor networks, wireless ad-hoc networks, Internet protocols, performance modeling, photonic networks, etc., is provided by model frameworks, developed as independent projects. OMNeT++ offers an Eclipse-based IDE, a graphical runtime environment, and a host of other tools. There are extensions for real-time simulation, network emulation, alternative programming languages (Java, C#), database integration, SystemC integration, and several other functions."

大意是说Omnet++是一款可扩展的、模块化的、基于c++模拟库组件的网络仿真器。

 1993年,András Varga 在布达佩斯技术大学开发了这款仿真器。目前,它的版本号已经发行到了omnet++4.5.它在APL下完全开源。任何人可以免费使用。在windows上安装omnet++参看我的文章。在ubuntu上安装参考我的文章。

安装完成后,运行IDE界面如图所示

为你模型编写代码

omnet++的仿真模型是由一些模块组成的,这些模块分布在网络协议的各层中。最基本的模块叫做simpleModule,简单模块。simpleModule里包含了你的模型逻辑。模型逻辑用c++开发。开发自己的算法协议时,需要用c++实现simpleModule中的所需的 initialize() 和 handleMessage()函数。

选择c++是因为它是相对低级的语言,低级也就意味着高效。仿真需要高效是因为需要模拟成千上万个事件。

建立仿真网络

用c++实现了simpleModule所需的逻辑后,就可以用这些simpleModule来组成普通的module,进而实现一个大的网络。在omnet++中用NED语言描述(定义)网络。在IDE中编写NED文件可以在两种模式下进行--design模式和source模式。在design模式下,你可以用连接工具连接节点之间的“门”,相应地会在source中自动生成NED代码。

Network Designer

总结

omnet++是一款强大的使用的网络仿真器,它几乎可以仿真网络开发中各个阶段的协议。

上一篇:在omnet++上仿真无线传感网络1
下一篇:《深度学习中的数学》学习笔记

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2025年04月20日 22时55分40秒