[问题] NS2脚本的问题

楼主: jackenwang (jacken)   2010-03-01 01:52:33
不好意思...
想请教板上各位超强的大大...
小弟想做1个AP被10个station连上后由AP传送资料给各个Station的脚本...
以下是小弟写的部分
nn的值为10....
Application/Traffic/CBR set packetSize_ 512
Application/Traffic/CBR set rate_ 256Kb
for {set i 1} {$i < [expr $val(nn)]} {incr i} {
set udp_($i) [new Agent/UDP]
set cbr_($i) [new Application/Traffic/CBR]
$ns_ attach-agent $node_(0) $udp_($i)
$cbr_($i) attach-agent $udp_($i)
}
for {set i 1} {$i < [expr $val(nn)]} {incr i} {
set null_($i) [new Agent/Null]
$ns_ attach-agent $node_($i) $null_($i)
$ns_ connect $udp_($i) $null_($i)
}
$ns_ at 1.0 "$cbr_(1) start"
$ns_ at 1.1 "$cbr_(2) start"
$ns_ at 1.2 "$cbr_(3) start"
$ns_ at 1.3 "$cbr_(4) start"
$ns_ at 1.4 "$cbr_(5) start"
$ns_ at 1.5 "$cbr_(6) start"
$ns_ at 1.6 "$cbr_(7) start"
$ns_ at 1.7 "$cbr_(8) start"
$ns_ at 1.8 "$cbr_(9) start"
$ns_ at 1.9 "$cbr_(10) start"
$ns_ at 50.0 "puts \"NS EXITING...\""
$ns_ at 50.0 "stop"
不过执行后却会出现"Scheduler: Event UID not valid!"的结果...
想请教各位大大...
我该怎么改或怎么写才能达到我想要的结果??
让1台AP能传送资料给各个连上的Station??
麻烦各位高手能够指点迷津...超级感谢!!

Links booklink

Contact Us: admin [ a t ] ucptt.com