test-suite-sctp.tcl
来自「一款用来进行网络模拟的软件」· TCL 代码 · 共 2,235 行 · 第 1/5 页
TCL
2,235 行
$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 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 set host1_core [$ns node] set host1_if0 [$ns node] set host1_if1 [$ns node] $host1_core color Blue $host1_if0 color Blue $host1_if1 color Blue $ns multihome-add-interface $host1_core $host1_if0 $ns multihome-add-interface $host1_core $host1_if1 $ns duplex-link $host0_if0 $host1_if0 .5Mb 200ms DropTail $ns duplex-link $host0_if1 $host1_if1 .5Mb 200ms DropTail set err0 [new ErrorModel/List] $err0 droplist {16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38} $ns lossmodel $err0 $host0_if0 $host1_if0 set err1 [new ErrorModel/List] $err1 droplist {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16} $ns lossmodel $err1 $host0_if1 $host1_if1 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 multihome-attach-agent $host1_core $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 $sctp0 set-primary-destination $host1_if0}Test/sctp-multihome2-2AMR-Exceeded instproc run {} { $self instvar ns ftp0 $ns at 0.5 "$ftp0 start" $ns at 180.0 "$self finish" $ns run}Test/sctp-multihome2-2Failover instproc init {} { $self instvar ns testName ftp0 global quiet set testName multihome2-2Failover $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_core [$ns node] set host1_if0 [$ns node] set host1_if1 [$ns node] $host1_core color Blue $host1_if0 color Blue $host1_if1 color Blue $ns multihome-add-interface $host1_core $host1_if0 $ns multihome-add-interface $host1_core $host1_if1 $ns duplex-link $host0_if0 $host1_if0 .5Mb 200ms DropTail $ns duplex-link $host0_if1 $host1_if1 .5Mb 200ms DropTail set err0 [new ErrorModel/List] $err0 droplist {16 17 18 19 20 21 22 23 24 25 26 27 29 28 31 32} $ns lossmodel $err0 $host0_if0 $host1_if0 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 multihome-attach-agent $host1_core $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 $sctp0 set-primary-destination $host1_if0 set ftp0 [new Application/FTP] $ftp0 attach-agent $sctp0}Test/sctp-multihome2-2Failover instproc run {} { $self instvar ns ftp0 $ns at 0.5 "$ftp0 start" $ns at 180.0 "$self finish" $ns run}Test/sctp-multihome2-2Failover0 instproc init {} { $self instvar ns testName ftp0 global quiet set testName multihome2-2Failover0 $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_core [$ns node] set host1_if0 [$ns node] set host1_if1 [$ns node] $host1_core color Blue $host1_if0 color Blue $host1_if1 color Blue $ns multihome-add-interface $host1_core $host1_if0 $ns multihome-add-interface $host1_core $host1_if1 $ns duplex-link $host0_if0 $host1_if0 .5Mb 200ms DropTail $ns duplex-link $host0_if1 $host1_if1 .5Mb 200ms DropTail set err0 [new ErrorModel/List] $err0 droplist {16 17 18 19 20 21 22 23 24 25 26 27 28 29 31 32} $ns lossmodel $err0 $host0_if0 $host1_if0 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 heartbeatInterval_ 0 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 multihome-attach-agent $host1_core $sctp1 $sctp1 set mtu_ 1500 $sctp1 set initialRwnd_ 131072 $sctp1 set useDelayedSacks_ 1
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?