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 |
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.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
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.
|
|
10-26-2010, 07:54 AM
|
#1
|
LQ Newbie
Registered: Oct 2010
Posts: 1
Rep:
|
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
|
|
|
11-19-2010, 01:26 AM
|
#2
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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 ).
..
|
|
|
04-10-2012, 05:32 AM
|
#3
|
LQ Newbie
Registered: Mar 2012
Posts: 15
Rep:
|
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,
|
|
|
04-10-2012, 05:57 AM
|
#4
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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.
.
|
|
|
04-19-2012, 12:44 PM
|
#5
|
Member
Registered: Apr 2012
Posts: 42
Rep:
|
thanks, nam is working now and xgraph as well.
Now tell me how to patch mobiwan with ns-2.33.
|
|
|
04-20-2012, 01:28 AM
|
#6
|
Member
Registered: Mar 2012
Location: Kolkata
Distribution: CentOS
Posts: 38
Rep:
|
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.
|
|
|
04-22-2012, 02:49 AM
|
#7
|
Member
Registered: Apr 2012
Posts: 42
Rep:
|
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
|
|
|
05-20-2014, 04:08 AM
|
#8
|
LQ Newbie
Registered: May 2014
Posts: 4
Rep:
|
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
|
|
|
05-20-2014, 06:30 AM
|
#9
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
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'.
-
|
|
|
05-21-2014, 12:24 AM
|
#10
|
LQ Newbie
Registered: May 2014
Posts: 4
Rep:
|
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"
|
|
|
05-21-2014, 03:15 AM
|
#11
|
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
|
# 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
-
|
|
|
05-21-2014, 09:44 AM
|
#12
|
LQ Newbie
Registered: May 2014
Posts: 4
Rep:
|
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!!!
|
|
|
06-02-2014, 07:32 AM
|
#13
|
LQ Newbie
Registered: May 2014
Posts: 4
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 11:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|