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

Re: PIM multicast simulations



Ahmed,

I created a simple 10 node falt topogy to run the PIM-SM code. Here is the 
script file,


set ns [new Simulator]
Simulator set EnableMcast_ 1

for {set i 0} {$i < 10} {incr i} {
            set n($i) [$ns node]
    }


#set n0 [$ns node]
#set n1 [$ns node]
#set n2 [$ns node]
#set n3 [$ns node]

set f [open out-pim2.tr w]
$ns trace-all $f

#$ns multi-link-of-interfaces [list $n0 $n1 $n2 $n3] 1.5Mb 10ms DropTail

        $ns duplex-link $n(0) $n(9) 1.5Mb 40ms DropTail
        $ns duplex-link $n(0) $n(4) 1.5Mb 60ms DropTail
        $ns duplex-link $n(0) $n(2) 1.5Mb 40ms DropTail
        $ns duplex-link $n(1) $n(8) 1.5Mb 70ms DropTail
        $ns duplex-link $n(2) $n(6) 1.5Mb 70ms DropTail
        $ns duplex-link $n(3) $n(9) 1.5Mb 20ms DropTail
        $ns duplex-link $n(3) $n(8) 1.5Mb 70ms DropTail
        $ns duplex-link $n(3) $n(5) 1.5Mb 70ms DropTail
        $ns duplex-link $n(4) $n(7) 1.5Mb 70ms DropTail
        $ns duplex-link $n(4) $n(6) 1.5Mb 40ms DropTail
        $ns duplex-link $n(5) $n(9) 1.5Mb 70ms DropTail
        $ns duplex-link $n(5) $n(7) 1.5Mb 40ms DropTail
        $ns duplex-link $n(7) $n(9) 1.5Mb 60ms DropTail
        $ns duplex-link $n(8) $n(9) 1.5Mb 70ms DropTail

set pim0 [new PIM $ns $n(0) [list 1 1 0]]
set pim1 [new PIM $ns $n(1) [list 0 1 0]]
set pim2 [new PIM $ns $n(2) [list 1]]
set pim3 [new PIM $ns $n(3) [list 0 1 0]]
set pim4 [new PIM $ns $n(4) [list 1]]
set pim5 [new PIM $ns $n(5) [list 0]]
set pim6 [new PIM $ns $n(6) [list 0]]
set pim7 [new PIM $ns $n(7) [list 1]]
set pim8 [new PIM $ns $n(8) [list 0]]
set pim9 [new PIM $ns $n(9) [list 1]]


PIM config $ns

$ns at 0.0 "$ns run-mcast"

set rcvr0 [new Agent/Message]
$ns attach-agent $n(0) $rcvr0
set rcvr1 [new Agent/Message]
$ns attach-agent $n(1) $rcvr1
set rcvr2  [new Agent/Message]
$ns attach-agent $n(2) $rcvr2
set rcvr3 [new Agent/Message]
$ns attach-agent $n(3) $rcvr3
set rcvr4 [new Agent/Message]
$ns attach-agent $n(4) $rcvr4
set rcvr5 [new Agent/Message]
$ns attach-agent $n(5) $rcvr5
set rcvr6  [new Agent/Message]
$ns attach-agent $n(6) $rcvr6
set rcvr7 [new Agent/Message]
$ns attach-agent $n(7) $rcvr7
set rcvr8  [new Agent/Message]
$ns attach-agent $n(8) $rcvr8
set rcvr9 [new Agent/Message]

set sender0 [new Agent/Message]
$sender0 set dst_ 0x8003
$sender0 set class_ 2
$ns attach-agent $n(0) $sender0

$ns at 1.95 "$n(0) join-group $rcvr0 0x8003"
#$ns at 1.96 "$n1 join-group $rcvr1 0x8003"
$ns at 2.05 "$n(1) join-group $rcvr1 0x8003"
$ns at 1.97 "$n(2) join-group $rcvr2 0x8003"
$ns at 2.0 "$n(3) join-group $rcvr3 0x8003"
$ns at 2.05 "$n(9) join-group $rcvr9 0x8003"

$ns at 2.0 "$sender0 send \"pkt1\""
$ns at 2.1 "$sender0 send \"pkt2\""
$ns at 2.13 "$sender0 send \"pkt3\""
$ns at 2.16 "$sender0 send \"pkt4\""
$ns at 2.2 "$sender0 send \"pkt5\""

$ns at 2.5 "finish"
#$ns at 2.01 "finish"

proc finish {} {
        global ns
        $ns flush-trace
        exec awk -f ../../nam-demo/nstonam.awk out-pim2.tr > pim2-nam.tr
        # exec rm -f out
        #XXX
        puts "running nam..."
#       exec nam pim2-nam &
        exit 0
}

$ns run


The script failed with the following messages. I don't understand why it is ok 
when simulation is performed in a LAN topology, however doesn't work for other 
cases. Is anyone looking into this problem? since I guess most of the ns users 
are using new version of ns now. (I tried with both ns-2.1b3 and the daily 
snapshot as of 1+1/2 weeks ago, they all give the same error messages)

ns: _o3 run-mcast: invalid command name "0"
    while executing
"[$link set ifacein_] set intf_label_"
    (procedure "_o50" line 3)
    (Node get-oif line 3)
    invoked from within
"$self get-oif $link"
    (procedure "_o50" line 5)
    (Node init-outLink line 5)
    invoked from within
"$node init-outLink"
    (procedure "_o3" line 5)
    (Simulator run-mcast line 5)
    invoked from within
"_o3 run-mcast"


Tks,

shuqian Yan