LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 10-26-2010, 07:54 AM   #1
ElijahJ
LQ Newbie
 
Registered: Oct 2010
Posts: 1

Rep: Reputation: 0
ns-2.34 problem executing 'nam' on ubuntu 9.10


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
 
Old 11-19-2010, 01:26 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Welcome to LQ.

The most easy way to have a 'nam' in your path is :
cd ns-allinone-2.34/nam-1.14/
sudo make install

Which will do one thing: Copying the executable nam to /usr/local/bin/.
.. Then you have it in a system path.

( The same is valid for ns-allinone-2.34/ns-2.34/ ,
to get /usr/local/bin/ns ).
..
 
Old 04-10-2012, 05:32 AM   #3
yotta15
LQ Newbie
 
Registered: Mar 2012
Posts: 15

Rep: Reputation: Disabled
Error when executing a tcl file in ns-2.29

Hello knudfl ,

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

Can you help me plz ,
thanks a lot,
 
Old 04-10-2012, 05:57 AM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Nam is a separate application : Any nam can be used.
The best version is 1.14 : Please see post #4 here ...
http://www.linuxquestions.org/questi...04-a-842109/#4

Unpack nam-1.14.<arch>.tar.gz, and copy 'nam' to /usr/local/bin/
... Then you have nam in a system PATH.

.
 
Old 04-19-2012, 12:44 PM   #5
Riaz Khan
Member
 
Registered: Apr 2012
Posts: 42
Blog Entries: 2

Rep: Reputation: Disabled
thanks, nam is working now and xgraph as well.
Now tell me how to patch mobiwan with ns-2.33.
 
Old 04-20-2012, 01:28 AM   #6
masju
Member
 
Registered: Mar 2012
Location: Kolkata
Distribution: CentOS
Posts: 38

Rep: Reputation: Disabled
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

that's all
then run the simple tcl script.
 
Old 04-22-2012, 02:49 AM   #7
Riaz Khan
Member
 
Registered: Apr 2012
Posts: 42
Blog Entries: 2

Rep: Reputation: Disabled
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]$


please tell me how to resolve this problem
 
Old 05-20-2014, 04:08 AM   #8
shama123
LQ Newbie
 
Registered: May 2014
Posts: 4
Blog Entries: 3

Rep: Reputation: Disabled
Unhappy 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
 
Old 05-20-2014, 06:30 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Post #8, @shama123 : Welcome to LQ.
Quote:
exec nam-1.14 out.nam &
exit 0
Looks like a home made tcl script.

Just edit "exec nam-1.14 out.nam &" to :
exec nam out.nam &

... and the unknown tcl script may work : If you have a usable 'nam'.

-
 
Old 05-21-2014, 12:24 AM   #10
shama123
LQ Newbie
 
Registered: May 2014
Posts: 4
Blog Entries: 3

Rep: Reputation: Disabled
Unhappy Thank you about your reply

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"
 
Old 05-21-2014, 03:15 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
# 10 .

OK. No nam.

There are nam packages for Fedora. Which Fedora ?
Please show the outputs from these commands :
a) uname -m
b) cat /etc/redhat-release

-
 
Old 05-21-2014, 09:44 AM   #12
shama123
LQ Newbie
 
Registered: May 2014
Posts: 4
Blog Entries: 3

Rep: Reputation: Disabled
Thumbs up My nam is now working

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!!!
 
Old 06-02-2014, 07:32 AM   #13
shama123
LQ Newbie
 
Registered: May 2014
Posts: 4
Blog Entries: 3

Rep: Reputation: Disabled
Smile Get the Bandwidth of a link in olsr

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
 
  


Reply

Tags
nam, nam-bin, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running nam-1.11 of ns-allinone-2.29 rishabhk Linux - Newbie 5 03-17-2011 05:31 AM
[SOLVED] problem regarding executing c program in ubuntu gerry_bertier Linux - Newbie 6 10-15-2010 07:44 AM
Problem with nam in ns-2.34 dreams2010 Linux - Software 5 09-26-2010 06:49 AM
problem in running NAM marioma Linux - Networking 4 06-01-2010 07:20 PM
I am getting problem in nam-1.11 while installing ns-allinone-2.29 on fedora core 5 deodutta Linux - General 0 02-03-2007 10:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:41 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration