LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   aqua sim in ns2 - DBR protocol (https://www.linuxquestions.org/questions/linux-software-2/aqua-sim-in-ns2-dbr-protocol-890215/)

saye_s 07-06-2011 07:24 AM

aqua sim in ns2 - DBR protocol
 
i am new to aqua sim. I want to write a tcl code which use DBR as a routing protocol. i searched for finding such codes but I couldn't find any. I would really appreciate it if you would be so kind as to guide me or send me one, please.

my email: saye_shamisa@yahoo.com

TB0ne 07-07-2011 04:10 PM

Quote:

Originally Posted by saye_s (Post 4406730)
i am new to aqua sim. I want to write a tcl code which use DBR as a routing protocol. i searched for finding such codes but I couldn't find any. I would really appreciate it if you would be so kind as to guide me or send me one, please.

Sorry, that's not the way things work. This is a community forum, not a place to come for free, personalized one-on-one tech support by email.

And not even the NS Wiki has anything on DBR (http://nsnam.isi.edu/nsnam/index.php/Main_Page)...there is DFR and DBF. If you mean the depth-based routing protocol, you will have to write "codes" yourself, it seems.

saye_s 07-08-2011 04:10 AM

Quote:

Originally Posted by TB0ne (Post 4408212)
Sorry, that's not the way things work. This is a community forum, not a place to come for free, personalized one-on-one tech support by email.

And not even the NS Wiki has anything on DBR (http://nsnam.isi.edu/nsnam/index.php/Main_Page)...there is DFR and DBF. If you mean the depth-based routing protocol, you will have to write "codes" yourself, it seems.



HI

Aqua-sim enable us to use ns for simulate underwater protocols. If you install the package then you have DBR and VBF and ... as a routing protocol. It doesn't need to write the codes your self.

TB0ne 07-08-2011 10:13 AM

Quote:

Originally Posted by saye_s (Post 4408615)
HI
Aqua-sim enable us to use ns for simulate underwater protocols. If you install the package then you have DBR and VBF and ... as a routing protocol. It doesn't need to write the codes your self.

Right...so again, if you want "codes" for DBR, you will have to write them yourself, as there don't appear to be any pre-existing ones. But if you say it PROVIDES the codes, and then say you don't need to write them, what exactly is the point of your original question and follow-up???

saye_s 07-10-2011 04:06 AM

Quote:

Originally Posted by TB0ne (Post 4408860)
Right...so again, if you want "codes" for DBR, you will have to write them yourself, as there don't appear to be any pre-existing ones. But if you say it PROVIDES the codes, and then say you don't need to write them, what exactly is the point of your original question and follow-up???

yes, DBR is a routing protocol and you can use it in tcl script as you can use for example AODV but I can't write such tcl script. I changed an example for vbf routing. the changhed example is as following:



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
#*********************************Me:please change next line***************
#set opt(adhocRouting) Vectorbasedforward
set opt(adhocRouting) DBR
#*********************************Me:width is for vbf and we didn't need it in dbr ***************
#set opt(width) 100
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
#********************************* Me:please omit the next line, you don't need it for dbr ***************
#Agent/Vectorbasedforward set hop_by_hop_ 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_

#********************************* Me:please omit the next line, you don't need it for dbr ***************
#puts "Width=$opt(width)"


#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)
#***********Me: see ns2.30/tcl/lib/ns-agent.tcl for more infrormation about UWSink and attach-vectorbasedforward.********
#***********Me: I have one question, shouldn't I add a function in ns-agent.tcl for depth of node for dbr usage?*************
#$a_(0) attach-vectorbasedforward $opt(width)
$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)
#***********Me: see ns2.30/tcl/lib/ns-agent.tcl for more infrormation about UWSink and attach-vectorbasedforward.********
#***********Me: I have one question, shouldn't I add a function in ns-agent.tcl for depth of node for dbr usage?*************

#$a_(1) attach-vectorbasedforward $opt(width)
$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)
#***********Me: see ns2.30/tcl/lib/ns-agent.tcl for more infrormation about UWSink and attach-vectorbasedforward.********
#***********Me: I have one question, shouldn't I add a function in ns-agent.tcl for depth of node for dbr usage?*************
#$a_(2) attach-vectorbasedforward $opt(width)
$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)
#***********Me: see ns2.30/tcl/lib/ns-agent.tcl for more infrormation about UWSink and attach-vectorbasedforward.********
#***********Me: I have one question, shouldn't I add a function in ns-agent.tcl for depth of node for dbr usage?*************
#$a_(3) attach-vectorbasedforward $opt(width)
$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)
#***********Me: see ns2.30/tcl/lib/ns-agent.tcl for more infrormation about UWSink and attach-vectorbasedforward.********
#***********Me: I have one question, shouldn't I add a function in ns-agent.tcl for depth of node for dbr usage?*************
#$a_(4) attach-vectorbasedforward $opt(width)
$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)
#***********Me: see ns2.30/tcl/lib/ns-agent.tcl for more infrormation about UWSink and attach-vectorbasedforward.********
#***********Me: I have one question, shouldn't I add a function in ns-agent.tcl for depth of node for dbr usage?*************
#$a_($total_number) attach-vectorbasedforward $opt(width)
$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...."
#*********************************Me:width is for vbf and we didn't need it in dbr, please change the next line ***************
# puts $data "nodes = $opt(nn), maxspeed = $opt(maxspeed), minspeed = $opt(minspeed), random_seed = $opt(seed), sending_interval_=$opt(interval), width=$opt(width)"
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



but when I run it, it says:

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!!
starting Simulation...
GOD: the old file name istest.data
GOD: the new file name isa.data
Segmentation fault


I SAid I need an example of using DBR in tcl to compare with mine. I don't know why the segmentation fault occure. when I run the unchanged code, it runs without any problem.

if you need to see dbr.cc code or the others code just let me know please. Thanks in advance.

TB0ne 07-10-2011 10:35 AM

Quote:

Originally Posted by saye_s (Post 4410444)
yes, DBR is a routing protocol and you can use it in tcl script as you can use for example AODV but I can't write such tcl script. I changed an example for vbf routing. the changhed example is as following:

I said I need an example of using DBR in tcl to compare with mine. I don't know why the segmentation fault occure. when I run the unchanged code, it runs without any problem.

Yes, and as I said, there don't appear to be any, and that you are going to have to write your own. The only way to make it work is for you to learn the language, and work through the errors, the same as everyone else would.
Quote:

if you need to see dbr.cc code or the others code just let me know please. Thanks in advance.
We will be glad to assist...is the code you posted above exactly like you've run it?

afsane 09-05-2011 03:00 PM

Hi,my question is about my DBR & VBF TCL script.when I run VBF it says
invalid command name "Agent/Vectorbasedforward"
while executing
"Agent/Vectorbasedforward set hop_by_hop_0"

And when I run DBR it says:
invalid command name "Mac/UnderwaterMac"
while executing
"Mac/UnderwaterMac set bit_rate_1.0e4"

I searched a lot but I could not find the problem,I will be thankful if you help me and tell me what should I do?
I have another request.I need TCL script for any underwater routing protocol.Thanks a lot for your help

saye_s 09-06-2011 06:14 AM

Hi

please write your code, I should take a look at it first.

afsane 09-06-2011 08:46 AM

This is VBF tcl script:
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) Vectorbasedforward;
set opt(width) 100
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
Agent/Vectorbasedforward set hop_by_hop_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 ON \
-routerTrace ON \
-macTrace ON\
-topoInstance $topo\
-energyModel $opt(energy)\
-txPower $opt(txpower)\
-rxPower $opt(rxpower)\
-initialEnergy $opt(initialenergy)\
-idlePower $opt(idlepower)\
-channel $chan_1_
puts "Width=$opt(width)"


#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) attach-vectorbasedforward $opt(width)
$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) attach-vectorbasedforward $opt(width)
$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) attach-vectorbasedforward $opt(width)
$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) attach-vectorbasedforward $opt(width)
$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) attach-vectorbasedforward $opt(width)
$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) attach-vectorbasedforward $opt(width)
$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), width=$opt(width)"
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 is DBR tcl script:
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


I use ns-allinone-2.28,can the problem caused because of its version?
Some sites recommended to add init_tk at the first of the line in which error occurred,but it could not help me at all.
Thanks for your attention.

aram_2 09-13-2011 05:25 PM

Hello to all
I want to create a linear topology which every one send own traffic to sink
but i can't understand how can i define a sink and how can i say to nodes that send their packet to sink
set a_(4) [new Agent/UWSink]
set a_(3) [new Agent/UWSink]
set a_(2) [new Agent/UWSink]
,.......
:(
another problem is how can i get total throughput of my scenario
thanks to all.

afsane 09-28-2011 03:43 AM

Hi,
my ns simulator does not have broadcastMac class,I will be thanksful if anyone can tell me that how can I add this class.

afsane 10-07-2011 07:19 AM

Hi,
I have a question about ns2.30.I tried to install ns2.30 on windows (with cygwin).
when I want to make ns it gives me these erors:
configure:error:Installation of tcl seems incomplete or can not be found automatically.
Please correct the problem by telling configure where tcl is
using the argument --with-tcl=/path/to/package
<perhaps after installing it>,
or the package is not required, disable it with --with-tcl=no.
Makefile.in is newer than makefile.
You need to re-run configure.
false
make: *** [Makefile] Error 1
Makefile.in is newer than Makefile.
You need to re-run configure.
false
make: *** [Makefile] Error 1

I will be thankfull if anyone can help me.

afsane 10-07-2011 09:04 AM

Hi,
now my problem is that my ns2.30 does not have makefile.I will be thankfull if anyone send me the makefile.

knudfl 10-07-2011 10:58 AM

Posts #9, #12 : Don't use color for a text, please edit.
Color is for a few words. And please edit the posts to use code tags:
Write [/code] at code end, and [code] at code text start. Like this :
Code:

cd ns-allinone-2.30/ && ./install
#12, #13 : ns-allinone-2.30 is a must for cygwin.
http://www.isi.edu/nsnam/dist/ > ns-allinone-2.30.tar.gz
> http://www.isi.edu/nsnam/dist/ns-allinone-2.30.tar.gz

A Makefile will be created, when you have tcl tk otcl tclcl in place.
That's what ns-allinone-2.30 takes care of : Installing the files in
locations inside ns-allinone-2.30, so ns etc. know where to find them.

An alien Makefile won't do : Only the one created on your OS will fit.

..

ssohrab2003 12-03-2011 01:50 PM

Hi,

how can I download aquasim from a trusted website ? would you please introduce a download repository ?

knudfl 12-04-2011 10:42 AM

Post # 15, @ssohrab2003.

Which links did you find ? ?

knudfl 12-07-2011 05:10 PM

# 15, @ssohrab2003

Aqua-sim_ns230.no-test.tar.bz2 can be downloaded from
https://docs.google.com/open?id=0B7S...I2MjJmMWRkNGQ2

It is the patched ns-2.30 with the tcl/test directory omitted.
Not the complete ns-allinone-2.30. So unpacking goes this way :
1) tar xvf ns-allinone-2.30.tar.gz
2) cd ns-allinone-2.30/ && tar xvf Aqua-sim_ns230.no-test.tar.bz2

Tested with 'export CC=gcc34 CXX=g++34 && ./install'
Result : OK, no errors appeared.

..

ssohrab2003 12-12-2011 12:16 AM

thank you for your reply , I have installed it successfully ,
but I couldn't use aqua3d ,because whenever I load a .nam file in it , the console shows "aqua3d running...."
but it doesn't execute . However , I could execute it by clicking on it ,when I load a .nam file it close ???
why this is happen? I have also install wxwidget freeglut gtk in their last version.

ssohrab2003 01-07-2012 03:35 PM

hi,
why in the tr file of VBF-Example-6 we have not a send column ,
but in VBF-example-5 send and receive is shown ?

how can I fix this error

Archanajayakumar 09-16-2012 02:36 AM

can you please mail me DSR.CC file for underwater. Thanks in advance.My mail id is jaykayarchu@gmail.com

maryam.pk 01-25-2013 07:18 AM

hello Dear Afsaneh,
 
can you solve the error for VBF & DBR source code? because I have the same problem

uwsn2012 01-26-2013 03:45 AM

Quote:

Originally Posted by ssohrab2003 (Post 4568998)
hi,
why in the tr file of VBF-Example-6 we have not a send column ,
but in VBF-example-5 send and receive is shown ?

how can I fix this error

I have the same question... plz can you help me understand this problem ??

aDarkSun 04-09-2013 06:59 PM

Hi,

anybody completed to write code for Depth based routing(DBR)? If yes, would you plz share the code.

It would be very helpful for me if i can find the code.

Thank you

uwsn2012 04-10-2013 03:01 AM

Quote:

Originally Posted by aDarkSun (Post 4928534)
Hi,

anybody completed to write code for Depth based routing(DBR)? If yes, would you plz share the code.

It would be very helpful for me if i can find the code.

Thank you

Hi,
you mean tcl script of dbr protocol ??

aDarkSun 04-10-2013 04:21 AM

Quote:

Originally Posted by uwsn2012 (Post 4928728)
Hi,
you mean tcl script of dbr protocol ??

Yes. But i think some c++ code also need to change. am i right? So, if the c++ code also need to change then would you please share those.

Thank you

knudfl 04-10-2013 06:43 AM

1 Attachment(s)
We once got one suggestion for a "dbr.tcl", post #9 here
http://www.linuxquestions.org/questi...ocol-890215/#9
( The DBR tcl script starts at line 335.)

The code must be modified to work. ( Causes 'Segmentation fault'.)
-

aDarkSun 04-10-2013 07:25 AM

Quote:

Originally Posted by knudfl (Post 4928859)
We once got one suggestion for a "dbr.tcl", post #9 here
http://www.linuxquestions.org/questi...ocol-890215/#9
( The DBR tcl script starts at line 335.)

The code must be modified to work. ( Causes 'Segmentation fault'.)
-

Thanks for your help.

Would you please help me by giving a small hints for the following issues:

[Note: I am a beginner of aquasim and plz forgive me if I ask very basic question. plz give me a hint and i will try to do my best to solve myself]

1. the DBR routing menas the dbr.tcl file or I have to write some other code (like other c++ code) for this?
2. If I need to modify the DBR routing then how do i modify that. a little hint may be very helpful for me to start modification of that.

Thank you

knudfl 04-10-2013 07:47 AM

# 27.
Quote:

1. the DBR routing menas the dbr.tcl file or I have to write some other code
(like other c++ code) for this ?
I have no idea.


Quote:

2. If I need to modify the DBR routing then how do i modify that.
A little hint may be very helpful for me to start modification of that.
From the short look I have had on the text : There are no obvious errors.
So you will have to experiment.
Or learn tcl coding / the special ns2 commands.

-

maryam.pk 05-03-2013 08:08 AM

Hi knudfl

I need to specify two nodes as sink on the surface water could you help me? how should I set a node as a sink(destination) in ns-2?
best regards

maryam.pk 05-03-2013 12:02 PM

Dear all,

I am at ns studies , but I don't understand the following
code:

Agent::delay_bind_init_all()
{
delay_bind_init_one("agent_addr_");
delay_bind_init_one("agent_port_");
delay_bind_init_one("dst_addr_");
delay_bind_init_one("dst_port_");
delay_bind_init_one("fid_");
delay_bind_init_one("prio_");
delay_bind_init_one("flags_");
delay_bind_init_one("ttl_");
delay_bind_init_one("class_");
Connector::delay_bind_init_all();
}

int
Agent::delay_bind_dispatch(const char *varName, const char *localName, TclObject *tracer)
{
if (delay_bind(varName, localName, "agent_addr_", (int*)&(here_.addr_), tracer)) return TCL_OK;
if (delay_bind(varName, localName, "agent_port_", (int*)&(here_.port_), tracer)) return TCL_OK;
if (delay_bind(varName, localName, "dst_addr_", (int*)&(dst_.addr_), tracer)) return TCL_OK;
if (delay_bind(varName, localName, "dst_port_", (int*)&(dst_.port_), tracer)) return TCL_OK;
if (delay_bind(varName, localName, "fid_", (int*)&fid_, tracer)) return TCL_OK;
if (delay_bind(varName, localName, "prio_", (int*)&prio_, tracer)) return TCL_OK;
if (delay_bind(varName, localName, "flags_", (int*)&flags_, tracer)) return TCL_OK;
if (delay_bind(varName, localName, "ttl_", &defttl_, tracer)) return TCL_OK;
if (delay_bind(varName, localName, "class_", (int*)&fid_, tracer)) return TCL_OK;
return Connector::delay_bind_dispatch(varName, localName, tracer);
}

Could you please explain me the function.

knudfl 05-03-2013 12:27 PM

# 30 .

Most important : Code must be presented in code tags ..
http://www.linuxquestions.org/questi....php?do=bbcode
Type [/code] at code end, and [code] at code start.

I.e. you will have to delete the "code text" in post #30,
and replace it with the proper code.

Also : If you want an answer you will have to tell where it origins from,
and what the original file name is.

-

maryam.pk 05-04-2013 06:16 AM

This source code is some part of Vector base forward(vbf.tcl) routing protocol, my question is what is different between node 0 and node 1?and why?
how we define sink node and mobile node and source node?

when I run this file the packet always goes to node 0 as it was defined as sink node,but where we should define as sink node?

regards.

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

# a_->timeout((Packet*) e)

set a_(0) [new Agent/UWSink]
$ns_ attach-agent $node_(0) $a_(0)
$a_(0) attach-vectorbasedforward $opt(width)
$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) attach-vectorbasedforward $opt(width)
$a_(1) cmd set-range $opt(range)
$a_(1) cmd set-target-x -30
$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

maryam.pk 05-12-2013 02:16 AM

1 Attachment(s)
hello
I want to do comparison between routing protocol performance with the defferents metric but i don't know how to draw a graph like below: can you suggest me a software to draw sth like this picture?

naznin 08-14-2013 12:25 AM

Quote:

Originally Posted by saye_s (Post 4408615)
HI

If you install the package then you have DBR and VBF and ... as a routing protocol. It doesn't need to write the codes your self.

Hi, i have installed aquasim-1.0. It do not contain DBR protocol. Will somebody suggest me the version of aquasim so that i can get codes of DBR protocol. Also the link from where i can get it.

Thanks in advance.

knudfl 08-14-2013 12:58 AM

Post # 34, @naznin : Welcome.
Quote:

It do not contain DBR protocol.
What do you mean ?
Code:

$ cd ns-2.30/ && grep -Rin dbr *

common/packet.h:75:#define HDR_DBR(p)      (hdr_dbr::access(p))  /* hai's dbr */
common/packet.h:185:    PT_DBR,
common/packet.h:294:            name_[PT_DBR]="dbr";
dbr/README:5:  Add DBR agent
dbr/README:6:  Create create-dbr-agent proc
dbr/README:10:  Add PT_DBR
dbr/dbr.cc:30:#define  DBR_MAX_DELAY  0.2    // maximal propagation delay for one hop
dbr/dbr.cc:31:#define DBR_MAX_RANGE    100    // maximal transmmition range
dbr/dbr.cc:32:#define DBR_MIN_BACKOFF  0.0    // minimal backoff time for the packet
dbr/dbr.cc:35:#define DBR_USE_ROUTEFLAG
dbr/dbr.cc:36:#define DBR_MAX_HOPS      3
dbr/dbr.cc:37:#define DBR_DEPTH_THRESHOLD 0.0
dbr/dbr.cc:38:#define DBR_SCALE 1.0
dbr/dbr.cc:40:int hdr_dbr::offset_;
dbr/dbr.cc:46:static class DBRAgentClass : public TclClass {
dbr/dbr.cc:48:  DBRAgentClass() : TclClass("Agent/DBR") {}
dbr/dbr.cc:50:          return (new DBR_Agent);
dbr/dbr.cc:52:} class_DBRAgent;
dbr/dbr.cc:54:class DBRHeaderClass : public PacketHeaderClass {
dbr/dbr.cc:56:  DBRHeaderClass() : PacketHeaderClass("PacketHeader/DBR",
dbr/dbr.cc:57:                                  sizeof(hdr_dbr)) {
dbr/dbr.cc:58:          bind_offset(&hdr_dbr::offset_);
dbr/dbr.cc:62:void DBR_BeaconHandler::handle(Event *e)
dbr/dbr.cc:67:void DBR_BeaconTimer::expire(Event *e)
dbr/dbr.cc:72:void DBR_SendingTimer::expire(Event *e)
dbr/dbr.cc:78:void DBR_DeadNeighbTimer::expire(Event *e)
dbr/dbr.cc:119: hdr_dbr *dbrh;
dbr/dbr.cc:122: dbrh = hdr_dbr::access(p);
dbr/dbr.cc:123: curID = dbrh->packetID();
dbr/dbr.cc:129:        dbrh = hdr_dbr::access((*iter)->p_);
dbr/dbr.cc:130:        if (dbrh->packetID() == curID)
dbr/dbr.cc:156: hdr_dbr *dbrh;
dbr/dbr.cc:159: dbrh = hdr_dbr::access(p);
dbr/dbr.cc:160: curID = dbrh->packetID();
dbr/dbr.cc:166:        dbrh = hdr_dbr::access((*iter)->p_);
dbr/dbr.cc:167:        if (dbrh->packetID() == curID)
dbr/dbr.cc:182: hdr_dbr *dbrh;
dbr/dbr.cc:188:        dbrh = hdr_dbr::access((*iter)->p_);
dbr/dbr.cc:190:                        i, dbrh->packetID(), (*iter)->send_time_);
dbr/dbr.cc:196:NeighbTable::NeighbTable(DBR_Agent *a)
dbr/dbr.cc:449:#ifdef  DBR_USE_ROUTEFLAG
dbr/dbr.cc:513:#endif  // DBR_USE_ROUTEFLAG
dbr/dbr.cc:516:DBR_Agent::DBR_Agent() : Agent(PT_DBR),
dbr/dbr.cc:517: bint_(DBR_BEACON_INT), bdesync_(DBR_BEACON_DESYNC), mn_(0), pkt_cnt_(0)
dbr/dbr.cc:525:DBR_Agent::~DBR_Agent() 
dbr/dbr.cc:535:DBR_Agent::makeBeacon(void)
dbr/dbr.cc:542: hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.cc:547: cmh->ptype_ = PT_DBR;
dbr/dbr.cc:549: cmh->size() = dbrh->size() + IP_HDR_LEN;
dbr/dbr.cc:554: iph->dport() = DBR_PORT;
dbr/dbr.cc:557: mn_->getLoc(&(dbrh->x), &(dbrh->y), &(dbrh->z));
dbr/dbr.cc:558: dbrh->mode() = DBRH_BEACON;
dbr/dbr.cc:559: dbrh->nhops() = 1;
dbr/dbr.cc:565:void DBR_Agent::sendBeacon(void)
dbr/dbr.cc:586:void DBR_Agent::send_callback(void)
dbr/dbr.cc:589: hdr_dbr *dbrh;
dbr/dbr.cc:601: dbrh = hdr_dbr::access(q->p_);
dbr/dbr.cc:602: pc_->addPacket(dbrh->packetID());
dbr/dbr.cc:614:void DBR_Agent::beacon_callback(void)
dbr/dbr.cc:643:void DBR_Agent::deadneighb_callback(NeighbEnt *ne)
dbr/dbr.cc:648:void DBR_Agent::forwardPacket(Packet *p, int flag)
dbr/dbr.cc:652: hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.cc:665: cmh->ptype_ = PT_DBR;
dbr/dbr.cc:666: cmh->size() = dbrh->size() + IP_HDR_LEN;
dbr/dbr.cc:669: switch (dbrh->mode())
dbr/dbr.cc:671: case DBRH_DATA_GREEDY:
dbr/dbr.cc:688:                dbrh->mode() = DBRH_DATA_RECOVER;
dbr/dbr.cc:689:                dbrh->prev_hop() = mn_->address();
dbr/dbr.cc:690:                dbrh->owner() = mn_->address();
dbr/dbr.cc:691:                dbrh->nhops() = DBR_MAX_HOPS;          // set the range of broadcasting by hops
dbr/dbr.cc:694: case DBRH_DATA_RECOVER:
dbr/dbr.cc:699:        if (pc_->accessPacket(dbrh->packetID()))
dbr/dbr.cc:709:                pc_->addPacket(dbrh->packetID());
dbr/dbr.cc:715:                if (dbrh->nhops() <= 0)
dbr/dbr.cc:728:                        dbrh->mode() = DBRH_DATA_RECOVER;
dbr/dbr.cc:729:                        dbrh->owner() = dbrh->prev_hop();
dbr/dbr.cc:730:                        dbrh->prev_hop() = mn_->address();
dbr/dbr.cc:731:                        dbrh->nhops()--;
dbr/dbr.cc:737:        else if (ne->net_id != dbrh->prev_hop())
dbr/dbr.cc:741:                dbrh->mode() = DBRH_DATA_GREEDY;
dbr/dbr.cc:749:                fprintf(stderr, "[%d]:dbrh->nhops = %d\n", mn_->address(),
dbr/dbr.cc:750:                                dbrh->nhops());
dbr/dbr.cc:753:                if (dbrh->nhops() <= 0)
dbr/dbr.cc:770:                        dbrh->mode() = DBRH_DATA_RECOVER;
dbr/dbr.cc:771:                        dbrh->owner() = dbrh->prev_hop();
dbr/dbr.cc:772:                        dbrh->prev_hop() = mn_->address();
dbr/dbr.cc:773:                        dbrh->nhops()--;
dbr/dbr.cc:792:void DBR_Agent::beaconIn(Packet *p)
dbr/dbr.cc:795: hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.cc:808: ne->x = dbrh->x;
dbr/dbr.cc:809: ne->y = dbrh->y;
dbr/dbr.cc:810: ne->z = dbrh->z;
dbr/dbr.cc:822:void DBR_Agent::recv(Packet *p, Handler *)
dbr/dbr.cc:826: hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.cc:841: if (dbrh->mode() == DBRH_BEACON)
dbr/dbr.cc:862:        cmh->ptype_ = PT_DBR;
dbr/dbr.cc:863:        cmh->size() = dbrh->size() + IP_HDR_LEN;
dbr/dbr.cc:867:        // setup DBR header
dbr/dbr.cc:868:        dbrh->mode() = DBRH_DATA_GREEDY;
dbr/dbr.cc:869:        //dbrh->packetID() = (int)mn_->address();
dbr/dbr.cc:870:        dbrh->packetID() = pkt_cnt_++;
dbr/dbr.cc:871:        dbrh->depth() = z;              // save the depth info
dbr/dbr.cc:881:    (dbrh->mode() == DBRH_DATA_GREEDY))
dbr/dbr.cc:912:void DBR_Agent::handlePktForward(Packet *p)
dbr/dbr.cc:916: hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.cc:926: if (pc_->accessPacket(dbrh->packetID()))
dbr/dbr.cc:932:        pc_->addPacket(dbrh->packetID());
dbr/dbr.cc:938: cmh->ptype_ = PT_DBR;
dbr/dbr.cc:939: cmh->size() = dbrh->size() + IP_HDR_LEN;
dbr/dbr.cc:951:void DBR_Agent::handlePktForward(Packet *p)
dbr/dbr.cc:955: hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.cc:971: fprintf(stderr, " curID: %d\n", dbrh->packetID());
dbr/dbr.cc:988: cmh->ptype_ = PT_DBR;
dbr/dbr.cc:989: cmh->size() = dbrh->size() + IP_HDR_LEN;
dbr/dbr.cc:992: switch (dbrh->mode())
dbr/dbr.cc:994: case DBRH_DATA_GREEDY:
dbr/dbr.cc:998:        delta = z - dbrh->depth();
dbr/dbr.cc:1001:                if (delta < DBR_DEPTH_THRESHOLD)
dbr/dbr.cc:1010:                        mn_->address(), z, dbrh->depth(), delta);
dbr/dbr.cc:1014:                dbrh->depth() = z;
dbr/dbr.cc:1017:                //delay = DBR_DEPTH_THRESHOLD / delta * DBR_SCALE;
dbr/dbr.cc:1018:                delta = 1.0 - delta / DBR_MAX_RANGE;
dbr/dbr.cc:1019:                delay = DBR_MIN_BACKOFF + 4.0 * delta * DBR_MAX_DELAY;
dbr/dbr.cc:1024:        case DBRH_DATA_RECOVER:
dbr/dbr.cc:1025:                if (dbrh->nhops() <= 0)
dbr/dbr.cc:1034:                dbrh->nhops()--;
dbr/dbr.cc:1041:        // make up the DBR header
dbr/dbr.cc:1042:        dbrh->owner() = dbrh->prev_hop();
dbr/dbr.cc:1043:        dbrh->prev_hop() = mn_->address();
dbr/dbr.cc:1057:        if (pc_->accessPacket(dbrh->packetID()))
dbr/dbr.cc:1063:        //      pc_->addPacket(dbrh->packetID());
dbr/dbr.cc:1099:void DBR_Agent::recv(Packet *p, Handler *)
dbr/dbr.cc:1103:        hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.cc:1119:        if (dbrh->mode() == DBRH_BEACON)
dbr/dbr.cc:1138:                dbrh->mode() = DBRH_DATA_GREEDY;
dbr/dbr.cc:1139:                dbrh->packetID() = (int)mn_->address();
dbr/dbr.cc:1142:                (dbrh->mode() == DBRH_DATA_GREEDY))
dbr/dbr.cc:1168:                if (dbrh->mode() == DBRH_BEACON)
dbr/dbr.cc:1186:                if((dbrh->mode() == DBRH_DATA_RECOVER) &&
dbr/dbr.cc:1187:                        (dbrh->owner() == mn_->address()))
dbr/dbr.cc:1192:                        //ntab_->updateRouteFlag(dbrh->prev_hop(), 0);
dbr/dbr.cc:1199:                dbrh->owner(), dbrh->prev_hop(), mn_->address());
dbr/dbr.cc:1207:void DBR_Agent::recv2(Packet *p, Handler *)
dbr/dbr.cc:1211:        hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.cc:1227:        if (dbrh->mode() == DBRH_BEACON)
dbr/dbr.cc:1246:                dbrh->mode() = DBRH_DATA_GREEDY;
dbr/dbr.cc:1247:                dbrh->packetID() = (int)mn_->address();
dbr/dbr.cc:1250:                (dbrh->mode() == DBRH_DATA_GREEDY))
dbr/dbr.cc:1276:                if (dbrh->mode() == DBRH_BEACON)
dbr/dbr.cc:1294:                if((dbrh->mode() == DBRH_DATA_RECOVER) &&
dbr/dbr.cc:1295:                        (dbrh->owner() == mn_->address()))
dbr/dbr.cc:1300:                        //ntab_->updateRouteFlag(dbrh->prev_hop(), 0);
dbr/dbr.cc:1307:                dbrh->owner(), dbrh->prev_hop(), mn_->address());
dbr/dbr.cc:1314:int DBR_Agent::command(int argc, const char * const *argv)
dbr/dbr.cc:1318:                if (strcmp(argv[1], "start-dbr") == 0)
dbr/dbr.cc:1372:                                fprintf(stderr, "DBRAgent: %s lookup of %s failed\n",
dbr/dbr.cc:1384:void DBR_Agent::trace(char* fmt, ...)
dbr/dbr.cc:1396:void DBR_Agent::init(void)
dbr/dbr.cc:1399:        beacon_timer_ = new DBR_BeaconTimer(this);
dbr/dbr.cc:1402:        send_timer_ = new DBR_SendingTimer(this);
dbr/dbr.cc:1406:void DBR_Agent::tap(const Packet *p)
dbr/dbr.cc:1412:void dumpDBRHdr(Packet *p)
dbr/dbr.cc:1415:        hdr_dbr *dbrh = hdr_dbr::access(p);
dbr/dbr.h:6:#ifndef    _DBR_H_
dbr/dbr.h:7:#define    _DBR_H_
dbr/dbr.h:23:#define    DBR_PORT                0xFF
dbr/dbr.h:25:#define    DBR_BEACON_DESYNC      0.1            // desynchronizing form for alive beacons
dbr/dbr.h:26:#define    DBR_BEACON_INT          10              // interval between beacons
dbr/dbr.h:29:class DBR_Agent;
dbr/dbr.h:33:class hdr_dbr;
dbr/dbr.h:36:struct DBRPacket {
dbr/dbr.h:41:  DBRPacket() : pkt(NULL) {}
dbr/dbr.h:42:  DBRPacket(Packet *p, hdr_dbr *dbrh) :
dbr/dbr.h:47:class DBR_AgentTimer : public TimerHandler {
dbr/dbr.h:49:  DBR_AgentTimer(DBR_Agent *a) { a_ = a; }
dbr/dbr.h:53:  DBR_Agent *a_;
dbr/dbr.h:56:class DBR_BeaconHandler : public Handler {
dbr/dbr.h:58:  DBR_BeaconHandler(DBR_Agent *a) { a_ = a; }
dbr/dbr.h:62:  DBR_Agent *a_;
dbr/dbr.h:65:class DBR_BeaconTimer : public DBR_AgentTimer {
dbr/dbr.h:67:  DBR_BeaconTimer(DBR_Agent *a) : DBR_AgentTimer(a) {}
dbr/dbr.h:71:class DBR_SendingTimer : public DBR_AgentTimer {
dbr/dbr.h:73:  DBR_SendingTimer(DBR_Agent *a) : DBR_AgentTimer(a) {}
dbr/dbr.h:107:  NeighbEnt(DBR_Agent* ina) :
dbr/dbr.h:116:  //DBR_DeadNeighbTimer dnt;      // timer for expiration of neighbor
dbr/dbr.h:122:  NeighbTable(DBR_Agent *a);
dbr/dbr.h:134:  DBR_Agent *a_;      // agent owns the table
dbr/dbr.h:138:#define  DBRH_DATA_GREEDY        0
dbr/dbr.h:139:#define  DBRH_DATA_RECOVER      1
dbr/dbr.h:140:#define  DBRH_BEACON            2
dbr/dbr.h:142:class hdr_dbr {
dbr/dbr.h:146:  static hdr_dbr* access(const Packet *p) {
dbr/dbr.h:147:          return (hdr_dbr*)p->access(offset_);
dbr/dbr.h:183:class DBR_Agent : public Tap, public Agent {
dbr/dbr.h:184:  friend class DBR_BeaconHandler;
dbr/dbr.h:185:  friend class DBR_BeaconTimer;
dbr/dbr.h:186:  friend class DBR_SendingTimer;
dbr/dbr.h:189:  DBR_Agent();
dbr/dbr.h:190:  ~DBR_Agent();
dbr/dbr.h:202:  //DBR_BeaconHandler bhdl;
dbr/dbr.h:211:  int off_dbr_;          // offset of DBR packet header in pkt
dbr/dbr.h:222:  DBR_BeaconTimer *beacon_timer_;        // beacon timer
dbr/dbr.h:223:  DBR_SendingTimer *send_timer_;          // sending timer
dbr/dbr.h:244:#endif    /* _DBR_H_ */
tcl/lib/ns-lib.tcl:625:    DBR {
tcl/lib/ns-lib.tcl:626:            set ragent [$self create-dbr-agent $node]
tcl/lib/ns-lib.tcl:706:        $routingAgent_ == "DBR"||
tcl/lib/ns-lib.tcl:837:# dbr @ hai
tcl/lib/ns-lib.tcl:838:Simulator instproc create-dbr-agent { node } {
tcl/lib/ns-lib.tcl:839: set ragent [new Agent/DBR]
tcl/lib/ns-lib.tcl:841: $ragent start-dbr
trace/cmu-trace.cc:1183:                case PT_DBR:


naznin 08-15-2013 12:00 AM

[QUOTE=knudfl;5008949]Post # 34, @naznin :

What do you mean ?
Sir, my uw_routing directory do not contain .cc and .h file for DBR protocol.How can i get it.



Thanks in advance.

naznin 08-15-2013 12:09 AM

Quote:

Originally Posted by knudfl (Post 5008949)
Post # 34, @naznin : Welcome.

What do you mean ?
[code]$ cd ns-2.30/ && grep -Rin dbr *

Sir, my uw_routing directory do not contain .cc and .hh file of DBR protocol.How can i get it. Also can you explain the command "cd ns-2.30/ && grep -Rin dbr *"

naznin 08-15-2013 12:26 AM

Hi, when i open terminal it is showing
Code:

bash: /ns-allinone-2.30/otcl-1.12: No such file or directory
bash: /ns-allinone-2.30/lib: No such file or directory
bash: /usr/local/lib: Is a directory
bash: /ns-allinone-2.30/tcl8.4.18/library: No such file or directory
bash: /ns-allinone-2.30/bin:/home: No such file or directory
bash: 2.30/tk8.4.18/unix:/home: No such file or directory
bash: /ns-allinone-2.30/ns-2.30/: No such file or directory
bash: /ns-allinone-2.30/nam-1.13/: No such file or directory

But i can see all directories.Also i am not able to run underwater tcl scripts.But no problem with ns2.Can anyone help me. I am using Ubuntu 12.10.

Thanks in advance.

knudfl 08-15-2013 02:16 AM

'# 38 .

Neither "/ns-allinone-2.30/" or "2.30/" are supposed to be present.
bash : I have no idea what you are doing. Did you enter a command ?


Aqua-sim : Your post #34 says : "I have installed aquasim-1.0."
The following shows how to install 'Aqua-Sim-1.0.tgz' to Ubuntu 12.10:
1) $ mkdir Aquasim
2) $ cd Aquasim/
3) $ tar xvf Aqua-Sim-1.0.tgz
4) $ export CC=gcc41 CXX=g++41 && ./install
5) $ cd ns-2.30/ ; $ ./ns : To test the new "ns aqua".
6) $ cp ns ns-aqua : Then you have a backup.
7) $ sudo cp ns-aqua /usr/local/bin/ : Then it's in a system PATH,
.... and you can do simulations with : $ ns-aqua file.tcl

Links : Aqua-Sim-1 http://ubinet.engr.uconn.edu/aqua_pa...ua-Sim-1.0.tgz
gcc41 / g++41 http://www.linuxquestions.org/questi...532/page4.html
→ → gcc41-compat*1210, g++41-compat, post # 47.
Aquasim, LQ http://www.linuxquestions.org/questions/tags/aquasim/
Ubuntu package 'aquasim-ns-2.30-ubuntu10_i386.deb' :
https://docs.google.com/file/d/0B7S2...ZXR1hwNEE/edit
( Ref. post #45 here http://www.linuxquestions.org/questi...532/page3.html )

-

knudfl 08-15-2013 03:02 AM

# 36 .
Quote:

my uw_routing directory do not contain .cc and .h file for DBR protocol
? uw_routing directory ? Do you mean "underwatersensor/uw_tcl/" ?

Post #35 shows where "DBR" is added :
ns-2.30/{ dbr/dbr.cc, dbr/dbr.h, tcl/lib/ns-lib.tcl }.
( The folder dbr/ is unique for aquasim, isn't present in a default ns-2.30 ).

Remark : None of those files (or any other files.cc, files.h)
are used at simulation time. All .cc, .h, tcl/lib/<files.tcl>
functions are compiled into the executable 'ns'.

DBR : Attempts to make simulation files ...
dbr.tcl : http://www.linuxquestions.org/questi...ocol-890215/#5
vbr+dbr.tcl : http://www.linuxquestions.org/questi...ocol-890215/#9
*** The two files don't work very well,
but you but you can use them as a starting point ...

-

naznin 08-15-2013 04:56 AM

Quote:

Originally Posted by knudfl (Post 5009586)
'# 38 .


The following shows how to install 'Aqua-Sim-1.0.tgz' to Ubuntu 12.10:
1) $ mkdir Aquasim
2) $ cd Aquasim/
3) $ tar xvf Aqua-Sim-1.0.tgz
4) $ export CC=gcc41 CXX=g++41 && install


-

when i do 4th step ,i am getting like this

install: missing file operand
Try `install --help' for more information.

is it like this

$ export CC=gcc41 CXX=g++41 && ./install

knudfl 08-15-2013 07:32 AM

# 41 .

Sorry for the typo, it is of course $ export CC=gcc41 CXX=g++41 && ./install

naznin 08-15-2013 08:30 AM

Quote:

Originally Posted by knudfl (Post 5009586)
'# 38 .


The following shows how to install 'Aqua-Sim-1.0.tgz' to Ubuntu 12.10:
1) $ mkdir Aquasim
2) $ cd Aquasim/
3) $ tar xvf Aqua-Sim-1.0.tgz
4) $ export CC=gcc41 CXX=g++41 && ./install
5) $ cd ns-2.30/ ; $ ./ns : To test the new "ns aqua".

-

what does ./ns mean.I am getting like this

bash: ./ns: No such file or directory

knudfl 08-15-2013 10:55 AM

# 43 .

A period ( . ) and ./ ( <period><slash> ) means the current directory.

./ns <Enter> means : Run the executable 'ns' in the directory "ns-2.30/".
So better take care that ns-2.30/ is your location : $ cd Aquasim/ns-2.30/
... And then check the location with the pwd command.

Example : $ pwd
The reply here is ( For the Aquasim ns-2.30 ) :
/home/knudfl/Aquasim/ns-2.30

-

naznin 08-15-2013 10:40 PM

Quote:

Originally Posted by knudfl (Post 5009839)
# 43 .



./ns <Enter> means : Run the executable 'ns' in the directory "ns-2.30/".
So better take care that ns-2.30/ is your location : $ cd Aquasim/ns-2.30/
... And then check the location with the pwd command.

Example : $ pwd
The reply here is ( For the Aquasim ns-2.30 ) :
/home/knudfl/Aquasim/ns-2.30

-

Sir, i did it in the same way. But i got like this.

:~/Aquasim/ns-2.30$ ./ns
bash: ./ns: No such file or directory

See this also

:~/Aquasim/ns-2.30$ ls
adc dbr Makefile sctp
AllinOne delaybox Makefile.in sensor-nets
aodv diffserv makefile.vc sillyrouting
apps diffusion mcast src_rtg
asim diffusion3 mobile tcl
autoconf.h doc mpls tcp
autoconf.h.in dsdv nam test-all
autoconf-win32.h dsr nix test-output
BASE-VERSION empweb ns.1 TODO.html
baytcp emulate ns_tclsh.cc tools
bin FILES packmime tora
bitmap gaf pgm trace
CHANGES.html gen plm underwatersensor
classifier HOWTO-CONTRIBUTE pushback validate
common html qs validate-full
conf imep queue validate.out
config.guess indep-utils rap validate.win32
config.h install-sh README validate-wired
config.log INSTALL.WIN32 realaudio validate-wireless
config.status lib release_steps.txt VERSION
config.sub LICENSES routealgo webcache
configure link routing wpan
configure.in linkstate rtproto xcp
COPYRIGHTS mac satellite

what should i do now.

Thanks for pwd command.

knudfl 08-16-2013 06:13 AM

# 45 .

Repeat the the procedure in post #39 as many times as it takes to do it right.
No 'ns' : That's a failed build. I wonder why you didn't see any error output?

Are you sure that you have a 32bits (i686) OS ?
Please show the output from $ uname -m <Enter>

-

naznin 08-19-2013 12:28 AM

Quote:

Originally Posted by knudfl (Post 5010317)
# 45 .

Are you sure that you have a 32bits (i686) OS ?
Please show the output from $ uname -m <Enter>

-

$ uname -m
i686

knudfl 08-19-2013 02:29 AM

# 47 .

OK, 32bits = i686 : The compiling should go with no errors.

? What is the error output, when no 'ns' is created ? ?

naznin 08-19-2013 02:53 AM

Quote:

Originally Posted by knudfl (Post 5011723)
# 47 .


? What is the error output, when no 'ns' is created ? ?

:~/Aquasim/ns-2.30$ ./ns
bash: ./ns: No such file or directory

knudfl 08-19-2013 03:10 AM

# 49.

OK, I'll rephrase : What is the error output, when you compile ?
→ You can check with : 1) cd ns-2.30/ ; 2) make
→ The last lines should show why 'ns' isn't compiled / linked.


All times are GMT -5. The time now is 01:18 AM.