Skip to main content

Installing Network Simulator 2 (NS2.34) in Ubuntu 11.04

Already this blog posts various titles on installing NS2 in Linux distros. Here is the step for installing in Ubuntu 11.04.

1. Version taken is NS2.34

2. Since ubuntu 11.04 uses GCC-4.5.2, there should be some minor tweeks.

3. Two files should be edited ~ns-2.34/tools/ and ~ns-2.34/mobile/  as given in the following post

4. Install the following things in Ubuntu

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

sudo apt-get install gcc-4.4

5. open the file ~ns-2.34/otcl-1.13/configure and change the line number 6304 to SHLIB_LD="gcc -shared" instead of SHLIB_LD="ld -shared"

6. open the file ~ns-2.34/otcl-1.13/ and change the line CC    @CC@ to CC    gcc-4.4

7. Set the path in /home/<name>/ .bashrc as in

8. After setting the path, sometimes overflow error may come when running ns and nam, so open the file ~ns-2.34/tcl8.X.x/unix/ and in line number 270 change @CC@ to @CC@ –V 4.4

Thats it!!! NS2 Installed.

(Thanks to:



  1. Hey thanks alot yaar. It worked!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  2. I have a problem. I have installed ns2 through Ubuntu Software Center because I couldn't install with Terminal. It was impossible for me
    Now I have to install a patch for RSVP and I don't know how. In all the tutorials I have saw, they go to the folder of ns2 and continue with the installation.

    The problem is that I don't have a ns2 folder, all the files are spread in several folders.
    I don't know what I have to do to install a patch in this case.

    Can somebody help me please?

    Send an email

  3. Sir i have installed ns2, in the above manner, but during validating all the tests failed, does that affect my working on Ns2 in any manner. plz help me sir.

  4. No even if validation fails, ns2 will run

  5. Hello Sir,
    I am using Ubuntu 11.04 Natty Nehwal version and tried installing ns2 version 2.34 following above instructions. After I was done with the complete procedure of setting the path in the .bashrc file I was NOT able to start ns2 or nam using the ns or nam command. It said that ns2 is not installed on this system and that use sudo apt-get install ns2 command to install it. It was the same case with nam.
    The lines added to the .bashrc file are:


    After all this was done I used the sudo apt-get install for ns2 and nam both. Luckily enough both of them got installed and when I type ns or nam in the terminal it works but strangely the ./validate still fails and prints memory traces having Aborted labels because your above reply states that ns2 will run.
    Does it apply to my system as well or is there still a problem with the ns2 installation?
    Kindly Reply.
    Thank You.

  6. hey omkar
    please check the PATH variable,
    there should be a space in between
    export PATH=
    export LD_LIBRARY_PATH=

    So if, you make a space between export and PATH and export and LD_LIBRARY_PATH, your problme will be rectified

    BTW, ubuntu11.04 comes with the predefined ns2 tool and you cannot recompile it that much easy, but still you can run tcl files and see the nam demo.

    better go with your own installation and succeed.

  7. Sir,
    I've changed the ~ns-2.34/tcl8.4.18/unix/, line 270 to

    @CC@ –V 4.4 instead of @CC@

    but still overflow..

  8. ok fixed :D

    needed to install again..

  9. [...] [...]


Post a comment

Popular posts from this blog

Implementing a new system call in Kernel version 2.6.32

A system call is used by application or user programs to request service from the operating systems. Since the user programs does not have direct access to the kernel whereas the OS has the direct access. OS can access the hardware through system calls only. The following files has to be modified for implementing a system call /usr/src/linux- /usr/src/linux- /usr/src/linux- /usr/src/linux- New set of files to be created Create a new directory newcall/ inside the path “ /usr/src/linux- ” Create new files Makefile, newcall.c and put them in the /usr/src/linux- folder Create new user files (in any folder of Linux) to test the system call testnewcall.c, testnewcall.h (created in /home/pradeepkumar ) syscall_table_32.S Find the file /usr/src/linux-

How to Access MOODLE in Intranet and Internet

When Moodle is accessed either in Intranet or internet, there will not be any issue. But occasions when the MOODLE Site has to be accessed both in the intranet and in the Internet, here is a simple trick Server Used: IBM Blade Servers Operating system: Windows Server 2008 Moodle Version: 2.4 WAMP Server is used. Number of Users: 3000 (Students) + 200 (Faculty) Open the config.php from ~/moodle/config.php include these lines $CFG->wwwroot = 'http://'.$server_id.'/vitcc'; $CFG->dataroot  = 'C:\\wamp\\moodledata'; before the following line $CFG->directorypermissions = 07xx; Restart the WAMP Server and you can Check MOODLE Site both in Internet and Intranet. The above Image tells the intranet Link and the internet link can be opened outside the campus network

Electrical Machine Design (equations)

Factors DC Machine Transformers Induction Machines Synchronous Machines Output Equation P a =C o D 2 Ln, where Pa=P/h for generators, Pa=P for motors For Single Phase Q=2.22 f B m A i K w A w d 10 -3 For Three Phase Q=3.33 f B m A i K w A w d 10 -3 Q=C o D 2 L n s KVA Input Q= HP * 0.746 / Cos f * h Q=C o D 2 L n s KVA Input Q= HP * 0.746 / Cos f * h For Turbo alternators Q=1.11B av ac K ws V a 2 L 10 -3 /n s Output Coefficient C o =B av ac* 10 -3 where Bav-magnetic loading and ac - electric loading DNA C o =11 K ws B av ac 10 -3 C o =11 K ws B av ac 10 -3 Choice of Magnetic Loading Flux Density in Teeth Frequency of Flux Reversals Size of machine DNA Magnetizing current, Flux Density, Iron loss Iron loss, Stability, Voltage Rating, Parallel Operation, Transient ShortCircuit current