Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I successfully installed and validate ns-allinone-2.34 network simulator on ubuntu-9.10. I then tried to run simple tcl code and ended up on the following error. I couldn't move ahead from there. What should I do to make 'nam(version 1.14)' work on my ubuntu 9.10???? Thanks in advance
ns: finish: couldn't execute "nam": no such file or directory
while executing
"exec nam out.nam &"
(procedure "finish" line 7)
invoked from within
"finish"
Here is the code I tried to run (for reference):
#Create a simulator object
set ns [new Simulator]
#Define different colors for data flows (for NAM)
$ns color 1 Blue
$ns color 2 Red
#Open the NAM trace file
set nf [open out.nam w]
$ns namtrace-all $nf
#Define a 'finish' procedure
proc finish {} {
global ns nf
$ns flush-trace
#Close the NAM trace file
close $nf
#Execute NAM on the trace file
exec nam out.nam &
exit 0
}
#Create four nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
#Create links between the nodes
$ns duplex-link $n0 $n2 2Mb 10ms DropTail
$ns duplex-link $n1 $n2 2Mb 10ms DropTail
$ns duplex-link $n2 $n3 1.7Mb 20ms DropTail
#Set Queue Size of link (n2-n3) to 10
$ns queue-limit $n2 $n3 10
#Give node position (for NAM)
$ns duplex-link-op $n0 $n2 orient right-down
$ns duplex-link-op $n1 $n2 orient right-up
$ns duplex-link-op $n2 $n3 orient right
#Monitor the queue for link (n2-n3). (for NAM)
$ns duplex-link-op $n2 $n3 queuePos 0.5
#Setup a TCP connection
set tcp [new Agent/TCP]
$tcp set class_ 2
$ns attach-agent $n0 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n3 $sink
$ns connect $tcp $sink
$tcp set fid_ 1
#Setup a FTP over TCP connection
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ftp set type_ FTP
#Setup a UDP connection
set udp [new Agent/UDP]
$ns attach-agent $n1 $udp
set null [new Agent/Null]
$ns attach-agent $n3 $null
$ns connect $udp $null
$udp set fid_ 2
#Setup a CBR over UDP connection
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set type_ CBR
$cbr set packet_size_ 1000
$cbr set rate_ 1mb
$cbr set random_ false
#Schedule events for the CBR and FTP agents
$ns at 0.1 "$cbr start"
$ns at 1.0 "$ftp start"
$ns at 4.0 "$ftp stop"
$ns at 4.5 "$cbr stop"
#Detach tcp and sink agents (not really necessary)
$ns at 4.5 "$ns detach-agent $n0 $tcp ; $ns detach-agent $n3 $sink"
#Call the finish procedure after 5 seconds of simulation time
$ns at 5.0 "finish"
#Print CBR packet size and interval
puts "CBR packet size = [$cbr set packet_size_]"
puts "CBR interval = [$cbr set interval_]"
#Run the simulation
ns run
By the way I googled and got some suggestions like: adding 'nam' directory to environment. I did this as follow but it didn't work:
I added:
export PATH=$PATH:/home/elias/ns-allinone-2.34/nam-1.14
to /etc/profile (>sudo gedit /etc/profile)
Last edited by ElijahJ; 10-26-2010 at 08:02 AM.
Reason: Additional necessary information added to the end
I installed Ns-2.29 with Nist mobility Package in ubuntu 9.10.
the ./install and ./validate were successful.
But when I want to test an example (ns example1a.tcl) I got the same error like ElijahJ
ns: finish: couldn't execute "nam": no such file or directory
while executing
"exec nam out.nam &"
(procedure "finish" line 7)
invoked from within
"finish"
I tried what you said but it doesn't work !! It seems like nam is not installed or what ?
root@charifa-laptop:~/Bureau/Install2/ns-allinone-2.29/nam-1.11# make install
/usr/bin/install -c -m 555 -o bin -g bin nam /usr/local/bin
/usr/bin/install: impossible d'évaluer «nam»: Aucun fichier ou dossier de ce type
make: *** [install] Erreur 1
Hi Riaz, #5
I don't know whether you have got my invitation mail. Anyway I thing I will be able to say the
steps to install mobiwan patch in ns-2.33.
First keep the patch file in the folder ns-2.33 within ns-allinone-2.33
then go to that folder ie cd ns-allinone-2.33/ns-2.33
write the command: "patch -p1 < ns-233-mobiwan-1.patch"
write the command: ./configure
write the command: make clean
write the command: make
now when i run any tcl script it givess me an error :
[riaz@riaz new_project]$ ns packetsend.tcl
can't read "EnableHierRt_": no such variable
(Object set line 1)
invoked from within
"Simulator set EnableHierRt_"
(procedure "_o10" line 10)
(Node attach line 10)
invoked from within
"$node attach $agent"
(procedure "_o3" line 2)
(Simulator attach-agent line 2)
invoked from within
"$ns_ attach-agent $n0 $udp0"
(file "packetsend.tcl" line 18)
[riaz@riaz new_project]$
ns: finish: couldn't execute "nam-1.14": no such file or directory
I was installed ns-allinone-2.34. when i try to run tcl script i was got below error message
ns: finish: couldn't execute "nam-1.14": no such file or directory
while executing
"exec nam-1.14 out.nam &"
(procedure "finish" line 5)
invoked from within
"finish"
I was used below sample script,
set ns [new Simulator]
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam-1.14 out.nam &
exit 0
}
$ns at 5.0 "finish"
$ns run
I have nam-1.14 folder inside my ns-allinone-2.34 folder. But i'm getting this error message. Plz help me anyone
I was chanced nam-1.14 to nam. But still i'm getting the same error message
ns: finish: couldn't execute "nam": no such file or directory
while executing
"exec nam out.nam &"
(procedure "finish" line 5)
invoked from within
"finish"
Thank you very much for your reply. I was removed my ns-allinone-2.34 folder and re-installed it. Now all are working perfectly. I think previously my nam is not installed correctly. I given the path of nam wrongly in .bashrc file. Now all are good. Thanx all!!!
If i need to get the Bandwidth of a link to calculate other values, how can i get in in ns2 using olsr?
There are set of nodes in MANET and need to get the Bandwidth to calculate Connectivity Index. Can someone help me to find this. If you know how to do c++ coding for calculate Connectivity Index that will be helpful to me
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.