[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Error in BST.tcl
Nader,
I found out a solution to the problem in an older BST.tcl. I just want
validation on it. Could you see if it really works?
The problem comes from join-group procedure in BST.tcl. Here is the correct
procedure :
BST instproc join-group { group {src "x"} } {
$self instvar node_ ns_ oiflist_
BST instvar RP_
set nbr [$node_ rpf-nbr $RP_($group)]
set nbrs($nbr) 1
$node_ add-mark m1 blue "[$node_ get-shape]"
foreach nbr [array names nbrs] {
if [$nbr is-lan?] {
$nbr instvar receivers_
if [info exists receivers_($group)] {
incr receivers_($group)
} else {
$self send-ctrl "graft" $RP_($group) $group
set receivers_($group) 1
}
}
$self next $group ; #annotate
}
# Old test line
# if {[$node_ getReps "x" $group] == ""} {
# New test line
if {![$node_ check-local $group] || [$node_ getReps "x" $group] == ""} {
# $self dbg "Sending join-group"
$self send-ctrl "graft" $RP_($group) $group
}
}
Cheers,
Abdelhamid
>From: Nader Salehi <[email protected]>
>To: "Abdelhamid JOUMDANE" <[email protected]>
>CC: [email protected]
>Subject: Re: Error in BST.tcl
>Date: Wed, 15 Sep 1999 13:11:13 -0700 (PDT)
>
>Abdelhamid,
>
>This is a bug with the BST code. I'll look into it.
>
>Nader
>
>Abdelhamid> Hi,
>Abdelhamid> I am trying to use using ~ns/tcl/mcast/BST.tcl. I figured
>Abdelhamid> out that if a node belonging to the tree and was passed by
>Abdelhamid> a prune message, the can't join the tree anymore. The test
>Abdelhamid> used in "BST join-group" don't allow the propagation of
>Abdelhamid> the message.
>Abdelhamid>
>Abdelhamid> Here is a sample script where we can see the problem :
>Abdelhamid> ## After the prune passed node 1 and 4, they can't join
>Abdelhamid> anymore
>Abdelhamid>
>Abdelhamid>
>Abdelhamid> ## Simple Bi-directional Shared Tree multicast test
>Abdelhamid> # on a binary tree
>Abdelhamid>
>Abdelhamid> set ns [new Simulator -multicast on]
>Abdelhamid>
>Abdelhamid> set f [open out-mc8.tr w]
>Abdelhamid> $ns trace-all $f
>Abdelhamid> set nf [open out-mc8.nam w]
>Abdelhamid> $ns namtrace-all $nf
>Abdelhamid>
>Abdelhamid> set degree 2 ;#binary
>Abdelhamid> set depth 4 ;
>Abdelhamid> set n(0) [$ns node]
>Abdelhamid> set nidx 1
>Abdelhamid> for {set l 1} {$l<$depth} {incr l} {
>Abdelhamid> set nodes_at_level [expr pow($degree, $l)]
>Abdelhamid> for {set k 1} {$k <= $nodes_at_level} {incr k} {
>Abdelhamid> #create new node
>Abdelhamid> eval set n($nidx) [$ns node]
>Abdelhamid> #link it to the parent
>Abdelhamid> set p [expr ($nidx - 1)/$degree]
>Abdelhamid> $ns duplex-link $n($p) $n($nidx) 1.5Mb [expr
>$depth*10/pow(2,$l)]ms
>Abdelhamid> DropTail
>Abdelhamid> #orient the link
>Abdelhamid> # parent p has children [$p*$degree+1..($p+1)*$degree]
>Abdelhamid> # so middle point is $p*$degree+($degree+1)/2
>Abdelhamid> set mp [expr $p*$degree + ($degree+1)/2.0]
>Abdelhamid> if {$nidx < $mp} {
>Abdelhamid> set orientation "left-down"
>Abdelhamid> } elseif {$nidx > $mp } {
>Abdelhamid> set orientation "right-down"
>Abdelhamid> } else {
>Abdelhamid> set orientation "down"
>Abdelhamid> }
>Abdelhamid> $ns duplex-link-op $n($p) $n($nidx) orient $orientation
>Abdelhamid> # $ns duplex-link-op $n($p) $n($nidx) queuePos [expr
>1/pow($degree, $l)]
>Abdelhamid>
>Abdelhamid> #attach senders
>Abdelhamid> set cbr($nidx) [new Agent/CBR]
>Abdelhamid> $cbr($nidx) set dst_ 0x8003
>Abdelhamid> $cbr($nidx) set class_ [expr 100 + $nidx]
>Abdelhamid> $cbr($nidx) set interval_ 20ms
>Abdelhamid> $ns attach-agent $n($nidx) $cbr($nidx)
>Abdelhamid>
>Abdelhamid> #attach receivers
>Abdelhamid> set rcvr($nidx) [new Agent/Null]
>Abdelhamid> $ns attach-agent $n($nidx) $rcvr($nidx)
>Abdelhamid>
>Abdelhamid> incr nidx
>Abdelhamid> }
>Abdelhamid> }
>Abdelhamid>
>Abdelhamid> ### Start multicast configuration:
>Abdelhamid> source BST.tcl
>Abdelhamid>
>Abdelhamid> BST set RP_([expr 0x8003]) $n(0)
>Abdelhamid>
>Abdelhamid>
>Abdelhamid> set mproto BST
>Abdelhamid> set mrthandle [$ns mrtproto $mproto {}]
>Abdelhamid> ### End of multicast configuration
>Abdelhamid>
>Abdelhamid> $ns color 103 Navy ;#cbrs
>Abdelhamid> $ns color 105 BlueViolet
>Abdelhamid>
>Abdelhamid> $ns color 30 purple ;#grafts
>Abdelhamid> $ns color 31 green ;#prunes
>Abdelhamid>
>Abdelhamid> $n(0) color blue ;#RP
>Abdelhamid>
>Abdelhamid> $n(0) color Navy
>Abdelhamid> $n(3) color BlueViolet
>Abdelhamid>
>Abdelhamid> #$ns at 0 "$cbr(3) start"
>Abdelhamid> $ns at 0.05 "$cbr(5) start"
>Abdelhamid> $ns at 0.3 "$n(4) join-group $rcvr(4) 0x8003"
>Abdelhamid> $ns at 0.3 "$n(6) join-group $rcvr(6) 0x8003"
>Abdelhamid> $ns at 0.4 "$n(4) leave-group $rcvr(4) 0x8003"
>Abdelhamid> $ns at 0.5 "$n(6) leave-group $rcvr(6) 0x8003"
>Abdelhamid>
>Abdelhamid> # These joins won't take effect ???
>Abdelhamid> $ns at 0.6 "$n(4) join-group $rcvr(4) 0x8003"
>Abdelhamid> $ns at 0.6 "$n(1) join-group $rcvr(1) 0x8003"
>Abdelhamid>
>Abdelhamid> $ns at 1.0 "finish"
>Abdelhamid>
>Abdelhamid> proc finish {} {
>Abdelhamid> global ns
>Abdelhamid> $ns flush-trace
>Abdelhamid>
>Abdelhamid> puts "running nam..."
>Abdelhamid> exec nam out-mc8 &
>Abdelhamid> exit 0
>Abdelhamid> }
>Abdelhamid>
>Abdelhamid> $ns run
>Abdelhamid>
>Abdelhamid>
>Abdelhamid> Anyone knows how to deal with this?
>Abdelhamid>
>Abdelhamid> Thanks,
>Abdelhamid> Abdelhamid JOUMDANE
>Abdelhamid>
>Abdelhamid> ______________________________________________________
>Abdelhamid> Get Your Private, Free Email at http://www.hotmail.com
>Abdelhamid>
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com