fedora ns3
ns is a discrete-event network simulator targeted primarily for research and educational use. There are two version of ns, ns-2 and ns-3, which are quite different with each other in the implementation and method to use them. In this post, we introduce how to install ns-2 and ns-3 on Fedora Linux 15.
ns是主要用于研究和教育用途的离散事件网络模拟器。 ns有两种版本,即ns-2和ns-3 ,它们在实现和使用它们的方法上彼此完全不同。 在本文中,我们介绍如何在Fedora Linux 15上安装ns-2和ns-3 。
在Fedora上安装ns-2.34 (Install ns-2.34 on Fedora)
Download the allinone package
下载allinone软件包
$ wget http://downloads.sourceforge.net/project/nsnam/allinone/ns-allinone-2.34/ns-allinone-2.34.tar.gz
Uncompress the pacakge
解压缩pacakge
$ tar xf ns-allinone-2.34.tar.gz
Install needed pacakges
安装所需的功能
# yum install gcc make libX11-devel libXt-devel libXmu-devel
Ns-2 requires older version of gcc. So we install gcc-34 and gcc-34-c++ for it
Ns-2需要较旧版本的gcc。 所以我们为此安装了gcc-34和gcc-34-c ++
# yum install compat-gcc-34 compat-gcc-34-c++
Install the allinon package of ns-2. During the install process, specify the CXX compiler we use
安装ns-2的allinon软件包。 在安装过程中,指定我们使用的CXX编译器
$ cd ns-allinone-2.34
$ CXX=g++34 ./install
Configure the environmental variables for ns-2 and nam, and add the executables to the PATH so that we can use ns and nam directly.
为ns-2和nam配置环境变量,并将可执行文件添加到PATH,以便我们可以直接使用ns和nam。
Add to ~/.bashrc if you use bash
如果使用bash,请添加到〜/ .bashrc
NS_HOME=/full/path/to/ns-allinone-2.34
PATH=$NS_HOME/bin:$NS_HOME/tcl8.4.18/unix:$NS_HOME/tk8.4.18/unix:$PATH
export PATH
or
要么
Add to ~/.cshrc_user if you use c shell
如果使用c shell,请添加到〜/ .cshrc_user
setenv NS_HOME "/full/path/to/ns-allinone-2.34"
setenv PATH "${PATH}:${NS_HOME}/bin:${NS_HOME}/tcl8.4.18/unix:${NS_HOME}/tk8.4.18/unix"
setenv LD_LIBRARY_PATH "${NS_HOME}/otcl-1.13:${NS_HOME}/ns-2.34/lib:/usr/local/lib"
setenv TCL_LIBRARY "${NS_HOME}/tcl8.4.18/library"
The installation is done by this step. Open another shell and try our installation:
通过此步骤完成安装。 打开另一个外壳,然后尝试安装:
$ nam
and
和
$ ns
在Fedora上安装ns-3.12.1 (Install ns-3.12.1 on Fedora)
Install needed packages
安装所需的软件包
# yum install libxml2 libxml2-devel gcc gcc-c++ make automake
autoconf binutils openssh-server openssh-clients openssl python
python-devel mercurial bzr scons flex bison tcpdump valgrind gdb
Download the allinone pacakge for ns-3
下载适用于ns-3的allinone pacakge
$ mkdir tarballs
$ cd tarballs
$ wget http://www.nsnam.org/release/ns-allinone-3.12.1.tar.bz2
$ tar xjf ns-allinone-3.12.1.tar.bz2
Build ns-3
版本ns-3
$ cd ns-allinone-3.12.1/
$ ./build.py
We will now interact directly with Waf in the ns-3.12.1 directory
现在,我们将直接在ns-3.12.1目录中与Waf进行交互
$ cd ns-3.12.1
Configuration with Waf
用Waf配置
$ ./waf -d optimized configure --enable-examples; ./waf
Validate our installation by running one example
通过运行一个示例来验证我们的安装
$ ./waf shell
$ cd build/optimized/examples/
$ udp/udp-echo
Use tcpdump to display the simulation result
使用tcpdump显示模拟结果
$ tcpdump -tt -r udp-echo-0-1.pcap
翻译自: https://www.systutorials.com/install-ns-2-and-ns-3-on-fedora-linux/
fedora ns3