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/)

mdkhasawneh 03-15-2012 06:00 AM

Dear knudfl im totaly new to NS2

for this reason i post the tcl to get help in modifying the file to run NAM.

can you tell me what to do?

muaz.sh 03-15-2012 11:37 AM

@27 this message refers that you have successfully integrated the GPSR implementation with ns2. in order to run nam animation, wireless-gpsr.tcl puts the traces files in the same folder, these files are trace.tr and nam.out.tr, so if you need to run the animation of this file you need to use the terminal and execute this command:
nam nam.out.tr

mdkhasawneh 03-15-2012 11:48 AM

Dear muaz.sh after execute this command:
nam nam.out.tr

and by play the nam i get this in terminal and nothing at nam

muaz.sh 03-15-2012 11:58 AM

are you sure you did not modify the wireless-gpsr.tcl or any other file?

mdkhasawneh 03-15-2012 12:11 PM

Dear muaz.sh i just modify wireless-gpsr.tcl accourding to post #17

can you send me the correct wireless-gpsr.tcl for runing the nam?

muaz.sh 03-16-2012 03:46 AM

Dear mdkhasawneh,
nam is just an another program like ns, so if you need to run it you must call it from shell: nam <nam trace file>, or you can run it from within tcl script by this command: exec nam <nam trace file>

muaz.sh 03-16-2012 10:06 AM

In order to surpass the problem of "node X is not defined" you need to add this loop after the definition of the nodes i.e after if { $opt(sc) == "" } statement:

for {set i 0} {$i < $opt(nn) } {incr i} {
$ns_ initial_node_pos $node_($i) 10
}
where
$ns_ initial_node_pos node size
command defines the node initial position in nam. <size> denotes the size of node in nam. This function must be called after mobility model has been defined.

Menik 03-18-2012 06:19 PM

Hi nimacasino,
Could you please let me know how did you fix GPSR for NS2.34 ?
I am also referring the link. However, thanking you if you can explain it in steps.
Thanks in advance !

Menik 03-18-2012 10:40 PM

HI Mauz.sh,

Are the steps mentioned in #16 are valid for NS2.35 as well ?
I am getting an error when i type "ns wireless-gpsr.tcl". Any help ?

mdkhasawneh 03-19-2012 07:39 AM

Hello i run GPSR Successfully from Keliu GPSR implementation.
when i run nam nam.out.tr i can see the radio range for nodes and transmission but the nodes are static and not moving. is this ok or nodes can be moving also.

i have another problem in understanding the trace file format from nam.out.tr to represent the result in grapgh.

it look different from the trace file format at

http://www.cs.binghamton.edu/~kliu/r...ode/index.html

i will attache some data from nam.out.tr and please if anyone can understand the format explain for me.

Code:


r -t 0.060020077 -s 30 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 13 -k RTR
r -t 0.060020077 -s 21 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 13 -k RTR
r -t 0.060020104 -s 11 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 13 -k RTR
r -t 0.060020104 -s 31 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 13 -k RTR
r -t 0.060020143 -s 0 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 13 -k RTR
r -t 0.060020143 -s 40 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 13 -k RTR
r -t 0.060020143 -s 22 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 13 -k RTR
+ -t 0.068286028 -s 40 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
- -t 0.068286028 -s 40 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
h -t 0.068286028 -s 40 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
r -t 0.069482095 -s 30 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
r -t 0.069482095 -s 50 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
r -t 0.069482095 -s 41 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
r -t 0.069482123 -s 31 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
r -t 0.069482123 -s 51 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
r -t 0.069482162 -s 20 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
r -t 0.069482162 -s 60 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
r -t 0.069482162 -s 42 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 14 -k RTR
+ -t 0.088690801 -s 58 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 15 -k RTR
- -t 0.088690801 -s 58 -d -1 -p gpsr -e 29 -c 2 -a 0 -i 15 -k RTR

where the format at http://www.cs.binghamton.edu/~kliu/r...ode/index.html

look like

Code:


s 76.000000000 _98_ AGT  --- 1812 cbr 32 [0 0 0 0] ------- [98:0 0:0 32 0]
r 0.010176954 _9_ RTR  --- 1 gpsr 29 [0 ffffffff 8 800] ------- [8:255 -1:255 32 0]


Menik 03-19-2012 03:42 PM

Hi
When I run the same code with modifications ia m getting a run time error. mdkhasawneh, which NS2 version you are running and on which platform ? Thanks in advance.
I am geting below runtime error for ns wireless-gpsr.tcl

* glibc detected * ns: free(): invalid next size (fast): 0x08ede2f0 ***
======= Backtrace: =========
/lib/libc.so.6[0x5646c5]
/lib/libc.so.6(cfree+0x59)[0x564b09]
/lib/libc.so.6[0x51bf12]
/lib/libc.so.6[0x51ac83]
/lib/libc.so.6(setlocale+0x178)[0x51a688]
ns[0x84d63ff]
ns[0x8464965]
ns(Tcl_FindExecutable+0x17)[0x84600d7]
ns(Tcl_Main+0x32)[0x84942e2]
ns(nslibmain+0x20)[0x8413de2]
ns(main+0x22)[0x8413e3e]
/lib/libc.so.6(__libc_start_main+0xdc)[0x510e9c]
ns(__gxx_personality_v0+0x37d)[0x819b8b1]
======= Memory map: ========
00200000-00201000 r-xp 00200000 00:00 0 [vdso]
004c6000-004d1000 r-xp 00000000 fd:00 3209017 /lib/libgcc_s-4.1.2-20080825.so.1
004d1000-004d2000 rwxp 0000a000 fd:00 3209017

PRINCY 03-22-2012 11:12 AM

Hi,

I have patched the Ke Liu's GPSR implementation in NS-2.34 ..but the nodes are not moving in nam....can any one help me ?

Menik 03-25-2012 07:25 AM

Hi All,
Can anyone please explain how to get x, y coordinates on C++ code
?
If anyone could please letme know a place I can find atleast an example.

Thanks

Menik 03-27-2012 04:24 PM

Hi All,
If anyone who is familier with the GPSR protocol and if you know how they print the X Y coordinates please explain how they have done it.
I know it uses MobileNode.h hearder and call functions in that class.
But from where do we pass the nodes to the C++ class ?
Because most of the wireless examples (e.g. AODV), we define the adhoc routing protocol when configure the node.

Please help me.
Thanks,

Menik 04-03-2012 12:46 AM

HI All,
Is there anyone who is working on WSN. I have some questions tobe clarified. Please send me an email to menikt@gmail.com and we can have a
discussion.
Thanks


All times are GMT -5. The time now is 08:23 AM.