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

[ns] Error model in Centralized Multicast




Hi,
Does anyone know how to insert a error modelin Centralized Multicast?
I could write a script. 
Then, that script ran normally. 
But, when a trace file is seen, a packet isn't lying due to the error.
I couldn't error operations(indicated by "e") in the first column of a
trace file.
I don't know this cause. 
I don't know where of where my script is wrong. 

Please, give me some advice.
Thanks,

my script is shown below.
              n(2)
             /
            /
           /
n(0)-----n(1)-----n(3)
           \
            \
             \
             n(4)
##############################################
#protocol
set mproto CtrMcast
set mrthandle [$ns mrtproto $mproto {}]
$mrthandle set_c_rp $n(1)
set group0 [Node allocaddr]

set udp0 [new Agent/UDP]
$ns attach-agent $n(0) $udp0
$udp0 set dst_addr_ $group0
$udp0 set class_ 1
$udp0 set fid_ 1
set cbr0 [new Application/Traffic/CBR]
$cbr0 attach-agent $udp0
$cbr0 set packetSize_ 90

#rcrv
set rcvr2 [new Agent/LossMonitor]
$ns attach-agent $n(2) $rcvr2
$ns at 2.0 "$n(2) join-group $rcvr2 $group0"
$ns at 50.0 "$n(2) leave-group $rcvr2 $group0"

set rcvr3 [new Agent/LossMonitor]
$ns attach-agent $n(3) $rcvr3
$ns at 8.0 "$n(3) join-group $rcvr3 $group0"
$ns at 40.0 "$n(3) leave-group $rcvr3 $group0"

set rcvr4 [new Agent/LossMonitor]
$ns attach-agent $n(4) $rcvr4
$ns at 10.0 "$n(4) join-group $rcvr4 $group0"
$ns at 30.0 "$n(4) leave-group $rcvr4 $group0"

set em2_ [new ErrorModel]
$em2_ unit pkt
$em2_ set rate_ 0.1
$em2_ ranvar [new RandomVariable/Uniform]
$ns lossmodel $em2_ $n(1) $n(2)

$ns at 0.0 "$cbr0 start"
$ns at 100.0 "finish"

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

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

$ns run