📄 test-suite-sctp.tcl
字号:
set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 5Mb 50ms DropTail $ns duplex-link-op $n0 $n1 orient right set err [new ErrorModel/List] $err droplist {112} $ns lossmodel $err $n0 $n1 set sctp0 [new Agent/SCTP] $ns attach-agent $n0 $sctp0 $sctp0 set mtu_ 1500 $sctp0 set dataChunkSize_ 1468 $sctp0 set numOutStreams_ 1 $sctp0 set useMaxBurst_ 1 if {$quiet == 0} { $sctp0 set debugMask_ -1 $sctp0 set debugFileIndex_ 0 set trace_ch [open trace.sctp w] $sctp0 set trace_all_ 1 $sctp0 trace cwnd_ $sctp0 trace rto_ $sctp0 trace errorCount_ $sctp0 attach $trace_ch } set sctp1 [new Agent/SCTP] $ns attach-agent $n1 $sctp1 $sctp1 set mtu_ 1500 $sctp1 set initialRwnd_ 23488 $sctp1 set useDelayedSacks_ 1 if {$quiet == 0} { $sctp1 set debugMask_ -1 $sctp1 set debugFileIndex_ 1 } $ns connect $sctp0 $sctp1 set ftp0 [new Application/FTP] $ftp0 attach-agent $sctp0}Test/sctp-burstAfterFastRtxRecovery instproc run {} { $self instvar ns ftp0 $ns at 0.5 "$ftp0 start" $ns at 5.0 "$self finish" $ns run}Test/sctp-burstAfterFastRtxRecovery-2 instproc init {} { $self instvar ns testName ftp0 global quiet set testName burstAfterFastRtxRecovery-2 $self next set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 .5Mb 200ms DropTail $ns duplex-link-op $n0 $n1 orient right set err [new ErrorModel/List] $err droplist {31} $ns lossmodel $err $n0 $n1 set sctp0 [new Agent/SCTP] $ns attach-agent $n0 $sctp0 $sctp0 set mtu_ 1500 $sctp0 set dataChunkSize_ 1468 $sctp0 set numOutStreams_ 1 $sctp0 set useMaxBurst_ 1 if {$quiet == 0} { $sctp0 set debugMask_ -1 $sctp0 set debugFileIndex_ 0 set trace_ch [open trace.sctp w] $sctp0 set trace_all_ 1 $sctp0 trace cwnd_ $sctp0 trace rto_ $sctp0 trace errorCount_ $sctp0 attach $trace_ch } set sctp1 [new Agent/SCTP] $ns attach-agent $n1 $sctp1 $sctp1 set mtu_ 1500 $sctp1 set initialRwnd_ 23488 $sctp1 set useDelayedSacks_ 1 if {$quiet == 0} { $sctp1 set debugMask_ -1 $sctp1 set debugFileIndex_ 1 } $ns connect $sctp0 $sctp1 set ftp0 [new Application/FTP] $ftp0 attach-agent $sctp0}Test/sctp-burstAfterFastRtxRecovery-2 instproc run {} { $self instvar ns ftp0 $ns at 0.5 "$ftp0 start" $ns at 6.0 "$self finish" $ns run}Test/sctp-cwndFreeze instproc init {} { $self instvar ns testName ftp0 global quiet set testName cwndFreeze $self next set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 .5Mb 200ms DropTail $ns duplex-link-op $n0 $n1 orient right set err [new ErrorModel/List] $err droplist {15} $ns lossmodel $err $n0 $n1 set sctp0 [new Agent/SCTP] $ns attach-agent $n0 $sctp0 $sctp0 set mtu_ 1500 $sctp0 set dataChunkSize_ 1468 $sctp0 set numOutStreams_ 1 if {$quiet == 0} { $sctp0 set debugMask_ -1 $sctp0 set debugFileIndex_ 0 set trace_ch [open trace.sctp w] $sctp0 set trace_all_ 1 $sctp0 trace cwnd_ $sctp0 trace rto_ $sctp0 trace errorCount_ $sctp0 attach $trace_ch } set sctp1 [new Agent/SCTP] $ns attach-agent $n1 $sctp1 $sctp1 set mtu_ 1500 $sctp1 set initialRwnd_ 131072 $sctp1 set useDelayedSacks_ 0 if {$quiet == 0} { $sctp1 set debugMask_ -1 $sctp1 set debugFileIndex_ 1 } $ns connect $sctp0 $sctp1 set ftp0 [new Application/FTP] $ftp0 attach-agent $sctp0}Test/sctp-cwndFreeze instproc run {} { $self instvar ns ftp0 $ns at 0.5 "$ftp0 start" $ns at 5.0 "$self finish" $ns run}Test/sctp-cwndFreeze-multistream instproc init {} { $self instvar ns testName ftp0 global quiet set testName cwndFreeze-multistream $self next set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 .5Mb 200ms DropTail $ns duplex-link-op $n0 $n1 orient right set err [new ErrorModel/List] $err droplist {15} $ns lossmodel $err $n0 $n1 set sctp0 [new Agent/SCTP] $ns attach-agent $n0 $sctp0 $sctp0 set mtu_ 1500 $sctp0 set dataChunkSize_ 1468 $sctp0 set numOutStreams_ 5 if {$quiet == 0} { $sctp0 set debugMask_ -1 $sctp0 set debugFileIndex_ 0 set trace_ch [open trace.sctp w] $sctp0 set trace_all_ 1 $sctp0 trace cwnd_ $sctp0 trace rto_ $sctp0 trace errorCount_ $sctp0 attach $trace_ch } set sctp1 [new Agent/SCTP] $ns attach-agent $n1 $sctp1 $sctp1 set mtu_ 1500 $sctp1 set initialRwnd_ 131072 $sctp1 set useDelayedSacks_ 1 if {$quiet == 0} { $sctp1 set debugMask_ -1 $sctp1 set debugFileIndex_ 1 } $ns connect $sctp0 $sctp1 set ftp0 [new Application/FTP] $ftp0 attach-agent $sctp0 }Test/sctp-cwndFreeze-multistream instproc run {} { $self instvar ns ftp0 $ns at 0.5 "$ftp0 start" $ns at 10.0 "$self finish" $ns run}Test/sctp-hugeRwnd instproc init {} { $self instvar ns testName ftp0 global quiet set testName hugeRwnd $self next set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 1500Mb 300ms DropTail $ns duplex-link-op $n0 $n1 orient right $ns queue-limit $n0 $n1 10000 set err [new ErrorModel/List] set sctp0 [new Agent/SCTP] $ns attach-agent $n0 $sctp0 $sctp0 set mtu_ 1500 $sctp0 set dataChunkSize_ 1468 $sctp0 set numOutStreams_ 1 if {$quiet == 0} { $sctp0 set debugMask_ -1 $sctp0 set debugFileIndex_ 0 set trace_ch [open trace.sctp w] $sctp0 set trace_all_ 1 $sctp0 trace cwnd_ $sctp0 trace rto_ $sctp0 trace errorCount_ $sctp0 attach $trace_ch } set sctp1 [new Agent/SCTP] $ns attach-agent $n1 $sctp1 $sctp1 set mtu_ 1500 $sctp1 set initialRwnd_ 1048576 $sctp1 set useDelayedSacks_ 0 if {$quiet == 0} { $sctp1 set debugMask_ -1 $sctp1 set debugFileIndex_ 1 } $ns connect $sctp0 $sctp1 set ftp0 [new Application/FTP] $ftp0 attach-agent $sctp0}Test/sctp-hugeRwnd instproc run {} { $self instvar ns ftp0 $ns at 0.5 "$ftp0 start" $ns at 10.0 "$self finish" $ns run}Test/sctp-initRtx instproc init {} { $self instvar ns testName ftp0 global quiet set testName initRtx $self next set n0 [$ns node] set n1 [$ns node] $ns duplex-link $n0 $n1 .5Mb 200ms DropTail $ns duplex-link-op $n0 $n1 orient right set err [new ErrorModel/List] $err droplist {0} $ns lossmodel $err $n0 $n1 set sctp0 [new Agent/SCTP] $ns attach-agent $n0 $sctp0 $sctp0 set mtu_ 1500 $sctp0 set dataChunkSize_ 1468 $sctp0 set numOutStreams_ 1 if {$quiet == 0} { $sctp0 set debugMask_ -1 $sctp0 set debugFileIndex_ 0 set trace_ch [open trace.sctp w] $sctp0 set trace_all_ 1 $sctp0 trace cwnd_ $sctp0 trace rto_ $sctp0 trace errorCount_ $sctp0 attach $trace_ch } set sctp1 [new Agent/SCTP] $ns attach-agent $n1 $sctp1 $sctp1 set mtu_ 1500 $sctp1 set initialRwnd_ 131072 $sctp1 set useDelayedSacks_ 1 if {$quiet == 0} { $sctp1 set debugMask_ -1 $sctp1 set debugFileIndex_ 1 } $ns connect $sctp0 $sctp1 set ftp0 [new Application/FTP] $ftp0 attach-agent $sctp0 }Test/sctp-initRtx instproc run {} { $self instvar ns ftp0 $ns at 0.5 "$ftp0 start" $ns at 10.0 "$self finish" $ns run}Test/sctp-multihome1-2 instproc init {} { $self instvar ns testName host0_if1 sctp0 ftp0 global quiet set testName multihome1-2 $self next set host0_core [$ns node] set host0_if0 [$ns node] set host0_if1 [$ns node] $host0_core color Red $host0_if0 color Red $host0_if1 color Red $ns multihome-add-interface $host0_core $host0_if0 $ns multihome-add-interface $host0_core $host0_if1 set host1 [$ns node] $host1 color Blue set router [$ns node] $ns duplex-link $host0_if0 $router .5Mb 200ms DropTail $ns duplex-link $host0_if1 $router .5Mb 200ms DropTail $ns duplex-link $host1 $router .5Mb 200ms DropTail set sctp0 [new Agent/SCTP] $ns multihome-attach-agent $host0_core $sctp0 $sctp0 set mtu_ 1500 $sctp0 set dataChunkSize_ 1468 $sctp0 set numOutStreams_ 1 if {$quiet == 0} { $sctp0 set debugMask_ -1 $sctp0 set debugFileIndex_ 0 set trace_ch [open trace.sctp w] $sctp0 set trace_all_ 1 $sctp0 trace cwnd_ $sctp0 trace rto_ $sctp0 trace errorCount_ $sctp0 attach $trace_ch } set sctp1 [new Agent/SCTP] $ns attach-agent $host1 $sctp1 $sctp1 set mtu_ 1500 $sctp1 set initialRwnd_ 131072 $sctp1 set useDelayedSacks_ 1 if {$quiet == 0} { $sctp1 set debugMask_ -1 $sctp1 set debugFileIndex_ 1 } $ns connect $sctp0 $sctp1 set ftp0 [new Application/FTP] $ftp0 attach-agent $sctp0}Test/sctp-multihome1-2 instproc run {} { $self instvar ns host0_if1 sctp0 ftp0 $ns at 6.0 "$sctp0 force-source $host0_if1" $ns at 0.5 "$ftp0 start" $ns at 8.0 "$self finish" $ns run}Test/sctp-multihome2-1 instproc init {} { $self instvar ns testName host0_if1 sctp1 ftp1 global quiet set testName multihome2-1 $self next set host0_core [$ns node] set host0_if0 [$ns node] set host0_if1 [$ns node] $host0_core color Red $host0_if0 color Red $host0_if1 color Red $ns multihome-add-interface $host0_core $host0_if0 $ns multihome-add-interface $host0_core $host0_if1 set host1 [$ns node] $host1 color Blue set router [$ns node] $ns duplex-link $host0_if0 $router .5Mb 200ms DropTail $ns duplex-link $host0_if1 $router .5Mb 200ms DropTail $ns duplex-link $host1 $router .5Mb 200ms DropTail set sctp0 [new Agent/SCTP] $ns multihome-attach-agent $host0_core $sctp0 $sctp0 set mtu_ 1500 $sctp0 set dataChunkSize_ 1468 $sctp0 set numOutStreams_ 1 $sctp0 set oneHeartbeatTimer_ 1 if {$quiet == 0} { $sctp0 set debugMask_ -1 $sctp0 set debugFileIndex_ 0 set trace_ch [open trace.sctp w] $sctp0 set trace_all_ 1 $sctp0 trace cwnd_ $sctp0 trace rto_ $sctp0 trace errorCount_ $sctp0 attach $trace_ch } set sctp1 [new Agent/SCTP] $ns attach-agent $host1 $sctp1 $sctp1 set mtu_ 1500 $sctp1 set dataChunkSize_ 512 $sctp1 set initialRwnd_ 131072 $sctp1 set useDelayedSacks_ 1 if {$quiet == 0} { $sctp1 set debugMask_ -1 $sctp1 set debugFileIndex_ 1 } $ns connect $sctp0 $sctp1 $sctp1 set-primary-destination $host0_if0 set ftp1 [new Application/FTP] $ftp1 attach-agent $sctp1}Test/sctp-multihome2-1 instproc run {} { $self instvar ns host0_if1 sctp1 ftp1 $ns at 6.0 "$sctp1 set-primary-destination $host0_if1" $ns at 0.5 "$ftp1 start" $ns at 8.0 "$self finish" $ns run}Test/sctp-multihome2-2AMR-Exceeded instproc init {} { $self instvar ns testName ftp0 global quiet set testName multihome2-2AMR-Exceeded $self next set host0_core [$ns node] set host0_if0 [$ns node] set host0_if1 [$ns node] $host0_core color Red $host0_if0 color Red $host0_if1 color Red $ns multihome-add-interface $host0_core $host0_if0 $ns multihome-add-interface $host0_core $host0_if1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -