LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   The problem of running the tcl script file in the NS2.31+crcn environment (https://www.linuxquestions.org/questions/linux-software-2/the-problem-of-running-the-tcl-script-file-in-the-ns2-31-crcn-environment-4175459959/)

syxcod 04-29-2013 02:57 AM

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.

knudfl 04-30-2013 04:24 AM

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/

-

fattabiouni 10-01-2013 07:23 AM

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

thank you in advance

fattabiouni 10-26-2013 07:33 AM

how to adjust the cognitive radio CR power level in tcl script to find the optimal power level?

thank you in advance

marwa88 11-23-2015 11:47 AM

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

knudfl 11-23-2015 03:13 PM

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/*


-

marwa88 11-23-2015 03:56 PM

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.

knudfl 11-23-2015 04:09 PM

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.


-

marwa88 11-23-2015 06:09 PM

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.

knudfl 11-23-2015 06:41 PM

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


-

marwa88 11-23-2015 07:07 PM

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?

knudfl 11-23-2015 09:54 PM

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.


-

marwa88 11-24-2015 08:04 AM

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.

knudfl 11-24-2015 09:24 AM

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/

-

marwa88 11-24-2015 10:14 AM

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 .


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