Hello

I am having a problem while I am trying to simulate multicast over a wireless
network (802.11). The error I get is the following. It would be great
if you could let me know what I am doing wrong



The error I get is:
...

ns: _o22 new-group 0 -2147483648 -1 cache-miss: can't read "protocols_(-1)":
no such variable
    while executing
"$protocols_($iface) upcall $code $source $group $iface"

    (procedure "_o23" line 9)
    (mrtObject upcall line 9)
    invoked from within
"$mrtObject_ upcall $code $src $group $iface"
    (procedure "_o17" line 3)
    (Node new-group line 3)

    invoked from within
"$node_ new-group $src $group $iface $code"
    (procedure "_o22" line 3)
    (Classifier/Multicast new-group line 3)
    invoked from within
"_o22 new-group 1 -2147483648 -1 cache-miss"


Thanks!

dan miao

------------------------------------------------------------------------------------------
My codes:

set val(chan)  Channel/WirelessChannel
set val(prop)  Propagation/TwoRayGround
set val(netif)  Phy/WirelessPhy
set val(mac)    Mac/802_11
set val(ifq)   Queue/DropTail/PriQueue

set val(ll)    LL
set val(ant)   Antenna/OmniAntenna
set val(ifqlen)   50
set val(nn)       4
set val(rp)       AODV
set val(x)       500
set val(y)       500
set ns [new Simulator -multicast on]
$ns multicast

set tracefd [open multicast.tr w]
$ns trace-all $tracefd
set namtracefd [open multicast.nam w]
$ns namtrace-all-wireless $namtracefd $val(x) $val(y)

set topo [new Topography]

$topo load_flatgrid $val(x) $val(y)
create-god $val(nn)
$ns node-config -addressType def\
-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 n_$i [$ns node]
    #$n_$i random-motion 0
}
$n_0 set X_ 5.0
$n_0 set Y_ 2.0
$n_0 set Z_ 0.0
$n_1 set X_ 390.0
$n_1 set Y_ 385.0
$n_1 set Z_ 0.0
$n_2 set X_ 200.0
$n_2 set Y_ 100.0

$n_2 set Z_ 0.0
$n_3 set X_ 100.0
$n_3 set Y_ 200.0
$n_3 set Z_ 0.0

set group1 [Node allocaddr]

#set mproto CtrMcast
#DM set CacheMissMode dvmrp
#set mproto DM
set mrthandle [$ns mrtproto DM {}]



set udp0 [new Agent/UDP]
$ns attach-agent $n_0 $udp0


set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500

$cbr0 attach-agent $udp0

set null1 [new Agent/Null]
set null2 [new Agent/Null]

set null3 [new Agent/Null]
$ns attach-agent $n_1 $null1
$ns attach-agent $n_2 $null2
$ns attach-agent $n_3 $null3

$ns connect $udp0 $null1
$ns connect $udp0 $null2
$ns connect $udp0 $null3

$udp0 set dst_addr_ $group1

$udp0 set dst_port_ 0



set rcvr [new Agent/LossMonitor]


$ns at 1.20 "$n_1 join-group $rcvr $group1"
$ns at 1.25 "$n_2 join-group $rcvr $group1"
$ns at 1.26 "$n_3 join-group $rcvr $group1"

$ns at 1.80 "$n_3 leave-group $rcvr $group1"
$ns at 1.85 "$n_2 leave-group $rcvr $group1"
$ns at 1.90 "$n_3 leave-group $rcvr $group1"
$ns at 1.00 "$cbr0 start"



$ns at 2.0 "finish"

proc finish {} {
        global ns
        $ns flush-trace

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


$ns run

Reply via email to