LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   How to patch GPSR routing protocol to ns-2.34 (https://www.linuxquestions.org/questions/linux-software-2/how-to-patch-gpsr-routing-protocol-to-ns-2-34-a-878526/)

Chakraborty 04-09-2014 12:21 PM

Quote:

# 209 .
The files were deleted before I had a chance to get them :
See your post #204 : No attached files.
very sorry for that. I just missed to remember.
Now it is added below.
Quote:

1. Not all protocols support nam.
Great beneficial if you could manage to tell the reason please.
Quote:

# 209 .
See $ './configure --help' , the option is : --enable-debug
-
I also got that hint by google hits. But not got the procedure.
Could you please give the details to implement, familiarize and use, the debugger.

With many thanks

knudfl 04-09-2014 01:44 PM

# 211 .

Building with "--enable-debug" :
The suggestion is to build another ns-allinone-2.33 in a new directory.
EDIT : ns-allinone-2.34
→ To leave your already working version safe.

Edit the file install, line 551 :
Code:

        ./configure --enable-debug --with-otcl=../otcl-$OTCLVER --with-tclcl=../tclcl-$TCLCLVER || die "Ns configuration failed! Exiting ...";
Using 'gdb' http://www.gnu.org/software/gdb/documentation/ ,,
,, http://www.gnu.org/software/gdb/documentation/

If you have gdb questions : Start a "gdb thread". (I have never used gdb.)

""implement gdb"" : $ sudo apt-get install gdb

-

Chakraborty 04-09-2014 03:26 PM

Quote:

# 211 .

Building with "--enable-debug" :
The suggestion is to build another ns-allinone-2.33 in a new directory.
→ To leave your already working version safe.
2.33 or 2.34. But the patch is for 2.34?
Quote:

# 211
Edit the file install, line 551 :
Code:

        ./configure --enable-debug --with-otcl=../otcl-$OTCLVER --with-tclcl=../tclcl-$TCLCLVER || die "Ns configuration failed! Exiting ...";

should I go from scratch i.e changing the line 551 quoted above and then usual installation
OR
Just take a separate copy of ns-allinone-2.34(folder) with a new name(for safety) and within it issue the command
./configure
make clean
make

Waitinng for your reply.

Besides,With the help of
Quote:

#33, #37
successful in getting the nam required to visualize the data paths.
It is only showing nodes with beaconing trasmission ranges, for wireless-gpsr.tcl

additionally......
when run with 200 node
segmentation fault

when run with 100 nodes of default wireless-gpsr.tcl
fatal ARP error...

Either OR by both through gdb and nam I need to confirm the working of default gpsr
and gpsr modified by me.

Please suggest.
With Thanks

knudfl 04-09-2014 03:45 PM

# 213 .
Quote:

should I go fro scratch i.e changing the line 551 quoted above and then usual installation
OR
Just take a separate copy of ns-allinone-2.34
This is how to build an extra version of ns-allinone-2.34, with "debug" :
$ tar xvf ns-allinone-2.34.tar.gz
* Do the patching you want, edit the file install, and ..
$ cd ns-allinone-2.34/ && export CC=gcc41 CXX=g++41 && ./install

Sorry for the ns-2.33 typo. It's also line 551 in ns-2.34.

-

Chakraborty 04-09-2014 04:05 PM

Quote:

# 213 .

This is how to build an extra version of ns-allinone-2.34, with "debug" :
$ tar xvf ns-allinone-2.34.tar.gz
* Do the patching you want, edit the file install, and ..
$ cd ns-allinone-2.34/ && export CC=gcc41 CXX=g++41 && ./install

Sorry for the ns-2.33 typo. It's also line 551 in ns-2.34.
How to use ? with respect to gpsr.cc when used by 'ns'
Any idea/suggestion.

knudfl 04-10-2014 01:49 AM

# 215 .

'gdb' handles executable´s like 'ns'.

So you will have to build two times new ns-allinone-2.35 with "--enable-debug" :
One with the default KeLiu gpsr.cc : Make a copy of 'ns' to e.g. "ns-debug-a".
And with the edited gpsr.cc : $ cp ns ns-debug-e

Then you can compare the two ns-* to watch any difference :
1) $ gdb ns-debug-a
2) $ gdb ns-debug-e
.... Please run $ 'gdb --help' : To know the options.

-

shahidz 04-10-2014 05:26 AM

sir i patch GPSR protocol when i run ns hls.tcl the out is like this.
sir please tele me what dose it mean??
user@XubunTOS:~/ns2/ns-allinone-2.33/ns-2.33$ ns
% ^Z
[3]+ Stopped ns
user@XubunTOS:~/ns2/ns-allinone-2.33/ns-2.33$ cd hls
user@XubunTOS:~/ns2/ns-allinone-2.33/ns-2.33/hls$ cd utils/
user@XubunTOS:~/ns2/ns-allinone-2.33/ns-2.33/hls/utils$ ns hls.tcl
num_nodes is set 40
Configuring Nodes (40)
INITIALIZE THE LIST xListHead
Starting Simulation...
radiorange 250, x 2000 y 2000
length : 3.000000 , cellperline 12 , heigth 3.000000
maxlevel 3
radiorange 250, x 2000 y 2000
length : 3.000000 , cellperline 12 , heigth 3.000000
maxlevel 3
...................
...................
radiorange 250, x 2000 y 2000
length : 3.000000 , cellperline 12 , heigth 3.000000
maxlevel 3
radiorange 250, x 2000 y 2000
length : 3.000000 , cellperline 12 , heigth 3.000000
maxlevel 3
SORTING LISTS ...DONE!
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
--- Classfier::no-slot{} default handler (tcl/lib/ns-lib.tcl) ---
_o31: no target for slot 0
_o31 type: Classifier/Port
content dump:
classifier _o31
0 offset
0 shift
2147483647 mask
1 slots
slot 255: _o33 (CMUTrace/Recv)
---------- Finished standard no-slot{} default handler ----------

knudfl 04-10-2014 06:12 AM

Post #217, @shahidz : Welcome to LQ.

Your "% ^Z" , "[3]+ Stopped ns" ,,, and the failed simulation :
Looks like a failed build.
Please read "gpsr-hls" http://www.linuxquestions.org/questions/tags/gpsr-hls/
* gpsr-hls, Ubuntu, the latest build instructions, post #5 here ...
http://www.linuxquestions.org/questi...-4175498876/#5

And : Here in this very thread, we have an example of $ ./ns hls.tcl , post #19
http://www.linuxquestions.org/questi...526/page2.html

Any questions ? Then please specify your OS : a) $ uname -m <Enter>
b) $ cat /etc/issue <Enter>

-

Chakraborty 04-14-2014 12:29 PM

Dear Knudfl,
I am using SMAC, instead of 802_11 in the default wireless-gpsr.tcl file, as I need it.

And

chakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34-modified/ns-2.34/gpsr$ ns wireless-gpsr.tcl
num_nodes is set 100
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
GPSR configuration file
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Load complete...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 129.2
SORTING LISTS ...DONE!
Couldn't schedule timerchakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34-modified/ns-2.34/gpsr$

"Couldn't schedule timer" msg.
Where could be the problem.Trace is also incomplete.

Any idea please?

knudfl 04-14-2014 01:49 PM

# 219 .

Assume wireless-gpsr.tcl edited to wireless-gpsr-SMAC.tcl, with line 45 =
set opt(mac) Mac/SMAC
+ using files "../tcl/lib/ns-bsnode.tcl", gpsr.tcl, cbr100.tcl, grid-deploy10x10.tcl :
wireless-gpsr-SMAC.tcl, line 52 : set opt(cp) "./cbr100.tcl"
wireless-gpsr-SMAC.tcl, line 53 : set opt(sc) "./grid-deploy10x10.tcl"

My test :
Code:

$ ns-gpsr-k wireless-gpsr-SMAC.tcl
num_nodes is set 100
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
GPSR configuration file
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Load complete...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5,  distCST_ = 129.2
SORTING LISTS ...DONE!

... The files trace.tr 304kB, nam.out.tr 320kB are created.

? ? Did you edit something in the code ? {gpsr_neighbor.cc, gpsr_neighbor.h} ?

-

Chakraborty 04-15-2014 12:17 AM

Quote:

#219

chakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34-modified/ns-2.34/gpsr$ ns wireless-gpsr.tcl
......
Couldn't schedule timerchakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34-modified/ns-2.34/gpsr$
This was with ns-allinone-2.34-modified/ns-2.34/gpsr$
where the {gpsr.cc, gpsr.h,gpsr_neighbor.cc, gpsr_neighbor.h} were modified.

An original copy of gpsr is kept intact as in {/ns-allinone-2.34/ns-2.34/gpsr$}
Done and cross checked the changes as mentioned by you in #220,
BUT!

chakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34-modified/ns-2.34/gpsr$ cd ..
chakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34-modified/ns-2.34$ cd ..
chakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34-modified$ cd ..
chakraborty@chakraborty-Inspiron-1545:~$ cd ns-allinone-2.34/ns-2.34/gpsr
chakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34/ns-2.34/gpsr$ ns wireless-gpsr.tcl
num_nodes is set 100
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
GPSR configuration file
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Load complete...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 129.2
SORTING LISTS ...DONE!
Couldn't schedule timerchakraborty@chakraborty-Inspiron-1545:~/ns-allinone-2.34/ns-2.34/gpsr$

If possible please upload the files you have run.

Please reply soon.
With Thanks

Chakraborty 04-15-2014 02:01 AM

Dear Knudfl,

Is there any software/procedure that will map a tcl script having
node coordinates to a graphical grig based manner,
with respect to node coordinates.
Just statinary nodes.
I am trying with nam.

Anything else from your's side.

With thanks.

shahidz 04-15-2014 06:25 AM

sir please give me some useful links about the comparison of LEACH,LEACHC and GPSR

Chakraborty 04-15-2014 02:33 PM

Dear shahidz,

You need to patch these two protocols with their respective ns-2.xx versions.Luckily for both of them(LEACH & GPSR) it is 2.34.They may not be worrking with the same ns(executable). Better you keep two ns-allinone-2.34 as

{ns/ns-allinone-2.34-LEACH/ns-2.34}
&&
{ns/ns-allinone-2.34-GPSR/ns-2.34}

All you need is to change the bash file with path information, while switching.

And don't forget to renname the ns.

Please check this links FOR LEACH:

http://www.linuxquestions.org/questi...2-34-a-870368/

&&

http://www.linuxquestions.org/questi...2-34-a-860250/

shahidz 04-16-2014 12:03 AM

i already patch these protocol but we search a good papers about the perfomance comparison of LEACH,LEACHC and GPSR.
Thanks fo reply..


All times are GMT -5. The time now is 10:31 AM.