Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm using Ns2.35 in ubuntu 14.04.
I want to simulate GPSR routing protocol on it, but it's not work.
Maybe code is wrong (i download it on the internet) or GPSR doesn't work on ns2.35, i think.
this is the code of GPSR.
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 opt(bint) 1.0 ;# beacon interval
set opt(use_mac) 1 ;# use link breakage feedback from MAC
set opt(use_peri) 1 ;# probe and use perimeters
set opt(use_planar) 1 ;# planarize graph
set opt(verbose) 1 ;#
set opt(use_beacon) 1 ;# use beacons at all
set opt(use_reactive) 0 ;# use reactive beaconing
set opt(locs) 0 ;# default to OmniLS
set opt(use_loop) 0 ;# look for unexpected loops in peris
set opt(agg_mac) 1 ;# Aggregate MAC Traces
set opt(agg_rtr) 0 ;# Aggregate RTR Traces
set opt(agg_trc) 0 ;# Shorten Trace File
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
set opt(ll) LL
set opt(ant) Antenna/OmniAntenna
set opt(x) 1020 ;# X dimension of the topography
set opt(y) 1020 ;# Y dimension of the topography
set opt(ifqlen) 512 ;# max packet in ifq
set opt(seed) 1.0
set opt(adhocRouting) GPSR ;# AdHoc Routing Protocol
set opt(nn) 60 ;# how many nodes are simulated
set opt(stop) 300.0 ;# simulation time
set opt(use_gk) 0 ;# > 0: use GridKeeper with this radius
set opt(zip) 0 ;# should trace files be zipped
set opt(agttrc) ON ;# Trace Agent
set opt(rtrtrc) ON ;# Trace Routing Agent
set opt(mactrc) OFF ;# Trace MAC Layer
set opt(movtrc) OFF;# Trace Movement
set opt(lt) ""
set opt(cp) "./cbr/n60/n60_ms15_rate025_size64_seed2"
set opt(sc) "./scenario/n60/d500_n60_x1020_y1020_h10_l0_p0"
set opt(out) "result_gpsr.tr"
Agent/GPSR set locservice_type_ 2
Agent/GPSR set bint_ $opt(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_ $opt(use_peri)
Agent/GPSR set use_planar_ $opt(use_planar)
Agent/GPSR set use_mac_ $opt(use_mac)
Agent/GPSR set use_beacon_ $opt(use_beacon)
Agent/GPSR set verbose_ $opt(verbose)
Agent/GPSR set use_reactive_beacon_ $opt(use_reactive)
Agent/GPSR set use_loop_detect_ $opt(use_loop)
CMUTrace set aggregate_mac_ $opt(agg_mac)
CMUTrace set aggregate_rtr_ $opt(agg_rtr)
# seeding RNG
ns-random $opt(seed)
# create simulator instance
set ns_ [new Simulator]
set loadTrace $opt(lt)
set topo [new Topography]
$topo load_flatgrid $opt(x) $opt(y)
set tracefd [open $opt(out) w]
$ns_ trace-all $tracefd
set chanl [new $opt(chan)]
# Create God
set god_ [create-god $opt(nn)]
# Attach Trace to God
set T [new Trace/Generic]
$T attach $tracefd
$T set src_ -5
$god_ tracetarget $T
#
# Define Nodes
#
puts "AdHoc Routing Protocol ($opt(adhocRouting))"
puts "Configuring Nodes ($opt(nn))"
puts "Time Simulation ($opt(stop))"
$ns_ node-config -adhocRouting $opt(adhocRouting) \
-llType $opt(ll) \
-macType $opt(mac) \
-ifqType $opt(ifq) \
-ifqLen $opt(ifqlen) \
-antType $opt(ant) \
-propType $opt(prop) \
-phyType $opt(netif) \
-channel $chanl \
-topoInstance $topo \
-wiredRouting OFF \
-mobileIP OFF \
-agentTrace $opt(agttrc) \
-routerTrace $opt(rtrtrc) \
-macTrace $opt(mactrc) \
-movementTrace $opt(movtrc)
#
# Create the specified number of nodes [$val(nn)] and "attach" them
# to the channel.
for {set i 0} {$i < $opt(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
set ragent [$node_($i) set ragent_]
$ragent install-tap [$node_($i) set mac_(0)]
if { $opt(mac) == "Mac/802_11" } {
# bind MAC load trace file
[$node_($i) set mac_(0)] load-trace $loadTrace
}
# Bring Nodes to God's Attention
$god_ new_node $node_($i)
}
source $opt(sc)
source $opt(cp)
#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $opt(nn) } {incr i} {
$ns_ at $opt(stop).0 "$node_($i) reset";
}
$ns_ at $opt(stop).0002 "puts \"NS EXITING... $opt(out)\" ; $ns_ halt"
puts "Starting Simulation..."
$ns_ run
#2
Dear knudfl
I have sucseccfully run GPSR in ns2 by folow this guid.
Code:
> patch GPSR in ns-2.35
$ 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/0B7S255p3kFXNSGJCZ2YzUGJDVk0/view?usp=sharing
$ cd ns-allinone-2.35/
$ patch -p0 < GPSR-hls_ns235.patch
https://drive.google.com/file/d/0B7S255p3kFXNcGFJbGttY2dLT2M/view?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/0B7S255p3kFXNVDVyb190WVdyOVE/view?usp=sharing
and this is result
Code:
phuc@ubuntu:~/Desktop/simulation/gpsr-hls-examples-05.14/hls-utils$ ns-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!
can you show me how to run NAM file to see nodes move and communicate with each other.
thank for your time!
Regards!
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517
Rep:
Nam : $ cd ns-allinone-2.35/nam-1.15/
$ sudo make install
The nam output file from the ssoumayaa.tcl simulation is fangzhen1.nam :
$ nam fangzhen1.nam
... But not much activity. Please try out the other simulation files.
Dear knudfl
I was install another Ns2.35 to instanll GPSR-Keliu on it.
From #2,#3 of this link :http://www.linuxquestions.org/questi...-4175528835/#2
But when i do this: $ns-gpsr-keliu (name).tcl to simulate but it doesn't work.
When i install GPSR-hls, i have download this file be for install : ns-allinone-2.35_gcc482.tar.gz
But, when i install GPSR-KEliu, i didn't see any kind of that file in the link above.
Can you help me for this problem? Thank you so much!
gpsr-KeLiu_ns235.patch
and i already patch gpsr-keliu on ns2.35, but when i do this: ns-gpsr-keliu <name>.tcl
have the error that: ns-gpsr-keliu command not found
Thanks
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517
Rep:
Re #9.
The command 'ns-gpsr-keliu' can be used only if you create the file 'ns-gpsr-keliu':
$ cd ns-2.35/
$ cp ns ns-gpsr-keliu
$ sudo cp ns-gpsr-keliu /usr/local/bin/
Dear knudfl
I try to run GPSR in ns2 but when i use this code
Code: patch -p0 < GPSR-hls_ns235.patch
i have an error which is
bash: GPSR-hls_ns235.patch: No such file or directory
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,517
Rep:
Re post #11, @ranoucha : Welcome to LQ.
The easy way : Copy the file GPSR-hls_ns235.patch to ns-allinone-2.35/.
I.e. the patch must be present when using the command $ patch -p0 < GPSR-hls_ns235.patch
(Also possible with $ patch -p0 < /home/ranoucha/Downloads/GPSR-hls_ns235.patch ,,,
if you are keeping the file in Downloads/).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.