LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 11-24-2014, 05:08 AM   #1
Md Zishan Khan
LQ Newbie
 
Registered: Oct 2014
Location: West Bengal, INDIA
Posts: 16

Rep: Reputation: Disabled
Having error in running a zrp tcl file . .


File is
--------------------------
set opt(chan) Channel/WirelessChannel
set opt(prop) Propagation/TwoRayGround
set opt(netif) Phy/WirelessPhy
set opt(mac) Mac/NULL
#set opt(mac) Mac/802_11
set opt(ifq) Queue/DropTail/PriQueue
set opt(ll) LL
set opt(ant) Antenna/OmniAntenna
set opt(x) 1300 ;# X dimension of the topography
set opt(y) 1300 ;# Y dimension of the topography
set opt(ifqlen) 20 ;# max packet in ifq(effectless)
set opt(seed) 0.0
set opt(tr) pktdemo.tr ;# trace file
set opt(nam) pktdemo.nam ;# nam trace file
set opt(adhocRouting) ZRP
set opt(nn) 20 ;# how many nodes are simulated
set opt(stop) 10 ;# simulation time
set val(cp) “example.scen”
set val(trfile) “example.traffic”
#
# Other default settings
# for the ifq
Queue set limit_ 50

LL set mindelay_ 50us
LL set delay_ 25us
LL set bandwidth_ 0
LL set off_prune_ 0
LL set off_CtrMcast_ 0
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

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

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

# create simulator instance

set ns_ [new Simulator]

# set wireless channel, radio-model and topography objects

set wchan [new $opt(chan)]
set wprop [new $opt(prop)]
set wtopo [new Topography]

# create trace object for ns and nam
set tracefd [open $opt(tr) w]
set namtrace [open $opt(nam) w]
$ns_ trace-all $tracefd
$ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y)

# define topology
$wtopo load_flatgrid $opt(x) $opt(y)
#$wprop topography $wtopo
#
# Create God
#
set god_ [create-god $opt(nn)]
#
# define how node should be created
#

#global node setting
# -ifqLen $opt(ifqlen) \
# -qlen $opt(ifqlen) \

$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) \
-topoInstance $wtopo \
-agentTrace ON\
-routerTrace ON \
-movementTrace OFF\
-macTrace OFF

#
# Create the specified number of nodes [$opt(nn)] and “attach” them
# to the channel.

for {set i 0} {$i < $opt(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
}

#
# Define node movement model
#
puts "Loading connection pattern…"
#
# scen-670×670-50-600-20-0
#
source $val(cp)
#
# Define traffic model
#
puts "Loading traffic file"
source $val(trfile)

# Define node initial position in nam
for {set i 0} {$i < $opt(nn)} {incr i} {
# 20 defines the node size in nam, must adjust it according to
your scenario
# The function must be called after mobility model is defined
$ns_ initial_node_pos $node_($i) 250
}

#
# Tell nodes when the simulation ends
#
for {set i 0} {$i < $opt(nn) } {incr i} {
$ns_ at $opt(stop).000000001 "$node_($i) reset";
}
# tell nam the simulation stop time
$ns_ at $opt(stop) "$ns_ nam-end-wireless $opt(stop)"
$ns_ at $opt(stop).000000001 "puts \"NS EXITING…\" ; $ns_ halt"

puts "Starting Simulation…"
$ns_ run

Error is
-------------------------------------------------------
num_nodes is set 20
warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl

(_o16 cmd line 1)
invoked from within
"_o16 cmd addr"
invoked from within
"catch "$self cmd $args" ret"
invoked from within
"if [catch "$self cmd $args" ret] {
set cls [$self info class]
global errorInfo
set savedInfo $errorInfo
error "error when calling class $cls: $args" $..."
(procedure "_o16" line 2)
(SplitObject unknown line 2)
invoked from within
"_o16 addr"
("eval" body line 1)
invoked from within
"eval $node addr $args"
("default" arm line 2)
invoked from within
"switch -exact $routingAgent_ {
DSDV {
set ragent [$self create-dsdv-agent $node]
}
DSR {
$self at 0.0 "$node start-dsr"
}
AODV {
set ragent [$self cre..."
(procedure "_o3" line 14)
(Simulator create-wireless-node line 14)
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"
("for" body line 2)
invoked from within
"for {set i 0} {$i < $opt(nn) } {incr i} {
set node_($i) [$ns_ node]
$node_($i) random-motion 0 ;# disable random motion
}"
(file "miraj.tcl" line 111)
 
Old 11-24-2014, 08:09 AM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
First : Please edit post #1 to use ``code tags´´ around the two chapters.
1) The tcl text.
2) The error output.
http://www.linuxquestions.org/questi....php?do=bbcode
http://www.linuxquestions.org/questi...gs-4175464257/
I.e. type [/code] at code text end, and [code] at text start.

And : Please do not use Windows© typing.
Use [ " ] instead of [ ” ].


? What is "Mac/NULL" ? set opt(mac) Mac/NULL
Besides that : Two files are missing : "example.scen", "example.traffic"
May be missing : Agent/ZRP set radius_ 2 ;# Setting ZRP radius=[?]


* Please have a look at the ZRP examples, zrp-examples-2012.tar.bz2
https://drive.google.com/file/d/0B7S...ew?usp=sharing
.. and may be zrp_xgraph-examples.tar.gz
https://drive.google.com/file/d/0B7S...ew?usp=sharing

-

Last edited by knudfl; 11-24-2014 at 09:58 AM.
 
  


Reply

Tags
ns2, zrp



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
getting error in NS 2.34 while running a tcl file Md Zishan Khan Linux - Newbie 11 02-11-2016 02:26 AM
error in running tcl file in NS2 mary1001 Linux - Newbie 4 11-09-2014 08:32 PM
[SOLVED] Error while running tcl file in ubuntu 12.04 mulyead Linux - Newbie 3 11-14-2013 11:30 AM
HELP ME: Error while running tcl scrip for ZRP in NS2.33 ubuntu 10.04 vuichoigiaitri Ubuntu 1 12-02-2012 10:11 PM
scheduler error in running tcl file humairaafzal73 Linux - Software 0 02-27-2012 10:17 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 05:53 PM.

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