LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 02-23-2010, 02:11 PM   #1
wa1961
LQ Newbie
 
Registered: Feb 2010
Posts: 3
Blog Entries: 1

Rep: Reputation: 0
graph ns2


Hi all.
I'm just installed ns 2.31 in my cumputer:fedora 12 (this is the first time working with ns2 and fedora) but I don't know commands to run an example of tcl script and show the graph in my screen. plz help me.
 
Old 02-23-2010, 03:39 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
Welcome LQ.

I assume that you have run ./validate with few or no errors.
And you can check nam : 1) cd nam-<version>/ , 2) ./nam
.. to see the nam GUI open.
http://www.linuxquestions.org/questi...lem-726993/#12

The command to run an example : ns2 example-Xx.tcl
Some example files will open nam at once and show the simulation.
Other examples will create a file : nam.out , which can be run
with : nam nam.out

ns 2 info : LQ Search → TagName = ns2
http://www.linuxquestions.org/questions/search.php
http://www.linuxquestions.org/questi...2&pp=50&page=2

Examples and tutorial ..
http://www.linuxquestions.org/questi.../ns2-781274/#2
.....
P.S. : ns-2.34 is the latest version.
.....
 
Old 02-23-2010, 05:04 PM   #3
wa1961
LQ Newbie
 
Registered: Feb 2010
Posts: 3
Blog Entries: 1

Original Poster
Rep: Reputation: 0
Thanks very much for ur help,
But while I run ./nam it doesn't show the GUI:

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

what is this error?

Last edited by wa1961; 02-23-2010 at 05:06 PM.
 
Old 02-23-2010, 05:20 PM   #4
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
Quote:
Originally Posted by wa1961 View Post
Thanks very much for ur help,
But while I run ./nam it doesn't show the GUI:

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

what is this error?
type nam that's enough, nam GUI will be opened.
if you want to run nam <filename>.out
 
0 members found this post helpful.
Old 02-24-2010, 12:26 AM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
The error : " [code omitted because of length] ,etc. "
EDIT :
http://www.linuxquestions.org/questi...31-a-801695/#3
...............About the patch 'tk-8.4-lastevent.patch'


After the ns2, nam build : Test both in all different
ways, you can think of. They are supposed to be statically
build, i.e. only using the ns2 "tcl, tk version 8.4.14".

So reinstalling the system tcl ( tk ) version 8.5.7
after the tests should usually do no harm.
.....

Last edited by knudfl; 04-19-2010 at 01:42 AM.
 
1 members found this post helpful.
Old 02-24-2010, 03:30 AM   #6
Mwandha
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
to run tcl scripts, you can use the command ns...for example if you do have example.tcl you can run it as:
#ns example.tcl
to run nam scripts, you can also run them as:
#nam example.nam

but incase your nam is connected to your tcl script it is better to call it from within your tcl script such as:

exec nam example.nam & so as not to run two scripts. here you will only need to run the tcl scripts and if it does run properly the nam with its GUI will appear at the end so as you test out your example.

regards

NB: i too am a newbie but thanks to the forums you learn alot
 
1 members found this post helpful.
Old 02-24-2010, 03:39 AM   #7
Mwandha
LQ Newbie
 
Registered: Feb 2010
Posts: 4

Rep: Reputation: 0
In case you are installing just package by package, i would advice for you to download ns-allinone 2.33 or depending on the version you want it comes with all the packages you need of ns, nam, tcl, tk this also helps you avoid such errors.
 
1 members found this post helpful.
Old 02-26-2010, 07:33 AM   #8
wa1961
LQ Newbie
 
Registered: Feb 2010
Posts: 3
Blog Entries: 1

Original Poster
Rep: Reputation: 0
ns2 and nam

Hi all.
I have reinstalled ns2 and it shows me % when I tape ns in the shell.
But I have got the same the problem with the graphic mode. I have tried many times to show an example of simulation but nothing appear.
when I tape nam I always got this msg:

nam:
[code omitted because of length]
: no event type or button # or keysym
while executing
"bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D / 120) * 4}] units
}"
invoked from within
"if {[tk windowingsystem] eq "classic" || [tk windowingsystem] eq "aqua"} {
bind Listbox <MouseWheel> {
%W yview scroll [expr {- (%D)}] units
}
bind Li..."

Plz help because I need to show an example of simulation to begin working.
Is it necessary to patch ns2?
Thanks and regards.

Last edited by wa1961; 02-26-2010 at 07:38 AM.
 
Old 02-27-2010, 04:29 AM   #9
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
Yes, that is odd, nam-1.13 ( or 1.14 ) will not create
a working executable on Fedora 12.
No problems with nam on any other modern Linux.
EDIT : See post # 10.

I just made a test compile of nam-1.14 , no ./install
of the complete ns-allinone-2.34 . ( Is known to work
perfect on Fedora 11.)

Nam is a separate application, any version will do.
Click my name, send an email, and I will attach a
static 'nam' (version 1.14), that works on Fedora 12,
to a return mail. ( filesize = 948 kB ).

Suggest : 1) copy the new nam to /usr/local/bin/
Then it is in your path, and the command nam works.

2) And delete the corrupt nam-1.13/nam
.....

P.S. : I guess, the best ns2 version for Fedora 12 is ns-allinone-2.34 .
Fedora 11 : proplems with version 2.33 . But 2.34 works perfect.
.....

Last edited by knudfl; 08-16-2010 at 01:03 PM.
 
Old 03-20-2010, 08:37 AM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
About the 'nam' issues ..
http://www.linuxquestions.org/questi...king-793115/#9
cd tk8.4.18/
patch -p0 < tk-8.4-lastevent.patch
http://bugs.gentoo.org/attachment.cgi?id=161242
http://bugs.gentoo.org/show_bug.cgi?id=225999
.....
 
Old 03-21-2012, 03:48 PM   #11
TSE_2011
LQ Newbie
 
Registered: Mar 2012
Posts: 10

Rep: Reputation: Disabled
Unhappy

hi Freinds
i install ns-2.34 & leach Protocol in ns2.
i want see out graph leach but i'v this message after enter instruction ns leach.tcl:
couldn't read file "mit/uAMPS/ns-leach.tcl": no such file or directory
while executing
"source.orig mit/uAMPS/ns-leach.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 mit/uAMPS/ns-leach.tcl"
(file "leach.tcl" line 7)
plz help;
 
Old 04-06-2012, 01:34 AM   #12
hmd_jfr
LQ Newbie
 
Registered: Apr 2012
Location: zanjan - iran
Distribution: fedora - ubunto
Posts: 6

Rep: Reputation: Disabled
hi! for run ns2 tcl file >>> go to tcl path and
ns tclfilename.tcl
for run Xgraph >>> write run command in TCL file
if dont run Xgraph plz send me email(hmd_jfr@yahoo.com)
 
Old 04-06-2012, 02:37 AM   #13
TSE_2011
LQ Newbie
 
Registered: Mar 2012
Posts: 10

Rep: Reputation: Disabled
Question

when me execute leacltcl.tcl i'v This Message:
Usage: myleach.tcl
mandatory arguments:
[-x MAXX] [-y MAXY]
optional arguments:
[-cp conn pattern] [-sc scenario] [-nn nodes]
[-seed seed] [-stop sec] [-tr tracefile]


???
 
Old 07-02-2013, 07:58 AM   #14
Farshid
LQ Newbie
 
Registered: Jul 2013
Posts: 4

Rep: Reputation: Disabled
xgraph font error

hi friend
when i run xgraph
get me this 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)"

how can fix it?
 
Old 07-02-2013, 09:28 AM   #15
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2014.08, Slack14.1 DebWheezy, +50+ other Linux OS, for test only.
Posts: 13,923

Rep: Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587Reputation: 2587
Post # 14, @Farshid : Welcome to LQ.

Is that when you run a command ( $ xgraph file ? )
or is it when you are closing xgraph ?

Which version of Ubuntu are you using ? ?
1) $ cat /etc/issue <Enter>
2) $ uname -m <Enter>

-
 
  


Reply

Tags
nam, network simulator 2, ns 2, ns-2, 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
Differences between LEACH results on ns2.1b5 and ns2.35 deepa_2111 Linux - Software 15 05-16-2013 05:53 PM
NS2: Require eap-sim authentication code for simulation in ns2.24 noamankhatib Linux - Software 0 04-29-2013 12:03 PM
Finding for Nam graph in NS2 Madhu S H Linux - Software 1 01-17-2012 04:16 AM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM


All times are GMT -5. The time now is 08:10 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration