ndnSIM学习
ndnSIM下载
操作系统:Ubantu16.04
版本ndnSIM2.1
安装依赖
sudo apt-get install build-essential libsqlite3-dev libcrypto++-dev
sudo apt-get install libboost-all-dev
sudo apt-get install python-dev python-pygraphviz python-kiwi
sudo apt-get install python-pygoocanvas python-gnome2
sudo apt-get install python-rsvg ipython
下载源码
mkdir ndnSIM2.1
cd ndnSIM2.1
git clone https://github.com/named-data-ndnSIM/ns-3-dev.git ns-3
git clone https://github.com/named-data-ndnSIM/pybindgen.git pybindgen
git clone https://github.com/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM
切换版本
//ndnSIM2.1/ns-3/src/ndnSIM目录下
git checkout ndnSIM-2.1
git submodule update --init
//ndnSIM2.1/ns-3目录下
git checkout ns-3.23-dev-ndnSIM-2.1
//ndnSIM2.1/pybindgen目录下
git checkout 0.17.0.post45+ng4806e4f
此时在ndnSIM2.1/ns-3目录下运行
./waf configure
说明缺少 python-setuptools
执行
sudo apt-get install python-setuptools
此时显示 需要安装setuptools_scm
//若未安装pip执行以下两条命令
//wget https://bootstrap.pypa.io/pip/2.7/get-pip.py
//python get-pip.py
pip install setuptools_scm
此时显示
进入目录ndnSIM2.1/ns-3/bindings/python,打开wcript文件
修改
在ndnSIM/ns-3目录下输入
./waf configure --enable-examples
./waf
成功
参考博客 ndnSIM仿真平台使用之安装.
eclipse安装
sudo apt-get install eclipse-platform
若出现“出现错误:‘E: 有未能满足的依赖关系。请尝试不指明软件包的名字来运行“apt-get -f install”(也可以指定一个解决办法)’”则先执行命令
sudo apt-get --fix-broken install
配置c++编译环境
sudo apt-get install build-essential
sudo apt-get install eclipse-cdt
在eclipse中配置对ns-3支持
1.File->Import->C/C+±>Existing Code as Makefile Project, 选择ndnSIM2.1/ns-3 并把项目名称命名为 “ns-3”
2.ns-3->properties->c++build
3.Run->External Tools->External tools Configuration->program