[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Heres the script: Re: DM routing no longer works



Here's the script that is driving me crazy....

It builds a network of 16 nodes in a square formation with criss-cross mesh
of links.

Node 0 is the sender.
Nodes 12, 10, 5 and 15 are the receivers.
All 4 receivers and the sender join the group
The sender starts sending a cbr traffic to the group

Problem statement(daily snapshot 2.1b5 11th feb 1999): 
-------------------------------------------------------

DM prunes receivers 10 and 15 from the tree (WHY DOES IT DO THIS?)
The result is that only receivers 12 and 5 continue to receive traffic from
hte sender

I've just tried this script on ns 2.1b3 and there is no problem, i.e. all 4 
receivers continue to receive traffic from the sender.

-----------------------------------------------

set defdel 0.05s
set side 4
set r1 12
set r2 10
set r3 5
set r4 15
set sen 0

set group0 0x8001

#Create a simulator object
set ns [new Simulator]
Simulator set EnableMcast_ 1
Simulator set NumberInterfaces_ 1

$ns color 1 red
# prune/graft packets
$ns color 30 yellow
$ns color 31 blue

#Open a trace file
$ns trace-all [open out.tr w]
$ns namtrace-all [open out.nam w]

set i 0
while {$i < [expr $side*$side]} {
set n($i) [$ns node]
set i [expr $i+1]
}

set cbr0 [new Agent/CBR]
$ns attach-agent $n($sen) $cbr0
$cbr0 set dst_ $group0

set i 0
while {$i < $side} {
  set j 0
  while {$j < [expr $side*$side]} {
    if {$j < [expr $side*$side-$side]} {  
        $ns duplex-link $n([expr $i+$j]) $n([expr $i+$j+$side]) 1Mb $defdel 
DropTail
        $ns duplex-link-op $n([expr $i+$j]) $n([expr $i+$j+$side]) orient up
    }
    if {$i < [expr $side-1]} {
        $ns duplex-link $n([expr $i+$j]) $n([expr $i+$j+1]) 1Mb $defdel 
DropTail
        $ns duplex-link-op $n([expr $i+$j]) $n([expr $i+$j+1]) orient right
    }  
    set j [expr $j+$side]
  }
  set i [expr $i+1]
}

DM set PruneTimeout 1000
set mproto DM
set mrthandle [$ns mrtproto $mproto {}]

$n($sen) color yellow
$n($r1) color green
$n($r2) color green
$n($r3) color green
$n($r4) color green

set nullr1 [new Agent/LossMonitor]
$ns attach-agent $n($r1) $nullr1
set nullr2 [new Agent/LossMonitor]
$ns attach-agent $n($r2) $nullr2
set nullr3 [new Agent/LossMonitor]
$ns attach-agent $n($r3) $nullr3
set nullr4 [new Agent/LossMonitor]
$ns attach-agent $n($r4) $nullr4

$ns at 0.09 "$n($sen) join-group $nullr1 $group0"
$ns at 0.1 "$n($r1) join-group $nullr1 $group0"
$ns at 0.11 "$n($r2) join-group $nullr2 $group0"
$ns at 0.12 "$n($r3) join-group $nullr3 $group0"
$ns at 0.13 "$n($r4) join-group $nullr4 $group0"

$ns at 1.0 "$cbr0 start"

$ns at 7.0 "finish"

proc finish {} {
        global ns 
        $ns flush-trace
        exec nam out.nam &
        exit 0
}

#Run the simulation
$ns run


>I tried a DM example script (tcl/ex/newmcast/mcast3.tcl)using the latest
>ns 
>snapshot (downloaded last week), and it is working fine. all the 
>join/prune are ok. I also have the chance to look into the DM.tcl file, 
>from my point of view, it should be no problem to run.

>Maybe you can describe what problem you've encountered to the mailing
>list.

>shuqian