How to run scenario of DSR protocol multiple times in one session in ns2?
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
0
down vote
favorite
Actually, I'm new in simulation project that I want to call another procedure from the following loop:
call.tcl
source costtest1.tcl
for set x 5 $x <6 incr x
input_Protocol_pramerters 20 $x 2.0 $x
puts "Done"
The other procedure includes the following DSR protocol to generate the performance evaluation for simulation scenario:
costtest1.tcl
proc input_Protocol_pramerters No_node No_connaction Rate iter
set cbr "cbr-"
set secn "scan-"
append cbr $iter
append secn $iter
set DSR_fileTr "DSR"
append DSR_fileTr $iter ".tr"
set DSR_fileNam "DSR"
append DSR_fileNam $iter ".nam"
puts $iter
#---- Generate Movement file ----
puts [eval exec "./setdest -v 1 -n $No_node -p 5 -M $No_connaction -t 100 -x 1000 -y 1000 >$secn"]
#---- Generate Movement file ----
puts [eval exec "ns cbrgen.tcl -type cbr -nn $No_node -seed 1.0 -mc $No_connaction -rate $Rate >$cbr"]
#---- Main simulation file to generate DSR.tr and DSR.nam
#----------------------------------------------------------------
# Definition of the physical layer
#----------------------------------------------------------------
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) CMUPriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
#-----------------------------------------------------------------
# Scenario parameters
#------------------------------------------------------------------
set val(x) 1500 ;# X dimension of the topography
set val(y) 1500 ;# Y dimension of the topography
set val(ifqlen) 50 ;# max packet in queue
set val(seed) 1.0 ;#random seed
set val(adhocRouting) DSR
set val(nn) $No_node ;# how many nodes are simulated
set val(cp) $cbr
set val(sc) $secn
set val(stop) 50 ;# simulation time
#----------------------------------------------------------------------
# Set up simulator objects
#----------------------------------------------------------------------
# create simulator instance
set ns_ [new Simulator]
# setup topography object
set topo [new Topography]
# create trace object for ns and nam
set tracefd [open $DSR_fileTr w]
$ns_ use-newtrace ;# use the new wireless trace file format
set namtrace [open $DSR_fileNam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
# define topology
$topo load_flatgrid $val(x) $val(y)
# Create God
set god_ [create-god $val(nn)]
$ns_ node-config -adhocRouting $val(adhocRouting)
-llType $val(ll)
-macType $val(mac)
-ifqType $val(ifq)
-ifqLen $val(ifqlen)
-antType $val(ant)
-propType $val(prop)
-phyType $val(netif)
-channelType $val(chan)
-topoInstance $topo
-agentTrace ON
-routerTrace ON
-macTrace ON
# Create the specified number of nodes [$val(nn)] and "attach" them
# to the channel.
for set i 0 $i < $val(nn) incr i
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
# Define node movement model
puts "Loading connection pattern..."
source $val(cp)
# Define traffic model
puts "Loading scenario file..."
source $val(sc)
# Define node initial position in nam
for set i 0 $i < $val(nn) incr i
# 50 defines the node size in nam, must adjust it according to your scenario
# The function must be called after mobility model is defined
# puts "Processing node $i"
$ns_ initial_node_pos $node_($i) 50
#
# Tell nodes when the simulation ends
#
for set i 0 $i < $val(nn) incr i
$ns_ at $val(stop).0 "$node_($i) reset";
$ns_ at $val(stop).0002 "puts "NS EXITING..." ; $ns_ halt"
# dump the initial simulation info to the trace file
puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(adhocRouting)"
puts $tracefd "M 0.0 sc $val(sc) cp $val(cp) seed $val(seed)"
puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)"
puts "Starting Simulation..."
$ns_ run
# end Mail file
# Evaluate parametrs
puts [eval exec "awk -f End2endDelay_RoutingPackets.awk $DSR_fileTr"]
In the first iteration, I got the results:
5
num_nodes is set 20
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...
Packet Sent = 136.00
Packet Receive = 82.00
routingpkts = 123.00
Packet Delivery Ratio = 60.29
NRL = 1.50
Average end-to-end Delay (ms)= 13219.08
No. of dropped data (packets) = 21
No. of dropped data (bytes) = 11172
In the second iteration, I got the following error:
6
num_nodes is set 20
invalid command name "_o491 _o4"
while executing
"$ns_ get-nodetype"
(procedure "_o501" line 22)
(Object next line 22)
invoked from within
"_o501 next"
("eval" body line 1)
invoked from within
"eval $self next $args"
(procedure "_o501" line 3)
(Object next line 3)
invoked from within
"_o501 next"
("eval" body line 1)
invoked from within
"eval $self next $args "
(procedure "_o501" line 6)
(SRNodeNew init line 6)
invoked from within
"_o501 init "
(Class create line 1)
invoked from within
"SRNodeNew create _o501 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg]
delete $o
return ""
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new SRNodeNew"
("eval" body line 1)
invoked from within
"eval new $nodeclass $args"
(procedure "_o491" line 8)
(Simulator create-node-instance line 8)
invoked from within
"_o491 create-node-instance"
("eval" body line 1)
invoked from within
"eval $self create-node-instance $args"
(procedure "_o491" line 6)
(Simulator create-wireless-node line 6)
invoked from within
"_o491 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o491" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
(procedure "input_Protocol_pramerters" line 61)
invoked from within
"input_Protocol_pramerters 20 6 2.0 6"
(file "call.tcl" line 5)
networking tcl ns2
add a comment |Â
up vote
0
down vote
favorite
Actually, I'm new in simulation project that I want to call another procedure from the following loop:
call.tcl
source costtest1.tcl
for set x 5 $x <6 incr x
input_Protocol_pramerters 20 $x 2.0 $x
puts "Done"
The other procedure includes the following DSR protocol to generate the performance evaluation for simulation scenario:
costtest1.tcl
proc input_Protocol_pramerters No_node No_connaction Rate iter
set cbr "cbr-"
set secn "scan-"
append cbr $iter
append secn $iter
set DSR_fileTr "DSR"
append DSR_fileTr $iter ".tr"
set DSR_fileNam "DSR"
append DSR_fileNam $iter ".nam"
puts $iter
#---- Generate Movement file ----
puts [eval exec "./setdest -v 1 -n $No_node -p 5 -M $No_connaction -t 100 -x 1000 -y 1000 >$secn"]
#---- Generate Movement file ----
puts [eval exec "ns cbrgen.tcl -type cbr -nn $No_node -seed 1.0 -mc $No_connaction -rate $Rate >$cbr"]
#---- Main simulation file to generate DSR.tr and DSR.nam
#----------------------------------------------------------------
# Definition of the physical layer
#----------------------------------------------------------------
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) CMUPriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
#-----------------------------------------------------------------
# Scenario parameters
#------------------------------------------------------------------
set val(x) 1500 ;# X dimension of the topography
set val(y) 1500 ;# Y dimension of the topography
set val(ifqlen) 50 ;# max packet in queue
set val(seed) 1.0 ;#random seed
set val(adhocRouting) DSR
set val(nn) $No_node ;# how many nodes are simulated
set val(cp) $cbr
set val(sc) $secn
set val(stop) 50 ;# simulation time
#----------------------------------------------------------------------
# Set up simulator objects
#----------------------------------------------------------------------
# create simulator instance
set ns_ [new Simulator]
# setup topography object
set topo [new Topography]
# create trace object for ns and nam
set tracefd [open $DSR_fileTr w]
$ns_ use-newtrace ;# use the new wireless trace file format
set namtrace [open $DSR_fileNam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
# define topology
$topo load_flatgrid $val(x) $val(y)
# Create God
set god_ [create-god $val(nn)]
$ns_ node-config -adhocRouting $val(adhocRouting)
-llType $val(ll)
-macType $val(mac)
-ifqType $val(ifq)
-ifqLen $val(ifqlen)
-antType $val(ant)
-propType $val(prop)
-phyType $val(netif)
-channelType $val(chan)
-topoInstance $topo
-agentTrace ON
-routerTrace ON
-macTrace ON
# Create the specified number of nodes [$val(nn)] and "attach" them
# to the channel.
for set i 0 $i < $val(nn) incr i
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
# Define node movement model
puts "Loading connection pattern..."
source $val(cp)
# Define traffic model
puts "Loading scenario file..."
source $val(sc)
# Define node initial position in nam
for set i 0 $i < $val(nn) incr i
# 50 defines the node size in nam, must adjust it according to your scenario
# The function must be called after mobility model is defined
# puts "Processing node $i"
$ns_ initial_node_pos $node_($i) 50
#
# Tell nodes when the simulation ends
#
for set i 0 $i < $val(nn) incr i
$ns_ at $val(stop).0 "$node_($i) reset";
$ns_ at $val(stop).0002 "puts "NS EXITING..." ; $ns_ halt"
# dump the initial simulation info to the trace file
puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(adhocRouting)"
puts $tracefd "M 0.0 sc $val(sc) cp $val(cp) seed $val(seed)"
puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)"
puts "Starting Simulation..."
$ns_ run
# end Mail file
# Evaluate parametrs
puts [eval exec "awk -f End2endDelay_RoutingPackets.awk $DSR_fileTr"]
In the first iteration, I got the results:
5
num_nodes is set 20
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...
Packet Sent = 136.00
Packet Receive = 82.00
routingpkts = 123.00
Packet Delivery Ratio = 60.29
NRL = 1.50
Average end-to-end Delay (ms)= 13219.08
No. of dropped data (packets) = 21
No. of dropped data (bytes) = 11172
In the second iteration, I got the following error:
6
num_nodes is set 20
invalid command name "_o491 _o4"
while executing
"$ns_ get-nodetype"
(procedure "_o501" line 22)
(Object next line 22)
invoked from within
"_o501 next"
("eval" body line 1)
invoked from within
"eval $self next $args"
(procedure "_o501" line 3)
(Object next line 3)
invoked from within
"_o501 next"
("eval" body line 1)
invoked from within
"eval $self next $args "
(procedure "_o501" line 6)
(SRNodeNew init line 6)
invoked from within
"_o501 init "
(Class create line 1)
invoked from within
"SRNodeNew create _o501 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg]
delete $o
return ""
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new SRNodeNew"
("eval" body line 1)
invoked from within
"eval new $nodeclass $args"
(procedure "_o491" line 8)
(Simulator create-node-instance line 8)
invoked from within
"_o491 create-node-instance"
("eval" body line 1)
invoked from within
"eval $self create-node-instance $args"
(procedure "_o491" line 6)
(Simulator create-wireless-node line 6)
invoked from within
"_o491 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o491" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
(procedure "input_Protocol_pramerters" line 61)
invoked from within
"input_Protocol_pramerters 20 6 2.0 6"
(file "call.tcl" line 5)
networking tcl ns2
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
Actually, I'm new in simulation project that I want to call another procedure from the following loop:
call.tcl
source costtest1.tcl
for set x 5 $x <6 incr x
input_Protocol_pramerters 20 $x 2.0 $x
puts "Done"
The other procedure includes the following DSR protocol to generate the performance evaluation for simulation scenario:
costtest1.tcl
proc input_Protocol_pramerters No_node No_connaction Rate iter
set cbr "cbr-"
set secn "scan-"
append cbr $iter
append secn $iter
set DSR_fileTr "DSR"
append DSR_fileTr $iter ".tr"
set DSR_fileNam "DSR"
append DSR_fileNam $iter ".nam"
puts $iter
#---- Generate Movement file ----
puts [eval exec "./setdest -v 1 -n $No_node -p 5 -M $No_connaction -t 100 -x 1000 -y 1000 >$secn"]
#---- Generate Movement file ----
puts [eval exec "ns cbrgen.tcl -type cbr -nn $No_node -seed 1.0 -mc $No_connaction -rate $Rate >$cbr"]
#---- Main simulation file to generate DSR.tr and DSR.nam
#----------------------------------------------------------------
# Definition of the physical layer
#----------------------------------------------------------------
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) CMUPriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
#-----------------------------------------------------------------
# Scenario parameters
#------------------------------------------------------------------
set val(x) 1500 ;# X dimension of the topography
set val(y) 1500 ;# Y dimension of the topography
set val(ifqlen) 50 ;# max packet in queue
set val(seed) 1.0 ;#random seed
set val(adhocRouting) DSR
set val(nn) $No_node ;# how many nodes are simulated
set val(cp) $cbr
set val(sc) $secn
set val(stop) 50 ;# simulation time
#----------------------------------------------------------------------
# Set up simulator objects
#----------------------------------------------------------------------
# create simulator instance
set ns_ [new Simulator]
# setup topography object
set topo [new Topography]
# create trace object for ns and nam
set tracefd [open $DSR_fileTr w]
$ns_ use-newtrace ;# use the new wireless trace file format
set namtrace [open $DSR_fileNam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
# define topology
$topo load_flatgrid $val(x) $val(y)
# Create God
set god_ [create-god $val(nn)]
$ns_ node-config -adhocRouting $val(adhocRouting)
-llType $val(ll)
-macType $val(mac)
-ifqType $val(ifq)
-ifqLen $val(ifqlen)
-antType $val(ant)
-propType $val(prop)
-phyType $val(netif)
-channelType $val(chan)
-topoInstance $topo
-agentTrace ON
-routerTrace ON
-macTrace ON
# Create the specified number of nodes [$val(nn)] and "attach" them
# to the channel.
for set i 0 $i < $val(nn) incr i
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
# Define node movement model
puts "Loading connection pattern..."
source $val(cp)
# Define traffic model
puts "Loading scenario file..."
source $val(sc)
# Define node initial position in nam
for set i 0 $i < $val(nn) incr i
# 50 defines the node size in nam, must adjust it according to your scenario
# The function must be called after mobility model is defined
# puts "Processing node $i"
$ns_ initial_node_pos $node_($i) 50
#
# Tell nodes when the simulation ends
#
for set i 0 $i < $val(nn) incr i
$ns_ at $val(stop).0 "$node_($i) reset";
$ns_ at $val(stop).0002 "puts "NS EXITING..." ; $ns_ halt"
# dump the initial simulation info to the trace file
puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(adhocRouting)"
puts $tracefd "M 0.0 sc $val(sc) cp $val(cp) seed $val(seed)"
puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)"
puts "Starting Simulation..."
$ns_ run
# end Mail file
# Evaluate parametrs
puts [eval exec "awk -f End2endDelay_RoutingPackets.awk $DSR_fileTr"]
In the first iteration, I got the results:
5
num_nodes is set 20
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...
Packet Sent = 136.00
Packet Receive = 82.00
routingpkts = 123.00
Packet Delivery Ratio = 60.29
NRL = 1.50
Average end-to-end Delay (ms)= 13219.08
No. of dropped data (packets) = 21
No. of dropped data (bytes) = 11172
In the second iteration, I got the following error:
6
num_nodes is set 20
invalid command name "_o491 _o4"
while executing
"$ns_ get-nodetype"
(procedure "_o501" line 22)
(Object next line 22)
invoked from within
"_o501 next"
("eval" body line 1)
invoked from within
"eval $self next $args"
(procedure "_o501" line 3)
(Object next line 3)
invoked from within
"_o501 next"
("eval" body line 1)
invoked from within
"eval $self next $args "
(procedure "_o501" line 6)
(SRNodeNew init line 6)
invoked from within
"_o501 init "
(Class create line 1)
invoked from within
"SRNodeNew create _o501 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg]
delete $o
return ""
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new SRNodeNew"
("eval" body line 1)
invoked from within
"eval new $nodeclass $args"
(procedure "_o491" line 8)
(Simulator create-node-instance line 8)
invoked from within
"_o491 create-node-instance"
("eval" body line 1)
invoked from within
"eval $self create-node-instance $args"
(procedure "_o491" line 6)
(Simulator create-wireless-node line 6)
invoked from within
"_o491 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o491" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
(procedure "input_Protocol_pramerters" line 61)
invoked from within
"input_Protocol_pramerters 20 6 2.0 6"
(file "call.tcl" line 5)
networking tcl ns2
Actually, I'm new in simulation project that I want to call another procedure from the following loop:
call.tcl
source costtest1.tcl
for set x 5 $x <6 incr x
input_Protocol_pramerters 20 $x 2.0 $x
puts "Done"
The other procedure includes the following DSR protocol to generate the performance evaluation for simulation scenario:
costtest1.tcl
proc input_Protocol_pramerters No_node No_connaction Rate iter
set cbr "cbr-"
set secn "scan-"
append cbr $iter
append secn $iter
set DSR_fileTr "DSR"
append DSR_fileTr $iter ".tr"
set DSR_fileNam "DSR"
append DSR_fileNam $iter ".nam"
puts $iter
#---- Generate Movement file ----
puts [eval exec "./setdest -v 1 -n $No_node -p 5 -M $No_connaction -t 100 -x 1000 -y 1000 >$secn"]
#---- Generate Movement file ----
puts [eval exec "ns cbrgen.tcl -type cbr -nn $No_node -seed 1.0 -mc $No_connaction -rate $Rate >$cbr"]
#---- Main simulation file to generate DSR.tr and DSR.nam
#----------------------------------------------------------------
# Definition of the physical layer
#----------------------------------------------------------------
set val(chan) Channel/WirelessChannel
set val(prop) Propagation/TwoRayGround
set val(netif) Phy/WirelessPhy
set val(mac) Mac/802_11
set val(ifq) CMUPriQueue
set val(ll) LL
set val(ant) Antenna/OmniAntenna
#-----------------------------------------------------------------
# Scenario parameters
#------------------------------------------------------------------
set val(x) 1500 ;# X dimension of the topography
set val(y) 1500 ;# Y dimension of the topography
set val(ifqlen) 50 ;# max packet in queue
set val(seed) 1.0 ;#random seed
set val(adhocRouting) DSR
set val(nn) $No_node ;# how many nodes are simulated
set val(cp) $cbr
set val(sc) $secn
set val(stop) 50 ;# simulation time
#----------------------------------------------------------------------
# Set up simulator objects
#----------------------------------------------------------------------
# create simulator instance
set ns_ [new Simulator]
# setup topography object
set topo [new Topography]
# create trace object for ns and nam
set tracefd [open $DSR_fileTr w]
$ns_ use-newtrace ;# use the new wireless trace file format
set namtrace [open $DSR_fileNam w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $val(x) $val(y)
# define topology
$topo load_flatgrid $val(x) $val(y)
# Create God
set god_ [create-god $val(nn)]
$ns_ node-config -adhocRouting $val(adhocRouting)
-llType $val(ll)
-macType $val(mac)
-ifqType $val(ifq)
-ifqLen $val(ifqlen)
-antType $val(ant)
-propType $val(prop)
-phyType $val(netif)
-channelType $val(chan)
-topoInstance $topo
-agentTrace ON
-routerTrace ON
-macTrace ON
# Create the specified number of nodes [$val(nn)] and "attach" them
# to the channel.
for set i 0 $i < $val(nn) incr i
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
# Define node movement model
puts "Loading connection pattern..."
source $val(cp)
# Define traffic model
puts "Loading scenario file..."
source $val(sc)
# Define node initial position in nam
for set i 0 $i < $val(nn) incr i
# 50 defines the node size in nam, must adjust it according to your scenario
# The function must be called after mobility model is defined
# puts "Processing node $i"
$ns_ initial_node_pos $node_($i) 50
#
# Tell nodes when the simulation ends
#
for set i 0 $i < $val(nn) incr i
$ns_ at $val(stop).0 "$node_($i) reset";
$ns_ at $val(stop).0002 "puts "NS EXITING..." ; $ns_ halt"
# dump the initial simulation info to the trace file
puts $tracefd "M 0.0 nn $val(nn) x $val(x) y $val(y) rp $val(adhocRouting)"
puts $tracefd "M 0.0 sc $val(sc) cp $val(cp) seed $val(seed)"
puts $tracefd "M 0.0 prop $val(prop) ant $val(ant)"
puts "Starting Simulation..."
$ns_ run
# end Mail file
# Evaluate parametrs
puts [eval exec "awk -f End2endDelay_RoutingPackets.awk $DSR_fileTr"]
In the first iteration, I got the results:
5
num_nodes is set 20
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
Loading connection pattern...
Loading scenario file...
Starting Simulation...
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
NS EXITING...
Packet Sent = 136.00
Packet Receive = 82.00
routingpkts = 123.00
Packet Delivery Ratio = 60.29
NRL = 1.50
Average end-to-end Delay (ms)= 13219.08
No. of dropped data (packets) = 21
No. of dropped data (bytes) = 11172
In the second iteration, I got the following error:
6
num_nodes is set 20
invalid command name "_o491 _o4"
while executing
"$ns_ get-nodetype"
(procedure "_o501" line 22)
(Object next line 22)
invoked from within
"_o501 next"
("eval" body line 1)
invoked from within
"eval $self next $args"
(procedure "_o501" line 3)
(Object next line 3)
invoked from within
"_o501 next"
("eval" body line 1)
invoked from within
"eval $self next $args "
(procedure "_o501" line 6)
(SRNodeNew init line 6)
invoked from within
"_o501 init "
(Class create line 1)
invoked from within
"SRNodeNew create _o501 "
invoked from within
"catch "$className create $o $args" msg"
invoked from within
"if [catch "$className create $o $args" msg] {
if [string match "__FAILED_SHADOW_OBJECT_" $msg]
delete $o
return ""
global errorInfo
error "class $..."
(procedure "new" line 3)
invoked from within
"new SRNodeNew"
("eval" body line 1)
invoked from within
"eval new $nodeclass $args"
(procedure "_o491" line 8)
(Simulator create-node-instance line 8)
invoked from within
"_o491 create-node-instance"
("eval" body line 1)
invoked from within
"eval $self create-node-instance $args"
(procedure "_o491" line 6)
(Simulator create-wireless-node line 6)
invoked from within
"_o491 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o491" line 23)
(Simulator node line 23)
invoked from within
"$ns_ node"
(procedure "input_Protocol_pramerters" line 61)
invoked from within
"input_Protocol_pramerters 20 6 2.0 6"
(file "call.tcl" line 5)
networking tcl ns2
networking tcl ns2
asked Apr 9 at 17:43
![](https://lh5.googleusercontent.com/-Cvr4ZrY8W7I/AAAAAAAAAAI/AAAAAAAAARA/l5dCkVgc6eI/photo.jpg?sz=32)
![](https://lh5.googleusercontent.com/-Cvr4ZrY8W7I/AAAAAAAAAAI/AAAAAAAAARA/l5dCkVgc6eI/photo.jpg?sz=32)
sadeem deyah
11
11
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1023407%2fhow-to-run-scenario-of-dsr-protocol-multiple-times-in-one-session-in-ns2%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password