LinuxQuestions.org
Help answer threads with 0 replies.
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 04-29-2013, 02:57 AM   #1
syxcod
LQ Newbie
 
Registered: Apr 2013
Posts: 4

Rep: Reputation: Disabled
Unhappy The problem of running the tcl script file in the NS2.31+crcn environment


After installing the NS2.31 and the crcn patch, I tried to run the script file in the fold crcn.
When I typed the command
ns test4maccon.tcl
a error appeared:

num_nodes is set 6

(_o3 cmd line 1)
invoked from within
"_o3 cmd add-channel 0 _o13"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o3" line 2)
(SplitObject unknown line 2)
invoked from within
"$ns_ add-channel $i $chan_($i)"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $val(channum) } {incr i} {
$ns_ add-channel $i $chan_($i)
}"
(file "test4maccon.tcl" line 43)
I have no idea how to solve this problem.
Anyone knows?
Regards.
 
Old 04-30-2013, 04:24 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

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

A corrupt ns ? A failed build ? Or an 'ns' with no CRCN ?
I.e. you could be using a wrong 'ns' executable.
It's a good idea to do the following right after the build :
$ cd ns-allinone-2.31/ns-2.31/ && cp ns ns-crcn
... Then all commands can be : $ ns-crcn <file>.tcl

The ns-CRCN binary package : crcn-ns-2.31-ubuntu10_i386.deb
https://docs.google.com/file/d/0B7S2...it?usp=sharing
.. Providing /usr/local/bin/ns-crcn

crcn-examples-032013.tar.bz2 :
https://docs.google.com/file/d/0B7S2...it?usp=sharing

All LQ crcn http://www.linuxquestions.org/questions/tags/crcn/

-

Last edited by knudfl; 04-30-2013 at 04:27 AM.
 
1 members found this post helpful.
Old 10-01-2013, 07:23 AM   #3
fattabiouni
LQ Newbie
 
Registered: Sep 2013
Posts: 23

Rep: Reputation: Disabled
is the tcl script that we need to use to adjust the power level involves in crcn?
how?

thank you in advance
 
Old 10-26-2013, 07:33 AM   #4
fattabiouni
LQ Newbie
 
Registered: Sep 2013
Posts: 23

Rep: Reputation: Disabled
how to adjust the cognitive radio CR power level in tcl script to find the optimal power level?

thank you in advance
 
Old 11-23-2015, 11:47 AM   #5
marwa88
Member
 
Registered: Nov 2015
Posts: 56

Rep: Reputation: Disabled
Hi,

i use fedora12 and when i try to run tcl files in the crcn folder, i had this same error of syxcod.

The solution provided here is for ubuntu
Quote:
The ns-CRCN binary package : crcn-ns-2.31-ubuntu10_i386.deb
https://docs.google.com/file/d/0B7S2...it?usp=sharing
.. Providing /usr/local/bin/ns-crcn
There is any other solution for fedora12 please?
Thank you
 
Old 11-23-2015, 03:13 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #5.

The errors in {post #1, @syxcod} are caused by using an executable 'ns' with no CRCN.

See http://www.linuxquestions.org/questi...-4175502417/#2
$ cd ns-2.31/
$ cp ns ns231-crcn
# make install
# cp ns231-crcn /usr/local/bin/

And then run all the simulations from the crcn-examples_06.2015/ folder.
( crcn-examples_06.2015/ can have any location.)
crcn-examples_06.2015.tar.gz https://drive.google.com/file/d/0B7S...ew?usp=sharing

Example simulation : $ ns231-crcn 0-test4maccon.tcl
The examples were modified to create trace files with different names.
To prevent that you get a "test.tr" file from all the examples :
0-test4maccon.tcl will create 0test.tr .... 5-test4wcett.tcl will create 5test.tr ...


If you have a failed build, simply start from scratch in a new folder, in /home/name/ns2/*


-

Last edited by knudfl; 11-23-2015 at 03:22 PM.
 
Old 11-23-2015, 03:56 PM   #7
marwa88
Member
 
Registered: Nov 2015
Posts: 56

Rep: Reputation: Disabled
Hi,
Thank you for responding me,

when i installed the crcn patch i did not copy it in the ns-2.31 folder as decribed above.
I replaced the existing files in ns-2.31 by the new files of the crcn patch for example (i replaced the existing aodv folder contents with the new one i copied from crcn. and i Leaved the rest of the files unmodified.)

my question is, i want to use your method described above, i must use new ns (not mofified), or my ns that i replaced its files?

thank you in advance.
 
Old 11-23-2015, 04:09 PM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #7.

Start from scratch means :
Create a new folder in /home/name/ns2/ ,,, ( Do not use the Desktop )
and : $ tar xvf ns-allinone-2.31.tar.gz

I.e. do not reuse, if changes like yours are failing.


-
 
Old 11-23-2015, 06:09 PM   #9
marwa88
Member
 
Registered: Nov 2015
Posts: 56

Rep: Reputation: Disabled
please tell me what you mean by ns in this instruction, wich ns exactly that i must copy it in the ns231-crcn folder?

cp ns ns231-crcn

sorry for all those questions.

Last edited by marwa88; 11-23-2015 at 06:13 PM.
 
Old 11-23-2015, 06:41 PM   #10
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #9.

There is no ns231-crcn/ folder, and please do not make one.

$ cd ns-2.31/ && cp ns ns231-crcn
... Means that you get a copy of the executable 'ns' by name 'ns231-crcn' !

And that new executable is to be copied to /usr/local/bin/ :
# cp ns231-crcn /usr/local/bin/

... To make it possible doing $ ns231-crcn 0-test4maccon.tcl
... This way you are absolutely sure you are using the right executable.

And the simulation will succeed. Unless you have a failed build.
The safe way of building http://www.linuxquestions.org/questi...-4175502417/#2
Or use the patch crcn_ns231.patch, instead of "crcn-ns2.31.tar.gz".

... The prerequisites must of course be installed, before a build is started :
# yum install gcc-c++ compat-gcc-34-c++ autoconf automake make patch libtool libXmu-devel


-

Last edited by knudfl; 11-23-2015 at 06:52 PM.
 
Old 11-23-2015, 07:07 PM   #11
marwa88
Member
 
Registered: Nov 2015
Posts: 56

Rep: Reputation: Disabled
Please one last question,
in ubuntu i succeed to install this patch but i did not succed to do it in fedora.
When i installed it in ubuntu i did this step:
Quote:
Extract CRCN.zip and you will see several files inside that. You have to copy each file in that and replace the corresponding files in ns2.31 folder.

Let me explain this in more detail.

If you have a folder named AODV in crcn. Copy all its contents and paste it in /home/micman/ns-allinone-2.31/ns-2.31/aodv folder.

Here micman is my username, replace it with your username.
You would be replacing the existing aodv folder contents with the new one you copied from crcn. Leave rest of the files unmodified.

Similarly, you will have folders named common,mac, mobile and so on. Repeat Step2 for all these folders.
I do this step in fedora or i skip it?
 
Old 11-23-2015, 09:54 PM   #12
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #11.

`crcn.zip' : That's the year 2008 files. Not required.
Were replaced by crcn-ns2.31.tar.gz, and later by crcn_ns231.patch ... for easier use.

Be aware that most "ns2 tutorials" are made by young students using a Linux OS and ns2 for the first time. And not all will know how to create a patch. And a patch is actually an important document, because only the patch will show the exact changes made to the files.


-
 
Old 11-24-2015, 08:04 AM   #13
marwa88
Member
 
Registered: Nov 2015
Posts: 56

Rep: Reputation: Disabled
yes i will use crcn_ns231.patch and if i understand those are steps to instal the patch.
Quote:
$ tar xvf ns-allinone-2.31.tar.gz
$ cd ns-allinone-2.31/
$ tar xvf crcn-ns2.31.tar.gz
$ export CC=gcc34 CXX=g++34 && ./install
$ cd ns-2.31/
cp ns ns231-crcn
# make install
cp ns231-crcn /usr/local/bin/
But before doing those steps i must copy each file in that patch and replace the corresponding files in ns2.31 folder or i start directly doing steps above?
Thank you.
 
Old 11-24-2015, 09:24 AM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #13.
Quote:
I will use crcn_ns231.patch
Using the patch is different than your ``quote`` : $ patch -p0 < crcn_ns231.patch

No copying no files nowhere ... unless you are looking for troubles.

I.e. nothing but this ...
$ tar xvf ns-allinone-2.31.tar.gz
$ cd ns-allinone-2.31/
$ patch -p0 < crcn_ns231.patch
$ export CC=gcc34 CXX=g++34 && ./install
$ cd ns-2.31/
cp ns ns231-crcn
# make install
cp ns231-crcn /usr/local/bin/

-
 
Old 11-24-2015, 10:14 AM   #15
marwa88
Member
 
Registered: Nov 2015
Posts: 56

Rep: Reputation: Disabled
Ah ok, thank you so much i feel that is more clear for me now.

That mean i need only to put this patch in the ns-allinone-2.31 folder.

Kindly give me the link of crcn_ns231.patch

Because this is the link that you gave me above: http://www.linuxquestions.org/questi...-4175502417/#2

is for

crcn-ns2.31.tar.gz: https://drive.google.com/file/d/0B7S...cn_ns231.patch.

i did research in this forum and i find this link of crcn_ns231.patch:

https://drive.google.com/file/d/0B7S...lpN3VTbUE/view

it was used for ubuntu so only i want to verify if i can use it also for fedora?

sorry again and thank you so much .
 
  


Reply

Tags
crcn, 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 with running tcl script under ns 2.33 manjunath11 Linux - Newbie 56 02-11-2014 08:26 AM
CRCN ns2 add channel GUI nam throughput problem Khaled ELmishad Linux - Software 37 12-05-2013 02:23 AM
NS2.33+ mobiwan : error "Segmentation Defaul" when running a tcl script yotta15 Linux - Newbie 1 06-29-2012 04:09 AM
crcn ns2 add channel GUI nam throughput problem Khaled ELmishad Programming 1 05-12-2012 08:37 AM
problem in displaying throughput in crcn patch in ns2 humairaafzal73 Linux - Software 0 02-07-2012 04:37 AM

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

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

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