LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to patch GPSR routing protocol to ns-2.35 (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-patch-gpsr-routing-protocol-to-ns-2-35-a-4175431318/)

sukhalid 10-09-2012 06:52 AM

How to patch GPSR routing protocol to ns-2.35
 
Hi,
I have patched GPSR to ns-2.35 using keliu' code. It works fine with given tcl file. I need to move nodes according to mine own mobility scenario and compare them to AODV protocol.
I have two problems
1. I don't understand what this command in gpsr.tcl file means
Code:

proc gpsr-create-mobile-node { id args } {
        .........................       
if [info exists opt(energy)] {
        $node addenergymodel [new $opt(energy) $node 10 0.5 0.2]}
        .............

What are these figures (0.5, 0.2), are these energy consumed in reception and transmission or some thing else.

Secondly I want move mobile node created using proc defined in gpsr.tcl file according to my own mobility plan e.g.
Code:

$ns_ at 0.000000000000 "$node_(0) setdest 144.816950690450 20.073824649527 0.324133202939"
$ns_ at 0.000000000000 "$node_(1) setdest 93.957720171475 192.140808646867 1.452613500562"
$ns_ at 12.158688172971 "$node_(23) setdest 113.137798368154 39.443538618334 0.902003496971"
$ns_ at 14.805074599534 "$node_(2) setdest 152.227654369397 20.766089279052 1.742469780423"

But when I run simulation it gives error like this:[QUOTE]Load complete...
Starting Simulation...
ns: _o18 setdest 144.816950690450 20.073824649527 0.324133202939:
(_o18 cmd line 1)
invoked from within
"_o18 cmd setdest 144.816950690450 20.073824649527 0.324133202939"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o18" line 2)
(SplitObject unknown line 2)
invoked from within
"_o18 setdest 144.816950690450 20.073824649527 0.324133202939"
[\QUOTE]
Urgent help is needed please

ImaneZ 07-26-2013 06:46 AM

About patching GPSR
 
Hello,

Please i want to patch GPSR on NS2.35 and i don't know how?

can you help me, and send me the module and the patch if it's possible!

thanx in advance.

hemantnyadav 08-15-2013 11:56 PM

I need patch for GPSR to ns2.35 and please tell me how to install or use
 
[QUOTE=sukhalid;4801195]Hi,
I have patched GPSR to ns-2.35 using keliu' code. It works fine with given tcl file. I need to move nodes according to mine own mobility scenario and compare them to AODV protocol.
I have two problems
1. I don't understand what this command in gpsr.tcl file means
Code:

proc gpsr-create-mobile-node { id args } {
        .........................       
if [info exists opt(energy)] {
        $node addenergymodel [new $opt(energy) $node 10 0.5 0.2]}
        .............

What are these figures (0.5, 0.2), are these energy consumed in reception and transmission or some thing else.

Secondly I want move mobile node created using proc defined in gpsr.tcl file according to my own mobility plan e.g.
Code:

$ns_ at 0.000000000000 "$node_(0) setdest 144.816950690450 20.073824649527 0.324133202939"
$ns_ at 0.000000000000 "$node_(1) setdest 93.957720171475 192.140808646867 1.452613500562"
$ns_ at 12.158688172971 "$node_(23) setdest 113.137798368154 39.443538618334 0.902003496971"
$ns_ at 14.805074599534 "$node_(2) setdest 152.227654369397 20.766089279052 1.742469780423"

But when I run simulation it gives error like this:
Quote:

Load complete...
Starting Simulation...
ns: _o18 setdest 144.816950690450 20.073824649527 0.324133202939:
(_o18 cmd line 1)
invoked from within
"_o18 cmd setdest 144.816950690450 20.073824649527 0.324133202939"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o18" line 2)
(SplitObject unknown line 2)
invoked from within
"_o18 setdest 144.816950690450 20.073824649527 0.324133202939"
[\QUOTE]
Urgent help is needed please

maulanaibrahim 05-27-2014 11:29 AM

ask for solving problem
 
im facing the same problem..are you solved the problem? please share the solution..i really need it.thx

farfattou 08-09-2014 08:45 AM

hi,
I need to patch gpsr on ns-2.35
any help plz

knudfl 12-20-2014 07:32 AM

New patches :

GPSR-KeLiu, ns235 https://drive.google.com/file/d/0B7S...ew?usp=sharing
→ gpsr-KeLiu_ns235.patch

GPSR-KeLiu, ns234 https://drive.google.com/file/d/0B7S...ew?usp=sharing
→ gpsr-KeLiu_ns234.patch

GPSR-hls, ns235 http://network-simulator-ns-2.7690.n...g-td29371.html

GPSR-hls, ns234 https://drive.google.com/file/d/0B7S...ew?usp=sharing
→ GPSR-hls_ns234.patch

-

Noor Hassan Baloch 02-17-2015 12:50 PM

how to patch GPSR in NS2.35

knudfl 02-17-2015 01:22 PM

← ← #7.

? How to patch ns-2.35 with gpsr :
Please read post #6, and follow the links.

huynhloc.dv11 04-10-2015 10:00 PM

Can you help me??
 
I did install patch for ns2.35.

But i can't run file keliu gpsr.tcl with command: ns-keliu gpsr.tcl

huynhloc@ubuntu:~/ns/ns-allinone-2.35/ns-2.35$ cd examples-01.2015
huynhloc@ubuntu:~/ns/ns-allinone-2.35/ns-2.35/examples-01.2015$ ns-keliu gpsr50.tcl
ns-keliu: command not found

knudfl 04-11-2015 04:22 AM

Post #9, @huynhloc.dv11 : Welcome to LQ.

The file "ns-keliu" must be created, before you can use it.

Example :
$ cd ns-allinone-2.35/ns-2.35/
$ cp ns ns235-KeLiu ( Any name can be used )
$ sudo cp ns235-KeLiu /usr/local/bin/


-

h8yung 06-24-2016 03:12 AM

do you get the right result?
 
[QUOTE=hemantnyadav;5010173]
Quote:

Originally Posted by sukhalid (Post 4801195)
Hi,
I have patched GPSR to ns-2.35 using keliu' code. It works fine with given tcl file. I need to move nodes according to mine own mobility scenario and compare them to AODV protocol.
I have two problems
1. I don't understand what this command in gpsr.tcl file means
Code:

proc gpsr-create-mobile-node { id args } {
        .........................       
if [info exists opt(energy)] {
        $node addenergymodel [new $opt(energy) $node 10 0.5 0.2]}
        .............

What are these figures (0.5, 0.2), are these energy consumed in reception and transmission or some thing else.

Secondly I want move mobile node created using proc defined in gpsr.tcl file according to my own mobility plan e.g.
Code:

$ns_ at 0.000000000000 "$node_(0) setdest 144.816950690450 20.073824649527 0.324133202939"
$ns_ at 0.000000000000 "$node_(1) setdest 93.957720171475 192.140808646867 1.452613500562"
$ns_ at 12.158688172971 "$node_(23) setdest 113.137798368154 39.443538618334 0.902003496971"
$ns_ at 14.805074599534 "$node_(2) setdest 152.227654369397 20.766089279052 1.742469780423"

But when I run simulation it gives error like this:


Rach k 06-25-2016 12:05 AM

hi sukkhalid,
i am facing the same problem as you mentioned in post #1. I have patched gpsr keliu for ns-2.34. May i know what steps has to be taken to correct it.

h8yung 06-25-2016 02:39 AM

your tcl have some problem.you should change your tcl.

Rach k 06-25-2016 03:39 AM

hi,
I have changed the values of number of nodes, seed value in wireless-gpsr.tcl and included node movement file generated by VanetMobiSim and Cbr file. which has worked well for both AODV and OLSR. But it isnt working for gpsr.
It shows the below error

Load complete...
Starting Simulation...
ns: _o18 setdest 144.816950690450 20.073824649527 0.324133202939:
(_o18 cmd line 1)
invoked from within
"_o18 cmd setdest 144.816950690450 20.073824649527 0.324133202939"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o18" line 2)
(SplitObject unknown line 2)
invoked from within
"_o18 setdest 144.816950690450 20.073824649527 0.324133202939"

Rach k 06-25-2016 04:41 AM

plz help me, anyone can say what is going wrong.
tcl code
Code:

# 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: /home/cvs/repository/kliu/ns2/gpsr/wireless-gpsr.tcl,v 1.8 2005/12/01 00:03:17 kliu Exp $
#
# Ported from CMU/Monarch's code, nov'98 -Padma.




# ======================================================================
# Default Script Options
# ======================================================================
set opt(chan)                Channel/WirelessChannel
set opt(prop)                Propagation/TwoRayGround
set opt(netif)                Phy/WirelessPhy
set opt(mac)                Mac/802_11
set opt(ifq)                Queue/DropTail/PriQueue        ;# for dsdv
set opt(ll)                LL
set opt(ant)            Antenna/OmniAntenna

set opt(x)                1001                ;# X dimension of the topography
set opt(y)                1001                ;# Y dimension of the topography
set opt(cp)                "cbr-15-5.tcl"
set opt(sc)                "scenario.ns_movements"

set opt(ifqlen)                50                ;# max packet in ifq
set opt(nn)                15                ;# number of nodes
set opt(seed)                5.0
set opt(stop)                1000.0                ;# simulation time
set opt(tr)                trace.tr                ;# trace file
set opt(nam)            nam.out.tr
set opt(rp)            gpsr                ;# routing protocol script (dsr or dsdv)
set opt(lm)            "off"                ;# log movement

# ======================================================================

LL set mindelay_                50us
LL set delay_                        25us
LL set bandwidth_                0        ;# not used

Agent/Null set sport_                0
Agent/Null set dport_                0

Agent/CBR set sport_                0
Agent/CBR set dport_                0

Agent/TCPSink set sport_        0
Agent/TCPSink set dport_        0

Agent/TCP set sport_                0
Agent/TCP set dport_                0
Agent/TCP set packetSize_        1460

Queue/DropTail/PriQueue set Prefer_Routing_Protocols    1

# unity gain, omni-directional antennas
# set up the antennas to be centered in the node and 1.5 meters above it
Antenna/OmniAntenna set X_ 0
Antenna/OmniAntenna set Y_ 0
Antenna/OmniAntenna set Z_ 1.5
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0

# Initialize the SharedMedia interface with parameters to make
# it work like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/WirelessPhy set CPThresh_ 10.0
Phy/WirelessPhy set CSThresh_ 1.559e-11
Phy/WirelessPhy set RXThresh_ 3.652e-10
Phy/WirelessPhy set Rb_ 2*1e6
Phy/WirelessPhy set freq_ 914e+6
Phy/WirelessPhy set L_ 1.0


# The transimssion radio range
#Phy/WirelessPhy set Pt_ 6.9872e-4    ;# ?m
Phy/WirelessPhy set Pt_ 8.5872e-4    ;# 40m
#Phy/WirelessPhy set Pt_ 1.33826e-3  ;# 50m
#Phy/WirelessPhy set Pt_ 7.214e-3    ;# 100m
#Phy/WirelessPhy set Pt_ 0.2818      ;# 250m
# ======================================================================

# Agent/GPSR setting
Agent/GPSR set planar_type_  1  ;#1=GG planarize, 0=RNG planarize
Agent/GPSR set hello_period_  5.0 ;#Hello message period

# ======================================================================

proc usage { argv0 }  {
        puts "Usage: $argv0"
        puts "\tmandatory arguments:"
        puts "\t\t\[-x MAXX\] \[-y MAXY\]"
        puts "\toptional arguments:"
        puts "\t\t\[-cp conn pattern\] \[-sc scenario\] \[-nn nodes\]"
        puts "\t\t\[-seed seed\] \[-stop sec\] \[-tr tracefile\]\n"
}


proc getopt {argc argv} {
        global opt
        lappend optlist cp nn seed sc stop tr x y

        for {set i 0} {$i < $argc} {incr i} {
                set arg [lindex $argv $i]
                if {[string range $arg 0 0] != "-"} continue

                set name [string range $arg 1 end]
                set opt($name) [lindex $argv [expr $i+1]]
        }
}


#proc cmu-trace { ttype atype node } {
#        global ns_ tracefd
#
#        puts ABC
#        if { $tracefd == "" } {
#                return ""
#        }
#        puts BCD
#        set T [new CMUTrace/$ttype $atype]
#        $T target [$ns_ set nullAgent_]
#        $T attach $tracefd
#        $T set src_ [$node id]
#       
#        $T node $node
#
#        return $T
#}




proc log-movement {} {
    global logtimer ns_ ns

    set ns $ns_
    source ../tcl/mobility/timer.tcl
    Class LogTimer -superclass Timer
    LogTimer instproc timeout {} {
        global opt node_;
        for {set i 0} {$i < $opt(nn)} {incr i} {
            $node_($i) log-movement
        }
        $self sched 0.1
    }

    set logtimer [new LogTimer]
    $logtimer sched 0.1
}

# ======================================================================
# Main Program
# ======================================================================
#
# Source External TCL Scripts
#
#source ../lib/ns-mobilenode.tcl

#if { $opt(rp) != "" } {
        #source ../mobility/$opt(rp).tcl
        #} elseif { [catch { set env(NS_PROTO_SCRIPT) } ] == 1 } {
        #puts "\nenvironment variable NS_PROTO_SCRIPT not set!\n"
        #exit
#} else {
        #puts "\n*** using script $env(NS_PROTO_SCRIPT)\n\n";
        #source $env(NS_PROTO_SCRIPT)
#}
#source ../tcl/lib/ns-cmutrace.tcl
source ../tcl/lib/ns-bsnode.tcl
source ../tcl/mobility/com.tcl

# do the get opt again incase the routing protocol file added some more
# options to look for
getopt $argc $argv

if { $opt(x) == 0 || $opt(y) == 0 } {
        usage $argv0
        exit 1
}

if {$opt(seed) > 0} {
        puts "Seeding Random number generator with $opt(seed)\n"
        ns-random $opt(seed)
}

#
# Initialize Global Variables
#
set ns_                [new Simulator]
set chan        [new $opt(chan)]
set prop        [new $opt(prop)]
set topo        [new Topography]

set tracefd  [open $opt(tr) w]
$ns_ trace-all  $tracefd

set namfile [open $opt(nam) w]
$ns_ namtrace-all $namfile

$topo load_flatgrid $opt(x) $opt(y)

$prop topography $topo

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


#
#  Create the specified number of nodes $opt(nn) and "attach" them
#  the channel.
#  Each routing protocol script is expected to have defined a proc
#  create-mobile-node that builds a mobile node and inserts it into the
#  array global $node_($i)
#

$ns_ node-config -adhocRouting gpsr \
                -llType $opt(ll) \
                -macType $opt(mac) \
                -ifqType $opt(ifq) \
                -ifqLen $opt(ifqlen) \
                -antType $opt(ant) \
                -propType $opt(prop) \
                -phyType $opt(netif) \
                -channelType $opt(chan) \
                -topoInstance $topo \
                -agentTrace ON \
                -routerTrace ON \
                -macTrace OFF \
                -movementTrace OFF

source ./gpsr.tcl

for {set i 0} {$i < $opt(nn) } {incr i} {
    gpsr-create-mobile-node $i
}


#
# Source the Connection and Movement scripts
#
if { $opt(cp) == "" } {
        puts "*** NOTE: no connection pattern specified."
        set opt(cp) "none"
} else {
        puts "Loading connection pattern..."
        source $opt(cp)
}




#
# Tell all the nodes when the simulation ends
#
for {set i 0} {$i < $opt(nn) } {incr i} {
    $ns_ at $opt(stop).000000001 "$node_($i) reset";
}
$ns_ at $opt(stop).00000001 "puts \"NS EXITING...\" ; $ns_ halt"


if { $opt(sc) == "" } {
        puts "*** NOTE: no scenario file specified."
        set opt(sc) "none"
} else {
        puts "Loading scenario file..."
        source $opt(sc)
        puts "Load complete..."
}

puts $tracefd "M 0.0 nn $opt(nn) x $opt(x) y $opt(y) rp $opt(rp)"
puts $tracefd "M 0.0 sc $opt(sc) cp $opt(cp) seed $opt(seed)"
puts $tracefd "M 0.0 prop $opt(prop) ant $opt(ant)"

puts "Starting Simulation..."

proc finish {} {
    global ns_ tracefd namfile
    $ns_ flush-trace
    close $tracefd
    close $namfile
    exit 0
}

$ns_ at $opt(stop) "finish"

$ns_ run

This is the output i m getting
Quote:

ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ ns-gpsr-keliu g1.tcl
Seeding Random number generator with 5.0

num_nodes is set 15
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...
SORTING LISTS ...DONE!
NS EXITING...


knudfl 06-25-2016 06:19 AM

Re #14, #15.

Your file ( Rach_k-gpsr_K.tcl ) is not very useful with no 'cbr-15-5.tcl' and 'scenario.ns_movements'.
Please upload the files to dropbox https://www.dropbox.com/ or 'Google Drive'.
And : Please tell which line(s) you edited, i.e. the line number(s).


One thing I can suggest is to set up GPSR-hls, it may be more robust with changes.
( If usable for your project.)
Remember ... you can have as many ns-allinone-2.xx as you want, at the same time.
GPSR-hls → → → /usr/local/bin/ns-hls ( Or whatever name you like for 'ns'.


-

Rach k 06-25-2016 07:06 AM

hello knudfl,

I have tried gpsr-hls too, but it wasn't working. so switched to k-gpsr.
so here are the links for all the files i used. Scenario.ns_movements was generated by VanetMobiSim.
https://www.dropbox.com/s/xgqfn5qo1wn0l3o/u.xml?dl=0

https://www.dropbox.com/s/vm9olci5pa...-15-5.tcl?dl=0
https://www.dropbox.com/s/0wk5d6y8hki8801/g1.tcl?dl=0
https://www.dropbox.com/s/nhbdcjgagb...movements?dl=0
What actual code is
Code:

set opt(x)                670                ;# X dimension of the topography
set opt(y)                670                ;# Y dimension of the topography
set opt(cp)                "./cbr100.tcl"
set opt(sc)                "./grid-deploy10x10.tcl"

set opt(ifqlen)                50                ;# max packet in ifq
set opt(nn)                100                ;# number of nodes
set opt(seed)                0.0
set opt(stop)                250.0                ;# simulation time

In tcl file what i have changed is
Code:

set opt(x)                1001                ;# X dimension of the topography
set opt(y)                1001                ;# Y dimension of the topography
set opt(cp)                "cbr-15-5.tcl"
set opt(sc)                "scenario.ns_movements"

set opt(ifqlen)                50                ;# max packet in ifq
set opt(nn)                15                ;# number of nodes
set opt(seed)                5.0
set opt(stop)                1000.0                ;# simulation time


knudfl 06-25-2016 10:26 AM

Re #17.
Code:

$ ns235-gpsr-K-64 g1.tcl
Seeding Random number generator with 5.0

num_nodes is set 15
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...                                         
SORTING LISTS ...DONE!                                         
NS EXITING...

... That's with a 64bits OS ... PCLinuxOS 2016 - 64.
* trace.tr = 14.4MB .
... And Ubuntu 10.10 - 32bits : Same OK result, and again trace.tr 14.4MB .

? Which OS are you using for gpsr-KeLiu ?


-

Rach k 06-25-2016 11:53 AM

re #18
I am using ubuntu 12.04.5 LTS 32 bits.
Even I am getting the same results

knudfl 06-25-2016 01:07 PM

Re #19, #15.

I misunderstood something, or read from the wrong post. (#14).
Your result in post #15 is perfect. What's the problem ? If any.




-

Rach k 06-25-2016 11:06 PM

Re #20
I was expecting this as the output
Code:

ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ ns-gpsr-keliu 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!
NS EXITING...

but what the problem is, there is no variations in results, like Throughput, packet delivery ratio and all. I am getting negative and zero. This is the result, I am getting.
Code:

ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ ns-gpsr-keliu g1.tclSeeding Random number generator with 5.0

num_nodes is set 15
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...
SORTING LISTS ...DONE!
NS EXITING...
ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ awk -f all.awk trace.tr
cbr s:0 r:0, r/s Ratio:-nan, f:38184
avg_end_to_end_delay 0.0000
ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ awk -f pdr.awk trace.tr
sent:38184 recieve:0, PDR:0.0000
ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ awk -f tput.awk trace.tr
Average Throughput[kbps] = -0.00                StartTime=6.32        StopTime=0.00

Code:

ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ ns-gpsr-keliu g4.tcl
Seeding Random number generator with 60.0

num_nodes is set 15
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...
SORTING LISTS ...DONE!
NS EXITING...
ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ awk -f pdr.awk trace.tr
sent:36357 recieve:0, PDR:0.0000
ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ awk -f tput.awk trace.tr
Average Throughput[kbps] = -0.00                StartTime=32.29        StopTime=0.00
ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ awk -f all.awk trace.tr
cbr s:0 r:0, r/s Ratio:-nan, f:36357
avg_end_to_end_delay 0.0000

so I am guessing it as a wrong result.

knudfl 06-26-2016 06:59 AM

Re #21.

It's a general issue with GPSR-KeLiu, (GPSR-hls?) that no packages are received.
See http://www.linuxquestions.org/questions/tags/gpsr/

Please check with the default examples :
GPSR_KeLiu_examples.06.2016.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

gpsr-hls-examples-03.15.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

Seed : Per definition the seed is always random.


-

Rach k 06-27-2016 12:09 AM

Re #22
Hello Mr. Knudfl,
Thank you for your generous help. I have tried default examples which is mentioned in #22, it isnt working. It is showing the following error.
Code:

ubuntu34@ubuntu:~/Downloads/keliu$ ns-gpsr-keliu wireless-gpsr.tcl
couldn't read file "../tcl/lib/ns-bsnode.tcl": no such file or directory
    while executing
"source.orig ../tcl/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 ../tcl/lib/ns-bsnode.tcl"
    (file "wireless-gpsr.tcl" line 198)

I have replaced the ns-bsnode.tcl and com.tcl

knudfl 06-27-2016 03:59 AM

Re #23.

tcl/lib/ns-bsnode.tcl and tcl/mobility/com.tcl :
The default wireless-gpsr.tcl was meant to be run from ns-2.3x/gpsr/.
In that way you have tcl/ available outside the gpsr/ folder.

Alternatively you can have a folder tcl/{lib/, mobility/} outside the examples folder.

'wireless-gpsr.tcl' depends on three configuration files : gpsr.tcl, ns-bsnode.tcl, com.tcl.
* gpsr.tcl, ns-bsnode.tcl, com.tcl cannot be replaced with some random files.


-

Rach k 06-28-2016 11:37 PM

Re #24,
@knudfl

Hi,I have corrected the above error. But what I am facing is unable to analyse the statastics like PDR,end-end delay, normalised routing load. The only result, I am getting is throughput, by the throughput2007.awk script.
Code:

ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ awk -f end-to-end.awk trace.tr
Total Delay ms:0.000000
Total Sent AGT CBR Packets :0.000000
Total Drop RTR Packets :0.000000
Number of RTR received packets:0.000000
Number of Agent CBR received packets:0.000000
Average Delay ms:-nan
Packet Delivery ratio PDR -nan
 The throughput in bits per second is 0.000000
 The spectral Efficiency in b/s/Hz is 0.000000

ubuntu34@ubuntu:~/Downloads/ns-allinone-2.34/ns-2.34/gpsr$ awk -f Throughput2007.awk trace.tr
Average Throughput[kbps] = 11123.03                StartTime=59.14        StopTime=999.90
Average Throughput[kbps] = 11123.03                StartTime=59.14        StopTime=999.90

All most all awk scripts I have tried, which you have mentioned in one of your earlier post in the folder "awk#perl#python__scripts-10.2015 (2)".
https://www.dropbox.com/s/kv3irmojc5...t2007.awk?dl=0

knudfl 06-29-2016 01:25 AM

Re #25.

Same with GPSR-hls :
Code:

$ awk -f throughput-2015.awk fangzhen1.tr
start Time = 1.000000, stopTime = 0.000000
sent_packets    396
received_packets 0
PDR 0.00%
Average Throughput[kbps] = -0.00  StartTime=1.00  StopTime = 0.00

Other suggestions : ns3 + GPSR, Omnet++.
ns3 https://groups.google.com/forum/?fro...rum/ns-3-users
Omnett++ https://groups.google.com/forum/?fro...!forum/omnetpp


-

Ruqayya 07-27-2016 08:31 AM

#20

@ Rach_k

hello. i m also stuck in the same problem. i have tried both gpsr-hls and gpsr-keliu versions. tried many awk scripts to get the statistics like throughput,Packet delivery ratio etc but no success. Any success in analysing these statistics?

Rach k 07-27-2016 11:15 PM

Re #27
@ Ruqayya

Hi, I haven't got the desired results. Sorry I couldn't help.

Ruqayya 07-28-2016 12:34 AM

Re#27
thanks for reply. one more question.
In the trace which i got through gpsr-hls patched which i changed according to my scenario, all recieved packets are at RTR level and no packet is recieved at AGT level why this is happening ?? please help

alwaleed16 07-28-2016 07:41 AM

Dear knudfl,

I patched GPSR in ns 2.35 on Ubuntu 12.04 32bit according to the following commands:

$ tar xvf ns-allinone-2.35_gcc482.tar.gz ( Patched for gcc-4.8.2 and -4.9.1 ).
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ cd ns-allinone-2.35/
$ patch -p0 < GPSR-hls_ns235.patch
https://drive.google.com/file/d/0B7S...ew?usp=sharing
$ ./install
$ cd ns-2.35/
$ cp ns ns-gpsr-hls
$ sudo cp ns-gpsr-hls /usr/local/bin/
... Then you can do: $ ns-gpsr-hls ssoumayaa.tcl
... from the examples, gpsr-hls-examples-05.14.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

But when I tried to run ssoumayaa.tcl example the following error appeared

Configuring Nodes (40)
INITIALIZE THE LIST xListHead
Starting Simulation...
Segmentation fault (core dumped)
khalid@khalid-VirtualBox:~/ns-allinone-2.35/ns-2.35/gpsr$

Please, how can I overwrite this problem.

Thanks

knudfl 07-28-2016 09:51 AM

Re post #30, @alwaleed16 : Welcome to LQ.

Ubuntu 12.04.5 - 32bits : Using "ns235-gpsr-hls", built today.
Code:

ns235-gpsr-hls ssoumayaa.tcl
num_nodes is set 2
INITIALIZE THE LIST xListHead
Starting Simulation...
radiorange 250, x 2000 y 500
length : 3.000000 , cellperline 12 , heigth 1.000000
maxlevel 3
radiorange 250, x 2000 y 500
length : 3.000000 , cellperline 12 , heigth 1.000000
maxlevel 3
SORTING LISTS ...DONE!

... But then again, I didn't update yesterday. Last update = Jun 19.
So maybe a new update made Ubuntu 12.04 ns2 hostile ?

There is a possible solution : You can use an older executable 'ns-hls'.
Provided by the package gpsr-hls-2.33-ubuntu10_i386.deb, once made with Ubuntu 10.10
https://drive.google.com/file/d/0B7S...ew?usp=sharing
... Download the package, and 1) cd Downloads/
2) sudo gdebi ./gpsr-hls-2.33-ubuntu10_i386.deb

The command 'ns-hls ssoumayaa.tcl' works perfect here too.

Latest examples, gpsr-hls-examples-05.15.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-

alwaleed16 07-29-2016 03:20 AM

Dear knudfl,

I re-patched GPSR in ns 2.35 and now it works fine after execute ssoumayaa.tcl

num_nodes is set 2
INITIALIZE THE LIST xListHead
Starting Simulation...
radiorange 250, x 2000 y 500
length : 3.000000 , cellperline 12 , heigth 1.000000
maxlevel 3
radiorange 250, x 2000 y 500
length : 3.000000 , cellperline 12 , heigth 1.000000
maxlevel 3
SORTING LISTS ...DONE!
khalid@khalid-VirtualBox:~/hls-utils_05.15$

But when I executed 130sec-1f-hls-1.tcl and tried to calculate the PDF, NRL, and e2e-delay from awk#perl#python__scripts-10.2015 for the trace file in the link below, the awk scripts didn't work property and give zero.

http://www.megafileupload.com/7fb7/1f-gpsr20_2.tr

Please, how can I get an awk scripts work with GPSR trace file.

Thanks

alwaleed16 07-30-2016 02:00 AM

Dear knudfl,

Please I need help regarding post #32.

Thanks

knudfl 07-30-2016 05:44 AM

Re #32.

"130sec-1f-hls-1.tcl" :
Seems the old version must be used, see post #31.
I.e. /usr/local/bin/ns-hls → → $ ns-hls 130sec-1f-hls-1.tcl
... I get a 13.4MB trace file = 1f-gpsr20_2.tr

Analyzing : I edited 'evaluate.pl', (typo´s edited) → new version = evaluate-2016.pl
$ perl evaluate-2016.pl -f 1f-gpsr20_2.tr
Saving the result :
perl evaluate-2016.pl -f 1f-gpsr20_2.tr 2>&1 | tee evaluate-2016__1f-gpsr20_2.tr.txt

The files evaluate-2016.pl, evaluate-2016__1f-gpsr20_2.tr.txt :
gpsr-hls-evaluate2016.tar.gz https://drive.google.com/file/d/0B7S...ew?usp=sharing

Note : No guaranties for the examples in hls-utils_05.15/ to work in a particular way.
You are welcome to add / upload your own improved simulation examples.


-

alwaleed16 07-30-2016 04:10 PM

Dear knudfl,

Please, how can I execute the 130sec-1f-hls-1.tcl in the following manner

I.e. /usr/local/bin/ns-hls → → $ ns-hls 130sec-1f-hls-1.tcl

The name of gpsr-hls-examples-05.15.tar.gz after extract it is hls-utils_05-15. where I should put the file?

Thanks

knudfl 07-31-2016 04:36 AM

Re #35.
Quote:

Please, how can I execute the 130sec-1f-hls-1.tcl
The folder hls-utils_05-15/ can have any location in /home/.
Example location : /home/[name]/ns2/gpsr-hls/hls-utils_05-15/


/usr/local/bin/ns-hls is provided by "gpsr-hls-2.33-ubuntu10_i386.deb".
Download and install, see post #31 :
sudo gdebi ./gpsr-hls-2.33-ubuntu10_i386.deb


-

alwaleed16 07-31-2016 09:33 AM

Dear knudfl,

I tried to install compiler version 4.1.2 in ubuntu 10.10 32 bit bu the following error appeared:

khalid@khalid-VirtualBox:~$ sudo apt-get install g++-4.1
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package g++-4.1
E: Couldn't find any package by regex 'g++-4.1'

Please, how can I overwrite this problem.

Thanks

knudfl 07-31-2016 10:24 AM

Re #37.

What's the purpose of g++-4.1 ? ? And Ubuntu 10.10 ?
Ubuntu 10.10 was usable for ns2 in year 2011. 2012 ?

And : There is no g++-4.1 by default with Ubuntu 10.10 .

alwaleed16 07-31-2016 10:57 AM

Dear knudfl,

The purpose of g++-4.1 is to patch GPSR in ns 2.33 according to the following commands

$ cd ns-allinone-2.33/
$ tar xvf gpsr-hls-ns233-patching.tar.bz2
$ export CC=gcc-4.1 CXX=g++-4.1
$ ./install

Thanks

knudfl 07-31-2016 11:55 AM

Re #39.

Still : You cannot build a version as stable as the old gpsr-hls-2.33-ubuntu10_i386.deb .

The latest available "style gcc-4.1" compilers are gcc-3.4.6 packages :
compat-gcc34_3.4.6-ubuntu10_i386.deb, compat-g++34_3.4.6-ubuntu10_i386.deb

compat-gcc34 https://drive.google.com/file/d/0B7S...ew?usp=sharing
compat-g++34 https://drive.google.com/file/d/0B7S...ew?usp=sharing

cd ns-allinone-2.33/
patch -p0 < GPSR-hls_ns233-2015.patch https://drive.google.com/file/d/0B7S...ew?usp=sharing
export CC=gcc34 CXX=g++34 && ./install


-

alwaleed16 07-31-2016 01:24 PM

Dear knudfl,

Please, how can I install gcc-3.4.6 packages in post #39 and what is the commands.

Thanks

knudfl 07-31-2016 03:04 PM

Re #41.

The install command for downloaded packages :
cd Downloads/
sudo dpkg -i compat-gcc34_3.4.6-ubuntu10_i386.deb compat-g++34_3.4.6-ubuntu10_i386.deb

( Or just : sudo dpkg -i compat-g* )

alwaleed16 08-01-2016 05:44 AM

Dear knudfl,

I installed GPSR in ns 2.33 on ubuntu 10.10 according to post #39 and after that installed the binary package

Binary package : gpsr-hls-2.33-ubuntu10_i386.deb
https://docs.google.com/file/d/0B7S2...pXOTBtZkk/edit
→ $ sudo dpkg -i gpsr-hls-2.33-ubuntu10_i386.deb

but when run ns-hls ssoumayaa.tcl

bash: :/usr/X11R6/lib:/usr/local/lib: No such file or directory
khalid@khalid-VirtualBox:~$ ns-hls ssoumayaa.tcl
couldn't read file "ssoumayaa.tcl": no such file or directory

Please, how can I overwrite this mistake.

Thanks

alwaleed16 08-02-2016 06:06 AM

Dear knudfl,

Finally, I got I a 13.4MB trace file when run 130sec-1f-hls-1.tcl. But when I tried to evaluate the packet delivery fraction for the trace file from the awk#perl#python__scripts-10.2015, I got the received packet larger than the source packet

khalid@khalid-VirtualBox:~$ awk -f pdf.awk 1f-gpsr20_2.tr
cbr s:1116 r:1318, r/s Ratio:1.1810, f:10692

Please, may you help me to get a PDF awk script works property.

Thanks

knudfl 08-02-2016 03:27 PM

Re #44.

Did you read post #34 about evaluate-2016.pl ?

The perl scripts are included with GPSR-hls for a reason.
And may be the only usable tools.

alwaleed16 08-02-2016 04:49 PM

Dear knudfl,

I had read post #34 and execute evaluate-2016.pl. If I will change to GPSR_KeLiu, the most of awk scripts in awk#perl#python will work or not.

Thank you for your support.

knudfl 08-03-2016 06:00 AM

Re #16.
Quote:

... I will change to GPSR_KeLiu, ...
No reason to "change", you can easily have two versions of ns-allinone.2.xx.

There is no limit for the number of ns-allinone.2.xx.
You can have as many as you want, installed at the same time.
* But do never add any *PATH text to .bashrc . Not at all required.
Just keep the the executable´s 'ns-name' in /usr/local/bin/ :
/usr/local/bin/{ ns-hls, ns235-gpsr-hls, ns235-gpsr-KeLiu }. Etc. etc.


-

alwaleed16 08-03-2016 07:33 AM

Dear knudfl,

I mean in post #46 if I will change to GPSR_KeLiu instead of GPSR_hls, can I get a trace file from tcl GPSR examples works better with awk scripts in awk#perl#python.

Thanks

alwaleed16 08-06-2016 06:05 AM

Dear knudfl,

Please, how can I generate a traffic file for GPSR like in the link below but with different number of nodes and connections.

http://www.megafileupload.com/buuE/cbr100.tcl

Thanks

alwaleed16 08-07-2016 05:39 AM

Dear knudfl,

Please, I need help about post #49.

Thanks


All times are GMT -5. The time now is 12:34 AM.