NS-3的安装和实例运行

NS-3的安装和实例运行

Installation libraries:
sudo apt-get update
sudo apt-get install build-essential autoconf automake libxmu-dev ia32-libs NetAnim wireshark python-pygoocanvas python-pygraphviz python-dev qt4-default p7zip-full bzr cmake mercurial git cvs python-kiwi python-gnome2 python-gnome2-desktop python-rsvg

sudo apt install build-essential autoconf automake libxmu-dev python-pygraphviz cvs mercurial bzr git cmake p7zip-full python-matplotlib python-tk python-dev python-kiwi python-gnome2 python-gnome2-desktop qt4-dev-tools qt4-qmake qt4-qmake qt4-default gnuplot-x11 wireshark

Download ns-allinone-3.xxx from nanam

Copy it in a folder(preferably the home folder, /home/folder_Name)

Execute these commands from the home folder
tar jxvf ns-allinone-3.xxx
cd ns-allinone-3.xxx

Execute this command for building ns3
./build.py –enable-examples –enable-tests (u will wait a few minutes)

Run a simple example
cd ns-allinone-3.xxx/ns-3.xxx/
./waf –run hello-simulator (u will see “hello simulator” in the terminal)

To run examples in ns3. All the files can be executed within a folder called ~ns-3.xxx/scratch/
U need to copy the .cc or .py files from the examples folder to the ~ns-3.xxx/scratch/
Once copied u can run the examples, using
cd ns-allinone-3.xxx/ns-3.xxx/
./waf –run scratch/file (No extension for .cc files,就是说不要带后缀名)
./waf –pyrun scratch/file.py

最后,在安装依赖时可能会遇到问题,可以参考博客1,系统权限问题参考博客2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值