LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   how to integrate the "Resource/Energy" leach class into NS-2.34? (https://www.linuxquestions.org/questions/linux-software-2/how-to-integrate-the-resource-energy-leach-class-into-ns-2-34-a-870368/)

MayTamer 03-22-2011 09:49 PM

how to integrate the "Resource/Energy" leach class into NS-2.34?
 
Hello ...
I recently started installing leach protocol on NS-2.34 and Ubuntu 11.04.
I'm sure that I did all the necessary steps that were mentioned in this thread and other threads related Leach.
However, when running the ./test I got this error :
invalid command name "Resource/Energy"
while executing
"Resource/Energy instproc setParams {args} {
$self instvar energyLevel_ alarmLevel_
set energyLevel_ [lindex $args 0]
set alarmLevel_ [lind..."
(file "/opt/ns-allinone-2.34/ns-2.34/mit/rca/resources/ns-energy-resource.tcl" line 11)
........
I've read that I need to use either g++3.3 or g++4.1, but seems as there's a problem in installing these versions of compiler.
Can any one help me to integrate the "Resource/Energy" class into NS-2.34? Please!!!!!

knudfl 03-23-2011 03:44 AM

Welcome to LQ.

Add 'hardy' to /etc/apt/sources.list : g++-3.3....gcc-4.2((g++-4.2)) will be available.
sudo gedit /etc/apt/sources.list ; sudo apt-get update
Code:

deb http://76.73.4.58/ubuntu/ hardy-updates main
deb http://76.73.4.58/ubuntu/ hardy universe
deb http://security.ubuntu.com/ubuntu hardy-security main
deb http://security.ubuntu.com/ubuntu hardy-security universe

A missing "Resource/Energy" : It was not compiled into ns.
All new objects must be added to 'Makefile' ( Makefile.in ).
Patch ns234-leach.tar.bz2 https://docs.google.com/uc?id=0B7S25...CJzYt5QP&hl=en
May be compare the Makefile with the original ns-2.27 LEACH Makefile :
https://docs.google.com/uc?id=0B7S25...CNPCuaYP&hl=en

EDIT : See post # 22

..

MayTamer 03-25-2011 10:04 AM

solved!!
 
Thank you very much, Leach is working now on ns-2.34 :) I've started from scratch and installed g++4.3.

knudfl 03-25-2011 12:42 PM

Several members have asked how to add "ns234-leach files" to ns-2.34.

It will be very much appreciated, if you can write a short HOWTO.

Either here in the thread, or a in a blog entry :
http://www.linuxquestions.org/questi...yTamer-578702/
Or LQ 'Linux Wiki'
http://wiki.linuxquestions.org/wiki/Main_Page

..

MayTamer 03-31-2011 06:34 PM

Install Leach on ns-2.34
 
I suppose that ns-2.34 is installed with the compiler gcc-4.3.
The home directory of ns-2.34 is "/opt/ns-allinone-2.34"
1- download the package "ns-234-leach.tar.gz" into the directory "/opt/ns-allinone-2.34/ns-2.34".
https://docs.google.com/uc?id=0BzLWx...CNWG1NQK&hl=en
2- download the bash file "leach-setup.sh" into the directory "/opt/ns-allinone-2.34/ns-2.34".
https://docs.google.com/uc?id=0BzLWx...CJSU5ZYG&hl=en
3- If the home directory of your "ns-2.34" is other than "/opt/...", then you need to find "/opt/ns-allinone-2.34" and replace with "yourpath/ns-allinone-2.34" for the file "leach-setup.sh".
4- move to the directory "/opt/ns-allinone-2.34/ns-2.34" and patch the file "leach-setup.sh"
wsn@ubuntu:~$ cd /opt/ns-allinone-2.34/ns-2.34/
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$ bash leach-setup.sh
5- If the home directory of your "ns-2.34" is other than "/opt/...", then you need to find "/opt/ns-allinone-2.34" and replace with "yourpath/ns-allinone-2.34" for the follwoing two files:
- "Makefile" : found in the directory "yourpath/ns-allinone-2.34/ns-2.34".
- "Makefile.in" : found in the directory "yourpath/ns-allinone-2.34/ns-2.34".
6. Edit both “Makefile” & “Makefile.in” as following:
CC = gcc-4.3
CPP = g++-4.3
7- run the following commands
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./configure
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$make clean
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$make
7- If the previous commands passed successfully then you are ready to test your "Leach" by running ./test:
wsn@ubuntu:/opt/ns-allinone-2.34/ns-2.34$./test
8. check the file "leach.err", if no error reported then go to "leach.out" and enjoy your results!

knudfl 03-31-2011 07:03 PM

Thank you for the excellent description and the repacked files.



Regards.

..

melokuhle 04-30-2011 08:46 AM

Hello All

I tried to install LEACH on ns2.34 but IO got thi error when I was trying to Install it.keepwalking@ubuntu:~/ns-allinone-2.34/ns-2.34$ bash leach-setup.sh
ns-234-leach/trace/cmu-trace.cc
ns-234-leach/trace/
ns-234-leach/test
ns-234-leach/tcl/mobility/stat-clus.tcl
ns-234-leach/tcl/mobility/mte.tcl
ns-234-leach/tcl/mobility/leach.tcl
ns-234-leach/tcl/mobility/leach-c.tcl
ns-234-leach/tcl/mobility/
ns-234-leach/tcl/ex/wireless.tcl
ns-234-leach/tcl/ex/
ns-234-leach/tcl/
ns-234-leach/package_up
ns-234-leach/mit/uAMPS/stats.tcl
ns-234-leach/mit/uAMPS/sims/uamps.tcl
ns-234-leach/mit/uAMPS/sims/stat-clus.tcl
ns-234-leach/mit/uAMPS/sims/nodescen
ns-234-leach/mit/uAMPS/sims/mte.tcl
ns-234-leach/mit/uAMPS/sims/leach.tcl
ns-234-leach/mit/uAMPS/sims/leach-c.tcl
ns-234-leach/mit/uAMPS/sims/genscen
ns-234-leach/mit/uAMPS/sims/100nodes.txt
ns-234-leach/mit/uAMPS/sims/
ns-234-leach/mit/uAMPS/ns-stat-cluster.tcl
ns-234-leach/mit/uAMPS/ns-mte.tcl
ns-234-leach/mit/uAMPS/ns-leach.tcl
ns-234-leach/mit/uAMPS/ns-leach-c.tcl
ns-234-leach/mit/uAMPS/ns-bsapp.tcl
ns-234-leach/mit/uAMPS/extras.tcl
ns-234-leach/mit/uAMPS/bsagent.o
ns-234-leach/mit/uAMPS/bsagent.h
ns-234-leach/mit/uAMPS/bsagent.cc
ns-234-leach/mit/uAMPS/
ns-234-leach/mit/rca/resources/ns-resource.tcl
ns-234-leach/mit/rca/resources/ns-resource-manager.tcl
ns-234-leach/mit/rca/resources/ns-neighbor-resource.tcl
ns-234-leach/mit/rca/resources/ns-energy-resource.tcl
ns-234-leach/mit/rca/resources/
ns-234-leach/mit/rca/resource.o
ns-234-leach/mit/rca/resource.h
ns-234-leach/mit/rca/resource.cc
ns-234-leach/mit/rca/rcagent.o
ns-234-leach/mit/rca/rcagent.h
ns-234-leach/mit/rca/rcagent.cc
ns-234-leach/mit/rca/rca-ll.o
ns-234-leach/mit/rca/rca-ll.h
ns-234-leach/mit/rca/rca-ll.cc
ns-234-leach/mit/rca/ns-ranode.tcl
ns-234-leach/mit/rca/energy.o
ns-234-leach/mit/rca/energy.h
ns-234-leach/mit/rca/energy.cc
ns-234-leach/mit/rca/
ns-234-leach/mit/leach_sims/startup.energy
ns-234-leach/mit/leach_sims/leach.save2
ns-234-leach/mit/leach_sims/leach.save1
ns-234-leach/mit/leach_sims/leach.out
ns-234-leach/mit/leach_sims/leach.err
ns-234-leach/mit/leach_sims/leach.energy
ns-234-leach/mit/leach_sims/leach.data
ns-234-leach/mit/leach_sims/leach.alive
ns-234-leach/mit/leach_sims/conditions.txt
ns-234-leach/mit/leach_sims/TDMAschedule.80.txt
ns-234-leach/mit/leach_sims/TDMAschedule.60.txt
ns-234-leach/mit/leach_sims/TDMAschedule.480.txt
ns-234-leach/mit/leach_sims/TDMAschedule.460.txt
ns-234-leach/mit/leach_sims/TDMAschedule.440.txt
ns-234-leach/mit/leach_sims/TDMAschedule.420.txt
ns-234-leach/mit/leach_sims/TDMAschedule.400.txt
ns-234-leach/mit/leach_sims/TDMAschedule.40.txt
ns-234-leach/mit/leach_sims/TDMAschedule.380.txt
ns-234-leach/mit/leach_sims/TDMAschedule.360.txt
ns-234-leach/mit/leach_sims/TDMAschedule.340.txt
ns-234-leach/mit/leach_sims/TDMAschedule.320.txt
ns-234-leach/mit/leach_sims/TDMAschedule.300.txt
ns-234-leach/mit/leach_sims/TDMAschedule.280.txt
ns-234-leach/mit/leach_sims/TDMAschedule.260.txt
ns-234-leach/mit/leach_sims/TDMAschedule.240.txt
ns-234-leach/mit/leach_sims/TDMAschedule.220.txt
ns-234-leach/mit/leach_sims/TDMAschedule.200.txt
ns-234-leach/mit/leach_sims/TDMAschedule.20.txt
ns-234-leach/mit/leach_sims/TDMAschedule.180.txt
ns-234-leach/mit/leach_sims/TDMAschedule.160.txt
ns-234-leach/mit/leach_sims/TDMAschedule.140.txt
ns-234-leach/mit/leach_sims/TDMAschedule.120.txt
ns-234-leach/mit/leach_sims/TDMAschedule.100.txt
ns-234-leach/mit/leach_sims/TDMAschedule.0.txt
ns-234-leach/mit/leach_sims/
ns-234-leach/mit/
ns-234-leach/mac/wireless-phy.h
ns-234-leach/mac/wireless-phy.cc
ns-234-leach/mac/phy.h
ns-234-leach/mac/phy.cc
ns-234-leach/mac/mac.cc
ns-234-leach/mac/mac-sensor.h
ns-234-leach/mac/mac-sensor.cc
ns-234-leach/mac/mac-sensor-timers.h
ns-234-leach/mac/mac-sensor-timers.cc
ns-234-leach/mac/ll.h
ns-234-leach/mac/channel.cc
ns-234-leach/mac/
ns-234-leach/leach_test
ns-234-leach/common/packet.h
ns-234-leach/common/packet.cc
ns-234-leach/common/mobilenode.cc
ns-234-leach/common/
ns-234-leach/apps/app.h
ns-234-leach/apps/app.cc
ns-234-leach/apps/
ns-234-leach/Makefile.in
ns-234-leach/Makefile
ns-234-leach/
cp: cannot create directory `/keepwalking/ns-allinone-2.34/ns-2.34': No such file or directory
cp: target `/keepwalking/ns-allinone-2.34/ns-2.34/apps' is not a directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/mac': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/mac': No such file or directory
cp: target `/keepwalking/ns-allinone-2.34/ns-2.34/mac' is not a directory
cp: target `/keepwalking/ns-allinone-2.34/ns-2.34/mac' is not a directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/mac': No such file or directory
cp: target `/keepwalking/ns-allinone-2.34/ns-2.34/mac' is not a directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/trace': No such file or directory
cp: target `/keepwalking/ns-allinone-2.34/ns-2.34/common' is not a directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/common': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/tcl/mobility': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/tcl/mobility': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/tcl/mobility': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/tcl/mobility': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34/tcl/ex': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34': No such file or directory
cp: cannot create regular file `/keepwalking/ns-allinone-2.34/ns-2.34': No such file or directory
keepwalking@ubuntu:~/ns-allinone-2.34/ns-2.34$ cd
keepwalking@ubuntu:~$ ns
may you please help me to solve this problem

MayTamer 04-30-2011 11:20 PM

did you try to change the path in bash file to '/home/keepwalking/..' ?

jschiwal 05-01-2011 12:14 AM

Moved: This thread is more suitable in Linux-Software and has been moved accordingly to help your question get the exposure it deserves.

melokuhle 05-03-2011 04:52 AM

@Maytamer
Yes I did so but It still show me the same error can any one help me to solve this problem

knudfl 05-03-2011 05:09 AM

Post # 7, @ melokuhle.

Please edit post #7 to use code tags :
Write [/code] after the text, and [code] at error text start.
Or use the ( # ) button in the 'Advanced Editor' :
> Edit > Go Advanced.
http://www.linuxquestions.org/questi....php?do=bbcode

About the errors :
The first command to be used is : pwd
.. which will reply with your location.
I.e. you are either doing the command from a wrong location,
or you have no "/keepwalking/ns-allinone-2.34/ns-2.34/tcl/mobility"

..

magicbullet 05-04-2011 07:50 PM

How did you install gcc-4.3 on Ubuntu 11.04?
Thanks

knudfl 05-05-2011 03:29 AM

@magicbullet, post # 12 : Welcome to LQ.

No gcc-4.3 for Ubuntu 11.04, but you can then use gcc-4.2. *** EDIT
*** EDIT: see post #22.

Add hardy to etc/apt/sources.list, as described in post # 2.
( sudo gedit etc/apt/sources.list ).


And next ..
sudo apt-get update && sudo apt-get install g++-4.2 gcc-4.2

..

melokuhle 05-05-2011 04:35 AM

thanks for help me to solve the above problem now I came across another one may you please help me to solve it.

melokuhle 05-05-2011 05:18 AM

Hello every body


when I'm using the make command I get the following error:
Code:

trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’:
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ns
ns: command not found

can any one help me to to solve this problem.

magicbullet 05-05-2011 10:37 AM

Quote:

Originally Posted by knudfl (Post 4347106)
@magicbullet, post # 12 : Welcome to LQ.

No gcc-4.3 for Ubuntu 11.04, but you can then use gcc-4.2.
( gcc-4.1 and gcc-3.4 (gcc-3.3) will usually work perfect too.

Add hardy to etc/apt/sources.list, as described in post # 2.
( sudo gedit etc/apt/sources.list ).


And then ..
sudo apt-get update && sudo apt-get install g++-4.2 gcc-4.2

..

I've tried that but failed with the following error:

============================================================
* Build tcl8.4.18
============================================================
configure: WARNING: unrecognized options: --enable-gcc
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... gcc-4.2
checking whether the C compiler works... no
configure: error: in `/home/wilson/Documents/ns-allinone-2.34/tcl8.4.18/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details
tcl8.4.18 configuration failed! Exiting ...
Tcl is not part of the ns project. Please see www.Scriptics.com
to see if they have a fix for your platform.

I did this: export CC=gcc-4.2 CXX=g++-4.2 && ./install

Before this, I have installed other gcc versions like 4.3, 3.3 but they all failed as well

It seems all the gcc versions cannot compile, i.e. "checking whether the C compiler works... no"

knudfl 05-05-2011 10:49 AM

@magicbullet, post # 16.

'sudo apt-get install g++ g++-4.2' , etc. etc.

GCC cannot be used for very much alone.
You will have to install the g++** for all versions :
g++ insures that the files required by gcc also will get installed.

EDIT : See post # 22

..

magicbullet 05-05-2011 10:58 AM

Quote:

Originally Posted by knudfl (Post 4347490)
@magicbullet, post # 16.

'sudo apt-get g++ g++-4.2' , etc. etc.

GCC cannot be used for very much alone.
You will have to install the g++** for all versions :
g++ insures that the files required by gcc also will get installed.

U mean I need to do: sudo apt-get install g++-4.2 gcc-4.2 ?
Anything else? Anyhow, by doing: sudo apt-get install g++-4.2 gcc-4.2, I still get the same error.

I also did the following:

sudo rm /usr/bin/gcc
sudo ln -s /usr/bin/gcc-4.2 /usr/bin/gcc
export CC=gcc-4.2 CXX=g++-4.2 && ./install

Same error

knudfl 05-05-2011 11:21 AM

#18
Quote:

... I need to do: sudo apt-get install g++-4.2 gcc-4.2 ?
Not really. No reason to write gcc-4.2. gcc** will always be installed
for dependency, when you type g++*.


But there are problems with the older compilers in Ubuntu 11.04.
Versions 3.3 , 3.4 , 4.2 don't work here either : Ubuntu 11.04, 64bits.

I will look for a solution.
And please tell, if you have a 64bits OS. The command : 'uname -a' will show.

magicbullet 05-05-2011 11:26 AM

Quote:

Originally Posted by knudfl (Post 4347511)
#18
Not really. No reason to write gcc-4.2. gcc** will always be installed
for dependency, when you type g++*.


But there are problems with the older compilers in Ubuntu 11.04.
Versions 3.3 , 3.4 , 4.2 don't work here either : Ubuntu 11.04, 64bits.

I will look for a solution.
And please tell, if you have a 64bits OS. The command : 'uname -a' will show.

Thanks! The command shows : 2.6.38-8-generic #42-Ubuntu SMP Mon Apr 11 03:31:50 UTC 2011 i686 i686 i386 GNU/Linux

magicbullet 05-05-2011 12:17 PM

Quote:

Originally Posted by knudfl (Post 4347511)
#18
Not really. No reason to write gcc-4.2. gcc** will always be installed
for dependency, when you type g++*.


But there are problems with the older compilers in Ubuntu 11.04.
Versions 3.3 , 3.4 , 4.2 don't work here either : Ubuntu 11.04, 64bits.

I will look for a solution.
And please tell, if you have a 64bits OS. The command : 'uname -a' will show.

I have tried with 4.3 . It solved the above problem. However, I got the following error:

/usr/bin/ld: cannot find -lgcc_s
collect2: ld returned 1 exit status
make: *** [tcl2c++] Error 1
tclcl-1.19 make failed! Exiting ...

knudfl 05-05-2011 05:24 PM

# 20-21.
Quote:

i686 i686 i386
That's a 32bits OS.


There seems to be a workaround for the 32bits Ubuntu 11.04 (Not 64bits) :
cd /usr/local/lib/ &&
sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so

cd /usr/local/include/ && sudo ln -s /usr/include/i386-linux-gnu/asm/

Works with : export CC=gcc-4.2 CXX=g++-4.2 && ./install
( 4.3 should be OK too. Where did you get the "4.3" ? )

..

magicbullet 05-05-2011 07:53 PM

Quote:

Originally Posted by knudfl (Post 4347801)
# 20-21.

That's a 32bits OS.


There seems to be a workaround for the 32bits Ubuntu 11.04 (Not 64bits) :
cd /usr/local/lib/ &&
sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so

cd /usr/local/include/ && sudo ln -s /usr/include/i386-linux-gnu/asm/

Works with : export CC=gcc-4.2 CXX=g++-4.2 && ./install
( 4.3 should be OK too. Where did you get the "4.3" ? )

..

Thanks. It works now!

Btw, how do I remove all the linkages, i.e. sudo ln -s /lib/i386-linux-gnu/libgcc_s.so.1 libgcc_s.so and sudo ln -s /usr/include/i386-linux-gnu/asm/?

knudfl 05-06-2011 02:24 AM

# 23

cd /usr/local/lib/ && sudo rm libgcc_s*

cd /usr/local/include/ && sudo rm -r asm/

keepwalking 05-06-2011 08:39 AM

Hello every body
may any one help me to change this pseudo code to and real protocol I m not familiar with C++
Code:

Initialization
{
Find average energy of n nodes
Find the distance of each node
Calculate whether node is eligible as Cluster Head (ch node)
Select x nodes where x < n as the candidate of Cluster Head
43
}
Find m as total chromosome, where m=x nodes/desired p cluster
Populate m Chromosome
For i=0, i<m, i++
{
Randomly choose nodes from x nodes
If y < p
Add nodes to chromosome C at y
else
y=0
}
For each p chromsome
{
Do
{
For each Chromosome k where k<=p
{
Find the Chromosome Fitness
Find the Chromosome probability
}
Find average probability
Find best Chromosome as Parent 1
Do Roulette
{
Determine r where 0 < r < 1
If probability Chromosome i > r
Select Chromosome ith as second parent
Break roulette
Else
Continue Roulette
}
44
Do Crossover parent 1 and parent 2
Crossover result as Children 1 and Children 2
Mutation between least Probability Chromosome with Children
} Until iteration=k
Select the best chromosome as a group of Cluster Head (CH0,CH1,CH3,…,CHn)
Determine Cluster Head for each nodes, where d(CHi)<< from each nodes
Inform to all nodes about their Cluster head


vaan 05-07-2011 10:16 PM

same question~
 
Quote:

Originally Posted by melokuhle (Post 4347173)
Hello every body

when I'm using the make command I get the following error:
Code:

trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’:
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ns
ns: command not found

can any one help me to to solve this problem.

same question ,any one help? Thank you ~

leminh1009 05-09-2011 09:50 AM

Hi MayTamer,

Could you please advise me how to download "leach-setup.sh" file from your link provided? When i clicked that link, it doesn't work at all.

Thank in advance.

knudfl 05-09-2011 11:30 AM

# 27, @leminh1009.

The link works OK here. However, I have uploaded the files too
some time ago, to provide a "second source".

leach-setup234.sh = leach-setup.sh
https://docs.google.com/uc?id=0B7S25...download&hl=en

ns234-leach-042011.tar.bz2 = ns-234-leach.tar.gz
https://docs.google.com/uc?id=0B7S25...download&hl=en

..

deepa_2111 05-10-2011 07:10 PM

You need to add a declaration of format_rca in cmu-trace.h
Code:

        void    format_imep(Packet *p, int offset);
        void    format_aodv(Packet *p, int offset);
        void    format_aomdv(Packet *p, int offset);
#ifdef MIT_uAMPS
        void    format_rca(Packet *p, int offset);
#endif

        // This holds all the tracers added at run-time
        static PacketTracer *pktTrc_;

};

This should help solve your issue

Quote:

Originally Posted by melokuhle (Post 4347173)
Hello every body


when I'm using the make command I get the following error:
Code:

trace/cmu-trace.cc: In member function ‘void CMUTrace::format(Packet*, const char*)’:
trace/cmu-trace.cc:1327: error: ‘format_rca’ was not declared in this scope
trace/cmu-trace.cc: At global scope:
trace/cmu-trace.cc:1523: error: no ‘void CMUTrace::format_rca(Packet*, int)’ member function declared in class ‘CMUTrace’
make: *** [trace/cmu-trace.o] Error 1
luuh@ubuntu:~/ns-allinone-2.34/ns-2.34$ ns
ns: command not found

can any one help me to to solve this problem.



---------- Post added 05-10-11 at 08:11 PM ----------


deepa_2111 05-11-2011 08:17 AM

Please see my reply on Post #29

Quote:

Originally Posted by vaan (Post 4349690)
same question ,any one help? Thank you ~


deepa_2111 05-11-2011 08:19 AM

Please see my reply in Post #29

helyos 05-11-2011 08:39 AM

Hi there,

I am really a beginner and for a school project I have to make a simulation for LEACH protocol in ns.
I have installed ns-allinone-2.34 on Ubuntu 11.04 and now i think i have to add the LEACH patch to ns. As i read here there are some steps to do but the problem is that i have installed "gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) ".

Can someone please help me with the exact steps for this version of gcc complier.

Thank you in advance.
Awaiting for your early reply.

leminh1009 05-11-2011 12:38 PM

Hi MayTamer,

I set up successfully ns2 and leach but I've run ./test and I can't find leach.out. Could you please advise me this problem ?

Quote:
oot@bt:~/ns-allinone-2.34/ns-2.34# ./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...
root@bt:~/ns-allinone-2.34/ns-2.34#

helyos 05-11-2011 01:54 PM

leminh1009, can you help me with my issue? please

deepa_2111 05-11-2011 03:50 PM

Quote:

Originally Posted by leminh1009 (Post 4353462)
Hi MayTamer,

I set up successfully ns2 and leach but I've run ./test and I can't find leach.out. Could you please advise me this problem ?

Quote:
oot@bt:~/ns-allinone-2.34/ns-2.34# ./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...
root@bt:~/ns-allinone-2.34/ns-2.34#

look at the /mit/leach_sims/ directory in your ns-2.34 folder. leach.out and all the other simulation results should be there

knudfl 05-12-2011 04:55 AM

@ helyos, post # 32 : Welcome to LQ.

You can have as many compilers as you want, installed at the same time.
Installing g++-4.2 : Read post # 2.

And g++-4.3 : Must be manually installed. It's an Ubuntu Lucid package :
http://packages.ubuntu.com/lucid/g++-4.3

Use with e.g.: export CC=gcc-4.3 CXX=g++-4.3 && ./install

..

helyos 05-12-2011 07:03 AM

Thank you knudfl,
I have installed g++-4.2 and i have followed post #7 and at step 6:

6. Edit both “Makefile” & “Makefile.in” as following:
CC = gcc-4.2
CPP = g++-4.2


Then when i gave ./configure it gave me :

Code:

checking for tclsh8.4.18... no
checking for tclsh8.4... /usr/bin/tclsh8.4
checking for tk.h... -I../tk8.4.18/generic
checking for libtk8.4... -L/usr/lib -ltk8.4
checking for tk.tcl... ../tk8.4.18/library
checking for otcl.h... -I../otcl-1.13
checking for libotcl1.13... -L/usr/lib -lotcl
checking for tclcl.h... -I../tclcl-1.19
checking for libtclcl... no
checking for tcl2c++... /usr/bin

configure: error: Installation of tcl seems incomplete or can't be found automatically.
Please correct the problem by telling configure where tcl is
using the argument --with-tcl=/path/to/package
(perhaps after installing it),
or the package is not required, disable it with --with-tcl=no.

If i gave
rares@ubuntu:/opt/ns-allinone-2.34/ns-2.34$ ./configure --with-tcl=/usr/share/tcltk/
:

Code:

checking if STL works with namespace std... yes
checking should use STL... yes
checking for tcl.h... no
checking for tclInt.h... no
checking for libtcl8.4... no
checking for init.tcl... no
checking for http.tcl... no
checking Tcl http.tcl library... configure: error: Couldn't find http.tcl in                  /http        /http2.4        /http2.3        /http2.1        /http2.0        /http1.0

How can i fix it?

leminh1009 05-12-2011 10:22 AM

Hi everyone,

As previous, when I've been running ./test and I reached leach.out as following path: /root/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims but no result in it.

Could you please help me solve this problem?

Thanks in advance,

knudfl 05-12-2011 11:30 AM

#37, @ helyos : "" ... have followed post #7 and at step 6: ""

You mean post # 5 ? Post #5 assumes a working ns-allinone-2.34/.
cd ns-allinone-2.34/ && export CC=gcc4.2 CXX=g++-4.2 && ./install
( If you have built ns-allinone-2.34/ to another location, it cannot be reused.
You will have to start from scratch.)


Another thing : Ubuntu 11.04 is 'worst choice' for ns-allinone-2.34/.
Suggest : Use the 'Long Term Supported' Ubuntu 10.04.


..

helyos 05-12-2011 11:50 AM

Quote:

Originally Posted by knudfl (Post 4354470)
Another thing : Ubuntu 11.04 is 'worst choice' for ns-allinone-2.34/.
Suggest : Use the 'Long Term Supported' Ubuntu 10.04.


..

Ok, Thanks. I will install Ubuntu 10.04 and i will try to do a fresh install of ns2 on it.

helyos 05-12-2011 04:23 PM

Pfff.. now I am more closer to the end. So i installed the 'Long Term Supported' Ubuntu 10.04. In staled ns2 into the opt directory.
And now i passed from ./configure

I am stucked when i enter $ make:

Code:

rares@ubuntu:/opt/ns-allinone-2.34/ns-2.34$ make
g++-4.3 -c -Wall -Wno-write-strings  -DTCP_DELAY_BIND_ALL -DNO_TK -DTCLCL_CLASSINSTVAR  -DNDEBUG -DLINUX_TCP_HEADER -DUSE_SHM -DHAVE_LIBTCLCL -DHAVE_TCLCL_H -DHAVE_LIBOTCL1_13 -DHAVE_OTCL_H -DHAVE_LIBTK8_4 -DHAVE_TK_H -DHAVE_LIBTCL8_4 -DHAVE_TCLINT_H -DHAVE_TCL_H  -DHAVE_CONFIG_H -DNS_DIFFUSION -DSMAC_NO_SYNC -DCPP_NAMESPACE=std -DUSE_SINGLE_ADDRESS_SPACE -Drng_test -DMIT_uAMPS  -I. -I. -I/opt/ns-allinone-2.34/tclcl-1.19 -I/opt/ns-allinone-2.34/otcl -I/opt/ns-allinone-2.34/include -I/opt/ns-allinone-2.34/include -I/opt/ns-allinone-2.34/include -I/usr/include/pcap -I./tcp -I./sctp -I./common -I./link -I./queue -I./adc -I./apps -I./mac -I./mobile -I./trace -I./routing -I./tools -I./classifier -I./mcast -I./diffusion3/lib/main -I./diffusion3/lib -I./diffusion3/lib/nr -I./diffusion3/ns -I./diffusion3/filter_core -I./asim/ -I./qs -I./diffserv -I./satellite -I./wpan -I./mit/rca -I./mit/uAMPS -o tools/random.o tools/random.cc
make: g++-4.3: Command not found
make: *** [tools/random.o] Error 127

knudfl please help me. thank you in advance!

deepa_2111 05-12-2011 11:11 PM

Hi,

Ok .. try running leach_test alone. See if the output is created.
( You have to manually create the folder leach_sims )
Once you run leach_test, in \mit\leach_sims\ folder, open leach.err.
Do you have any error messages in it ?

Quote:

Originally Posted by leminh1009 (Post 4354399)
Hi everyone,

As previous, when I've been running ./test and I reached leach.out as following path: /root/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims but no result in it.

Could you please help me solve this problem?

Thanks in advance,


knudfl 05-13-2011 02:25 AM

#41, @helyos : No g++-4.3 unless you install it : Like all other prerequisites.


sudo apt-get install g++ g++-4.3 autoconf automake libtool \
libx11-dev libxmu-dev libxmu-headers libxt-dev


cd ns-allinone-2.34/ && export CC=gcc-4.3 CXX=g++-4.3 && ./install

..

helyos 05-13-2011 05:07 AM

@ knudfl When i have installed ns2 i have followed this http://www.anand-iyer.com/blog/?p=22 .

sudo apt-get install build-essential autoconf automake libxmu-dev gcc-4.3 was issued.

./install was issued too.

---------------------------
Ok so i have tried your way but failed at /install

it gave me :

Code:

* Build tcl8.4.18
============================================================
configure: WARNING: unrecognized options: --enable-gcc
checking whether to use symlinks for manpages... no
checking whether to compress the manpages... no
checking whether to add a package name suffix for the manpages... no
checking for gcc... gcc4.3
checking whether the C compiler works... no
configure: error: in `/opt/ns-allinone-2.34/tcl8.4.18/unix':
configure: error: C compiler cannot create executables
See `config.log' for more details.
tcl8.4.18 configuration failed! Exiting ...
Tcl is not part of the ns project.  Please see www.Scriptics.com
to see if they have a fix for your platform.

What should i do next? Reinstall it again?

knudfl 05-13-2011 08:16 AM

#44, @helyos.

Please do : sudo apt-get install g++ g++-3.4
I.e. the g++ components are required to have a working gcc(-any-version)

Quote:

checking for gcc... gcc4.3
There is a missing hyphen ( - ) : It's gcc-3.4

A good idea before compiling is to do these checks :
1) ls /usr/bin/gcc* 2) ls /usr/bin/g++*
.. to verify the compiler spelling. ("gcc34" is commonly used too.)

helyos 05-13-2011 12:00 PM

Ok then i had the error from post #29:

I have corrected that error conform to deepa but when i hit again "make":

Code:

./common/packet.h:398: warning: deprecated conversion from string constant to ‘char*’
trace/cmu-trace.cc: In member function ‘void CMUTrace::format_rca(Packet*, int)’:
trace/cmu-trace.cc:1531: error: ‘ADV_CHAR’ was not declared in this scope
trace/cmu-trace.cc:1535: error: ‘REQ_CHAR’ was not declared in this scope
trace/cmu-trace.cc:1539: error: ‘DATA_CHAR’ was not declared in this scope
make: *** [trace/cmu-trace.o] Error 1
root@ubuntu:/opt/ns-allinone-2.34/ns-2.34#

How and where should be declared these chars?

Thank you

deepa_2111 05-14-2011 01:05 AM

These are in cmu-trace.h
Code:

#ifdef MIT_uAMPS
#define ADV_CHAR            'A'
#define REQ_CHAR            'R'
#define DATA_CHAR            'D'
#endif

Quote:

Originally Posted by helyos (Post 4355482)
Ok then i had the error from post #29:

I have corrected that error conform to deepa but when i hit again "make":

Code:

./common/packet.h:398: warning: deprecated conversion from string constant to ‘char*’
trace/cmu-trace.cc: In member function ‘void CMUTrace::format_rca(Packet*, int)’:
trace/cmu-trace.cc:1531: error: ‘ADV_CHAR’ was not declared in this scope
trace/cmu-trace.cc:1535: error: ‘REQ_CHAR’ was not declared in this scope
trace/cmu-trace.cc:1539: error: ‘DATA_CHAR’ was not declared in this scope
make: *** [trace/cmu-trace.o] Error 1
root@ubuntu:/opt/ns-allinone-2.34/ns-2.34#

How and where should be declared these chars?

Thank you


deepa_2111 05-14-2011 01:09 AM

Are there any files in leach_sims ? for example, leach.err ?
What do you mean by "and I reached leach.out" ???
And did you made a folder called "ns-234-leach". If so, have u modified the leach_test file (line that says dirname="mit/leach_sims") accordingly?


Quote:

Originally Posted by leminh1009 (Post 4354399)
Hi everyone,

As previous, when I've been running ./test and I reached leach.out as following path: /root/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims but no result in it.

Could you please help me solve this problem?

Thanks in advance,


helyos 05-14-2011 05:52 AM

deepa_2111 i added what you told me. So, my cmu-trace.h file is :


Code:

/* -*-        Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t -*-
 *
 * Copyright (c) 1997 Regents of the University of California.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 * 3. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *        This product includes software developed by the Computer Systems
 *        Engineering Group at Lawrence Berkeley Laboratory.
 * 4. Neither the name of the University nor of the Laboratory may be used
 *    to endorse or promote products derived from this software without
 *    specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $Header: /cvsroot/nsnam/ns-2/trace/cmu-trace.h,v 1.28 2009/01/15 06:23:49 tom_henderson Exp $
 */

/* Ported from CMU/Monarch's code, nov'98 -Padma.*/

#ifndef __cmu_trace__
#define __cmu_trace__

#include "trace.h"
#include "god.h"

#ifndef __PRETTY_FUNCTION__
#define __PRETTY_FUNCTION__ ("")
#endif /* !__PRETTY_FUNCTION__ */

/* ======================================================================
  Global Defines
  ====================================================================== */
#define        DROP            'D'
#define        RECV            'r'
#define        SEND            's'
#define        FWRD            'f'

// change wrt Mike's code
#define EOT            'x'



#define TR_ROUTER        0x01
#define TR_MAC                0x02
#define TR_IFQ                0x04
#define TR_AGENT        0x08

#define TR_PHY                0x10

#define DROP_END_OF_SIMULATION                "END"
#define        DROP_MAC_COLLISION                "COL"
#define DROP_MAC_DUPLICATE                "DUP"
#define DROP_MAC_PACKET_ERROR                "ERR"
#define DROP_MAC_RETRY_COUNT_EXCEEDED        "RET"
#define DROP_MAC_INVALID_STATE                "STA"
#define DROP_MAC_BUSY                        "BSY"
#define DROP_MAC_INVALID_DST            "DST"
#define DROP_MAC_SLEEP                  "SLP"  // smac sleep state

#define DROP_RTR_NO_ROUTE                "NRTE"  // no route
#define DROP_RTR_ROUTE_LOOP                "LOOP"  // routing loop
#define DROP_RTR_TTL                    "TTL"  // ttl reached zero
#define DROP_RTR_QFULL                  "IFQ"  // queue full
#define DROP_RTR_QTIMEOUT              "TOUT"  // packet expired
#define DROP_RTR_MAC_CALLBACK          "CBK"  // MAC callback
#define DROP_RTR_SALVAGE                "SAL"

#define DROP_IFQ_QFULL                  "IFQ"  // no buffer space in IFQ
#define DROP_IFQ_ARP_FULL              "ARP"  // dropped by ARP
#define DROP_IFQ_FILTER                "FIL"

#define DROP_OUTSIDE_SUBNET            "OUT"  // dropped by base stations if received rtg updates from nodes outside its domain.

#define MAX_ID_LEN        3
#define MAX_NODE        4096


/**
 * This class allows a dynamic library to define the tracing format
 * for newly defined packet types
 *
 */
class PacketTracer
{
        public:
                PacketTracer();
                virtual ~PacketTracer();
                void setNext(PacketTracer *next);
                PacketTracer *getNext();
                int format_unknow(Packet *p, int offset, BaseTrace *pt_, int newtrace);
        protected:
                virtual int format(Packet *p, int offset, BaseTrace *pt_, int newtrace) = 0;        //return 0 if the packet is unknown
                PacketTracer *next_;
};


class CMUTrace : public Trace {
public:
        CMUTrace(const char *s, char t);
        void        recv(Packet *p, Handler *h);
        void        recv(Packet *p, const char* why);

        static void addPacketTracer(PacketTracer *pt);


private:
        char        tracename[MAX_ID_LEN + 1];
        int        nodeColor[MAX_NODE];
        int    tracetype;
        MobileNode *node_;
        int    newtrace_;

        //<zheng: ns 2.27 removed the following part, but we need it to control the broadcast radius>
        static double  bradius;
        static double  radius_scaling_factor_;
        static double  duration_scaling_factor_;
        static void calculate_broadcast_parameters();
        //</zheng>

        int initialized() { return node_ && 1; }
        int node_energy();
        int        command(int argc, const char*const* argv);
        void        format(Packet *p, const char *why);

        void    nam_format(Packet *p, int offset);

        void        format_phy(Packet *p, int offset);
       
        void        format_mac_common(Packet *p, const char *why, int offset);
        void    format_mac(Packet *p, int offset);
        void    format_smac(Packet *p, int offset);
        void        format_ip(Packet *p, int offset);

        void        format_arp(Packet *p, int offset);
        void    format_hdlc(Packet *p, int offset);
        void        format_dsr(Packet *p, int offset);
        void        format_msg(Packet *p, int offset);
        void        format_tcp(Packet *p, int offset);
        void    format_sctp(Packet *p, int offset);
        void        format_rtp(Packet *p, int offset);
        void        format_tora(Packet *p, int offset);
        void    format_imep(Packet *p, int offset);
        void    format_aodv(Packet *p, int offset);
        void    format_aomdv(Packet *p, int offset);
#ifdef MIT_uAMPS
        void    format_rca(Packet *p, int offset);
#define ADV_CHAR            'A'
#define REQ_CHAR            'R'
#define DATA_CHAR            'D'

#endif

        // This holds all the tracers added at run-time
        static PacketTracer *pktTrc_;

};
#endif

IS ok?

I ask this because when i run .test something it's working but I have some warning:

Code:

/test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
warning: no class variable Phy/WirelessPhy::alive_

        see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

INITIALIZE THE LIST xListHead
warning: no class variable Phy/WirelessPhy::alive_

        see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

warning: no class variable Phy/WirelessPhy::alive_

        see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...

In /opt/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims# nano leach.err I Have:
Code:

INITIALIZE THE LIST xListHead
SORTING LISTS ...DONE!

Is there a way to remove these warnings??

deepa_2111 05-14-2011 01:35 PM

@ Heylos, post #49

Congrats ! You have got it working. Whats you see in leach.err is not a warning/error. It is a status message that appears if your simulation is running.

The warnings you see are ok. But if you want to remove them, in uamps.tcl, added the last paragraph i.e.

Code:

Phy/WirelessPhy set bandwidth_    $opt(bw)
Phy/WirelessPhy set CSThresh_      $opt(CSThresh)
Phy/WirelessPhy set RXThresh_      $opt(RXThresh)
Phy/WirelessPhy set Efriss_amp_    $opt(Efriss_amp)
Phy/WirelessPhy set Etwo_ray_amp_  $opt(Etwo_ray_amp)
Phy/WirelessPhy set EXcvr_        $opt(EXcvr)
Phy/WirelessPhy set freq_          $opt(freq)
Phy/WirelessPhy set L_            $opt(L)
Phy/WirelessPhy set sleep_        0
Phy/WirelessPhy set alive_        1
Phy/WirelessPhy set ss_            $opt(spreading)
Phy/WirelessPhy set dist_          0

so that lines 98 - 131 in uamps.tcl are ::

Code:

# ===== Get rid of the warnings in bind ================================
Resource/Energy set energyLevel_  $opt(init_energy)
Resource/Energy set alarmLevel_    $opt(thresh_energy)
Resource/Energy set expended_      0

Agent/RCAgent set sport_          0
Agent/RCAgent set dport_          0
Agent/RCAgent set packetMsg_      0
Agent/RCAgent set distEst_        0
Agent/RCAgent set packetSize_      0
Agent/BSAgent set packetMsg_      0
Agent/BSAgent set packetSize_      0
Agent/BSAgent set recv_code_      0

RCALinkLayer set delay_            25us
RCALinkLayer set bandwidth_        0   
RCALinkLayer set off_prune_        0   
RCALinkLayer set off_CtrMcast_    0 
RCALinkLayer set macDA_            0 
RCALinkLayer set debug_            0 
RCALinkLayer set avoidReordering_  0 

Phy/WirelessPhy set bandwidth_    $opt(bw)
Phy/WirelessPhy set CSThresh_      $opt(CSThresh)
Phy/WirelessPhy set RXThresh_      $opt(RXThresh)
Phy/WirelessPhy set Efriss_amp_    $opt(Efriss_amp)
Phy/WirelessPhy set Etwo_ray_amp_  $opt(Etwo_ray_amp)
Phy/WirelessPhy set EXcvr_        $opt(EXcvr)
Phy/WirelessPhy set freq_          $opt(freq)
Phy/WirelessPhy set L_            $opt(L)
Phy/WirelessPhy set sleep_        0
Phy/WirelessPhy set alive_        1
Phy/WirelessPhy set ss_            $opt(spreading)
Phy/WirelessPhy set dist_          0

Quote:

Originally Posted by helyos (Post 4356145)
deepa_2111 i added what you told me. So, my cmu-trace.h file is :

IS ok?

I ask this because when i run .test something it's working but I have some warning:

Code:

/test
num_nodes is set 3
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
warning: no class variable Phy/WirelessPhy::alive_

        see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

INITIALIZE THE LIST xListHead
warning: no class variable Phy/WirelessPhy::alive_

        see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

warning: no class variable Phy/WirelessPhy::alive_

        see tcl-object.tcl in tclcl for info about this warning.

warning: no class variable Phy/WirelessPhy::Efriss_amp_

warning: no class variable Phy/WirelessPhy::Etwo_ray_amp_

warning: no class variable Phy/WirelessPhy::EXcvr_

warning: no class variable Phy/WirelessPhy::sleep_

warning: no class variable Phy/WirelessPhy::ss_

warning: no class variable Phy/WirelessPhy::dist_

Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 89.8
SORTING LISTS ...DONE!
NS EXITING...

In /opt/ns-allinone-2.34/ns-2.34/ns-234-leach/mit/leach_sims# nano leach.err I Have:
Code:

INITIALIZE THE LIST xListHead
SORTING LISTS ...DONE!

Is there a way to remove these warnings??



All times are GMT -5. The time now is 07:46 PM.