我使用NS2模拟网络并研究RFC 1323在TCP中的效果。
我创建了3个节点,一个TCP代理和TCPSink代理。创建一个FTP源并附加node0。但我无法弄清楚如何禁用或启用窗口缩放选项。我试过了
$sink set ts_echo_rfc1323_ false
但它没有任何区别。如何在NS2中禁用和启用rfc1323。
请查看我使用的代码。我是NS2的新手,所以我在这里缺少什么?
global s
set s [new Simulator]
set nam_trace [open b.nam w]
set all_trace [open b.trace w]
$s trace-all $all_trace
$s namtrace-all $nam_trace
proc finish {} {
global s nam_trace all_trace
$s flush-trace
close $nam_trace
close $all_trace
exit 0
}
set n0 [$s node]
set n1 [$s node]
set n2 [$s node]
set n3 [$s node]
$s duplex-link $n0 $n1 100Mb 60ms DropTail
$s duplex-link $n1 $n2 100Mb 60ms DropTail
$s duplex-link $n2 $n3 100Mb 60ms DropTail
$s duplex-link-op $n0 $n1 orient right-up
$s duplex-link-op $n2 $n3 orient right
set tcp [new Agent/TCP]
$tcp set timestamps_ true
$tcp set window_ 1000000
$s attach-agent $n0 $tcp
set sink [new Agent/TCPSink/Sack1]
$sink set ts_echo_rfc1323_ true
$s attach-agent $n3 $sink
$s connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ftp set type_ FTP
$s at 0 "$ftp start"
$s at 30 "$ftp stop"
$s at 31 "finish"
$s run