LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   ns2 (https://www.linuxquestions.org/questions/linux-software-2/ns2-4175492373/)

daidrohit 01-24-2014 12:27 AM

ns2
 
m new to ns2
m working with LEACH protocol and m finding errors while executing leach_test file





couldn't read file "tcl/mobility/leach-c.tcl": no such file or directory
while executing
"source.orig tcl/mobility/leach-c.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 tcl/mobility/$opt(rp).tcl"
(file "tcl/ex/wireless.tcl" line 186)



can anyone help me please........
plz reply if anyone find any solution to thi error

knudfl 01-24-2014 03:25 AM

How to use the "leach_test" file, example :

1) $ cd ns-allinone-2.xx/ns-2.xx/

2) $ export RCA_LIBRARY=/home/<name>/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/<name>/ns-allinone-2.34/ns-2.34/mit/uAMPS && ./test

** The files `test' and `leach_test' are text files. Please read them.
*** "test" is a 5 line script, that will run the "leach_test".

Leach info http://www.linuxquestions.org/questions/tags/leach/
And http://www.linuxquestions.org/questions/tags/pegasis/

-

daidrohit 01-24-2014 04:54 AM

ns2
 
thanks sir for ur reply...very much but again the same error is coming....
is there any other alternative....

knudfl 01-24-2014 06:44 AM

# 3 .
Quote:

but again the same error is coming
Which command are you using ? ?

daidrohit 01-27-2014 12:14 AM

ns2
 
i am using command ./leach_test

knudfl 01-27-2014 07:34 AM

# 5 .

.. Then instead please use the command suggested in post #2 :
$ export RCA_LIBRARY=/home/<name>/ns-allinone-2.34/ns-2.34/mit/rca && export uAMPS_LIBRARY=/home/<name>/ns-allinone-2.34/ns-2.34/mit/uAMPS && ./test

If you want to run least_test as a standalone command,
you will need a very complex setup, for all the connected files to be found.

? And why run leach_test alone, when `test' can run leach_test so clever ? ?

-

daidrohit 01-30-2014 11:18 PM

ns2
 
thanks very much for the reply......... its somewhat working
but when after runnig test file on teminal i got half of the output file and i dont get anytype of data in leach.energy, leach.data, leach.ch..
these files are totally blank....


i got error in LEACH.err file and error is INITIALIZE THE LIST xListHead



please help .........waiting for your reply.............

daidrohit 02-02-2014 02:06 AM

ns2
 
plz plz reply for the above post

daidrohit 02-03-2014 11:18 PM

ns2
 
I got error in LEACH.err file and error is
INITIALIZE THE LIST xListHead

what does it mean can anyone tell me please?????????????????

knudfl 02-04-2014 03:16 AM

# 7 :
Then please read the leach posts http://www.linuxquestions.org/questions/tags/leach/

# 9 : Doesn't look like an error.
Most simulations will start with "INITIALIZE THE LIST xListHead"


How to avoid errors : Use the proof patch = exidus-pegasis-leach-ns234.patch.2.tar.gz
All leach-pegasis http://www.linuxquestions.org/questions/tags/pegasis/
Install example, post #24 here
http://www.linuxquestions.org/questi...656/page2.html

-

daidrohit 02-05-2014 04:38 AM

ns2
 
thak u very much sir for ur reply...........


but sir i got half of the output in leach.err and i am not getting any thing in leach.energy,leach.alive and leach.data...file
they all are empty....



plz plz plz reply soon...m waiting for ur reply

knudfl 02-05-2014 07:12 AM

# 11 .

Well, then start from scratch, and use `exidus-pegasis-leach-ns234-patch.2.tar.gz'
https://docs.google.com/file/d/0B7S2...it?usp=sharing

1) tar xvf ns-allinone-2.34.tar.gz
2) cd ns-allinone-2.34/
3) tar xvf exidus-pegasis-leach-ns234.patch.2.tar.gz
4) export CC=gcc41 CXX=g++41
5) ./install
6) cd ns-2.34/ && sudo make install

-

daidrohit 02-05-2014 11:40 PM

ns2
 
sir m using ns-2.27
is the procesure is same for ns-2.27
????

daidrohit 02-06-2014 03:31 AM

ns2
 
sir i am getting error in terminal in test file: ns command not found

in 3 line of test file

#!/bin/bash
cd tcl/ex
ns wireless-demo-csci694.tcl
sleep 2

cd ../../
./leach_test


plz help...

knudfl 02-06-2014 07:28 AM

# 13 .
You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. But do not add any *PATH test to .bashrc.


# 14 .
Quote:

ns command not found
? Did you forget to do $ cd ns-2.34/ && sudo make install
... And please check that ns is present as /usr/local/bin/ns
... also : delete any ns2 *PATH text added to .bashrc . Never required !

-

daidrohit 02-07-2014 12:39 AM

ns2
 
thanku sir...

but i am new to ns2 and linux so plz can u elaborate the above post.....

i am not getting your point sir....

knudfl 02-07-2014 11:46 AM

Post # 16 .

Please tell what it is you don't understand.

daidrohit 02-10-2014 11:15 PM

ns2
 
sir

i amnot getting about this point

please check that ns is present as /usr/local/bin/ns
... also : delete any ns2 *PATH text added to .bashrc . Never required !

knudfl 02-11-2014 05:52 AM

# 18 .

Installing the executable 'ns' to /usr/local/bin/ :
a) $ cd ns-allinone-2.xx/ns-2.xx/
b) $ sudo make install


The executable 'ns' is hard coded to know the location of it's libraries etc.
.. Meaning that nothing is to be added to .bashrc !

-

daidrohit 02-18-2014 12:37 AM

ns2
 
thanks for ur reply sir,

by doing those steps as per your guidance i am getting error in leach.err file




application-specific initialization failed: Can't find a usable init.tcl in the following directories:
/home/dilip/ns/ns-allinone-2.27/lib/tcl8.4 /usr/local/lib/tcl8.4 /usr/lib/tcl8.4 /usr/local/library /usr/library /usr/tcl8.4.18/library /tcl8.4.18/library /home/dilip/ns/ns-allinone-2.27/lib/tcl8.4


plz help waiting for ur reply

daidrohit 02-18-2014 02:35 AM

ns2
 
sir i want to ask one more thing that i have all the outputs in ns-2.27 and i have installed ns in ubuntu using ns-2.34
and is there any dffernence to run the output files of ns-2.27 using terminal

daidrohit 02-20-2014 12:15 AM

ns2
 
plzzz help....
waiting for your reply

daidrohit 02-20-2014 01:18 AM

ns2
 
sir i have resolve all the above error
but i am getting new error

./test: line 3: ns: command not found


even i also set path

export RCA_LIBRARY=/home/rohit/ns/ns-allinone-2.27/ns-2.27/mit/rca && export uAMPS_LIBRARY=/home/rohit/ns/ns-allinone-2.27/ns-2.27/mit/uAMPS && ./test

but gain i got the same error in terminal and leach.err file



pplz plz plz plz helppppp..........................

knudfl 02-20-2014 03:06 AM

# 23 .
Quote:

ns: command not found
You probably have forgotten to add 'ns' to /usr/local/bin/ → →

$ cd ns-allinone-2.27/ns-2.27/
$ sudo make install

-

daidrohit 02-21-2014 03:33 AM

ns2
 
thanks for your reply sir

sir i have done that work as u mentioned in the above post
even i have installed again ns-allinone-2.27

but i am getting the same error and the error in the lech.err file is


couldn't read file "../lib/ns-bsnode.tcl": no such file or directory
while executing
"source.orig ../lib/ns-bsnode.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 ../lib/ns-bsnode.tcl"
(file "tcl/ex/wireless.tcl" line 191)



and when i run the test file then on terminal it displays

rohit@rohit-Presario-V3700-Notebook-PC:~/ns-allinone-2.27/ns-2.27$ ./test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...



plz plz plz reply sir

knudfl 02-21-2014 03:37 AM

# 25 .
Quote:

rohit@rohit-Presario-V3700-Notebook-PC:~/ns-allinone-2.27/ns-2.27$ ./test
You are supposed to do :
$ export RCA_LIBRARY=/home/rohit/ns/ns-allinone-2.27/ns-2.27/mit/rca && export uAMPS_LIBRARY=/home/rohit/ns/ns-allinone-2.27/ns-2.27/mit/uAMPS && ./test

daidrohit 02-24-2014 11:18 PM

ns2
 
dear sir

by giving the path as u mentioned above the same eror is coming in .err file

couldn't read file "../lib/ns-bsnode.tcl": no such file or directory
while executing
"source.orig ../lib/ns-bsnode.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 ../lib/ns-bsnode.tcl"
(file "tcl/ex/wireless.tcl" line 191)


test file is running in the terminal without any error in terminal. i am getting error in .err file




plz plz plz help

daidrohit 02-26-2014 02:41 AM

ns2
 
sir plz reply for the above post plzzz.........eagerly waiting


All times are GMT -5. The time now is 07:56 AM.