Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to install NS2 in Linux system

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

How to install NS2 in the Linux system, I believe that many inexperienced people do not know what to do. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.

NS2 is an open source software simulation platform for network technology written by C++ and Otcl. It is easy to develop network technology using NS2. How about installing NS2 in the Linux system?

Introduction to NS2: NS2 (Network Simulator,version 2) is an object-oriented network simulator, which is essentially a discrete event simulator developed by UC Berkeley.

It has a virtual clock and all simulations are driven by discrete events.

At present, NS2 can be used to simulate a variety of different IP networks. Some simulations have been implemented, such as network transport protocols, such as TCP and UDP, traffic source traffic generators, such as FTP,Telnet,Web CBR and VBR; routing queue management mechanisms, such as Droptail,RED and CBQ; routing algorithms, such as AODV, DSDV, DSR, etc.

. NS2 also implements multicast and some MAC sublayer protocols for LAN simulation.

Detailed steps of NS2 installation under Linux system: the purpose of setting up file sharing is to use the NS2 installation package on the hard disk under the virtual machine to install NS2. Let's start installing NS2. I installed the version of ns-allinone-2.34.tar.gz.

Step 1: set the installation directory

This step mainly sets up the installation directory, that is, put the installation package into the installation directory you want, and copy the installation package directly to / home/ghc/ns2 (ghc is my user name, ns2 is my new folder)

Step 2: install the software runtime environment

Sudo apt-get install build-essential # for gcc and some essential

Sudo apt-get install tcl8.4 # for tcl

Sudo apt-get install tcl8.4-dev # for tcl

Sudo apt-get install tk8.4 # for tk

Sudo apt-get install tk8.4-dev # for tk

Sudo apt-get install libxmu-dev libxmu-headers # for nam

What you should pay attention to in this step is that the software source must be set up, otherwise the installation will make an error. At the beginning, I did not set up the software source, which led to the unsuccessful installation of this step.

Step 3: install the software

1) decompression package: tar-zxvf / home/ghc/ns2/ns-allinone-2.34.tar.gz

2) enter the decompressed software directory: cd / home/ghc/ns-allinone-2.34

3) modify the generation command of gcc shared library:

Gcc version 4. 0 used ld-share to generate shared libraries, but above version 4. 0, this command was changed to gcc-share.

Type gcc-v in the terminal to see, my version is gcc version 4.4.3.

Modify method:

(1) enter the / ns-allinone-2.34/otcl-1.13 directory: cd otcl-1.13

(2) Open configure.in file: sudo gedit configure.in

(3) modify the parameters:

Change the SHLIB_LD= "ld-shared" in line 77 to SHLIB_LD= "gcc-shared", save and exit

Then, modify: sudo gedit configure in the row stack, change SHLIB_LD= "ld-shared" to SHLIB_LD= "gcc-shared" at line 6304, and save exit.

If it is not found in the file: SHLIB_LD= "ld-shared". Instead of doing this, move on to the next step:

4) perform the installation: return to the unzipped directory, cd / home/ghc/ns-allinone-2.34, and then sudo. / install

After the installation is successful, finally come out the prompt: prompt you to add these paths to path, so, you copy these path, and then press below to format, copy into it.

Please put / usr/ns-allinone-2.34/bin:/usr/ns-allinone-2.34/tcl8.4.18/unix:/usr/ns-allinone-2.34/tk8.4.18/unix into

Your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:

(1) You MUST put / usr/ns-allinone-2.34/otcl-1.13, / usr/ns-allinone-2.34/lib,into your LD_LIBRARY_PATH environment

Variable.

If it complains about X libraries, add path to your X librariesinto LD_LIBRARY_PATH.

If you are using csh, you can set it like:

Setenv LD_LIBRARY_PATH

If you are using sh, you can set it like:

Export LD_LIBRARY_PATH=

(2) You MUST put / usr/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental

Variable. Otherwise ns/nam will complain during startup.

After these steps, you can now run the ns validation suite with

Cd ns-2.34;. / validate

For trouble shooting, please first read ns problems page

Http://www.isi.edu/nsnam/ns/ns-problems.html. Also search the ns mailing list archive

For related posts.

Step 4: configuring environment variables

Use cd to enter the directory / home/ghc (ghc is my user name), and then sudo gedit .bashrc

Add the following at the end of the file:

PATH= "$PATH:/home/ghc/ns-allinone-2.34/bin:/home/ghc/ns-allinone-2.34/tcl8.4.18/unix:/home/ghc/ns-allinone-2.34/tk8.4.18/unix"

LD_LIBRARY_PATH= "/ home/ghc/ns-allinone-2.34/otcl-1.13:/home/ghc/ns-allinone-2.34/lib"

TCL_LIBRARY= "$TCL_LIBRARY:/home/ghc/ns-allinone-2.34/tcl8.4.18/library"

Save exit.

Note: where / home/ghc/ns-allinone-2.34/ is my software installation directory, in reference to this method is to change to your software installation directory.

Step 5: verify

Open a new terminal and enter ns. If% appears, the installation is successful.

You can also enter cd into / home/ghc/ns- allinone-2.34/ns-2.34/, input. / validate verification.

This verification will run for a long time.

After reading the above, have you mastered how to install NS2 in the Linux system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report