Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 11-07-2012, 10:41 AM   #1
LQ Newbie
Registered: Nov 2012
Posts: 1

Rep: Reputation: Disabled
Question NS2 WirelessMeshNetwork Simulation Error in add_interface

error message is
(_o34 cmd line 1)
invoked from within
"_o34 cmd add_interface _o14 _o98 LL Mac/802_11 Queue/DropTail/PriQueue 50 Phy/WirelessPhy Antenna/OmniAntenna _o10 {} {} {}"
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 "_o34" line 2)
(SplitObject unknown line 2)
invoked from within
"$node_(1) add_interface $chan_(3) $propInstance_ $val(ll) $val(mac) $val(ifq) $val(ifqlen) $val(netif) $val(ant) $topo $inerrProc_ $outerrProc_ $FECPr..."
(file "wmn.tcl" line 78)

and wmn.tcl is
# ======================================================================

# Define options

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

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)             5                          ;# number of mobilenodes

set val(nc)					5									;# 채널 개수

set val(ni)					10									;# 인터페이스 개수

set val(rp)             AODV                       ;# routing protocol DSDV

set val(x)					1500

set val(y)					1500

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

# Main Program

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


# Initialize Global Variables


set ns_		[new Simulator]

set tracefd     [open ./ w]

$ns_ trace-all $tracefd

# set up topography object

set topo       [new Topography]

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

create-god $val(ni)

#채널을 생성한다.

for {set i 1} {$i <= $val(nn) } {incr i} {

		set chan_($i) [new $val(chan)]


# configure node

        $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) \

			 -topoInstance $topo \

			 -agentTrace ON \

			 -routerTrace OFF \

			 -macTrace OFF \

			 -movementTrace OFF \

			 -channel $chan_(1)			

#다섯개의 노드를 생성한다.

set node_(0) [$ns_ node]

set node_(1) [$ns_ node]

$ns_ node-config -channel $chan_(2)

set node_(2) [$ns_ node]

$ns_ node-config -channel $chan_(3)

set node_(3) [$ns_ node]

$ns_ node-config -channel $chan_(4)

set node_(4) [$ns_ node]

set inerrProc_ ""

set outerrProc_ ""

set FECProc_ ""

set propInstance_ [new $val(prop)]

set port [Node set rtagent_port_]

set agent [$node_(1) set ragent_]

$node_(1) add-interface $chan_(2) $propInstance_ $val(ll) $val(mac) $val(ifq) $val(ifqlen) $val(netif) $val(ant) $topo $inerrProc_ $outerrProc_ $FECProc_

$node_(1) adjust-target-rtagent $agent $port

$node_(1) add_interface $chan_(3) $propInstance_ $val(ll) $val(mac) $val(ifq) $val(ifqlen) $val(netif) $val(ant) $topo $inerrProc_ $outerrProc_ $FECProc_

$node_(1) adjust-target-rtagent $agent $port

set agent [$node_(2) set ragent_]

$node_(2) add-interface $chan_(5) $propInstance_ $val(ll) $val(mac) $val(ifq) $val(ifqlen) $val(netif) $val(ant) $topo $inerrProc_ $outerrProc_ $FECProc_

$node_(2) adjust-target-rtagent $agent $port

set agent [$node_(3) set ragent_]

$node_(3) add-interface $chan_(4) $propInstance_ $val(ll) $val(mac) $val(ifq) $val(ifqlen) $val(netif) $val(ant) $topo $inerrProc_ $outerrProc_ $FECProc_

$node_(3) adjust-target-rtagent $agent $port

set agent [$node_(4) set ragent_]

$node_(4) add-interface $chan_(5) $propInstance_ $val(ll) $val(mac) $val(ifq) $val(ifqlen) $val(netif) $val(ant) $topo $inerrProc_ $outerrProc_ $FECProc_

$node_(4) adjust-target-rtagent $agent $port

for {set i 0} {$i < $val(nn) } {incr i} {

	$node_($i) random-motion 0

	$node_($i) set Z_ 0.0


#각노드의 위치를 설정한다.

$node_(0) set X_ 100.0

$node_(0) set Y_ 230.0

$node_(1) set X_ 330.0

$node_(1) set Y_ 230.0

$node_(2) set X_ 330.0

$node_(2) set Y_ 1.0

$node_(3) set X_ 560.0

$node_(3) set Y_ 230.0

$node_(4) set X_ 560.0

$node_(4) set Y_ 1.0

set tcp0_4 [new Aent/TCP/Sack1]

$tcp0_4 set class_ 0

set sink0_4 [new Agent/TCPSink/Sack1]

$ns_ attach-agent $node_(0) $tcp0_4

$ns_ attach-agent $node_(4) $sink0_4

$ns_ connect $tcp0_4 $sink0_4

set ftp0_4 [new Application/FTP]

$ftp0_4 attach-agent $tcp0_4

$ns_ at 1.0 "$ftp0_4 start"

$ns_ at 50.0 "$ftp0_4 stop"

$ns_ at 50.01 "stop

for {set i 0} {$i < $val(nn) } {incr i} {

	$ns_at 50.02 "$node_($i) reset";


$ns_ at 50.03 "puts \"NS EXTING...\" ; $ns-halt"

proc stop {} {

	grobal ns_ tracefd

	$ns_ flush-trace

	close $tracefd


#시뮬레이션 진행 상태를 출력한다.

for {set t 1} {$t <= 100} {incr t} {

	set simTime [expr [expr 50.0/100.0] * $t]

	$ns_ at $simTime "puts \"Current Sim Time(s) = $simTime \tCompleted = $t%\""


puts "Starting Simulation..."

$ns_ run
PLZ... help me...

Last edited by uj100; 11-07-2012 at 05:43 PM.
Old 11-07-2012, 02:29 PM   #2
LQ 5k Club
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156Reputation: 3156
Welcome to LQ.

Please edit your post to use code tags ( The 'Edit' button ) :
Write [/code] at code end, and [code] at code text start.

About your code : Which version of ns-allinone-2.xx is it about ?
Which patch was added ? ( If any.)



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
UMTS_WLAN NS2 simulation RSM_smile Linux - Newbie 0 09-17-2012 07:11 PM
Simulation in NS2 shilpy Linux - Software 2 09-04-2012 08:57 AM
error 'variable can't be read' in nS2 wired cum wireles simulation susanthomas Linux - Wireless Networking 1 06-07-2012 08:22 AM
Error on example simulation on ns2 using add-on for directional antenna Vixxx Linux - Software 5 02-03-2012 11:37 AM
NS2 network simulation problem:Change queue parameters dynamically during simulation raeisy Linux - Networking 1 11-21-2010 12:30 PM

All times are GMT -5. The time now is 12:38 AM.

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