[SOLVED] The problem of running the tcl script file in the NS2.31+crcn environment
Linux - SoftwareThis 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.
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.
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.
Distribution: PCLinuxOS2023 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,486
Rep:
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
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/*
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?
... 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
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.
Distribution: PCLinuxOS2023 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,486
Rep:
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.
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.
Distribution: PCLinuxOS2023 CentOS7.9 + 50+ other Linux OS, for test only.
Posts: 17,486
Rep:
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/
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.