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

Installing TexLive 2019 in Ubuntu 18.04

Installation of TexLive 2019 in Linux (Ubuntu 18.04 LTS)
TeX (Tech)

Installation of TexLive 2019

Please watch the video for full installation

I used .iso file to download, the Total size is 3.3GB for Linux,

and i used the torrent file to download, it took me just 20 min to download the entire .iso file

Extract the .iso file to a folder and open a terminal

$] sudo ./install-tl
(it goes into a terminal mode, which is faster compared to the GUI Mode)

$] sudo ./install-tl -gui
after the installation, set the PATH, MANPATH and INFOPATH as suggested by LATEX

export PATH=$PATH:/usr/local/texlive/2019/bin/x86_64-linux
export MANPATH=/usr/local/texlive/2019/texmf-dist/doc/man
export INFOPATH=/usr/local/texlive/2019/texmf-dist/doc/info

put these lines in to the /home/pradeepkumar/.bashrc

$] gedit /home/pradeepkumar/.bashrc
We have installed TexLive 2019 and texstudio.

To install texstudio

$] sudo apt install texstudio
The look and feel of TexStudio looks like this image.

texlive, it install everyt…

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- set of files to be createdCreate 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- and add the following line at the end

Electrical Machine Design (equations)

FactorsDC Machine Transformers Induction Machines Synchronous MachinesOutput EquationPa=CoD2Ln, where Pa=P/h for generators, Pa=P for motorsFor Single Phase
Q=2.22 f Bm Ai Kw Aw d10-3
For Three Phase
Q=3.33 f Bm Ai Kw Aw d 10-3Q=CoD2 L ns
KVA Input Q=
HP * 0.746 / Cos f * hQ=CoD2 L ns
KVA Input Q=
HP * 0.746 / Cos f * h
For Turbo alternators
Q=1.11Bavac KwsVa2 L 10-3/nsOutput CoefficientCo=Bav ac* 10-3where Bav-magnetic loading and ac - electric loadingDNACo=11 Kws Bav ac 10-3Co=11 Kws Bav ac 10-3 Choice of Magnetic LoadingFlux Density in Teeth Frequency of Flux Reversals Size of machineDNAMagnetizing current, Flux Density, Iron lossIron loss, Stability, Voltage Rating, Parallel Operation, Transient ShortCircuit current Choice of Electric LoadingTemperature rise,
speed of machine, Voltage, Armature reaction, CommutationDNAOverload Capacity, Copper losses, Temperature rise, Leakage ReactanceCopper loss, Synchronous reactance, Temperature rise, Stray Load losses,
Voltage rating Flux …