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

sukhalid 12-18-2012 07:05 PM

GPSR no recieved packets
 
Hi, the problem might occur because of 1) you have changed initial energy in GPSR.tcl where nodes are declared, 2) you donot run simulation for sufficient time. If problem still there please consider sharing your tcl and gpsr.tcl files.
Good luck

knudfl 12-18-2012 11:20 PM

Post # 61, @sukhalid :

The two connected tcl files are here, post # 13 ..
http://www.linuxquestions.org/questi...4175440313/#13

ssoumayaa 12-19-2012 02:49 AM

Hello everybody,

Thanks alots for your help... finally i could make gpsr work on my scenario (tcl file)... now i need to know how can i make a performance evaluation using awk scripts or other thing ... if anyone can tell me what to do ... it will be very helpfull .. i.e: i would like to make some plots of delay , throughput, packet loss ... i know houw to do it for other protocols like AODV because i already found awk scripts to do it ... but for GPSR i didn't find anything and its trace is different from others so that i can't use the same awk scripts with it ...

this is my new trace file :

Code:


# author: Thomas Ogilvie
# sample tcl script showing the use of GPSR and HLS (hierarchical location service)


## GPSR Options
Agent/GPSR set bdesync_                0.5 ;# beacon desync random component
Agent/GPSR set bexp_                  [expr 3*([Agent/GPSR set bint_]+[Agent/GPSR set bdesync_]*[Agent/GPSR set bint_])] ;# beacon timeout interval
Agent/GPSR set pint_                  1.5 ;# peri probe interval
Agent/GPSR set pdesync_                0.5 ;# peri probe desync random component
Agent/GPSR set lpexp_                  8.0 ;# peris unused timeout interval
Agent/GPSR set drop_debug_            1  ;#
Agent/GPSR set peri_proact_            1          ;# proactively generate peri probes
Agent/GPSR set use_implicit_beacon_    1  ;# all packets act as beacons; promisc.
Agent/GPSR set use_timed_plnrz_        0  ;# replanarize periodically
Agent/GPSR set use_congestion_control_ 0
Agent/GPSR set use_reactive_beacon_    0  ;# only use reactive beaconing

set val(bint)          0.5  ;# beacon interval
set val(use_mac)        1    ;# use link breakage feedback from MAC
set val(use_peri)      1    ;# probe and use perimeters
set val(use_planar)    1    ;# planarize graph
set val(verbose)        1    ;#
set val(use_beacon)    1    ;# use beacons at all
set val(use_reactive)  0    ;# use reactive beaconing
set val(locs)          0    ;# default to OmniLS
set val(use_loop)      0    ;# look for unexpected loops in peris

set val(agg_mac)          1 ;# Aggregate MAC Traces
set val(agg_rtr)          0 ;# Aggregate RTR Traces
set val(agg_trc)          0 ;# Shorten Trace File


set val(chan)                Channel/WirelessChannel
set val(prop)                Propagation/TwoRayGround
set val(netif)                Phy/WirelessPhy
set val(mac)                Mac/802_11
set val(ifq)                Queue/DropTail/PriQueue
set val(ll)                LL
set val(ant)                Antenna/OmniAntenna
set val(x)                2000      ;# X dimension of the topography
set val(y)                2000      ;# Y dimension of the topography
set val(ifqlen)                512      ;# max packet in ifq
set val(seed)                1.0
set val(adhocRouting)        GPSR      ;# AdHoc Routing Protocol
set val(nn)                10      ;# how many nodes are simulated
set val(stop)                40.0    ;# simulation time
set val(use_gk)                0          ;# > 0: use GridKeeper with this radius
set val(zip)                0        ;# should trace files be zipped

set val(agttrc)        ON ;# Trace Agent
set val(rtrtrc)        ON ;# Trace Routing Agent
set val(mactrc)        ON ;# Trace MAC Layer
set val(movtrc)        ON ;# Trace Movement


set val(lt)                ""
#set val(cp)                "cp-n40-a40-t40-c4-m0"
set val(sc)                "./changjing1.tcl"

set val(out)            "hls_test.tr"

Agent/GPSR set locservice_type_ 3

add-all-packet-headers
remove-all-packet-headers
add-packet-header Common Flags IP LL Mac Message GPSR  LOCS SR RTP Ping HLS

Agent/GPSR set bint_                  $val(bint)
# Recalculating bexp_ here
Agent/GPSR set bexp_                [expr 3*([Agent/GPSR set bint_]+[Agent/GPSR set bdesync_]*[Agent/GPSR set bint_])] ;# beacon timeout interval
Agent/GPSR set use_peri_              $val(use_peri)
Agent/GPSR set use_planar_            $val(use_planar)
Agent/GPSR set use_mac_              $val(use_mac)
Agent/GPSR set use_beacon_            $val(use_beacon)
Agent/GPSR set verbose_              $val(verbose)
Agent/GPSR set use_reactive_beacon_  $val(use_reactive)
Agent/GPSR set use_loop_detect_      $val(use_loop)

CMUTrace set aggregate_mac_          $val(agg_mac)
CMUTrace set aggregate_rtr_          $val(agg_rtr)



# ======================================================================
# seeding RNG

ns-random $val(seed)

# create simulator instance
set ns_                [new Simulator]
set loadTrace  $val(lt)
set topo        [new Topography]
$topo load_flatgrid $val(x) $val(y)
set tracefd        [open $val(out) w]
#$ns_ use-newtrace
set nf                [open hls.nam w]                ;# trace and nam file
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $nf 2000 2000 ;# mobily topo x&y
set chanl [new $val(chan)]


# Create God
set god_ [create-god $val(nn)]

# Attach Trace to God
set T [new Trace/Generic]
$T attach $tracefd
$T set src_ -5
$god_ tracetarget $T

## ======================================================================
# Define Nodes
## ======================================================================

puts "Configuring Nodes ($val(nn))"
$ns_ node-config -adhocRouting $val(adhocRouting) \
                -llType $val(ll) \
                -macType $val(mac) \
                -ifqType $val(ifq) \
                -ifqLen $val(ifqlen) \
                -antType $val(ant) \
                -propType $val(prop) \
                -phyType $val(netif) \
                -channel $chanl \
                -topoInstance $topo \
                -wiredRouting OFF \
                -mobileIP OFF \
                -agentTrace $val(agttrc) \
                -routerTrace $val(rtrtrc) \
                -macTrace $val(mactrc) \
                -movementTrace $val(movtrc)

## ======================================================================
#  Create the specified number of nodes [$val(nn)] and "attach" them
#  to the channel.
## ======================================================================

for {set i 0} {$i < $val(nn) } {incr i} {
    set node_($i) [$ns_ node]
    $node_($i) random-motion 0                ;# disable random motion
       
    # Bring Nodes to God's Attention
    $god_ new_node $node_($i)
}


#Setup UDP connection
set udp_s [new Agent/UDP]
set udp_r [new Agent/Null]
$ns_ attach-agent $node_(0) $udp_s
$ns_ attach-agent $node_(5) $udp_r


#Setup a MM Application
set e [new Application/Traffic/CBR]
$e set packetSize_ 500
$e set rate_  20Kb
$e set random_ 1
#$e attach-agent $udp_r
$e attach-agent $udp_s
$ns_ connect $udp_s $udp_r
#$ns_ at 0.0 "$e start"
$ns_  at 1.0 "$e start"
$ns_  at 2.0 "$e stop "


source $val(sc)

#source $val(cp)

## ======================================================================
# Tell nodes when the simulation ends
## ======================================================================

for {set i 0} {$i < $val(nn) } {incr i} {
    $ns_ at $val(stop).0 "$node_($i) reset";
}

$ns_ at  $val(stop).0002 "puts \"NS EXITING... $val(out)\" ; $ns_ halt"

proc stop {} {
          global ns_ tracefd
        global ns_ nf
            $ns_ flush-trace
        close $nf
            close $tracefd
        exit 0
}

puts "Starting Simulation..."
$ns_ run


ssoumayaa 12-19-2012 03:23 AM

i have "./changjing1.tcl" and the trace fil from which i need to plot some graphics but i couldn't send it here becase i had this message "The text that you have entered is too long (1730523 characters). Please shorten it to 30000 characters long."

i don't know how to let you see it ..

Thank you in advance

knudfl 12-19-2012 03:44 AM

# 64
Quote:

"The text that you have entered is too long (1730523 characters).
Please shorten it to 30000 characters long."

I don't know how to let you see it ..
Small files can be attached as <file-name>.gz.txt

Example : $ gzip fangzhen1.tr && mv fangzhen1.tr.gz fangzhen1.tr.gz.txt
... Then it's down from 174.8 kB to 22.4 kB.

Attachments : The paper clip tool in the 'Advanced Editor'.

.

VanetG 01-22-2013 12:59 AM

can u please tell why am i getting this error when i execute wireless.tcl
invalid command name "Agent/GPSR"
while executing
"Agent/GPSR set planar_type_ 0 "
(file "wireless-gpsr.tcl" line 112)
please reply asap
thanks

knudfl 01-22-2013 01:47 AM

Post # 66, @VanetG : Welcome to LQ.


Quote:

invalid command name "Agent/GPSR"
Possible issues that will cause this error :
1) Your install failed, or wasn't patched correctly.
2) A binary 'ns' from a "non GPSR" install was used.
3) 'ns-allinone-2.33/' was renamed or moved to another location.

-

info_mimi 01-23-2013 02:44 PM

Hello
i want to run GPSR in NS2 2.33 ,i should use only the implementation of Ke Liu's from this link
http://www.cs.binghamton.edu/~kliu/r...ode/index.html

or also i patch my ns2.33 like in post #11


i should use one methode or both of them ?
plz help me .............

knudfl 01-23-2013 03:26 PM

Post # 68, @info_mimi : Welcome to LQ.

You could use both : Set up two different ns-allinone-2.33/,
.. and find out which one can do the simulation you want.


( You can have as many versions of ns-allinone-2.xx as you want,
installed at the same time. But : Do not add any of them to a *PATH.)

P.S. : There is a binary package, GPSR-hls, gpsr-hls-2.33-ubuntu10_i386.deb,
post #3 here http://www.linuxquestions.org/questi...-4175446277/#3
.. so you do actually not have to build that one.

-

VanetG 01-25-2013 10:50 PM

Quote:

Originally Posted by knudfl (Post 4875211)
Post # 66, @VanetG : Welcome to LQ.



Possible issues that will cause this error :
1) Your install failed, or wasn't patched correctly.
2) A binary 'ns' from a "non GPSR" install was used.
3) 'ns-allinone-2.33/' was renamed or moved to another location.

-


I tried re installing ns again and have patched gpsr again
it was a successful make with last few lines being
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/gaurika/ns-allinone-2.34/ns-2.34/indep-utils/webtrace-conv/ucb'

Still when i run wireless-gpsr.tcl
i am getting same error
invalid command name "Agent/GPSR"
while executing
"Agent/GPSR set planar_type_ 1 "
(file "wireless-gpsr.tcl" line 112)

please help

knudfl 01-26-2013 01:59 AM

# 70

Please install the binary package, gpsr-hls-2.33-ubuntu10_i386.deb :
$ sudo dpkg -i gpsr-hls-2.33-ubuntu10_i386.deb
http://www.linuxquestions.org/questi...-4175446277/#3

Then you have a usable binary, 'ns-hls'.

-

VanetG 01-26-2013 03:09 AM

Quote:

Originally Posted by knudfl (Post 4877814)
# 70

Please install the binary package, gpsr-hls-2.33-ubuntu10_i386.deb :
$ sudo dpkg -i gpsr-hls-2.33-ubuntu10_i386.deb
http://www.linuxquestions.org/questi...-4175446277/#3

Then you have a usable binary, 'ns-hls'.

-

Could u please tell me the location where this package has to be installed, as i have installed it in my home folder and no new ns-hls folder has been created .
I think i am missing some step . please tell where am i going wrong

i am using ns2.34

Thanks

knudfl 01-26-2013 03:15 AM

# 72
Quote:

Could u please tell me the location where this package has to be installed
That's not how things work with an Ubuntu / .deb package :
http://www.linuxquestions.org/questi...-4175446277/#3
→ The files are automatically installed to /usr/local/bin/ns-hls
.. and /usr/local/lib/gpsr-hls/ns-allinone-2.33/hls-utils/
.. when you do $ sudo dpkg -i gpsr-hls-2.33-ubuntu10_i386.deb

-

VanetG 01-26-2013 03:22 AM

Quote:

Originally Posted by knudfl (Post 4877842)
# 72

That's not how things work with an Ubuntu / .deb package :
http://www.linuxquestions.org/questi...-4175446277/#3
→ The files are automatically installed to /usr/local/bin/ns-hls
.. and /usr/local/lib/gpsr-hls/ns-allinone-2.33/hls-utils/
.. when you do $ sudo dpkg -i gpsr-hls-2.33-ubuntu10_i386.deb

-

i ran the deb file it executed
but the AGENT/GPSR error still exists

i followed the steps :
"
Hi there
I am using ns2.34 the following steps are workable to include Keliu GPSR implementation which could be downloaded from http://www.cs.binghamton.edu/~kliu/r...ode/index.html:
1- follow the three steps you find in the readme, but at step "2" you need to follow "or sentence" i.e you need to modify the files rather than replace them, here you will find some structural difference between Keliu files and ns2.34 files but all you need to do is to do the simple modifications which are mentioned within step "2" of the readme.txt file
2- after you performe step 3 i.e recompilation of ns2.34 "it should be error free" then you can test wireless-gpsr.tcl "

knudfl 01-26-2013 05:59 AM

Ref. # 70
Quote:

invalid command name "Agent/GPSR"
Are you sure you have the ns-2.34/gpsr/ directory ?

And did you add the new lines to the Makefile ( or Makefile.in ) ?
( Line 330 in the Makefile.in )
Code:

          gpsr/gpsr_neighbor.o \
        gpsr/gpsr_sinklist.o \
        gpsr/gpsr.o

The valid link is http://www.cs.binghamton.edu/~kliu/r...ndex.html#gpsr
( The link in post # 74 is a copy of "half a link".)

-


All times are GMT -5. The time now is 05:42 PM.