I have problem with runnig tcl script

set ns [new Simulator]

# les dix noeuds: 
set node_0 [$ns node]
set node_1 [$ns node]
set node_2 [$ns node]
set node_3 [$ns node]
set node_4 [$ns node]
set node_5 [$ns node]
set node_6 [$ns node]
set node_7 [$ns node]
set node_8 [$ns node]
set node_9 [$ns node]
set node_10 [$ns node]


# création des outputs trace et nam:
set f [open glad.tr w]
$ns trace-all $f
set nf [open glad.nam w]
$ns namtrace-all $nf
# ======================================================================
# 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(rp)             DumbAgent                      ;# routing protocol
set val(start)          0.0
set val(ifqlen)         50                         ;# max packet in ifq
set val(nn)             11
set val(tr)             "trace"
set val(X)              500
set val(Y)              500
set val(CWmin)          16
set val(CWmax)          1024
set val(SlotTime)       0.000009
set val(SIFS)           0.000016
set val(basicRate)      2Mb
set val(dataRate)       54Mb
set val(PreambleLength)   104 
set val(PLCPHeaderLength)   48
#------------------------------------------------------------------------
# Codec:  G.711
#------------------------------------------------------------------------
#set val(ON)             1500ms
#set val(OFF)            1500ms
#set val(AppRate)        96Kb
#set val(pktsize)         160 #160 octets
#set val(pktinterval)     0.020
#set pktsize $val(pktsize)         #160 octets
#set pktinterval $val(pktinterval)   
#set val(run)             50.0
#------------------------------------------------------------------------
# MAC MIB
#------------------------------------------------------------------------
Mac/802_11         set basicRate         $val(basicRate)Mb
Mac/802_11         set dataRate          $val(dataRate)Mb
Mac/802_11         set CWMin             $val(CWmin)
Mac/802_11         set CWMax             $val(CWmax)
Mac/802_11         set SlotTime          $val(SlotTime)
Mac/802_11         set SIFS              $val(SIFS)
Mac/802_11              set PreambleLength    $val(PreambleLength);# no preamble
Mac/802_11              set PLCPHeaderLength  
$val(PLCPHeaderLength)             ;# 128 bits
Mac/802_11              set PLCPDataRate      1.0e6           ;# 1Mbps

# set up topography object
set topo       [new Topography]
#$topo load_flatgrid $val(X) $val(Y)

# Create God
create-god $val(nn)

# 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) \
             -channelType $val(chan) \
             -topoInstance $topo \
             -agentTrace ON \
             -routerTrace OFF \
             -macTrace OFF \
             -movementTrace OFF             
             
    for {set i 0} {$i < $val(nn) } {incr i} {
        set node_($i) [$ns node]     
        $node_($i) random-motion 0        ;# disable random motion
    }
# connection des noeuds entre eux: 

for {set i 1} {$i < $val(nn) } {incr i} {
    $ns duplex-link $node_($i) $node_(0) 1Mb 20ms DropTail            ;
    }
# c'est la relation (sending-receiving) ($ns connect $s_agent $r_agent)




# multi flows
for {set i 0} {$i < $val(nn) } {incr i 1} {
    set rtp($node_($i)) [new Agent/RTP]
    set null($node_($i)) [new Agent/Null]
    $ns attach-agent $node_($i) $rtp($node_($i))
    $ns attach-agent $node_($i) $null($node_($i))
        $rtp($node_($i)) set class_ ($node_($i))
    $ns connect $rtp($node_($i)) $null($node_(0))
        $ns connect $rtp($node_(0)) $null($node_($i))
    set cbr($node_($i)) [new Application/Traffic/CBR]
    $cbr($node_($i)) attach-agent $rtp($node_($i))
        #$ns at 0.1 "cbr($node_($i)) start"
        puts [$cbr($node_($i)) set packetSize_ 160]
        puts [$cbr($node_($i)) set interval_ 20ms]
}



$ns at 10.0 "finish"

proc finish {} {
    global ns f nf
    $ns flush-trace
    close $f
    close $nf

    puts "running nam..."
    exec nam glad.nam &
    exit 0
}

$ns run
 the problem when runnig this script, i have this message:

node 11 or 12 is not defined... 
    (_o25 cmd line 1)
    invoked from within
"_o25 cmd link 11 12 1.0 20.0 0 1.0"
    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 "_o25" line 2)
    (SplitObject unknown line 2)
    invoked from within
"$self link $dst $src $rate $delay $length $rev"
    (procedure "_o25" line 59)
    (NetworkModel layout_link line 59)
    invoked from within
"$self layout_link [lrange $line 1 end]"
    ("l" arm line 2)
    invoked from within
"switch $cmd {
"n" {
$self node $line
}
"g" {
$self layout_agent [lrange $line 1 end]
}
"l" {
$self layout_link [lrange $line 1 end]
}
"L" {
$self layo..."
    (procedure "_o25" line 17)
    (NetworkModel nam_layout line 17)
    invoked from within
"$self nam_layout $tracefile"
    (procedure "_o25" line 7)
    (Object next line 7)
    invoked from within
"_o25 next _o22 /home/emna/ns-allinone-2.34/ns-2.34/glad.nam"
    ("eval" body line 1)
    invoked from within
"eval $self next $animator $tracefile"
    (procedure "_o25" line 2)
    (NetworkModel/Auto init line 2)
    invoked from within
"_o25 init _o22 /home/emna/ns-allinone-2.34/ns-2.34/glad.nam"
    (Class create line 1)
    invoked from within
"NetworkModel/Auto create _o25 _o22 
/home/emna/ns-allinone-2.34/ns-2.34/glad.nam"
    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 $NETWORK_MODEL $self $tracefile"
    (procedure "_o22" line 87)
    (Animator init line 87)
    invoked from within
"_o22 init /home/emna/ns-allinone-2.34/ns-2.34/glad.nam {}"
    (Class create line 1)
    invoked from within
"Animator create _o22 /home/emna/ns-allinone-2.34/ns-2.34/glad.nam {}"
    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 $ANIMATOR_CLASS_ $tracefile  [join $args]"
 

i don't underdant this message

please some help



      

Reply via email to