NS-3学习笔记 1

这篇博客详细介绍了网络模拟器NS-3的学习过程,包括NS-3的基本概念、资源、开发环境设置和初步使用步骤。作者分享了安装NS-3所需的各种依赖和软件包,并提供了Ubuntu 16.04下的安装教程,强调了在使用过程中可能遇到的问题和解决办法。文章以实际操作为导向,旨在帮助初学者顺利入门NS-3。
摘要由CSDN通过智能技术生成

NS-3 是一个主要由C++编写并兼容python脚本的网络模拟工具。学习它的目的在于模拟那些不容易在物理网络中实现的过程。

我参考的资料是NS3的官方tutorial,主要内容包括:

  • 介绍
  • 学习资源
  • 开始上手
  • 基本概念
  • 调整(Tweaking)
  • 构建拓扑
  • 跟踪
  • 数据收集
  • 总结

    好了,我要开始“愉快”的学习了。

1. Introduction

NS-3是个主要面向研究和教育的离散时间模拟器。这个项目于2006年启动,开源,不与ns-2兼容。本tutorial将构建几个模拟例子,讲解关键概念和特性。
NS-3的特点:

  • NS-3由一系列的库组成,这些库关系松散,可以随时引入新的库,例如可视化部分;别的模拟工具往往是一个整体,结合了GUI。
  • NS-3的工作环境往往是命令行或程序界面,而不是可视化的
  • NS-3主要运行于linux下

2. Resources

2.1. 网站

Official web:http://www.nsnam.org/
Documents:http://www.nsnam.org/documentation/
wiki:http://www.nsnam.org/wiki
sourcecode:http://code.nsnam.org/

2.2. 代码版本控制

使用Mercurial

2.3. 编译/配置工具

使用基于python的waf(据说是适于编译复杂大系统)

2.4. 开发环境

使用c++和python
许多ns-3的API用python写的,但模块都是用C++写的。
C++指南:http://www.cplusplus.com/doc/tutorial/
ns-3使用了GNU toolchain,了解请看http://en.wikipedia.org/wiki/GNU_toolchain

2.5. Socket编程

使用ns-3要了解Socket编程概念,新手可参考书《TCP/IP Sockets in C》Donahoo Michael J. and Calvert Kenneth L. 或其他一些资料。

3. 开始动手

NS-3是一帮闲人自发搞起来的,所以没有包装的很完美。使用前要下载源代码,然后编译部署。

3.1. 下载NS-3

安装向导文档:https://www.nsnam.org/wiki/Installation
其中有关Ubuntu下安装NS-3的部分,摘录如下:

下列程序包在Ubuntu 16.04 release下验证通过,其他版本可能有所不同。
Note: Ubuntu 14.04 LTS release requires upgrade to gcc-4.9 from default gcc-4.8.
minimal requirements for C++ (release):
apt-get install gcc g++ python
minimal requirements for Python (release):
apt-get install gcc g++ python python-dev
minimal requirements for Python (development):
apt-get install mercurial python-setuptools git
Python API scanning support: cmake libc6-dev libc6-dev-i386 g++-multilib.To rescan Python bindings requires gccxml and pygccxml, which are installed by bake. However, for Ubuntu 16.04, gccxml will not build without a patch and a build flag described here: https://www.nsnam.org/bugzilla/show_bug.cgi?id=2451
qt4 development tools are needed for Netanim animator (Note: qt version qt4, not qt5, is required)
apt-get install qt4-dev-tools libqt4-dev
Support for generating modified python bindings
apt-get install cmake libc6-dev libc6-dev-i386 g++-multilib
and you will want to install gccxml and pygccxml as per the instructions for python bindings (or through the bake build tool as described in the tutorial).
Debugging:
apt-get install gdb valgrind
GNU Scientific Library (GSL) support for more accurate WiFi error models
apt-get install gsl-bin libgsl2 libgsl-dev
The Network Simulation Cradle (nsc) r

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值