Ubuntu安装ns2-2.35

Installing Network Simulator 2 (NS2) on Ubuntu 14.04

1 Introduction

Network simulators are tools used to simulate discrete events in a network and which helps to predict the behavIoUrs of a computer network. Generally the simulated networks have entities like links,switches,hubs,applications,etc. Once the simulation model is complete,it is executed to analyse the performance. Administratorscan then customize the simulator to suit their needs. Network simulators typically come with support for the most popular protocols and networks in use today,such as WLAN,UDP,TCP,IP,WAN,etc.

Most simulators that are available today are based on a GUI application like the NCTUNS while some others incl. NS2 are CLI based. Simulating the network involves configuring the state elements like links,terminals,etc. and also the events like packet drop rate,delivery statusand so on. The most important output of the simulations are the trace files. Trace files log every packet,every event that occurred in the simulation and are used for analysis. Network simulators can also provide other tools to facilitate visual analysis of trends and potential trouble spots. Most of the simulation is performed in discrete time intervals where events that are in the queue are processed one after the other in an order.

Since simulation is a complex task,we cannot guarantee that all the simulators can provide exact or accurate results for all the different type of information. Examples of network simulators are: ns,NCTUNS,NetSim,etc.

ns2 is a name for series of discrete event network simulators like ns-1,ns-2 and ns-3. All of them are discrete-event network simulators,primarily used in research and teaching. ns2 is free software,publicly available under the GNU GPLv2 license for research,development,and use.

This post deals with the installation of "ns2" also called the "network simulator 2" in Ubuntu 14.04.

2 Download and Extract ns2

Download the all in one package for ns2 from here

The package downloaded will be named "ns-allinone-2.35.tar.gz". copy it to the home folder. Then in a terminal use the following two commands to extract the contents of the package.:

cd ~/
tar -xvzf ns-allinone-2.35.tar.gz

All the files will be extracted into a folder called "ns-allinone-2.35".

3 Building the dependencies

Ns2 requires a few packages to be pre installed. It also requires the GCC- version 4.3 to work correctly. So install all of them by using the following command:

sudo apt-get install build-essential autoconf automake libxmu-dev

One of the dependencies mentioned is the compiler GCC-4.3,which is no longer available,and thus we have to install GCC-4.4 version. The version 4.4 is the oldest we can get. To do that,use the follwoing command:

sudo apt-get install gcc-4.4

The image below shows the output of executing both the above commands. If you have all the dependencies pre-installed,as I did,the output will look like the image below:

Once the installation is over,we have to make a change in the "ls.h" file. Use the following steps to make the changes:

Navigate to the folder "linkstate",use the following command. Here it is assumed that the ns folder extracted is in the home folder of your system.

cd ~/ns-allinone-2.35/ns-2.35/linkstate

Now open the file named "ls.h" and scroll to the 137th line. In that change the word"error" to "this->error". The image below shows the line 137 (highlighted in the image below) after making the changes to the ls.h file.To open the file use the following command:

gedit ls.h

Save that file and close it.

Now there is one more step that has to be done. We have to tell the ns which version of GCC will be used. To do so,go to your ns folder and type the following command:

Sudo gedit ns-allinone-2.34/otcl-1.13/Makefile.in

In the file,change Change CC= @CC@ to CC=gcc-4.4,as shown in the image below.

4 Installation

Now we are ready to install ns2. To do so we first require root privileges and then we can run the install script. Use the following two commands:

sudo su cd ~/ns-allinone-2.35/./install

The following is a snap of these commands:

The image below shows how it looks upon successful execution

It took almost 6 minutes to build and install ns2 on my system. But before we run it,we need to add the build path to the environment path.

5 Setting the Environment Path

The final step is to tell the system,where the files for ns2 are installed or present. To do that,we have to set the environment path using the ".bashrc" file. In that file,we need to add a few lines at the bottom. The things to be added are given below. But for the path indicated below,many of those lines have "/home/akshay/ns-allinone-2.35/....",but that is where I have my extracted folder. Make sure you replace them with your path. For example,if you have installed it in a folder"/home/abc",then replace "/home/akshay/ns-allinone-2.35/otcl-1.14" with"/home/abc/ns-allinone-2.35/otcl-1.14".

Do this for all the required lines.

sudo gedit ~/.bashrc

Lines to be added:

# LD_LIBRARY_PATH
OTCL_LIB=/home/akshay/ns-allinone-2.35/otcl-1.14
NS2_LIB=/home/akshay/ns-allinone-2.35/lib
X11_LIB=/usr/X11R6/lib
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB
# TCL_LIBRARY
TCL_LIB=/home/akshay/ns-allinone-2.35/tcl8.5.10/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB
# PATH
XGRAPH=/home/akshay/ns-allinone-2.35/bin:/home/akshay/ns-allinone-2.35/tcl8.5.10/unix:/home/akshay/ns-allinone-2.35/tk8.5.10/unix
#the above two lines beginning from xgraph and ending with unix should come on the same line
NS=/home/akshay/ns-allinone-2.35/ns-2.35/ 
NAM=/home/akshay/ns-allinone-2.35/nam-1.15/ 
PATH=$PATH:$XGRAPH:$NS:$NAM

Once the changes have been made,save the file and restart the system.

6 Running ns2

Once the system has restarted,open a terminal and start ns2 by using the following command:

ns

If the installation is correct then the terminal looks like the image below :

转自:https://www.howtoforge.com/tutorial/ns2-network-simulator-on-ubuntu-14.04/

--------------------------------------------分割线---------------------------------------------------

看了国内很多安装NS2的博客,都安装失败。

找到一篇文章,亲测,可行!

操作系统:Ubuntu 12.04 LTS 32bit

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


目录前言一、创建Hadoop用户二、更新apt和安装Vim编辑器三、安装SSH和配置SSH无密码登录四、安装Java环境1. 安装JDK2. 配置JDK环境3. 检验安装五、安装单机Hadoop1. 下载安装Hadoop2. 运行示例总结前言本文安装的 Hadoop 及 Java 环境基于林子雨老师的《大数据技术原理与应用(第3版)》中所要求,其中Java 版本为1.8.0_301,Hadoop 版本为3.3.1,其他版本的安装请参考其他博客。..
原文连接:https://www.cnblogs.com/yasmi/p/5192694.html  运行django出现错误信息:[2016-02-16 14:33:24,476 pyinotify ERROR] add_watch: cannot watch /usr/local/lib/python2.7/dist-packages/django/contrib/sessio...
电脑重启后,打开VirtualBox,发现一直用的虚拟机莫名的消失了,如下:别着急,以下教你如何找回之前的虚拟机:1、点击控制,然后选择注册,找到虚拟机的安装目录,比如:C:UserstxVirtualBox VMs,然后选择需要找回的虚拟机vbox,点击打开按钮即可:2、如果打开后报错,则执行第三步:3、删除ubuntu.vbox,然后将ubuntu.vbox-prev重命名为ubuntu.vbox,然后再执行第二步即可...
参见:https://blog.csdn.net/weixin_38883338/article/details/82153933 https://blog.csdn.net/github_39533414/article/details/85211012
Ubuntu 18.04 LTS 已切换到 Netplan 来配置网络接口。Netplan 基于 YAML 的配置系统,使得配置过程非常简单。Netplan 替换了我们之前在 Ubuntu 中用于配置网络接口的旧配置文件/etc/network/interfaces。在本文中,我们将学习如何使用 Netplan 在 Ubuntu 中配置网络。我们将看到静态和动态 IP 配置。我将使用 Ubuntu 18.04 LTS 来描述本文中提到的过程。使用 Netplan 配置网络您可以在/etc
介绍每个 Web 服务都可以通过特定的 URL 在 Internet 上访问,该 URL 代表一种“替代名称”,用于标识提供该服务的服务器的 IP 地址和端口。同一台机器可以同时在不同的端口上提供不同的服务。出于安全原因,可能需要屏蔽 Web 服务的端口号,从而在外部显示与服务实际侦听的端口号不对应的端口号。感谢本教程,您将能够管理您的服务器端口,配置集成在 Ubuntu 中的 UFW 防火墙。特别是,按照指南的说明,您将学习将来自某个端口的请求转发到另一个端口(端口转发),同时使用后者提供的.
Observium 是一个免费和开源的 sa 网络管理和监控系统工具。我们可以使用 SNMP 收集数据,它允许监控所有网络设备。它提供了一个简单易用的 Web 界面。它基于 PHP 并使用 MySQL 数据库来存储数据。在 ubuntu 上设置 Observium 有几个步骤:第 1 步:更新系统。apt-get update第 2 步:安装 PHP 和模块。apt install wget apache2 php php-{pear,cgi,common,curl,mbstring,g
从 20.04 开始,Ubuntu 决定更新实时服务器安装程序以实现自动安装规范,以便能够仅使用 Subiquity 完全自动化安装过程。Subiquity 是新的服务器安装程序(又名“服务器无处不在”),旨在取代之前基于 debian-installer 的经典系统。本文说明了如何使用 Packer 和 Proxmox 上的 Subiquity 生成 Ubuntu Server 20.04 图像模板。介绍Subiquity 仅在live图像文件版本中可用(例如ubuntu-20.0...
Ubuntu 将停止支持 Debian 安装程序(预置)。Ubuntu Server 20.04 附带了一种新的自动化操作系统安装方法,称为带有 subiquity 服务器安装程序的自动安装。这篇文章展示了使用新安装程序构建的打包程序。此设置仅适用于 Ubuntu-20.04 live-server 而不是旧版。SubiquitySubiquity 是 Ubuntu 服务器的新自动安装程序,它是在 18.04 中引入的。自动安装的设置由 cloud-init 配置提供。如果设置,将从配置文件.
此页面的目的是提供在您机器上的 VM 中执行自动安装的简单说明。此页面假设您使用的是 amd64 架构。s390x也有一个版本。通过网络提供自动安装数据这种方法是最容易推广到完全基于网络的安装的方法,在这种安装中,机器会进行网络引导,然后自动安装。下载 ISO转到20.04 ISO 下载页面并下载最新的 Ubuntu 20.04 实时服务器 ISO。挂载 ISOsudo mount -r ~/Downloads/ubuntu-20.04-live-server-amd64...
FTP 或文件传输协议是一种非常古老的知名协议,用于在客户端和服务器之间传输文件。它也是一个不安全的协议,仅在没有 TLS 的情况下使用。在本教程中,我们将为 TLS 配置 vsftpd,它允许我们安全地使用 FTP。如今,FTP 经常被更安全的协议所取代,例如 SFTP 或 SCP。但是,如果您需要在服务器上使用 FTP,vsftpd(Very Secure FTP Daemon)是一个完美的选择。在本教程中,我们将学习如何在基于 Ubuntu 20.04 的服务器上使用 vsft
使用cloud-init快速启动来宾操作系统的能力通常与在 EC2 或 Azure 等 IaaS 中部署虚拟机相关。但是 cloud-init 不仅仅适用于远程云提供商,将 cloud-init 用于可以快速部署在 KVM 中的本地映像非常适合本地开发和测试。本文将逐步测试 KVM 上的来宾 Ubuntu 仿生云映像。先决条件作为本文的先决条件,您必须按照此处所述安装 KVM 和 libvirt。还要安装管理云图像所需的附加包:sudo apt-get install -y
Window Linux双系统安装历程今天下午搞了几个小时,可谓是困难重重,但是实际上只是被一个很小的问题困住了,其它地方都很简单。接下来简单讲一下安装的步骤以及遇到的问题。先讲一下设备状况:一台12年买的i3 window7 待报废的lenovo 笔记本一个32g的usb3.0另一台新的win10笔记本电脑磁盘分区首先要在安装双系统的电脑上,划分硬盘中的一个分区来装linxu。点击我的电脑(此电脑)->管理-> 磁盘管理比如这里我们的e盘原本有98.55g,然后还有
https://pinyin.sogou.com/linux/help.php 安装指南 Ubuntu搜狗输入法安装指南 搜狗输入法已支持Ubuntu1604、1804、1910、2004、2010
在home主文件夹里面。
格式:rm -rf 目录名字 -r 就是向下递归,不管有多少级目录,一并删除 -f 就是直接强行删除,不作任何提示的意思 名称 概述 描述 选项
https://blog.csdn.net/qq_29985391/article/details/78008864 https://blog.csdn.net/wangxin0205/article
echo $ROS_PACKAGE_PATH
https://blog.csdn.net/weixin_37657720/article/details/80645991 :q! 不保存强制推出。 :wq 保存并退出。
https://blog.csdn.net/xin_101/article/details/88624726 https://blog.csdn.net/qq_15192373/article/det