看板 Network_Sim 關於我們 聯絡資訊
※ 引述《sui623 (深深體會沒有眼鏡的好...)》之銘言: : 據我所知~ns2裡面的CBR都是在腳本設定死的~~也就是事先就知道 : 如果想要只設定source 到destination的CBR : 但是不設定之間的relay node : 這樣好像會出錯XD~~ : 我看得CBR好像都沒有這方面的資料 : 可以請問一下大概的寫法嗎? 請問是這個嗎? set udp0 [new Agent/AODV] $ns attach-agent $node_(42) $udp0set null0 [new Agent/AODV] $ns attach-agent $node_(9) $null0$ns connect $udp0 $null0 $udp0 set fid_ 2 ;#在NAM中,UDP的連線會以紅色表示 set cbr0 [new Application/Traffic/CBR] ;#在UDP連線之上建立CBR應用程式 $cbr0 attach-agent$udp0 $cbr0 set type_ CBR$cbr0 set packet_size_ 1000;#設定封包大小 $cbr0 set rate_ 512Kb ;#設定傳輸速率 $cbr0 set random_ false $ns at 0.0 "$cbr0 start" $ns at 9.0 "$cbr0 stop" -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 140.114.71.232
mitsui0309:是的沒錯...........(有錯請更正) 07/28 16:01