Hi all, I have some question in simulation of mobile ip multicast, MIP-BT need HA join-group the multicast tree. First, in multicast tcl script, HA join the multicast by the way as belows: for {set i 1} {$i < 2} {incr i} { set rcvr($i) [new Agent/Null] $ns_ attach-agent $HA $rcvr($i) $ns_ at $i "$HA join-group $rcvr($i) $g_" } Question1: if HA is considered as receiver, then how to configure the MH ? Question2: run the tcl script produce some error [EMAIL PROTECTED] /home/cxh $ ns test_mip_multicast1.tcl num_nodes is set 3 warning: Please use -channel as shown in tcl/ex/wireless-mitf.tcl INITIALIZE THE LIST xListHead ns: _o221 drop 4194305 -1 -1: can't read "protocols_(-1)": no such variable while executing "$protocols_($iface) drop $replicator $src $dst $iface" (procedure "_o114" line 3) (mrtObject drop line 3) invoked from within "[$node_ getArbiter] drop $self $src $dst $iface" (procedure "_o221" line 3) (Classifier/Replicator/Demuxer drop line 3) invoked from within "_o221 drop 4194305 -1 -1"
i don't know how to solove it. the whole tcl script is as belows: # simulation of a wired-cum-wireless topology running with mobileIP # ====================================================================== # Define options # ====================================================================== set opt(chan) Channel/WirelessChannel ;# channel type set opt(prop) Propagation/TwoRayGround ;# radio-propagation model set opt(netif) Phy/WirelessPhy ;# network interface type set opt(mac) Mac/802_11 ;# MAC type set opt(ifq) Queue/DropTail/PriQueue ;# interface queue type set opt(ll) LL ;# link layer type set opt(ant) Antenna/OmniAntenna ;# antenna model set opt(ifqlen) 50 ;# max packet in ifq set opt(nn) 1 ;# number of mobilenodes set opt(adhocRouting) DSDV ;# routing protocol set opt(cp) "" ;# cp file not used set opt(sc) "" ;# node movement file. set opt(x) 670 ;# x coordinate of topology set opt(y) 670 ;# y coordinate of topology set opt(seed) 0.0 ;# random seed set opt(stop) 250 ;# time to stop simulation set opt(ftp1-start) 100.0 set num_wired_nodes 2 #set num_bs_nodes 2 ; this is not really used here. # ====================================================================== # check for boundary parameters and random seed if { $opt(x) == 0 || $opt(y) == 0 } { puts "No X-Y boundary values given for wireless topology\n" } if {$opt(seed) > 0} { puts "Seeding Random number generator with $opt(seed)\n" ns-random $opt(seed) } set ns_ [new Simulator] set tracefd [open wireless3-out.tr w] set namtrace [open wireless3-out.nam w] $ns_ trace-all $tracefd $ns_ namtrace-all-wireless $namtrace $opt(x) $opt(y) $ns_ node-config -addressType hierarchical $ns_ multicast on set g_ [Node allocaddr] AddrParams set domain_num_ 3 ;# number of domains lappend cluster_num 2 1 1 ;# number of clusters in each domain AddrParams set cluster_num_ $cluster_num lappend eilastlevel 1 1 2 1 ;# number of nodes in each cluster AddrParams set nodes_num_ $eilastlevel ;# of each domain # Create topography object set topo [new Topography] # define topology $topo load_flatgrid $opt(x) $opt(y) # create God # 2 for HA and FA create-god [expr $opt(nn) + 2] #create wired nodes set temp {0.0.0 0.1.0} ;# hierarchical addresses for {set i 0} {$i < $num_wired_nodes} {incr i} { set W($i) [$ns_ node [lindex $temp $i]] } # Configure for ForeignAgent and HomeAgent nodes $ns_ node-config -mobileIP ON \ -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 $topo \ -wiredRouting ON \ -agentTrace OFF\ -routerTrace OFF \ -macTrace OFF # Create HA and FA set HA [$ns_ node 1.0.0] set FA [$ns_ node 2.0.0] $HA random-motion 0 $FA random-motion 0 # Position (fixed) for base-station nodes (HA & FA). $HA set X_ 1.000000000000 $HA set Y_ 2.000000000000 $HA set Z_ 0.000000000000 $FA set X_ 650.000000000000 $FA set Y_ 600.000000000000 $FA set Z_ 0.000000000000 # create a mobilenode that would be moving between HA and FA. # note address of MH indicates its in the same domain as HA. $ns_ node-config -wiredRouting OFF set MH [$ns_ node 1.0.1] set node_(0) $MH set HAaddress [AddrParams addr2id [$HA node-addr]] [$MH set regagent_] set home_agent_ $HAaddress # movement of the MH $MH set Z_ 0.000000000000 $MH set Y_ 2.000000000000 $MH set X_ 2.000000000000 # MH starts to move towards FA $ns_ at 100.000000000000 "$MH setdest 640.000000000000 610.000000000000 20.000000000000" # goes back to HA $ns_ at 200.000000000000 "$MH setdest 2.000000000000 2.000000000000 20.000000000000" # create links between wired and BaseStation nodes $ns_ duplex-link $W(0) $W(1) 5Mb 2ms DropTail $ns_ duplex-link $W(1) $HA 5Mb 2ms DropTail $ns_ duplex-link $W(1) $FA 5Mb 2ms DropTail $ns_ duplex-link-op $W(0) $W(1) orient down $ns_ duplex-link-op $W(1) $HA orient left-down $ns_ duplex-link-op $W(1) $FA orient right-down set mproto DM set mrthandle [$ns_ mrtproto $mproto {}] # $ns_ at 0.0 "$mrthandle switch-treetype $g_" for {set i 1} {$i < 2} {incr i} { set rcvr($i) [new Agent/Null] $ns_ attach-agent $HA $rcvr($i) $ns_ at $i "$HA join-group $rcvr($i) $g_" } set udp0 [new Agent/UDP] $ns_ attach-agent $W(0) $udp0 $udp0 set dst_addr_ $g_ $udp0 set dst_port_ 0 $udp0 set class_ 2 set sender [new Application/Traffic/CBR] $sender attach-agent $udp0 $ns_ at 0.0 "$sender start" $ns_ at 10.0 " finish" proc finish {} { global ns_ tracefd namtrace close $tracefd close $namtrace puts "running nam..." exec nam wireless3-out.nam & #puts "finishing.." exit 0 } $ns_ run thank you in advance