Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
My research is regarding the cognitive radio network, in my project I need to model the Primary User activity so I tried to use the CRAHN simulator which has been published on "https://github.com/abdulla-alali".
I installed the ns and patched it without any problems, but when I tried to execute the crahn_examples I got the following error "invalid command name "PUMap" see the attached images.
It seems like there is a problem with the definition of one of the tcl classes.
May i ask your help/advice, cause i stuck in this.
How to get CRAHN ( Use a new folder, git doesn't write into TFRC-CR/ ? )
Ref. http://krc.coe.neu.edu/?q=node/16
$ git clone git://github.com/abdulla-alali/TFRC-CR.git -b CRAHN
Now with `CRAHN´ : TFRC-CR/ alias TFRC-CRAHN : 55 folders and 31 files :
* The folder cognitive/, and a new Makefile.in with the 8 times cognitive/*.o
* And the file README.md, that tells how to get CRAHN !
Quote : 1. Get ns-allinone-2.31.tar.gz and extract it
2. Install git, e.g. in Debian: ```sudo apt-get install git```
3. Clone this repository:
```git clone git://github.com/abdulla-alali/TFRC-CR.git -b CRAHN```
4. You'll end up with a ns-2.31 clone that has the CRAHN module integrated.
Replace the ns-2.31 subfolder (from the ns-allinone file that you already extracted)
with the one you cloned from here.
5. ```./configure``` and then ```make```
----
$ ns-crahn test-3nodes.tcl : OK.
$ ns-crahn test-random-topology.tcl : OK.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
Rep:
There are some missing files in the "TFRC-CRAHN" you get with ..
$ git clone git://github.com/abdulla-alali/TFRC-CR.git -b CRAHN
( The diffusion3/ns/ folder, etc.)
Just to be assured,
$ tar xvf ns-allinone-2.31.tar.gz
$ cd ns-allinone-2.31/
$ patch -p0 < TFRC-CRAHN_ns231.patch (the patch created by you and available on "https://drive.google.com/file/d/0B7S...it?usp=sharing")
$ ./install
$ cd ns-2.31/
$ ./configure
$ make clean
$ make depend
$ make
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
Rep:
# 4 .
Like post #3 :
$ tar xvf ns-allinone-2.31.tar.gz
$ cd ns-allinone-2.31/
$ patch -p0 < TFRC-CRAHN_ns231.patch
$ ./install
... I.e. the build command "install" will do all
the "configure && make" commands automatically.
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
Rep:
# 6 .
Well, you must go to the directory with the simulation files.
$ cd CRAHN_examples/cr_examples/3nodes/
$ ./ns-coh test-3nodes.tcl
The README in CRAHN_examples/cr_examples/3nodes/
isn't very clearly written. The text means → →
First line ..
Launch in this directory ( Else no dependencies={channel.txt, map.txt}.)
Next line :
<full-path-to-folder-with-ns>/ns test-3nodes.tcl
( Like $ /home/retta/bin/ns test-3nodes.tcl )
Other possible reasons for simulation(s) to fail :
Using the wrong OS / the wrong compiler.
So you will have to specify your OS :
a) Please show the output from the command $ uname -m
b) OS version : $ cat /etc/redhat-release
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,519
Rep:
CentOS 5.10 - x86_64 + TFRC-CRAHN
#8, #6.
Testing CentOS 5.10 - x86_64 + TFRC-CRAHN ...
No `Segmentation fault´ with the two files test*.tcl,
by using four different 'ns23*-crahn64-gcc<?>' executable´s :
1. ns-allinonne-2.33, TFRC-CRAHN_ns233.patch, gcc34 / g++34.
2. ns-allinonne-2.31, TFRC-CRAHN_ns231.patch, gcc34 / g++34.
3. ns-allinonne-2.31, TFRC-CRAHN_ns231.patch, gcc-4.1.2 / g++-4.1.2.
4. ns-allinonne-2.33, TFRC-CRAHN_ns233.patch, gcc-4.1.2 / g++-4.1.2.
.... ( gcc-4.1.2 / g++-4.1.2 are the default CentOS5 compilers gcc, g++,
and gcc34 / g++34 are the extra compilers "compat-gcc-34-c++".)
? Did you add any other code / patch /// any changes at all to ns-2.31 ?
I've read the file USAGE and the test-random-topology.tcl script, finally i got it.
To execute the script correctly i must set the number of connections (how many pairs of nodes is going to communicate),
rate in kbs (the transmission rate/bandwidth of the wireless channels), and the seed (introduce a randomness to NS2).
For ex:
$ ./ns-crahn test-random-topology.tcl 10 128 2
then i got:
$ ./ns-crahn test-random-topology.tcl : OK.
***My file is OK with $ test-random-topology.tcl
.. but I get errors like you when adding <options>.
just delete line #53 and uncomment line 52, it should work now with the options.
Actually i can't understand how you executed it without options!!!
I would like to thank you again knudfl for all the support/advice/help you gave to me.
Many many thanks.
...
3. Clone this repository:
```git clone git://github.com/abdulla-alali/TFRC-CR.git -b CRAHN```
4. You'll end up with a ns-2.31 clone that has the CRAHN module integrated.
I ran the command as given above but cannot see any CRAHN folder or a different ns-2.31 folder.
Only I could see some 55 folders inside the TFRC-CR folder which I downloaded.
Please help how to proceed with the installation of CRAHN integrated with NS2.31
Now trying to tun the examples (going inside the examples folder) -
$ ns test-random-topology.tcl 10 128 2
The Error is -
num_nodes is set 50
invalid command name "PUMap"
while executing
"PUMap create _o12 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg] {
delete $o
return ""
}
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new PUMap"
invoked from within
"set pumap [new PUMap]"
(file "test-random-topology.tcl" line 86)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.