我只是做了一个简单的模拟设置,但是当我增加缓冲区大小时它会混淆,导致更多的数据包丢失。有人可以解释原因吗?
set ns [new Simulator]
set tr [open out1.tr w]
$ns trace-all $tr
set ftr [open "out.nam" w]
$ns namtrace-all $ftr
set n0 [$ns node]
set n0 [$ns node]
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
$ns duplex-link $n0 $n2 10mb 10ms DropTail
$ns duplex-link $n1 $n2 10mb 10ms DropTail
$ns duplex-link $n2 $n3 1mb 10ms DropTail
$ns duplex-link $n4 $n3 10mb 10ms DropTail
$ns duplex-link $n5 $n3 10mb 10ms DropTail
$ns queue-limit $n2 $n3 50
set tcp0 [new Agent/TCP/Newreno]
$tcp0 set fid_ 1
$tcp0 set window_ 1000
set tcp1 [new Agent/TCP/Newreno]
$tcp1 set fid_ 2
$tcp1 set window_ 1000
set sink1 [new Agent/TCPSink]
set sink0 [new Agent/TCPSink]
$ns attach-agent $n0 $tcp0
$ns attach-agent $n1 $tcp1
$ns attach-agent $n4 $sink0
$ns attach-agent $n4 $sink1
$ns connect $tcp0 $sink0
$ns connect $tcp1 $sink1
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcp0
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp1
proc finish { } {
global ns tr ftr
$ns flush-trace
close $tr
close $ftr
#exec nam out.nam &
exec awk -f output.awk out1.tr &
exec awk -f throughputtest.awk out1.tr &
exec awk -f throughputtest.awk out1.tr > dataout.xg &
exit 0
}
$ns at 0.1 "$ftp0 start"
$ns at 0.1 "$ftp1 start"
$ns at 300 "finish"
$ns run
我将缓冲区大小设置为50/100/150/200但是当我运行模拟时,结果是当我增加缓冲区大小时数据包丢失增加,请有人给我一个解释,我在NS2模拟器中初学者。