LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 03-15-2016, 04:50 AM   #61
dollmin
LQ Newbie
 
Registered: Mar 2016
Posts: 7

Rep: Reputation: Disabled
dbr script


This is DBR tcl script:
Quote:
set opt(chan) Channel/UnderwaterChannel
set opt(prop) Propagation/UnderwaterPropagation
set opt(netif) Phy/UnderwaterPhy
set opt(mac) Mac/UnderwaterMac/BroadcastMac
set opt(ifq) Queue/DropTail/PriQueue
set opt(ll) LL
set opt(energy) EnergyModel
set opt(txpower) 2.0
set opt(rxpower) 0.75
set opt(initialenergy) 10000
set opt(idlepower) 0.008
set opt(ant) Antenna/OmniAntenna
set opt(filters) GradientFilter ;# options can be one or more of
;# TPP/OPP/Gear/Rmst/SourceRoute/Log/TagFilter
set opt(minspeed) 0 ;#minimum speed of node
set opt(maxspeed) 3 ;#maximum speed of node
set opt(speed) 0.5 ;#speed of node
set opt(position_update_interval) 0.3 ;# the length of period to update node's position
set opt(packet_size) 50 ;#50 bytes
set opt(routing_control_packet_size) 20 ;#bytes

set opt(ifqlen) 50 ;# max queue length in if
set opt(nn) 6 ;# number of nodes
set opt(x) 1000 ;# X dimension of the topography
set opt(y) 10 ;# Y dimension of the topography
set opt(z) 10
set opt(seed) 11
set opt(stop) 500 ;# simulation time
set opt(prestop) 90 ;# time to prepare to stop
set opt(tr) "a.tr" ;# trace file
set opt(datafile) "a.data"
set opt(nam) "a.nam" ;# nam file
set opt(adhocRouting) DBR
set opt(interval) 10.0
set opt(range) 100 ;#range of each node in meters

if { $argc > 0 } {
set opt(seed) [lindex $argv 0]
set opt(nn) [lindex $argv 1]
set opt(datafile) [lindex $argv 2]
}

puts "the file name is $opt(datafile)"
puts "the sending interval is $opt(interval)"

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

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

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 Z_ 0.05
Antenna/OmniAntenna set Gt_ 1.0
Antenna/OmniAntenna set Gr_ 1.0

Mac/UnderwaterMac set bit_rate_ 1.0e4 ;#10kbps
Mac/UnderwaterMac set encoding_efficiency_ 1
Mac/UnderwaterMac/BroadcastMac set packetheader_size_ 0 ;# #of bytes

# Initialize the SharedMedia interface with parameters to make
# it work like the 914MHz Lucent WaveLAN DSSS radio interface
Phy/UnderwaterPhy set CPThresh_ 10 ;#10.0
Phy/UnderwaterPhy set CSThresh_ 0 ;#1.559e-11
Phy/UnderwaterPhy set RXThresh_ 0 ;#3.652e-10
#Phy/WirelessPhy set Rb_ 2*1e6
Phy/UnderwaterPhy set Pt_ 0.2818
Phy/UnderwaterPhy set freq_ 25 ;# 25khz
Phy/UnderwaterPhy set K_ 2.0 ;# spherical spreading

# =================================================================
# Main Program
# =================================================================

#
# Initialize Global Variables
#
#set sink_ 1
set ns_ [new Simulator]
set topo [new Topography]

$topo load_cubicgrid $opt(x) $opt(y) $opt(z)
$ns_ use-newtrace
set tracefd [open $opt(tr) w]
$ns_ trace-all $tracefd

set nf [open $opt(nam) w]
$ns_ namtrace-all-wireless $nf $opt(x) $opt(y)


set data [open $opt(datafile) a]


set total_number [expr $opt(nn)-1]
set god_ [create-god $opt(nn)]


$ns_ at 0.0 "$god_ set_filename $opt(datafile)"


set chan_1_ [new $opt(chan)]


global defaultRNG
$defaultRNG seed $opt(seed)


$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) \
#-channelType $opt(chan) \
-agentTrace OFF \
-routerTrace OFF \
-macTrace ON\
-topoInstance $topo\
-energyModel $opt(energy)\
-txPower $opt(txpower)\
-rxPower $opt(rxpower)\
-initialEnergy $opt(initialenergy)\
-idlePower $opt(idlepower)\
-channel $chan_1_


#Set the Sink node


set node_(0) [ $ns_ node 0]
$node_(0) set sinkStatus_ 1
$god_ new_node $node_(0)
$node_(0) set X_ 500
$node_(0) set Y_ 0
$node_(0) set Z_ 0
$node_(0) set passive 1

set rt [$node_(0) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)

set a_(0) [new Agent/UWSink]
$ns_ attach-agent $node_(0) $a_(0)
$a_(0) cmd set-range $opt(range)
$a_(0) cmd set-target-x -20
$a_(0) cmd set-target-y -10
$a_(0) cmd set-target-z -20
$a_(0) cmd set-filename $opt(datafile)
$a_(0) cmd set-packetsize $opt(packet_size) ;# # of bytes



set node_(1) [ $ns_ node 1]
$node_(1) set sinkStatus_ 1
$god_ new_node $node_(1)
$node_(1) set X_ 440
$node_(1) set Y_ 0
$node_(1) set Z_ 0
$node_(1) set passive 1

set rt [$node_(1) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)
$node_(1) set max_speed $opt(maxspeed)
$node_(1) set min_speed $opt(minspeed)
$node_(1) set position_update_interval_ $opt(position_update_interval)
set a_(1) [new Agent/UWSink]
$ns_ attach-agent $node_(1) $a_(1)
$a_(1) cmd set-range $opt(range)
$a_(1) cmd set-target-x -20
$a_(1) cmd set-target-y -10
$a_(1) cmd set-target-z -20
$a_(1) cmd set-filename $opt(datafile)
$a_(1) cmd set-packetsize $opt(packet_size) ;# # of bytes
#$node_(1) move

set node_(2) [ $ns_ node 2]
$node_(2) set sinkStatus_ 1
$node_(2) random-motion 1
$node_(2) set max_speed $opt(maxspeed)
$node_(2) set min_speed $opt(minspeed)
$node_(2) set position_update_interval_ $opt(position_update_interval)

$god_ new_node $node_(2)
$node_(2) set X_ 380
$node_(2) set Y_ 0
$node_(2) set Z_ 0
$node_(2) set passive 1

set rt [$node_(2) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)

set a_(2) [new Agent/UWSink]
$ns_ attach-agent $node_(2) $a_(2)
$a_(2) cmd set-range $opt(range)
$a_(2) cmd set-target-x -20
$a_(2) cmd set-target-y -10
$a_(2) cmd set-target-z -20
$a_(2) cmd set-filename $opt(datafile)
$a_(2) cmd set-packetsize $opt(packet_size) ;# # of bytes
#$node_(2) move


set node_(3) [ $ns_ node 3]
$node_(3) set sinkStatus_ 1
$node_(3) random-motion 1

$node_(3) set max_speed $opt(maxspeed)
$node_(3) set min_speed $opt(minspeed)
$node_(3) set position_update_interval_ $opt(position_update_interval)

$god_ new_node $node_(3)
$node_(3) set X_ 320
$node_(3) set Y_ 0
$node_(3) set Z_ 0
$node_(3) set passive 1

set rt [$node_(3) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)

set a_(3) [new Agent/UWSink]
$ns_ attach-agent $node_(3) $a_(3)
$a_(3) cmd set-range $opt(range)
$a_(3) cmd set-target-x -20
$a_(3) cmd set-target-y -10
$a_(3) cmd set-target-z -20
$a_(3) cmd set-filename $opt(datafile)
$a_(3) cmd set-packetsize $opt(packet_size) ;# # of bytes




set node_(4) [ $ns_ node 4]
$node_(4) set sinkStatus_ 1
$node_(4) random-motion 1

$node_(4) set max_speed $opt(maxspeed)
$node_(4) set min_speed $opt(minspeed)
$node_(4) set position_update_interval_ $opt(position_update_interval)

$god_ new_node $node_(4)
$node_(4) set X_ 260
$node_(4) set Y_ 0
$node_(4) set Z_ 0
$node_(4) set passive 1

set rt [$node_(4) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)

set a_(4) [new Agent/UWSink]
$ns_ attach-agent $node_(4) $a_(4)
$a_(4) cmd set-range $opt(range)
$a_(4) cmd set-target-x -20
$a_(4) cmd set-target-y -10
$a_(4) cmd set-target-z -20
$a_(4) cmd set-filename $opt(datafile)
$a_(4) cmd set-packetsize $opt(packet_size) ;# # of bytes




#Set the source node
set node_($total_number) [$ns_ node $total_number]
$god_ new_node $node_($total_number)

$node_($total_number) set sinkStatus_ 1

$node_($total_number) set X_ 200
$node_($total_number) set Y_ 0
$node_($total_number) set Z_ 0
$node_($total_number) set-cx 200
$node_($total_number) set-cy 0
$node_($total_number) set-cz 0
set rt [$node_($total_number) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)


set a_($total_number) [new Agent/UWSink]
$ns_ attach-agent $node_($total_number) $a_($total_number)
$a_($total_number) cmd set-range $opt(range)
$a_($total_number) cmd set-target-x 500
$a_($total_number) cmd set-target-y 0
$a_($total_number) cmd set-target-z 0
$a_($total_number) cmd set-filename $opt(datafile)
$a_($total_number) cmd set-packetsize $opt(packet_size) ;# # of bytes
$a_($total_number) set data_rate_ [expr 1.0/$opt(interval)]

# make nam workable
set node_size 10
for {set k 0} { $k<$opt(nn)} {incr k} {
$ns_ initial_node_pos $node_($k) $node_size
}


set opt(stop2) [expr $opt(stop)+200]


puts "Node $total_number is sending first!!"
$ns_ at 1.33 "$a_($total_number) cbr-start"
$ns_ at $opt(stop).001 "$a_($total_number) terminate"

$ns_ at $opt(stop2).002 "$a_(0) terminate"


$ns_ at $opt(stop2).003 "$god_ compute_energy"
$ns_ at $opt(stop2).004 "$ns_ nam-end-wireless $opt(stop)"
$ns_ at $opt(stop2).005 "puts "NS EXISTING..."; $ns_ halt"


puts $data "New simulation...."
puts $data "nodes = $opt(nn), maxspeed = $opt(maxspeed), minspeed = $opt(minspeed), random_seed = $opt(seed), sending_interval_=$opt(interval))"
puts $data "x= $opt(x) y= $opt(y) z= $opt(z)"
close $data
puts "starting Simulation..."
$ns_ run
this script which i have run and getting segmentation fault.
 
Old 03-17-2016, 06:33 PM   #62
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,381

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Re #61, @dollmin.

Code must be inside CODE tags, not QUOTE.
Code : Please type [code]code text[/code]
... Or use the " # " button in the 'Advanced Editor'.
* Please edit post #61.
Editing : That's the 'Edit' button in post #61.

Your file runs when your errors have been edited, but no content in a.nam, a.tr :
Code:
$ ns-aqua dbr-dollmin.tcl 
the file name is a.data
the sending interval is 10.0
num_nodes is set 6
INITIALIZE THE LIST xListHead
Node 5 is sending first!!
NS EXISTING...
starting Simulation...
... The "Segmentation fault" may be caused by other reasons : See post #60.
Easy to install more OS`s : Install 'VirtualBox'.
... And then install e.g. "Ubuntu 9.10 - i386" into VirtualBox.

Your edited file is attached.
-
Attached Files
File Type: txt dbr-dollmin.tcl.txt (8.6 KB, 33 views)

Last edited by knudfl; 03-17-2016 at 06:41 PM.
 
Old 03-27-2016, 10:25 PM   #63
dollmin
LQ Newbie
 
Registered: Mar 2016
Posts: 7

Rep: Reputation: Disabled
Depth-based tcl

Hi
can anybody explain to me how DBR tcl script works...kindly help me out.
 
Old 03-28-2016, 12:33 AM   #64
dollmin
LQ Newbie
 
Registered: Mar 2016
Posts: 7

Rep: Reputation: Disabled
what will be the output

when i have run dbr tcl i have got
Code:
underwater: the packet is interfered at node 0
underwater: the packet is interfered at node 0
underwater: the packet is interfered at node 1
[5] got the pkt I've sent
[5] got the pkt I've sent
[5] got the pkt I've sent
[5] got the pkt I've sent
underwater: the packet is interfered at node 2
underwater: the packet is interfered at node 2
underwater: the packet is interfered at node 1
underwater: the packet is interfered at node 1
[5] got the pkt I've sent
backoffhandler: too many backoffs
[5] got the pkt I've sent
[5] got the pkt I've sent
underwater: the packet is interfered at node 2
underwater: the packet is interfered at node 2
underwater: the packet is interfered at node 1
underwater: the packet is interfered at node 1
[5] got the pkt I've sent
underwater: the packet is interfered at node 0
underwater: the packet is interfered at node 0
underwater: the packet is interfered at node 3
underwater: the packet is interfered at node 3
underwater: the packet is interfered at node 4
underwater: the packet is interfered at node 4
underwater: the packet is interfered at node 5
underwater: the packet is interfered at node 5
[5] got the pkt I've sent
SINK 5 : terminates (send 50, recv 0, cum_delay 0.000000)
SINK 0 : terminates (send 0, recv 0, cum_delay 0.000000)
god: the energy consumped is 99.168872
NS EXISTING...
is this working correctly or not.
kindly tell me what will be the output of dbr script
 
Old 03-28-2016, 08:21 AM   #65
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,942

Rep: Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364
Quote:
Originally Posted by dollmin View Post
Hi
can anybody explain to me how DBR tcl script works...kindly help me out.
We can HELP YOU with problems, but if you don't know what a script does, why are you running it?
Quote:
Originally Posted by dollmin
when i have run dbr tcl i have got is this working correctly or not.
kindly tell me what will be the output of dbr script
The output would be WHAT YOU POSTED, obviously.
 
Old 03-28-2016, 08:37 AM   #66
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2020 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,381

Rep: Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599Reputation: 3599
Re #64, @dollmin.
Quote:
when i have run dbr tcl i have got
"dbr tcl" : Unknown file.

? What do you mean ? Please refer to a known file name.
And if it's a new file : Attach the file as dbr-[unique-name].tcl.txt


-
 
Old 03-29-2016, 10:25 PM   #67
dollmin
LQ Newbie
 
Registered: Mar 2016
Posts: 7

Rep: Reputation: Disabled
post # 64

i am new in this field. i am working on my final project firstly i want to understand this script, then i will start my work on it....
 
Old 04-01-2016, 02:07 AM   #68
dollmin
LQ Newbie
 
Registered: Mar 2016
Posts: 7

Rep: Reputation: Disabled
xgraph

if any one have x-graph of depth based routing protocol kindly send me....
 
Old 04-02-2016, 08:57 AM   #69
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,942

Rep: Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364
Quote:
Originally Posted by dollmin View Post
i am new in this field. i am working on my final project firstly i want to understand this script, then i will start my work on it....
...and...
Quote:
Originally Posted by dollmin
if any one have x-graph of depth based routing protocol kindly send me....
Again, you need to read the LQ Rules and Question Guidelines. Posting repeated questions won't get you answers any faster. Again, show some effort of your own. We are NOT going to send you a script. If this is YOUR homework, then you need to do the research and the work on your own. So far, you have run a script...that's it. You haven't actually SHOWN the script, or told us anything about what you have done/tried on your own.

And your post doesn't make sense...how are you managing to work on your FINAL PROJECT, when you have no idea about the scripts/programs involved in it??? How did you get this far?
 
Old 04-28-2016, 11:04 PM   #70
dollmin
LQ Newbie
 
Registered: Mar 2016
Posts: 7

Rep: Reputation: Disabled
this is my xgraph coding it gives straight line. kindly tell me what is the problem in my code.
Attached Files
File Type: txt xgraph.tcl.txt (13.9 KB, 25 views)
 
Old 03-04-2017, 01:04 AM   #71
vaniyadivyesh@gmail.com
LQ Newbie
 
Registered: Mar 2017
Posts: 2

Rep: Reputation: Disabled
questions ...in aquasim ..in vbf example script

$node_($total_number) set sinkStatus_ 1

$node_($total_number) set X_ 200
$node_($total_number) set Y_ 0
$node_($total_number) set Z_ 0
$node_($total_number) set-cx 200
$node_($total_number) set-cy 0
$node_($total_number) set-cz 0
set rt [$node_($total_number) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)
.....
In this what is the meaning and work of set-cx,cy,cz.

Pls answer. As soon as possible..
 
Old 03-04-2017, 09:19 AM   #72
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 22,942

Rep: Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364Reputation: 6364
Quote:
Originally Posted by vaniyadivyesh@gmail.com View Post
$node_($total_number) set sinkStatus_ 1

$node_($total_number) set X_ 200
$node_($total_number) set Y_ 0
$node_($total_number) set Z_ 0
$node_($total_number) set-cx 200
$node_($total_number) set-cy 0
$node_($total_number) set-cz 0
set rt [$node_($total_number) set ragent_]
$rt set control_packet_size $opt(routing_control_packet_size)
.....
In this what is the meaning and work of set-cx,cy,cz.

Pls answer. As soon as possible..
Read the LQ Rules about text-speak, and not using it, and also read the "Question Guidelines"

We volunteer our time here, so telling us to answer "as soon as possible" is fairly rude. Also, you have re-opened a thread that has been closed for a year now, and that started SEVERAL years ago. Short answer for your question: those are variables in your program. What they define is nearly impossible to determine, since you haven't provided ANY context to your question, told us what that code is, what it does, or what it relates to.
 
  


Reply

Tags
aquasim, dbr, ns2, vbf


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
codes for leach protocol in ns2 shaddrack yaw nusenu Linux - Newbie 4 09-14-2014 10:16 AM
installing a new protocol in ns2.34 MounaRM Linux - Networking 1 11-26-2010 07:45 AM
i am using ubuntu as os. for NS2 to implement a routing protocol in ns2. sujovasu Programming 1 07-27-2010 01:44 AM
weight throwing protocol using ns2 code,diffusion based protocol using ns2 code rajrupa Linux - Networking 1 05-27-2010 03:39 AM
sim messenger (msn protocol) shows every1 as offile. qwijibow Linux - Software 0 03-02-2004 10:53 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration