LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices


Reply
  Search this Thread
Old 07-03-2014, 06:03 AM   #1
must
LQ Newbie
 
Registered: Jan 2014
Posts: 19

Rep: Reputation: Disabled
can any one help me with dsdv code for wimax


can anyone help me with this code?
when i run this code i got error

#===================================
# Simulation parameters setup
#===================================
set val(chan) Channel/WirelessChannel ;# channel type
set val(prop) Propagation/TwoRayGround ;# radio-propagation model
set val(netif) Phy/WirelessPhy/OFDM ;# network interface type
set val(mac) Mac/802_16/BS ;# 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) 40 ;# number of mobilenodes
set val(rp) DSDV ;# routing protocol
set val(x) 4766 ;# X dimension of topography
set val(y) 100 ;# Y dimension of topography
set val(stop) 50.0 ;# time of simulation end


#===================================
# Initialization
#===================================
#Create a ns simulator
set ns [new Simulator]

#Setup topography object
set topo [new Topography]
$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)

#Open the NS trace file
set tracefile [open dsdv.tr w]
$ns trace-all $tracefile

#Open the NAM trace file
set namfile [open dsdv.nam w]
$ns namtrace-all $namfile
$ns namtrace-all-wireless $namfile $val(x) $val(y)
set chan [new $val(chan)];#Create wireless channel

#===================================
# Mobile node parameter setup
#===================================
$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) \
-channel $chan \
-topoInstance $topo \
-agentTrace ON \
-routerTrace ON \
-macTrace ON \
-movementTrace ON



#===================================
# Nodes Definition
#===================================
#Create 40 nodes
set n0 [$ns node]
$n0 set X_ 937
$n0 set Y_ -575
$n0 set Z_ 0.0
$ns initial_node_pos $n0 20
set n1 [$ns node]
$n1 set X_ 1177
$n1 set Y_ -50
$n1 set Z_ 0.0
$ns initial_node_pos $n1 20
set n2 [$ns node]
$n2 set X_ 1064
$n2 set Y_ -373
$n2 set Z_ 0.0
$ns initial_node_pos $n2 20
set n3 [$ns node]
$n3 set X_ 452
$n3 set Y_ -108
$n3 set Z_ 0.0
$ns initial_node_pos $n3 20
set n4 [$ns node]
$n4 set X_ 951
$n4 set Y_ -206
$n4 set Z_ 0.0
$ns initial_node_pos $n4 20
set n5 [$ns node]
$n5 set X_ 967
$n5 set Y_ -38
$n5 set Z_ 0.0
$ns initial_node_pos $n5 20
set n6 [$ns node]
$n6 set X_ 846
$n6 set Y_ -260
$n6 set Z_ 0.0
$ns initial_node_pos $n6 20
set n7 [$ns node]
$n7 set X_ 1396
$n7 set Y_ -262
$n7 set Z_ 0.0
$ns initial_node_pos $n7 20
set n8 [$ns node]
$n8 set X_ 677
$n8 set Y_ -156
$n8 set Z_ 0.0
$ns initial_node_pos $n8 20
set n9 [$ns node]
$n9 set X_ 726
$n9 set Y_ 208
$n9 set Z_ 0.0
$ns initial_node_pos $n9 20
set n10 [$ns node]
$n10 set X_ 1198
$n10 set Y_ -187
$n10 set Z_ 0.0
$ns initial_node_pos $n10 20
set n11 [$ns node]
$n11 set X_ 534
$n11 set Y_ -1
$n11 set Z_ 0.0
$ns initial_node_pos $n11 20
set n12 [$ns node]
$n12 set X_ 840
$n12 set Y_ 310
$n12 set Z_ 0.0
$ns initial_node_pos $n12 20
set n13 [$ns node]
$n13 set X_ 617
$n13 set Y_ -637
$n13 set Z_ 0.0
$ns initial_node_pos $n13 20
set n14 [$ns node]
$n14 set X_ 520
$n14 set Y_ 310
$n14 set Z_ 0.0
$ns initial_node_pos $n14 20
set n15 [$ns node]
$n15 set X_ 682
$n15 set Y_ 75
$n15 set Z_ 0.0
$ns initial_node_pos $n15 20
set n16 [$ns node]
$n16 set X_ 490
$n16 set Y_ -386
$n16 set Z_ 0.0
$ns initial_node_pos $n16 20
set n17 [$ns node]
$n17 set X_ 1123
$n17 set Y_ -628
$n17 set Z_ 0.0
$ns initial_node_pos $n17 20
set n18 [$ns node]
$n18 set X_ 1358
$n18 set Y_ 141
$n18 set Z_ 0.0
$ns initial_node_pos $n18 20
set n19 [$ns node]
$n19 set X_ 882
$n19 set Y_ 150
$n19 set Z_ 0.0
$ns initial_node_pos $n19 20
set n20 [$ns node]
$n20 set X_ 550
$n20 set Y_ -665
$n20 set Z_ 0.0
$ns initial_node_pos $n20 20
set n21 [$ns node]
$n21 set X_ 984
$n21 set Y_ -170
$n21 set Z_ 0.0
$ns initial_node_pos $n21 20
set n22 [$ns node]
$n22 set X_ 817
$n22 set Y_ -564
$n22 set Z_ 0.0
$ns initial_node_pos $n22 20
set n23 [$ns node]
$n23 set X_ 667
$n23 set Y_ -437
$n23 set Z_ 0.0
$ns initial_node_pos $n23 20
set n24 [$ns node]
$n24 set X_ 886
$n24 set Y_ 247
$n24 set Z_ 0.0
$ns initial_node_pos $n24 20
set n25 [$ns node]
$n25 set X_ 902
$n25 set Y_ -165
$n25 set Z_ 0.0
$ns initial_node_pos $n25 20
set n26 [$ns node]
$n26 set X_ 970
$n26 set Y_ -365
$n26 set Z_ 0.0
$ns initial_node_pos $n26 20
set n27 [$ns node]
$n27 set X_ 737
$n27 set Y_ -17
$n27 set Z_ 0.0
$ns initial_node_pos $n27 20
set n28 [$ns node]
$n28 set X_ 657
$n28 set Y_ 96
$n28 set Z_ 0.0
$ns initial_node_pos $n28 20
set n29 [$ns node]
$n29 set X_ 1117
$n29 set Y_ -311
$n29 set Z_ 0.0
$ns initial_node_pos $n29 20
set n30 [$ns node]
$n30 set X_ 656
$n30 set Y_ -548
$n30 set Z_ 0.0
$ns initial_node_pos $n30 20
set n31 [$ns node]
$n31 set X_ 754
$n31 set Y_ 181
$n31 set Z_ 0.0
$ns initial_node_pos $n31 20
set n32 [$ns node]
$n32 set X_ 963
$n32 set Y_ 90
$n32 set Z_ 0.0
$ns initial_node_pos $n32 20
set n33 [$ns node]
$n33 set X_ 1163
$n33 set Y_ -394
$n33 set Z_ 0.0
$ns initial_node_pos $n33 20
set n34 [$ns node]
$n34 set X_ 1301
$n34 set Y_ 49
$n34 set Z_ 0.0
$ns initial_node_pos $n34 20
set n35 [$ns node]
$n35 set X_ 1212
$n35 set Y_ -115
$n35 set Z_ 0.0
$ns initial_node_pos $n35 20
set n36 [$ns node]
$n36 set X_ 1071
$n36 set Y_ -223
$n36 set Z_ 0.0
$ns initial_node_pos $n36 20
set n37 [$ns node]
$n37 set X_ 1400
$n37 set Y_ 286
$n37 set Z_ 0.0
$ns initial_node_pos $n37 20
set n38 [$ns node]
$n38 set X_ 671
$n38 set Y_ -506
$n38 set Z_ 0.0
$ns initial_node_pos $n38 20
set n39 [$ns node]
$n39 set X_ 590
$n39 set Y_ -12
$n39 set Z_ 0.0
$ns initial_node_pos $n39 20

#===================================
# Agents Definition
#===================================
#Set a TCP connection between node 31 and node 22

set tcp [new Agent/TCP]
$tcp set class_ 2
Agent/TCPSink set packetSize_ 128
set sink [new Agent/TCPSink]
$ns attach-agent $n31 $tcp
$ns attach-agent $n22 $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp

$ns at 1.0 "$ftp start"

#Set a TCP connection between node 0 and node 19

set tcp1 [new Agent/TCP]
$tcp1 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink1 [new Agent/TCPSink]
$ns attach-agent $n0 $tcp1
$ns attach-agent $n19 $sink1
$ns connect $tcp1 $sink1
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1

$ns at 1.0 "$ftp1 start"

#Set a TCP connection between node 24 and node 39

set tcp2 [new Agent/TCP]
$tcp2 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink2 [new Agent/TCPSink]
$ns attach-agent $n24 $tcp2
$ns attach-agent $n39 $sink2
$ns connect $tcp2 $sink2
set ftp2 [new Application/FTP]
$ftp2 attach-agent $tcp2

$ns at 1.0 "$ftp2 start"

#Set a TCP connection between node 27 and node 1

set tcp3 [new Agent/TCP]
$tcp3 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink3 [new Agent/TCPSink]
$ns attach-agent $n27 $tcp3
$ns attach-agent $n1 $sink3
$ns connect $tcp3 $sink3
set ftp3 [new Application/FTP]
$ftp3 attach-agent $tcp3

$ns at 1.0 "$ftp3 start"

#Set a TCP connection between node 11 and node 29

set tcp4 [new Agent/TCP]
$tcp4 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink4 [new Agent/TCPSink]
$ns attach-agent $n11 $tcp4
$ns attach-agent $n29 $sink4
$ns connect $tcp4 $sink4
set ftp4 [new Application/FTP]
$ftp4 attach-agent $tcp4

$ns at 1.0 "$ftp4 start"

#Set a TCP connection between node 25 and node 30

set tcp5 [new Agent/TCP]
$tcp5 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink5 [new Agent/TCPSink]
$ns attach-agent $n25 $tcp5
$ns attach-agent $n30 $sink5
$ns connect $tcp5 $sink5
set ftp5 [new Application/FTP]
$ftp5 attach-agent $tcp5

$ns at 1.0 "$ftp5 start"

#Set a TCP connection between node 37 and node 26

set tcp6 [new Agent/TCP]
$tcp6 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink6 [new Agent/TCPSink]
$ns attach-agent $n37 $tcp6
$ns attach-agent $n26 $sink6
$ns connect $tcp6 $sink6
set ftp6 [new Application/FTP]
$ftp6 attach-agent $tcp6

$ns at 1.0 "$ftp6 start"

#Set a TCP connection between node 34 and node 32

set tcp7 [new Agent/TCP]
$tcp7 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink7 [new Agent/TCPSink]
$ns attach-agent $n34 $tcp7
$ns attach-agent $n32 $sink7
$ns connect $tcp7 $sink7
set ftp7 [new Application/FTP]
$ftp7 attach-agent $tcp7

$ns at 1.0 "$ftp7 start"

#Set a TCP connection between node 8 and node 35

set tcp8 [new Agent/TCP]
$tcp8 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink8 [new Agent/TCPSink]
$ns attach-agent $n8 $tcp8
$ns attach-agent $n35 $sink8
$ns connect $tcp8 $sink8
set ftp8 [new Application/FTP]
$ftp8 attach-agent $tcp8

$ns at 1.0 "$ftp8 start"

#Set a TCP connection between node 0 and node 19

set tcp9 [new Agent/TCP]
$tcp9 set class_ 2
Agent/TCPSink set packetSize_ 128
set sink9 [new Agent/TCPSink]
$ns attach-agent $n1 $tcp9
$ns attach-agent $n28 $sink9
$ns connect $tcp9 $sink9
set ftp9 [new Application/FTP]
$ftp9 attach-agent $tcp9

$ns at 1.0 "$ftp9 start"


#===================================
# Termination
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exec nam dsdv.nam &
exit 0
}
for {set i 0} {$i < $val(nn) } { incr i } {
$ns at $val(stop) "\$n$i reset"
}
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "finish"
$ns at $val(stop) "puts \"done\" ; $ns halt"
$ns run


the error is :

num_nodes is set 40
invalid command name "Phy/WirelessPhy/OFDM"
while executing
"Phy/WirelessPhy/OFDM create _o18 "
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 $iftype"
(procedure "_o14" line 9)
(Node/MobileNode add-interface line 9)
invoked from within
"$node add-interface $chan $propInstance_ $llType_ $macType_ $ifqType_ $ifqlen_ $phyType_ $antType_ $topoInstance_ $inerrProc_ $outerrProc_ $FECProc_"
(procedure "_o3" line 83)
(Simulator create-wireless-node line 83)
invoked from within
"_o3 create-wireless-node"
("eval" body line 1)
invoked from within
"eval $self create-wireless-node $args"
(procedure "_o3" line 23)
(Simulator node line 23)
invoked from within
"$ns node"
invoked from within
"set n0 [$ns node]"
(file "40dsdv.tcl" line 64)
 
Old 07-03-2014, 06:29 AM   #2
Drakeo
Senior Member
 
Registered: Jan 2008
Location: Urbana IL
Distribution: Slackware, Slacko,
Posts: 3,716
Blog Entries: 3

Rep: Reputation: 483Reputation: 483Reputation: 483Reputation: 483Reputation: 483
Hello welcome please take time to read this it will help us help you.
How to ask a question http://www.linuxquestions.org/linux/...Ask_a_Question
 
Old 07-03-2014, 03:02 PM   #3
must
LQ Newbie
 
Registered: Jan 2014
Posts: 19

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Drakeo View Post
Hello welcome please take time to read this it will help us help you.
How to ask a question http://www.linuxquestions.org/linux/...Ask_a_Question
hello i can't inter this web he say :

You are not authorized to access this page.
 
  


Reply


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
LEACH and dsdv in tcl file linuxUser123linux Linux - Software 1 03-05-2014 01:05 AM
DSDV protocol tootz Linux - Software 0 03-05-2011 10:59 AM
I am getting following errors while compiling the existing dsdv.cc shyan Linux - Newbie 11 12-15-2008 11:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking

All times are GMT -5. The time now is 06:30 AM.

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