This post will help you in installing Network Simulator 2 version NS2.35 in Fedora 16
Steps:'
- Install Fedora using a DVD ISO (if you go for a CD iso, then you need to download lot of packages)
- Download NS-2.35 from this website.
- Unzip or untar it to any folder (recommended is /home/loginname) using the following commands one by one
tar zxvf ns-allinone-2.35.tar.gz
cd ns-allinone-2.35
./install
- Once installed the PATH information will be shown in the screen.
- Copy the PATH and LD_LIBRARY_PATH Variable to .bash_profile (see a dot in the beginning)
Input the path information in .bash_profile like this
There will be a PATH Variable already available in the .bash_profile file, just copy the PATH information from the NS2 installation and append it over the existing PATH variable (but put a separator : between each path)
export PATH=$HOME/bin:<Put a colon and Place your paths here>
export LD_LIBRARY_PATH=<place the LD_LIBRARY_PATHS> here.
Once done, save the file and close
execute the command
source .bash_profile
try ns (if you see a % indicates ns is installed successfully) or nam (a animation window will be opened).
can we run ns2 program written in older version like ns2.33 in ns2.35?
ReplyDeleteyes it is possible to run
ReplyDeletehow to create a .bashrc file?
ReplyDeleteplease provide with an example.
What are the required libraries for installing ns2.35 on Fedora 16 without any problems or errors (compile time/ run time)?
ReplyDeletehttp://fsdportal.blogspot.com
For a single PC is OK.. (Fedora 16)
ReplyDeleteWhat about networked systems - using centralized logging?
How any user can access ns and nam?
http://fsdportal.blogspot.com
You can create a ns2.sh file inside the /etc/profile.d and set the PATH and LD_LIBRARY_PATH and restart the system. ?In this anyone can be able to access the ns and nam.
ReplyDeleteHello Pradeepji...
ReplyDeleteI rectified the error.. while running NAM on fedora 16... after installing ns2.35 on f16.
In the path settings in .bash_profile...
I removed the path representation for tk
after/before I installed 'tk' from fedora 16's DVD.
Now its works fine..
I think there is some bugs in "tk section" of ns2.35.allinone.tar.gz pack content.
Thank You for your Basic Guidance to NS2 on Fedora 16
Krishna Valoor
http://fsdportal.blogspot.com
Hello..
ReplyDeleteCan You Help Me... (tried both NS2.34 and NS2.35 on Fedora 16)
NS & NAM are working fine...
Xgraph run-time error ..
###########################
Example.
File name: data.txt
content :
0 0
1 1
2 3
(or any valid data for testing xgraph)
Executing command :
$xgraph "data.txt"
It shows an error:
==================
Parameter LabelFont: can't translate `helvetica-10' into a font (defaulting to `fixed')
X Error: BadFont (invalid Font parameter)
Major opcode of failed request: 55 (X_CreateGC)
Aborted (core dumped)
or
Parameter TitleFont: can't translate `helvetica-18' into a font (defaulting to `fixed')
X Error: BadFont (invalid Font parameter)
Major opcode of failed request: 55 (X_CreateGC)
Aborted (core dumped)
Hi,
DeleteI have the same error.
Can you help me please!
Hii, i am getting the same error.Could you plz help me out.
Deleteplease help me, where can I find the .bash_profile?
ReplyDeletei have a trace file as output of a mobility model of manet.this trace file consist of co-ordinate of X,Y and is ns-compatible.i want to input this trace file in ns-2 and get a visual output.how can i fed my output file in ns-2? plz someone help me
ReplyDeleteSir, i have downloaded ns 2.34 allinone in fedora 8. But after ./install it works properly but at the end it says:No rule to make target VERSION,needed by gen.version/c.ns make failed.Please help me asap.It is urgent
ReplyDeleteI have install fedora 16. I want to install NS 2.35. I get the following error when I try ./install. Please anybody help me.
ReplyDelete[root@sham ns-allinone-2.35]# ./install
============================================================
* Testing for Darwin (OS X) environment
============================================================
============================================================
* Testing for Cygwin environment
============================================================
Cygwin not detected, proceeding with regular install.
============================================================
* Testing for FreeBSD environment
============================================================
FreeBSD not detected
============================================================
* Build XGraph-12.2
============================================================
configure: error: expected an absolute directory name for --prefix: ..
make all-am
make[1]: Entering directory `/home/for/ns-allinone-2.35/xgraph-12.2'
gcc -DHAVE_CONFIG_H -I. -g -MT xgraph.o -MD -MP -MF .deps/xgraph.Tpo -c -o xgraph.o xgraph.c
make[1]: gcc: Command not found
make[1]: *** [xgraph.o] Error 127
make[1]: Leaving directory `/home/for/ns-allinone-2.35/xgraph-12.2'
make: *** [all] Error 2
Can not create xgraph; But xgraph is an optional package, continuing...
============================================================
* Build CWeb
============================================================
Making cweb
gcc -g -c -o ctangle.o ctangle.c
make: gcc: Command not found
make: *** [ctangle.o] Error 127
cweb failed to make, but it's optional
chmod: cannot access `cweave': No such file or directory
chmod: cannot access `ctangle': No such file or directory
ln: failed to create symbolic link `cweave': File exists
ln: failed to create symbolic link `ctangle': File exists
============================================================
* Build Stanford GraphBase
============================================================
Making sgb
if test -r gb_io.ch; then ctangle gb_io.w gb_io.ch; else ctangle gb_io.w; fi
/bin/sh: ctangle: command not found
make: *** [gb_io.c] Error 127
Unable to create sgb library, but it's optional, so continuing...
============================================================
* Build GT-ITM
============================================================
sgb lib not found. gt-itm & sgb2ns could not be installed. Continuing..
============================================================
* Build zlib
============================================================
Checking for gcc...
Building static library libz.a version 1.2.3 with cc.
Checking for unistd.h... No.
Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()
Checking for snprintf() in stdio.h... No.
WARNING: snprintf() not found, falling back to sprintf(). zlib
can build but will be open to possible buffer-overflow security
vulnerabilities.
Checking for return value of sprintf()... No.
WARNING: apparently sprintf() does not return a value. zlib
can build but will be open to possible string-format security
vulnerabilities.
Checking for errno.h... No.
Checking for mmap support... No.
cc -O -DNO_snprintf -DHAS_sprintf_void -DNO_ERRNO_H -c -o example.o example.c
make: cc: Command not found
make: *** [example.o] Error 127
Zlib make failed, but it's optional Continue ...
=====================================================================================================================================================================================================================
hey install gcc compiler, only then installation will proceed.
Deletehow can i install gcc compiler in fedora 16
Deleteok found bash_profile already before this..it is a hidden file in Home directory..but when i try to run a tcl file for example "example.tcl" by using "ns example.tcl" I got "ns: command not found".. why is that?
ReplyDeletethat means ns is not installed.
ReplyDeletethanks for your reply..but, it only happens like that when i try to run "ns example.tcl" in 'ex' folder in tcl...but when i try to run other tcl files such as in 'test' folder in tcl, for example "ns test-all-jobs.tcl jobs-rate", it's working..is that really means that ns is not installed?
ReplyDeletedear sir,
ReplyDeletei m working on dccp for manets.......
i m not able to create a topology by giving dccp instead of tcp......
i m using ns-2.34.......please help me what should i do.......
my work is for my dissertation....
the error that is generated is
num_nodes is set 3
Configuring Nodes
INITIALIZE THE LIST xListHead
dccp1 variable created
dccp1 class set OK
Connection - 1 Establised
Connection - 2 Established
Printing the window size Completed
Everything is done
*** stack smashing detected ***: ns terminated
======= Backtrace: =========
/lib/i386-linux-gnu/libc.so.6(__fortify_fail+0x50)[0xb9a0a0]
/lib/i386-linux-gnu/libc.so.6(+0xe704a)[0xb9a04a]
ns(_ZN8CMUTrace10nam_formatEP6Packeti+0xbcf)[0x82bc1d9]
ns(_ZN8CMUTrace6formatEP6PacketPKc+0x6b)[0x82bc24f]
ns(_ZN8CMUTrace4recvEP6PacketP7Handler+0x71)[0x82bc587]
ns(_ZN5Agent4sendEP6PacketP7Handler+0x2c)[0x81d4ebe]
ns(_ZN9DCCPAgent6outputEb+0x732)[0x8236dee]
ns(_ZN9DCCPAgent7sendmsgEiPKc+0x1a3)[0x8239e95]
ns(_ZN5Agent7commandEiPKPKc+0x30b)[0x81ded1b]
ns(_ZN9DCCPAgent7commandEiPKPKc+0xad)[0x82391a1]
ns(_ZN16DCCPTCPlikeAgent7commandEiPKPKc+0x1f)[0x823f74d]
ns(_ZN8TclClass12dispatch_cmdEPvP10Tcl_InterpiPPKc+0x32)[0x83d1396]
ns[0x83d4f83]
ns(TclInvokeStringCommand+0x6e)[0x83d9a0e]
ns(TclEvalObjvInternal+0x373)[0x83db713]
ns[0x8407aba]
ns(TclCompEvalObj+0xdd)[0x840bd4d]
ns[0x8407dd3]
ns(TclCompEvalObj+0xdd)[0x840bd4d]
ns(TclObjInterpProc+0x2a7)[0x8435dc7]
ns(TclProcInterpProc+0x80)[0x8436280]
ns[0x83d5153]
ns(TclInvokeStringCommand+0x6e)[0x83d9a0e]
ns(TclEvalObjvInternal+0x373)[0x83db713]
ns[0x8407aba]
ns(TclCompEvalObj+0xdd)[0x840bd4d]
ns(TclObjInterpProc+0x2a7)[0x8435dc7]
ns(TclProcInterpProc+0x80)[0x8436280]
ns[0x83d4f83]
ns(TclInvokeStringCommand+0x6e)[0x83d9a0e]
ns(TclEvalObjvInternal+0x373)[0x83db713]
ns(Tcl_EvalEx+0x4fc)[0x83dc3ac]
ns(Tcl_Eval+0x3c)[0x83dc64c]
ns(Tcl_GlobalEval+0x36)[0x83dc6e6]
ns(_ZN3Tcl4evalEPc+0x1b)[0x83d09a3]
ns(_ZN9AtHandler6handleEP5Event+0x24)[0x81c4e1a]
ns(_ZN9Scheduler8dispatchEP5Eventd+0x94)[0x81c4dd0]
ns(_ZN9Scheduler3runEv+0x2c)[0x81c4d04]
ns(_ZN9Scheduler7commandEiPKPKc+0x6b)[0x81c4eb1]
ns(_ZN8TclClass12dispatch_cmdEPvP10Tcl_InterpiPPKc+0x32)[0x83d1396]
ns[0x83d4f83]
ns(TclInvokeStringCommand+0x6e)[0x83d9a0e]
ns(TclEvalObjvInternal+0x373)[0x83db713]
ns[0x8407aba]
ns(TclCompEvalObj+0xdd)[0x840bd4d]
ns[0x8407dd3]
ns(TclCompEvalObj+0xdd)[0x840bd4d]
ns(TclObjInterpProc+0x2a7)[0x8435dc7]
ns(TclProcInterpProc+0x80)[0x8436280]
ns[0x83d5153]
ns(TclInvokeStringCommand+0x6e)[0x83d9a0e]
ns(TclEvalObjvInternal+0x373)[0x83db713]
ns[0x8407aba]
ns(TclCompEvalObj+0xdd)[0x840bd4d]
ns(TclObjInterpProc+0x2a7)[0x8435dc7]
ns(TclProcInterpProc+0x80)[0x8436280]
ns[0x83d4f83]
the e
mintu, can u send me the code so that i will look into it. there was some problem with the CMU Trace error it seems, have u created any tracing for DCCP.
Deletesir,
Deletei m executing the example given in tcl for wireless in ns 2.34.
i had implemented the dccp patch in it.
it worked for dccp in wired networks.
but for wireless it is given error as:
num_nodes is set 2
INITIALIZE THE LIST xListHead
can't read "ns": no such variable
while executing
"$ns attach-agent $node_(0) $dccp1"
(file "wireless-mitf.tcl" line 153).
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
my code is present in tcl/ex/wireless-mitf.tcl
the modification i did is that i replaced tcp with dccp as:
set dccp1 [new Agent/DCCP/TCPlike]
$dccp1 set class_ 2
set dccpsink1 [new Agent/DCCP/TCPlike]
$ns attach-agent $node_(0) $dccp1
$ns attach-agent $node_(1) $dccpsink1
$ns connect $dccp1 $dccpsink1
set ftp [new Application/FTP]
$ftp attach-agent $dccp1
$ns at 10.0 "$ftp start"
plz help me sir.
mintu,
Deletei got the output for ur program. its working fine. contact me at tspembedded@gmail.com
Pradeep
Good morning,
ReplyDeleteCan you please tell me what is the difference between "installing" ns-2 and "compiling" it?
I am looking into using Evalvid with ns-2 so is installing ns-2 enough or I do need to compile it ( I hope you have experinced using Evalvid with ns-2 before)
Thnx in advance
sir. please reply me the correct code
ReplyDeletemintu
hello sir.....
ReplyDeletei have installed ns-2.35 on fedora 14 it was installed sucessfully.when i start ns-2 % prompt comes on terminal,when i write a small tcl script directly on terminal it is running.but when i try to run the same script by creating .tcl file it can't run. sir please reply.........
whether nam is working fine, if not go to ~ns-allinone-2.35/nam-1.xx/
ReplyDeleteand type make and see what error is coming, send me that so that i look into your problem.
Hello Sir, I am getting this error after running a file.Plz help me out of this
ReplyDeleteParameter LabelFont: can't translate `helvetica-10' into a font (defaulting to `fixed')
X Error: BadFont (invalid Font parameter)
Major opcode of failed request: 55 (X_CreateGC)
send me the code to tspembedded AT gmail dot com
Deletehello sir..can u please help me doing this..im having the same problem that is when i try to run my tcl file and its required the xgraph to appear, the output of the graph doesnt appear,and at the terminal error comeup :
ReplyDeleteParameter TitleFont : can't translate 'helvetica-18' into a font (defaulting to 'fixed')
X Error: BadFont (invalid Font Parameter)
Major opcode of failed request: 55(X_CreateGC)
pls sir..i really need to solve this problem for my final project.
hi sir,
ReplyDeletepls help me withthis error. i have the same error while run my tcl file.can u help me.
Parameter LabelFont: can't translate `helvetica-10' into a font (defaulting to `fixed')
X Error: BadFont (invalid Font parameter)
Major opcode of failed request: 55 (X_CreateGC)
can u send me your tcl file to this email tspembedded@gmail.com. I will look into the problem....
ReplyDeletehi sir,
ReplyDeleteI use ns2.34 under Centos 6.2. I work with gt-itm topology generator to create a topology
then I use the sgb2ns to convert to ns I finally execute the tcl file using the following code:
source ts1000.tcl ///////// ts1000 a file is obtained after conversion with sgb2ns
set ns [new Simulator]
set nf [open ts1000.nam w]
$ns namtrace-all $nf
create-topology nsns node 1.5Mb
$ns at 1.0 "exit 0"
$ns run
after the execution he displays the following error:
couldn't read file "ts1OOO.tcl": no such file or directory
while executing
"source.orig ts1OOO.tcl"
("uplevel" body line 1)
invoked from within
"uplevel source.orig [list $fileName]"
invoked from within
"if [$instance_ is_http_url $fileName] {
set buffer [$instance_ read_url $fileName]
uplevel eval $buffer
} else {
uplevel source.orig [list $fileName]
..."
(procedure "source" line 8)
invoked from within
"source ts1OOO.tcl"
please help me I can not forward
think you very much
the file it is searching is ts1000.tcl (in this 0000 is four zero's) and in the program it is mentioned as ts1OOO.tc(This is upper case letter o), so change it either to four zeroes or four upper case O
DeleteSir, I want ns2 code for MDPF. Anybody please post code for MDPF.
ReplyDelete