提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档
安装ndnSIM2.8版本
前言
ndn网络的研究,总是要用到实验去验证其思想,本文就是一个ndnSIM 安装过程。官方学习文档:https://ndnsim.net/current/
一、使用步骤
1.首先安装包
我这里使用的是Ubuntu 20,安装的是ndnSIM2.8
首先安装依赖包
sudo apt install build-essential libsqlite3-dev libboost-all-dev libssl-dev git python3-setuptools castxml
2.NS-3 Python绑定的依赖包
代码如下(示例):
sudo apt install gir1.2-goocanvas-2.0 gir1.2-gtk-3.0 libgirepository1.0-dev python3-dev python3-gi python3-gi-cairo python3-pip python3-pygraphviz python3-pygccxml
sudo pip3 install kiwi
到这里安装包,已经安装完成,剩下的就是正式安装ndnSIM,如果出错,看下说明是不是包缺少依赖,将依赖包安装
3.安装ndnSIM
代码如下(示例):
mkdir ndnSIM
cd ndnSIM
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 --recursive https://github.com/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM
这里是创建了一个文件夹,然后下载ndnSIM源码,如果下载不下来,可以更新源或者是
sudo apt update //更新源
git clone git://github.com/named-data-ndnSIM/ns-3-dev.git ns-3
git clone git://github.com/named-data-ndnSIM/pybindgen.git pybindgen
git clone --recursive git://github.com/named-data-ndnSIM/ndnSIM.git ns-3/src/ndnSIM
ndnSIM的编译和运行
```cpp
cd ns-3
./waf configure --enable-examples
./waf
到这里已经安装好ndnSIM,接下来就是测试了
./waf --run=ndn-simple
或者
./waf --run=ndn-simple --vis
就可以运行文件了,还有许多例子都可以进行测试。
总结
这只是安装ndnSIM,真正的仿真程序还是需要自己编写的在NS-3scratch/或src/ndnSIM/examples文件夹中编写,新手学习需要在例子中去一点一点学习,主要本身研究ndn网络的也不多,学习的资料也很少,需要代码功底。