LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-22-2017, 09:35 AM   #1
israk
LQ Newbie
 
Registered: Apr 2017
Posts: 18

Rep: Reputation: Disabled
problem while run DSDV. tcl file on ns-2.34 in ubuntu15.10


I can't run DSDV.tcl in ns-2.34, when i tried to run this tcl code following error occurs:

sabin@sabin-desktop:~/Documents/work$ ns DSDV.tcl
num_nodes is set 10
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
can't read "ns_": no such variable
while executing
"$ns_ at 2.000000000000 "$node_(0) setdest 195.315152435925 395.692980919066 2.781453702725""
(file "DSDV.tcl" line 189)
Please anyone help me to solve this error and also help me to run this tcl code....i can't solve this error ,i am very new in ubuntu.please help me

My DSDV.tcl code is:

Code:
set val(chan)           Channel/WirelessChannel    ;# channel type 
set val(prop)           Propagation/TwoRayGround   ;# radio-propagation model 
set val(netif)          Phy/WirelessPhy            ;# network interface type 
set val(mac)            Mac/802_11                 ;# MAC type 
set val(ifq)            Queue/DropTail/PriQueue    ;# interface queue type 
set val(ll)             LL                         ;# link layer type 
set val(ant)            Antenna/OmniAntenna        ;# antenna model 
set val(ifqlen)         50                         ;# max packet in ifq 
set val(nn)             10                          ;# number of mobilenodes 
set val(rp)             DSDV                      ;# routing protocol 

set val(x)              500   			   ;# X dimension of topography 
set val(y)              500   			   ;# Y dimension of topography   
set val(stop)		200			   ;# time of simulation end 
 

#=======================================================================================
Queue set limit_  50

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

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

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

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

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

Queue/DropTail/PriQueue set Prefer_Routing_Protocols    1

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

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

set ns [new Simulator] 
$ns use-newtrace
set tracefd [open DSDV_F.tr w] 
   
 
$ns trace-all $tracefd 

set nf [open DSDV_F.nam w]
$ns namtrace-all-wireless $nf $val(x) $val(y) 

#$ns namtrace-all $nf

proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam DSDV_F.nam 
exit 0
}
 
# set up topography object 
set topo [new Topography] 
 
$topo load_flatgrid $val(x) $val(y) 
 
set god_ [create-god $val(nn)] 
 


$ns node-config -adhocRouting $val(rp) \
	           -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 OFF \
			 -movementTrace ON

			  
	for {set i 0} {$i < $val(nn) } { incr i } { 
		set node_($i) [$ns node]	 
	} 
#=========================================================================
 
#
# nodes: 10, pause: 2.00, max speed: 10.00, max x: 500.00, max y: 500.00
#
$node_(0) set X_ 251.572003780626
$node_(0) set Y_ 430.554731063401
$node_(0) set Z_ 0.000000000000
$node_(1) set X_ 47.352365997921
$node_(1) set Y_ 407.391346580675
$node_(1) set Z_ 0.000000000000
$node_(2) set X_ 186.591565332153
$node_(2) set Y_ 98.182486119204
$node_(2) set Z_ 0.000000000000
$node_(3) set X_ 298.711284909385
$node_(3) set Y_ 356.352472822488
$node_(3) set Z_ 0.000000000000
$node_(4) set X_ 227.183906769904
$node_(4) set Y_ 417.034491836833
$node_(4) set Z_ 0.000000000000
$node_(5) set X_ 318.550210739124
$node_(5) set Y_ 169.767571918586
$node_(5) set Z_ 0.000000000000
$node_(6) set X_ 194.352727598829
$node_(6) set Y_ 290.504965564477
$node_(6) set Z_ 0.000000000000
$node_(7) set X_ 400.535896260167
$node_(7) set Y_ 418.417004177053
$node_(7) set Z_ 0.000000000000
$node_(8) set X_ 12.516629673415
$node_(8) set Y_ 202.410482010194
$node_(8) set Z_ 0.000000000000
$node_(9) set X_ 362.128227907855
$node_(9) set Y_ 476.851056023738
$node_(9) set Z_ 0.000000000000
$god_ set-dist 0 1 1
$god_ set-dist 0 2 2
$god_ set-dist 0 3 1
$god_ set-dist 0 4 1
$god_ set-dist 0 5 2
$god_ set-dist 0 6 1
$god_ set-dist 0 7 1
$god_ set-dist 0 8 2
$god_ set-dist 0 9 1
$god_ set-dist 1 2 2
$god_ set-dist 1 3 2
$god_ set-dist 1 4 1
$god_ set-dist 1 5 2
$god_ set-dist 1 6 1
$god_ set-dist 1 7 2
$god_ set-dist 1 8 1
$god_ set-dist 1 9 2
$god_ set-dist 2 3 2
$god_ set-dist 2 4 2
$god_ set-dist 2 5 1
$god_ set-dist 2 6 1
$god_ set-dist 2 7 2
$god_ set-dist 2 8 1
$god_ set-dist 2 9 3
$god_ set-dist 3 4 1
$god_ set-dist 3 5 1
$god_ set-dist 3 6 1
$god_ set-dist 3 7 1
$god_ set-dist 3 8 2
$god_ set-dist 3 9 1
$god_ set-dist 4 5 2
$god_ set-dist 4 6 1
$god_ set-dist 4 7 1
$god_ set-dist 4 8 2
$god_ set-dist 4 9 1
$god_ set-dist 5 6 1
$god_ set-dist 5 7 2
$god_ set-dist 5 8 2
$god_ set-dist 5 9 2
$god_ set-dist 6 7 1
$god_ set-dist 6 8 1
$god_ set-dist 6 9 2
$god_ set-dist 7 8 2
$god_ set-dist 7 9 1
$god_ set-dist 8 9 3
$ns_ at 2.000000000000 "$node_(0) setdest 195.315152435925 395.692980919066 2.781453702725"
$ns_ at 2.000000000000 "$node_(1) setdest 110.012650578895 25.629748085278 0.835343497747"
$ns_ at 2.000000000000 "$node_(2) setdest 290.048820276315 431.136410142382 1.639785475814"
$ns_ at 2.000000000000 "$node_(3) setdest 133.398689154286 23.766218555014 6.610212390061"
$ns_ at 2.000000000000 "$node_(4) setdest 460.579597577582 44.883973625458 9.820120144306"
$ns_ at 2.000000000000 "$node_(5) setdest 100.778205544191 266.480106494357 8.185143301382"
$ns_ at 2.000000000000 "$node_(6) setdest 308.675522730804 299.746163852327 6.280374670475"
$ns_ at 2.000000000000 "$node_(7) setdest 403.255889745714 457.253873024323 6.859630641249"
$ns_ at 2.000000000000 "$node_(8) setdest 411.252228436168 470.223128052058 1.825272361668"
$ns_ at 2.000000000000 "$node_(9) setdest 429.213886795679 215.455036101548 8.644572475010"
$ns_ at 2.079786532491 "$god_ set-dist 2 9 2"
$ns_ at 2.079786532491 "$god_ set-dist 6 9 1"
$ns_ at 2.079786532491 "$god_ set-dist 8 9 2"
$ns_ at 2.894614072644 "$god_ set-dist 4 5 1"
$ns_ at 5.310189563595 "$god_ set-dist 0 5 1"
$ns_ at 5.662538265462 "$god_ set-dist 1 3 1"
$ns_ at 5.822576590980 "$god_ set-dist 2 3 1"
$ns_ at 7.675524471848 "$node_(7) setdest 403.255889745714 457.253873024323 0.000000000000"
$ns_ at 8.301918590696 "$god_ set-dist 5 8 1"
$ns_ at 9.174698448651 "$god_ set-dist 5 9 1"
$ns_ at 9.675524471848 "$node_(7) setdest 382.126805834094 299.492412664560 9.587765569858"
$ns_ at 10.288185805733 "$god_ set-dist 2 4 1"
$ns_ at 12.929107286948 "$god_ set-dist 3 8 1"
$ns_ at 13.433391366999 "$god_ set-dist 6 8 2"
$ns_ at 13.461874781307 "$god_ set-dist 1 4 2"
$ns_ at 15.218548844051 "$god_ set-dist 1 5 1"
$ns_ at 15.483950186148 "$god_ set-dist 1 6 2"
$ns_ at 17.495560784887 "$god_ set-dist 5 7 1"
$ns_ at 19.906510531041 "$god_ set-dist 0 8 1"
$ns_ at 20.262555293931 "$node_(6) setdest 308.675522730804 299.746163852327 0.000000000000"
$ns_ at 22.262555293931 "$node_(6) setdest 306.664101729666 113.269892302374 6.337059782378"
$ns_ at 22.465178155179 "$god_ set-dist 5 9 2"
$ns_ at 25.794352596297 "$node_(0) setdest 195.315152435925 395.692980919066 0.000000000000"
$ns_ at 25.795385821813 "$god_ set-dist 2 7 1"
$ns_ at 26.153939863490 "$god_ set-dist 0 9 2"
$ns_ at 26.263998558574 "$god_ set-dist 5 7 2"
$ns_ at 26.276898977106 "$node_(7) setdest 382.126805834094 299.492412664560 0.000000000000"
$ns_ at 27.273705764239 "$god_ set-dist 0 4 2"
$ns_ at 27.324970483209 "$god_ set-dist 1 3 2"
$ns_ at 27.324970483209 "$god_ set-dist 1 9 3"
$ns_ at 27.794352596297 "$node_(0) setdest 292.685254099437 300.132389861983 3.110178519720"
$ns_ at 27.889686536222 "$god_ set-dist 2 9 1"
$ns_ at 28.276898977106 "$node_(7) setdest 260.812924883582 104.396789617495 4.316579459200"
$ns_ at 28.323552924053 "$god_ set-dist 1 4 3"
$ns_ at 28.323552924053 "$god_ set-dist 4 5 2"
$ns_ at 29.695538770038 "$god_ set-dist 0 2 1"
$ns_ at 31.111434564169 "$node_(5) setdest 100.778205544191 266.480106494357 0.000000000000"
$ns_ at 32.051358737005 "$god_ set-dist 6 8 1"
$ns_ at 33.111434564169 "$node_(5) setdest 361.432660296092 24.853925958652 4.948239703484"
$ns_ at 33.218121024222 "$node_(9) setdest 429.213886795679 215.455036101548 0.000000000000"
$ns_ at 35.218121024222 "$node_(9) setdest 59.326739595263 404.839816434933 2.957281736917"
$ns_ at 36.620790259229 "$god_ set-dist 5 7 1"
$ns_ at 38.949318268808 "$god_ set-dist 0 9 1"
$ns_ at 38.949318268808 "$god_ set-dist 1 9 2"
$ns_ at 41.020380301332 "$god_ set-dist 3 9 2"
$ns_ at 41.132131448441 "$god_ set-dist 3 4 2"
$ns_ at 42.126967793094 "$god_ set-dist 0 3 2"
$ns_ at 43.002024911939 "$god_ set-dist 2 4 2"
$ns_ at 46.553043747076 "$god_ set-dist 5 9 1"
$ns_ at 46.732956064510 "$node_(4) setdest 460.579597577582 44.883973625457 0.000000000000"
$ns_ at 47.266936886761 "$god_ set-dist 4 8 3"
$ns_ at 47.266936886761 "$god_ set-dist 6 8 2"
$ns_ at 48.732956064510 "$node_(4) setdest 235.536554244255 447.504253727590 3.035816059320"
$ns_ at 49.621391117426 "$god_ set-dist 1 2 1"
$ns_ at 49.795602677810 "$god_ set-dist 4 8 2"
$ns_ at 49.795602677810 "$god_ set-dist 7 8 1"
$ns_ at 51.690574865522 "$node_(6) setdest 306.664101729666 113.269892302374 0.000000000000"
$ns_ at 53.690574865522 "$node_(6) setdest 91.057250262217 237.568146994844 6.899061183213"
$ns_ at 54.772852353795 "$god_ set-dist 6 8 1"
$ns_ at 58.186585702213 "$node_(3) setdest 133.398689154286 23.766218555014 0.000000000000"
$ns_ at 60.186585702213 "$node_(3) setdest 268.961080220506 1.993000371043 2.332734925488"
$ns_ at 62.242919115257 "$god_ set-dist 1 4 2"
$ns_ at 62.242919115257 "$god_ set-dist 4 5 1"
$ns_ at 62.670697559915 "$god_ set-dist 2 4 1"
$ns_ at 63.338032524258 "$god_ set-dist 8 9 1"
$ns_ at 64.137389061085 "$god_ set-dist 1 5 2"
$ns_ at 66.845168105108 "$god_ set-dist 3 8 2"
$ns_ at 68.257321872718 "$god_ set-dist 1 6 1"
$ns_ at 69.380130734206 "$god_ set-dist 0 4 1"
$ns_ at 71.659552122958 "$node_(0) setdest 292.685254099437 300.132389861982 0.000000000000"
$ns_ at 73.659552122958 "$node_(0) setdest 144.299136594455 98.640313259602 3.276285501539"
$ns_ at 74.360277744359 "$god_ set-dist 4 6 2"
$ns_ at 81.499037308380 "$node_(7) setdest 260.812924883582 104.396789617495 0.000000000000"
$ns_ at 83.499037308380 "$node_(7) setdest 243.172449078380 376.709527186021 5.354121600664"
$ns_ at 83.794155468766 "$god_ set-dist 1 9 1"
$ns_ at 85.310053577229 "$god_ set-dist 3 4 1"
$ns_ at 85.742379711468 "$god_ set-dist 5 8 2"
$ns_ at 88.128730011148 "$god_ set-dist 5 6 2"
$ns_ at 89.703784745072 "$god_ set-dist 3 6 2"
$ns_ at 89.763626180712 "$node_(6) setdest 91.057250262217 237.568146994844 0.000000000000"
$ns_ at 90.401767123461 "$god_ set-dist 0 3 1"
$ns_ at 91.763626180712 "$node_(6) setdest 170.786737586288 460.839220638051 2.028823073952"
$ns_ at 96.047767665733 "$god_ set-dist 5 9 2"
$ns_ at 96.598115002718 "$god_ set-dist 1 7 1"
$ns_ at 101.308456131373 "$god_ set-dist 4 8 1"
$ns_ at 102.254971809893 "$god_ set-dist 2 5 2"
$ns_ at 103.814430517138 "$god_ set-dist 2 3 2"
$ns_ at 104.939162510471 "$node_(5) setdest 361.432660296092 24.853925958652 0.000000000000"
$ns_ at 106.939162510471 "$node_(5) setdest 377.567446216482 249.140849644620 0.519898235365"
$ns_ at 110.996937592769 "$god_ set-dist 5 7 2"
$ns_ at 111.636321491656 "$god_ set-dist 3 7 2"
$ns_ at 119.044451570419 "$node_(3) setdest 268.961080220506 1.993000371043 0.000000000000"
$ns_ at 120.626922079787 "$god_ set-dist 4 6 1"
$ns_ at 121.044451570419 "$node_(3) setdest 454.164194284508 301.924915355719 3.495276830396"
$ns_ at 134.466037421658 "$node_(7) setdest 243.172449078380 376.709527186021 0.000000000000"
$ns_ at 135.530068452987 "$god_ set-dist 0 7 2"
$ns_ at 136.466037421658 "$node_(7) setdest 320.575004252512 376.017485096035 6.319113186182"
$ns_ at 141.042771279629 "$god_ set-dist 4 5 2"
$ns_ at 141.042771279629 "$god_ set-dist 5 7 3"
$ns_ at 144.535279322352 "$god_ set-dist 0 9 2"
$ns_ at 144.535279322352 "$god_ set-dist 5 9 3"
$ns_ at 145.125504426245 "$god_ set-dist 0 4 2"
$ns_ at 145.512142288891 "$god_ set-dist 0 8 2"
$ns_ at 145.512142288891 "$god_ set-dist 5 8 3"
$ns_ at 145.631170372549 "$god_ set-dist 1 7 2"
$ns_ at 146.044527346779 "$god_ set-dist 1 4 1"
$ns_ at 148.372941503191 "$god_ set-dist 0 2 2"
$ns_ at 148.372941503191 "$god_ set-dist 2 5 3"
$ns_ at 148.715485491752 "$node_(7) setdest 320.575004252512 376.017485096035 0.000000000000"
$ns_ at 149.893626950644 "$god_ set-dist 0 6 2"
$ns_ at 149.893626950644 "$god_ set-dist 0 7 3"
$ns_ at 149.893626950644 "$god_ set-dist 5 6 3"
$ns_ at 150.037170357289 "$node_(0) setdest 144.299136594455 98.640313259602 0.000000000000"
$ns_ at 150.038608069873 "$god_ set-dist 2 3 1"
$ns_ at 150.038608069873 "$god_ set-dist 2 5 2"
$ns_ at 150.715485491752 "$node_(7) setdest 493.877484515895 439.212990542013 5.003191298028"
$ns_ at 152.037170357289 "$node_(0) setdest 146.809098668465 456.946506641077 1.862406776608"
$ns_ at 158.147608708904 "$god_ set-dist 7 9 2"
$ns_ at 165.561681455500 "$god_ set-dist 6 7 2"
$ns_ at 166.317148402523 "$god_ set-dist 3 8 1"
$ns_ at 166.317148402523 "$god_ set-dist 5 8 2"
$ns_ at 175.736202885045 "$node_(9) setdest 59.326739595263 404.839816434934 0.000000000000"
$ns_ at 177.736202885045 "$node_(9) setdest 380.380800370874 199.543016148952 0.265536775168"
$ns_ at 182.823630424738 "$god_ set-dist 1 8 2"
$ns_ at 185.691904262060 "$god_ set-dist 3 4 2"
$ns_ at 185.691904262060 "$god_ set-dist 4 5 3"
$ns_ at 187.584999438695 "$node_(7) setdest 493.877484515895 439.212990542013 0.000000000000"
$ns_ at 188.159823947233 "$god_ set-dist 0 3 2"
$ns_ at 188.159823947233 "$god_ set-dist 0 8 3"
$ns_ at 188.955414561035 "$god_ set-dist 0 8 2"
$ns_ at 188.955414561035 "$god_ set-dist 0 9 1"
$ns_ at 188.955414561035 "$god_ set-dist 5 9 2"
$ns_ at 189.584999438695 "$node_(7) setdest 23.064534947607 16.898307137854 7.945998041604"
$ns_ at 189.916757880840 "$god_ set-dist 3 7 1"
$ns_ at 189.916757880840 "$god_ set-dist 5 7 2"
$ns_ at 190.874380377758 "$god_ set-dist 1 2 2"
$ns_ at 190.874380377758 "$god_ set-dist 1 3 3"
$ns_ at 194.327422080783 "$god_ set-dist 1 4 2"
$ns_ at 194.327422080783 "$god_ set-dist 1 7 3"
#
# Destination Unreachables: 0
#
# Route Changes: 101
#
# Link Changes: 78
#
# Node | Route Changes | Link Changes
#    0 |            20 |           17
#    1 |            21 |           15
#    2 |            16 |           13
#    3 |            19 |           18
#    4 |            24 |           19
#    5 |            29 |           19
#    6 |            14 |           13
#    7 |            17 |           13
#    8 |            22 |           15
#    9 |            20 |           14
#
#=====================================================================
# nodes: 10, max conn: 20, send rate: 0.0, seed: 0
#
#
# 1 connecting to 2 at time 80.763021540252041
#
set tcp_(0) [$ns_ create-connection  TCP $node_(1) TCPSink $node_(2) 0]
$tcp_(0) set window_ 32
$tcp_(0) set packetSize_ 512
set ftp_(0) [$tcp_(0) attach-source FTP]
$ns_ at 80.763021540252041 "$ftp_(0) start"
#
# 3 connecting to 4 at time 156.00224684737728
#
set tcp_(1) [$ns_ create-connection  TCP $node_(3) TCPSink $node_(4) 0]
$tcp_(1) set window_ 32
$tcp_(1) set packetSize_ 512
set ftp_(1) [$tcp_(1) attach-source FTP]
$ns_ at 156.00224684737728 "$ftp_(1) start"
#
# 4 connecting to 5 at time 103.3559006654452
#
set tcp_(2) [$ns_ create-connection  TCP $node_(4) TCPSink $node_(5) 0]
$tcp_(2) set window_ 32
$tcp_(2) set packetSize_ 512
set ftp_(2) [$tcp_(2) attach-source FTP]
$ns_ at 103.3559006654452 "$ftp_(2) start"
#
# 5 connecting to 6 at time 38.455295021857737
#
set tcp_(3) [$ns_ create-connection  TCP $node_(5) TCPSink $node_(6) 0]
$tcp_(3) set window_ 32
$tcp_(3) set packetSize_ 512
set ftp_(3) [$tcp_(3) attach-source FTP]
$ns_ at 38.455295021857737 "$ftp_(3) start"
#
# 5 connecting to 7 at time 93.460039279172221
#
set tcp_(4) [$ns_ create-connection  TCP $node_(5) TCPSink $node_(7) 0]
$tcp_(4) set window_ 32
$tcp_(4) set packetSize_ 512
set ftp_(4) [$tcp_(4) attach-source FTP]
$ns_ at 93.460039279172221 "$ftp_(4) start"
#
# 6 connecting to 7 at time 107.04303348764917
#
set tcp_(5) [$ns_ create-connection  TCP $node_(6) TCPSink $node_(7) 0]
$tcp_(5) set window_ 32
$tcp_(5) set packetSize_ 512
set ftp_(5) [$tcp_(5) attach-source FTP]
$ns_ at 107.04303348764917 "$ftp_(5) start"
#
#Total sources/connections: 5/6


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

for {set i 0} {$i < 3 } { incr i } { 
    $ns at $val(stop) "$ftp_($i) stop"; 
}
#$ns at $val(stop) "$ftp stop" 

$ns at 121.0 "finish"

# Telling nodes when the simulation ends 
 
 
# ending nam and the simulation  
#$ns at $val(stop) "$ns nam-end-wireless $val(stop)" 
#$ns at $val(stop) "stop" 
#$ns at 150.01 "puts "end simulation" ; $ns halt" 

 
#Call the finish procedure after 5 seconds of simulation time 
$ns run

Last edited by israk; 04-23-2017 at 09:19 PM.
 
Old 04-22-2017, 02:00 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,269

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Please edit your above file to use Code Tags : [code]code text[/code]
Editing : That's the 'Edit' button in post #1.

Your file works (kind of, nam complains) when all ns is edited to ns_ (Or vice versa).
You cannot define ns, and then use ns_ in some lines.

The edited file: Attached as DSDV-nn10.tcl.gz.txt ( The name dsdv.tcl already exists.)
Download the file, rename to DSDV-nn10.tcl.gz, and $ gunzip DSDV-nn10.tcl.gz

26 examples: dsdv-examples.tar.gz https://drive.google.com/file/d/0B7S...ew?usp=sharing
-
Attached Files
File Type: txt DSDV-nn10.tcl.gz.txt (4.8 KB, 24 views)

Last edited by knudfl; 04-22-2017 at 02:01 PM.
 
1 members found this post helpful.
Old 04-22-2017, 08:29 PM   #3
israk
LQ Newbie
 
Registered: Apr 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thank you #knudfl...
But
where i add "$ gunzip DSDV-nn10.tcl.gz" this line in my code please help me
 
Old 04-22-2017, 08:46 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,269

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Re #3. Note : You will still have to edit post #1. Read post #2.



Quote:
$ gunzip DSDV-nn10.tcl.gz
" $ " means the terminal prompt.
The commands : 1) cd Downloads/
2) gunzip DSDV-nn10.tcl.gz
... The gunzip command will uncompress the gzipped file, so it is readable.


-

Last edited by knudfl; 04-22-2017 at 08:53 PM.
 
1 members found this post helpful.
Old 04-22-2017, 08:56 PM   #5
israk
LQ Newbie
 
Registered: Apr 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thank you very much...
 
Old 04-22-2017, 10:18 PM   #6
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,269

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Edit post #1 !

Type [/code] at tcl code end. And [code] at tcl code begin.

Or use the " # " button in the 'Advanced Editor'.
 
1 members found this post helpful.
Old 04-23-2017, 12:35 AM   #7
israk
LQ Newbie
 
Registered: Apr 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
I can't understand what you say ...where i add # into this code .,
and why trace file not create after run your code (DSDV-nn10.tcl)
Kindly help me


Thank you ...i solved it
I am very thankful to you ...#knudfl
Please help me to solve the following DSR.tcl code ..
when i tried to run it gives errors:

num_nodes is set 25
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl
INITIALIZE THE LIST xListHead
can't read "ns_": no such variable
while executing
"$ns_ at 2.000000000000 "$node_(0) setdest 12.739265838118 152.531678491875 40.827973220083""
(file "DSR.tcl" line 495)
Please help me

My DSR.tcl code is:

Code:
set val(chan)  Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy ;# network interface type
set val(mac) Mac/802_11 ;# MAC type
set val(ifq) Queue/DropTail/PriQueue ;# interface queue type
set val(ll) LL ;# link layer type
set val(ant) Antenna/OmniAntenna ;# antenna model
set val(ifqlen) 50 ;# max packet in ifq
set val(nn) 10 ;# number of mobilenodes
set val(rp) DSDV ;# routing protocol

set val(x) 500 ;# X dimension of topography
set val(y) 500 ;# Y dimension of topography
set val(stop) 200 ;# time of simulation end


#=======================================================================================
Queue set limit_ 50

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

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

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

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

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

Queue/DropTail/PriQueue set Prefer_Routing_Protocols 1

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

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

set ns_ [new Simulator]
$ns_ use-newtrace
set tracefd [open DSDV_F.tr w]


$ns_ trace-all $tracefd

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

#$ns_ namtrace-all $nf

proc finish {} {
global ns_ nf
$ns_ flush-trace
close $nf
exec nam DSDV_F.nam
exit 0
}

# set up topography object
set topo [new Topography]

$topo load_flatgrid $val(x) $val(y)

set god_ [create-god $val(nn)]



$ns_ node-config -adhocRouting $val(rp) \
-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 OFF \
-movementTrace ON


for {set i 0} {$i < $val(nn) } { incr i } {
set node_($i) [$ns_ node]
}
#=========================================================================


# nodes: 10, pause: 2.00, max speed: 10.00, max x: 500.00, max y: 500.00
#
$node_(0) set X_ 251.572003780626
$node_(0) set Y_ 430.554731063401
$node_(0) set Z_ 0.000000000000
$node_(1) set X_ 47.352365997921
$node_(1) set Y_ 407.391346580675
$node_(1) set Z_ 0.000000000000
$node_(2) set X_ 186.591565332153
$node_(2) set Y_ 98.182486119204
$node_(2) set Z_ 0.000000000000
$node_(3) set X_ 298.711284909385
$node_(3) set Y_ 356.352472822488
$node_(3) set Z_ 0.000000000000
$node_(4) set X_ 227.183906769904
$node_(4) set Y_ 417.034491836833
$node_(4) set Z_ 0.000000000000
$node_(5) set X_ 318.550210739124
$node_(5) set Y_ 169.767571918586
$node_(5) set Z_ 0.000000000000
$node_(6) set X_ 194.352727598829
$node_(6) set Y_ 290.504965564477
$node_(6) set Z_ 0.000000000000
$node_(7) set X_ 400.535896260167
$node_(7) set Y_ 418.417004177053
$node_(7) set Z_ 0.000000000000
$node_(8) set X_ 12.516629673415
$node_(8) set Y_ 202.410482010194
$node_(8) set Z_ 0.000000000000
$node_(9) set X_ 362.128227907855
$node_(9) set Y_ 476.851056023738
$node_(9) set Z_ 0.000000000000
$god_ set-dist 0 1 1
$god_ set-dist 0 2 2
$god_ set-dist 0 3 1
$god_ set-dist 0 4 1
$god_ set-dist 0 5 2
$god_ set-dist 0 6 1
$god_ set-dist 0 7 1
$god_ set-dist 0 8 2
$god_ set-dist 0 9 1
$god_ set-dist 1 2 2
$god_ set-dist 1 3 2
$god_ set-dist 1 4 1
$god_ set-dist 1 5 2
$god_ set-dist 1 6 1
$god_ set-dist 1 7 2
$god_ set-dist 1 8 1
$god_ set-dist 1 9 2
$god_ set-dist 2 3 2
$god_ set-dist 2 4 2
$god_ set-dist 2 5 1
$god_ set-dist 2 6 1
$god_ set-dist 2 7 2
$god_ set-dist 2 8 1
$god_ set-dist 2 9 3
$god_ set-dist 3 4 1
$god_ set-dist 3 5 1
$god_ set-dist 3 6 1
$god_ set-dist 3 7 1
$god_ set-dist 3 8 2
$god_ set-dist 3 9 1
$god_ set-dist 4 5 2
$god_ set-dist 4 6 1
$god_ set-dist 4 7 1
$god_ set-dist 4 8 2
$god_ set-dist 4 9 1
$god_ set-dist 5 6 1
$god_ set-dist 5 7 2
$god_ set-dist 5 8 2
$god_ set-dist 5 9 2
$god_ set-dist 6 7 1
$god_ set-dist 6 8 1
$god_ set-dist 6 9 2
$god_ set-dist 7 8 2
$god_ set-dist 7 9 1
$god_ set-dist 8 9 3
$ns_ at 2.000000000000 "$node_(0) setdest 195.315152435925 395.692980919066 2.781453702725"
$ns_ at 2.000000000000 "$node_(1) setdest 110.012650578895 25.629748085278 0.835343497747"
$ns_ at 2.000000000000 "$node_(2) setdest 290.048820276315 431.136410142382 1.639785475814"
$ns_ at 2.000000000000 "$node_(3) setdest 133.398689154286 23.766218555014 6.610212390061"
$ns_ at 2.000000000000 "$node_(4) setdest 460.579597577582 44.883973625458 9.820120144306"
$ns_ at 2.000000000000 "$node_(5) setdest 100.778205544191 266.480106494357 8.185143301382"
$ns_ at 2.000000000000 "$node_(6) setdest 308.675522730804 299.746163852327 6.280374670475"
$ns_ at 2.000000000000 "$node_(7) setdest 403.255889745714 457.253873024323 6.859630641249"
$ns_ at 2.000000000000 "$node_(8) setdest 411.252228436168 470.223128052058 1.825272361668"
$ns_ at 2.000000000000 "$node_(9) setdest 429.213886795679 215.455036101548 8.644572475010"
$ns_ at 2.079786532491 "$god_ set-dist 2 9 2"
$ns_ at 2.079786532491 "$god_ set-dist 6 9 1"
$ns_ at 2.079786532491 "$god_ set-dist 8 9 2"
$ns_ at 2.894614072644 "$god_ set-dist 4 5 1"
$ns_ at 5.310189563595 "$god_ set-dist 0 5 1"
$ns_ at 5.662538265462 "$god_ set-dist 1 3 1"
$ns_ at 5.822576590980 "$god_ set-dist 2 3 1"
$ns_ at 7.675524471848 "$node_(7) setdest 403.255889745714 457.253873024323 0.000000000000"
$ns_ at 8.301918590696 "$god_ set-dist 5 8 1"
$ns_ at 9.174698448651 "$god_ set-dist 5 9 1"
$ns_ at 9.675524471848 "$node_(7) setdest 382.126805834094 299.492412664560 9.587765569858"
$ns_ at 10.288185805733 "$god_ set-dist 2 4 1"
$ns_ at 12.929107286948 "$god_ set-dist 3 8 1"
$ns_ at 13.433391366999 "$god_ set-dist 6 8 2"
$ns_ at 13.461874781307 "$god_ set-dist 1 4 2"
$ns_ at 15.218548844051 "$god_ set-dist 1 5 1"
$ns_ at 15.483950186148 "$god_ set-dist 1 6 2"
$ns_ at 17.495560784887 "$god_ set-dist 5 7 1"
$ns_ at 19.906510531041 "$god_ set-dist 0 8 1"
$ns_ at 20.262555293931 "$node_(6) setdest 308.675522730804 299.746163852327 0.000000000000"
$ns_ at 22.262555293931 "$node_(6) setdest 306.664101729666 113.269892302374 6.337059782378"
$ns_ at 22.465178155179 "$god_ set-dist 5 9 2"
$ns_ at 25.794352596297 "$node_(0) setdest 195.315152435925 395.692980919066 0.000000000000"
$ns_ at 25.795385821813 "$god_ set-dist 2 7 1"
$ns_ at 26.153939863490 "$god_ set-dist 0 9 2"
$ns_ at 26.263998558574 "$god_ set-dist 5 7 2"
$ns_ at 26.276898977106 "$node_(7) setdest 382.126805834094 299.492412664560 0.000000000000"
$ns_ at 27.273705764239 "$god_ set-dist 0 4 2"
$ns_ at 27.324970483209 "$god_ set-dist 1 3 2"
$ns_ at 27.324970483209 "$god_ set-dist 1 9 3"
$ns_ at 27.794352596297 "$node_(0) setdest 292.685254099437 300.132389861983 3.110178519720"
$ns_ at 27.889686536222 "$god_ set-dist 2 9 1"
$ns_ at 28.276898977106 "$node_(7) setdest 260.812924883582 104.396789617495 4.316579459200"
$ns_ at 28.323552924053 "$god_ set-dist 1 4 3"
$ns_ at 28.323552924053 "$god_ set-dist 4 5 2"
$ns_ at 29.695538770038 "$god_ set-dist 0 2 1"
$ns_ at 31.111434564169 "$node_(5) setdest 100.778205544191 266.480106494357 0.000000000000"
$ns_ at 32.051358737005 "$god_ set-dist 6 8 1"
$ns_ at 33.111434564169 "$node_(5) setdest 361.432660296092 24.853925958652 4.948239703484"
$ns_ at 33.218121024222 "$node_(9) setdest 429.213886795679 215.455036101548 0.000000000000"
$ns_ at 35.218121024222 "$node_(9) setdest 59.326739595263 404.839816434933 2.957281736917"
$ns_ at 36.620790259229 "$god_ set-dist 5 7 1"
$ns_ at 38.949318268808 "$god_ set-dist 0 9 1"
$ns_ at 38.949318268808 "$god_ set-dist 1 9 2"
$ns_ at 41.020380301332 "$god_ set-dist 3 9 2"
$ns_ at 41.132131448441 "$god_ set-dist 3 4 2"
$ns_ at 42.126967793094 "$god_ set-dist 0 3 2"
$ns_ at 43.002024911939 "$god_ set-dist 2 4 2"
$ns_ at 46.553043747076 "$god_ set-dist 5 9 1"
$ns_ at 46.732956064510 "$node_(4) setdest 460.579597577582 44.883973625457 0.000000000000"
$ns_ at 47.266936886761 "$god_ set-dist 4 8 3"
$ns_ at 47.266936886761 "$god_ set-dist 6 8 2"
$ns_ at 48.732956064510 "$node_(4) setdest 235.536554244255 447.504253727590 3.035816059320"
$ns_ at 49.621391117426 "$god_ set-dist 1 2 1"
$ns_ at 49.795602677810 "$god_ set-dist 4 8 2"
$ns_ at 49.795602677810 "$god_ set-dist 7 8 1"
$ns_ at 51.690574865522 "$node_(6) setdest 306.664101729666 113.269892302374 0.000000000000"
$ns_ at 53.690574865522 "$node_(6) setdest 91.057250262217 237.568146994844 6.899061183213"
$ns_ at 54.772852353795 "$god_ set-dist 6 8 1"
$ns_ at 58.186585702213 "$node_(3) setdest 133.398689154286 23.766218555014 0.000000000000"
$ns_ at 60.186585702213 "$node_(3) setdest 268.961080220506 1.993000371043 2.332734925488"
$ns_ at 62.242919115257 "$god_ set-dist 1 4 2"
$ns_ at 62.242919115257 "$god_ set-dist 4 5 1"
$ns_ at 62.670697559915 "$god_ set-dist 2 4 1"
$ns_ at 63.338032524258 "$god_ set-dist 8 9 1"
$ns_ at 64.137389061085 "$god_ set-dist 1 5 2"
$ns_ at 66.845168105108 "$god_ set-dist 3 8 2"
$ns_ at 68.257321872718 "$god_ set-dist 1 6 1"
$ns_ at 69.380130734206 "$god_ set-dist 0 4 1"
$ns_ at 71.659552122958 "$node_(0) setdest 292.685254099437 300.132389861982 0.000000000000"
$ns_ at 73.659552122958 "$node_(0) setdest 144.299136594455 98.640313259602 3.276285501539"
$ns_ at 74.360277744359 "$god_ set-dist 4 6 2"
$ns_ at 81.499037308380 "$node_(7) setdest 260.812924883582 104.396789617495 0.000000000000"
$ns_ at 83.499037308380 "$node_(7) setdest 243.172449078380 376.709527186021 5.354121600664"
$ns_ at 83.794155468766 "$god_ set-dist 1 9 1"
$ns_ at 85.310053577229 "$god_ set-dist 3 4 1"
$ns_ at 85.742379711468 "$god_ set-dist 5 8 2"
$ns_ at 88.128730011148 "$god_ set-dist 5 6 2"
$ns_ at 89.703784745072 "$god_ set-dist 3 6 2"
$ns_ at 89.763626180712 "$node_(6) setdest 91.057250262217 237.568146994844 0.000000000000"
$ns_ at 90.401767123461 "$god_ set-dist 0 3 1"
$ns_ at 91.763626180712 "$node_(6) setdest 170.786737586288 460.839220638051 2.028823073952"
$ns_ at 96.047767665733 "$god_ set-dist 5 9 2"
$ns_ at 96.598115002718 "$god_ set-dist 1 7 1"
$ns_ at 101.308456131373 "$god_ set-dist 4 8 1"
$ns_ at 102.254971809893 "$god_ set-dist 2 5 2"
$ns_ at 103.814430517138 "$god_ set-dist 2 3 2"
$ns_ at 104.939162510471 "$node_(5) setdest 361.432660296092 24.853925958652 0.000000000000"
$ns_ at 106.939162510471 "$node_(5) setdest 377.567446216482 249.140849644620 0.519898235365"
$ns_ at 110.996937592769 "$god_ set-dist 5 7 2"
$ns_ at 111.636321491656 "$god_ set-dist 3 7 2"
$ns_ at 119.044451570419 "$node_(3) setdest 268.961080220506 1.993000371043 0.000000000000"
$ns_ at 120.626922079787 "$god_ set-dist 4 6 1"
$ns_ at 121.044451570419 "$node_(3) setdest 454.164194284508 301.924915355719 3.495276830396"
$ns_ at 134.466037421658 "$node_(7) setdest 243.172449078380 376.709527186021 0.000000000000"
$ns_ at 135.530068452987 "$god_ set-dist 0 7 2"
$ns_ at 136.466037421658 "$node_(7) setdest 320.575004252512 376.017485096035 6.319113186182"
$ns_ at 141.042771279629 "$god_ set-dist 4 5 2"
$ns_ at 141.042771279629 "$god_ set-dist 5 7 3"
$ns_ at 144.535279322352 "$god_ set-dist 0 9 2"
$ns_ at 144.535279322352 "$god_ set-dist 5 9 3"
$ns_ at 145.125504426245 "$god_ set-dist 0 4 2"
$ns_ at 145.512142288891 "$god_ set-dist 0 8 2"
$ns_ at 145.512142288891 "$god_ set-dist 5 8 3"
$ns_ at 145.631170372549 "$god_ set-dist 1 7 2"
$ns_ at 146.044527346779 "$god_ set-dist 1 4 1"
$ns_ at 148.372941503191 "$god_ set-dist 0 2 2"
$ns_ at 148.372941503191 "$god_ set-dist 2 5 3"
$ns_ at 148.715485491752 "$node_(7) setdest 320.575004252512 376.017485096035 0.000000000000"
$ns_ at 149.893626950644 "$god_ set-dist 0 6 2"
$ns_ at 149.893626950644 "$god_ set-dist 0 7 3"
$ns_ at 149.893626950644 "$god_ set-dist 5 6 3"
$ns_ at 150.037170357289 "$node_(0) setdest 144.299136594455 98.640313259602 0.000000000000"
$ns_ at 150.038608069873 "$god_ set-dist 2 3 1"
$ns_ at 150.038608069873 "$god_ set-dist 2 5 2"
$ns_ at 150.715485491752 "$node_(7) setdest 493.877484515895 439.212990542013 5.003191298028"
$ns_ at 152.037170357289 "$node_(0) setdest 146.809098668465 456.946506641077 1.862406776608"
$ns_ at 158.147608708904 "$god_ set-dist 7 9 2"
$ns_ at 165.561681455500 "$god_ set-dist 6 7 2"
$ns_ at 166.317148402523 "$god_ set-dist 3 8 1"
$ns_ at 166.317148402523 "$god_ set-dist 5 8 2"
$ns_ at 175.736202885045 "$node_(9) setdest 59.326739595263 404.839816434934 0.000000000000"
$ns_ at 177.736202885045 "$node_(9) setdest 380.380800370874 199.543016148952 0.265536775168"
$ns_ at 182.823630424738 "$god_ set-dist 1 8 2"
$ns_ at 185.691904262060 "$god_ set-dist 3 4 2"
$ns_ at 185.691904262060 "$god_ set-dist 4 5 3"
$ns_ at 187.584999438695 "$node_(7) setdest 493.877484515895 439.212990542013 0.000000000000"
$ns_ at 188.159823947233 "$god_ set-dist 0 3 2"
$ns_ at 188.159823947233 "$god_ set-dist 0 8 3"
$ns_ at 188.955414561035 "$god_ set-dist 0 8 2"
$ns_ at 188.955414561035 "$god_ set-dist 0 9 1"
$ns_ at 188.955414561035 "$god_ set-dist 5 9 2"
$ns_ at 189.584999438695 "$node_(7) setdest 23.064534947607 16.898307137854 7.945998041604"
$ns_ at 189.916757880840 "$god_ set-dist 3 7 1"
$ns_ at 189.916757880840 "$god_ set-dist 5 7 2"
$ns_ at 190.874380377758 "$god_ set-dist 1 2 2"
$ns_ at 190.874380377758 "$god_ set-dist 1 3 3"
$ns_ at 194.327422080783 "$god_ set-dist 1 4 2"
$ns_ at 194.327422080783 "$god_ set-dist 1 7 3"
#
# Destination Unreachables: 0
#
# Route Changes: 101
#
# Link Changes: 78
#
# Node | Route Changes | Link Changes
# 0 | 20 | 17
# 1 | 21 | 15
# 2 | 16 | 13
# 3 | 19 | 18
# 4 | 24 | 19
# 5 | 29 | 19
# 6 | 14 | 13
# 7 | 17 | 13
# 8 | 22 | 15
# 9 | 20 | 14
#
#=====================================================================
#
# nodes: 10, max conn: 20, send rate: 0.0, seed: 0
#
#
# 1 connecting to 2 at time 80.763021540252041
#
set tcp_(0) [$ns_ create-connection TCP $node_(1) TCPSink $node_(2) 0]
$tcp_(0) set window_ 32
$tcp_(0) set packetSize_ 512
set ftp_(0) [$tcp_(0) attach-source FTP]
$ns_ at 80.763021540252041 "$ftp_(0) start"
#
# 3 connecting to 4 at time 156.00224684737728
#
set tcp_(1) [$ns_ create-connection TCP $node_(3) TCPSink $node_(4) 0]
$tcp_(1) set window_ 32
$tcp_(1) set packetSize_ 512
set ftp_(1) [$tcp_(1) attach-source FTP]
$ns_ at 156.00224684737728 "$ftp_(1) start"
#
# 4 connecting to 5 at time 103.3559006654452
#
set tcp_(2) [$ns_ create-connection TCP $node_(4) TCPSink $node_(5) 0]
$tcp_(2) set window_ 32
$tcp_(2) set packetSize_ 512
set ftp_(2) [$tcp_(2) attach-source FTP]
$ns_ at 103.3559006654452 "$ftp_(2) start"
#
# 5 connecting to 6 at time 38.455295021857737
#
set tcp_(3) [$ns_ create-connection TCP $node_(5) TCPSink $node_(6) 0]
$tcp_(3) set window_ 32
$tcp_(3) set packetSize_ 512
set ftp_(3) [$tcp_(3) attach-source FTP]
$ns_ at 38.455295021857737 "$ftp_(3) start"
#
# 5 connecting to 7 at time 93.460039279172221
#
set tcp_(4) [$ns_ create-connection TCP $node_(5) TCPSink $node_(7) 0]
$tcp_(4) set window_ 32
$tcp_(4) set packetSize_ 512
set ftp_(4) [$tcp_(4) attach-source FTP]
$ns_ at 93.460039279172221 "$ftp_(4) start"
#
# 6 connecting to 7 at time 107.04303348764917
#
set tcp_(5) [$ns_ create-connection TCP $node_(6) TCPSink $node_(7) 0]
$tcp_(5) set window_ 32
$tcp_(5) set packetSize_ 512
set ftp_(5) [$tcp_(5) attach-source FTP]
$ns_ at 107.04303348764917 "$ftp_(5) start"
#
#Total sources/connections: 5/6
#
#=====================================================================



for {set i 0} {$i < 3 } { incr i } {
$ns_ at $val(stop) "$ftp_($i) stop";
}
#$ns_ at $val(stop) "$ftp stop"

$ns_ at 121.0 "finish"

# Telling nodes when the simulation ends


# ending nam and the simulation
#$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
#$ns at $val(stop) "stop"
#$ns at 150.01 "puts "end simulation" ; $ns halt"


#Call the finish procedure after 5 seconds of simulation time
$ns_ run

Last edited by israk; 04-23-2017 at 08:48 AM.
 
Old 04-23-2017, 04:51 AM   #8
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,269

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Please edit posts #1 and #7 to CODE TAGS : [code]code text[/code]
http://www.linuxquestions.org/questi....php?do=bbcode
... Or click "Go Advanced", and use the # button : Wrap [code] tags around selected text

When done, I will read post #7.
 
1 members found this post helpful.
Old 04-23-2017, 08:59 AM   #9
israk
LQ Newbie
 
Registered: Apr 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thank you ...
i edited the post #7
Please read the code And forgive my mistake
 
Old 04-23-2017, 08:59 AM   #10
israk
LQ Newbie
 
Registered: Apr 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thank you ...
i edited the post #7
Please read the code And forgive my mistake
 
Old 04-23-2017, 10:52 AM   #11
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,269

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Re #10.

Then please also edit post #1 to CODE Tags.

Post #8 says : #1 and #7
 
1 members found this post helpful.
Old 04-23-2017, 09:28 PM   #12
israk
LQ Newbie
 
Registered: Apr 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Sorry for that ., please forgive me.
I edited code #1 & #7
Kindly see my code and help me to solve error please...
 
Old 04-24-2017, 03:42 AM   #13
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,269

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Re #7.

Your edited file, attached to post #2 runs perfectly here : DSDV-nn10.tcl

Also included in the examples dsdv-ex-04.17.tar.gz : Your DSDV-nn10.tcl
https://drive.google.com/file/d/0B7S...ew?usp=sharing


Errors : You cannot define ns, and then use ns_ in some lines.
ns_ and ns are different words.


? Why do you think the file in post #7 will use the DSR protocol ?
The name DSR.tcl does not make it DSR : Says DSDV in line ~10 etc.
Looks like a copy of your faulty file from post #1.
Suggest : Use a copy of a valid dsr simulation for experiments.
( Besides that the file name DSR.tcl cannot be used. Already some with that name.)

Your file isn't fit for DSR. Usable dsr : dsr-examples-04.2015.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing


-

Last edited by knudfl; 04-24-2017 at 04:21 AM.
 
1 members found this post helpful.
Old 04-24-2017, 05:34 AM   #14
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2019 CentOS6.10 CentOS7.7 + 50+ other Linux OS, for test only.
Posts: 17,269

Rep: Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568Reputation: 3568
Found another three DSR examples, included in dsr-examples-04.17.tar.gz

https://drive.google.com/file/d/0B7S...ew?usp=sharing
 
1 members found this post helpful.
Old 04-24-2017, 06:59 AM   #15
israk
LQ Newbie
 
Registered: Apr 2017
Posts: 18

Original Poster
Rep: Reputation: Disabled
Thank you very much
But i also can't run the dsr code you gave me ...
There is a following error :

sabin@sabin-desktop:~/Documents/dsr/dsr-ex$ ns dsr.tcl
num_nodes is set 6
INITIALIZE THE LIST xListHead
using backward compatible Agent/CBR; use Application/Traffic/CBR instead
Start of simulation..
channel.cc:sendUp - Calc highestAntennaZ_ and distCST_
highestAntennaZ_ = 1.5, distCST_ = 550.0
SORTING LISTS ...DONE!
Segmentation fault (core dumped)
sabin@sabin-desktop:~/Documents/dsr/dsr-ex$

I am very sorry for my previous mistake ...Please accept my apology and help me to run dsr.tcl code

Last edited by israk; 04-24-2017 at 09:17 AM.
 
  


Reply

Tags
dsdv, dsr, ns2


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
problem while run dymo tcl file on ns-2.34 in ubuntu15.10 israk Linux - Newbie 7 04-04-2017 08:37 AM
problem while run dymo tcl file on ns-2.34 in ubuntu15.10 israk Linux - Newbie 1 04-02-2017 02:20 PM
LEACH and dsdv in tcl file linuxUser123linux Linux - Software 1 03-05-2014 12:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

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