test-suite-sctp.tcl

来自「一款用来进行网络模拟的软件」· TCL 代码 · 共 2,235 行 · 第 1/5 页

TCL
2,235
字号
        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-2Failover0 instproc run {} {    $self instvar ns ftp0    $ns at 0.5 "$ftp0 start"    $ns at 195.0 "$self finish"    $ns run}Test/sctp-multihome2-2Failover1 instproc init {} {    $self instvar ns testName ftp0    global quiet    set testName multihome2-2Failover1    $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    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-2Failover1 instproc run {} {    $self instvar ns ftp0    $ns at 0.5 "$ftp0 start"    $ns at 195.0 "$self finish"    $ns run}Test/sctp-multihome2-2Rtx1 instproc init {} {    $self instvar ns testName ftp0    global quiet    set testName multihome2-2Rtx1    $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 err [new ErrorModel/List]    $err droplist {16}    $ns lossmodel $err $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        set ftp0 [new Application/FTP]    $ftp0 attach-agent $sctp0        $sctp0 set-primary-destination $host1_if0}Test/sctp-multihome2-2Rtx1 instproc run {} {    $self instvar ns ftp0    $ns at 0.5 "$ftp0 start"    $ns at 10.0 "$self finish"    $ns run}Test/sctp-multihome2-2Rtx3 instproc init {} {    $self instvar ns testName ftp0    global quiet    set testName multihome2-2Rtx3    $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 err [new ErrorModel/List]    $err droplist {16 17 18}    $ns lossmodel $err $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    set ftp0 [new Application/FTP]    $ftp0 attach-agent $sctp0    $sctp0 set-primary-destination $host1_if0       }Test/sctp-multihome2-2Rtx3 instproc run {} {    $self instvar ns ftp0    $ns at 0.5 "$ftp0 start"    $ns at 10.0 "$self finish"    $ns run}Test/sctp-multihome2-2Timeout instproc init {} {    $self instvar ns testName ftp0    global quiet    set testName multihome2-2Timeout    $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}    $ns lossmodel $err0 $host0_if0 $host1_if0        set err1 [new ErrorModel/List]    $err1 droplist {1}    $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    $sctp0 set-primary-destination $host1_if0        set ftp0 [new Application/FTP]    $ftp0 attach-agent $sctp0}Test/sctp-multihome2-2Timeout instproc run {} {    $self instvar ns ftp0    $ns at 0.5 "$ftp0 start"    $ns at 12.0 "$self finish"    $ns run}Test/sctp-multihome2-2TimeoutRta0 instproc init {} {    $self instvar ns testName ftp0    global quiet    set testName multihome2-2TimeoutRta0    $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 29}    $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 rtxToAlt_ 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        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-2TimeoutRta0 instproc run {} {    $self instvar ns ftp0    $ns at 0.5 "$ftp0 start"    $ns at 12.0 "$self finish"    $ns run}Test/sctp-multihome2-2TimeoutRta2 instproc init {} {    $self instvar ns testName ftp0    global quiet    set testName multihome2-2TimeoutRta2    $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 29}    $ns lossmodel $err0 $host0_if0 $host1_if0        set sctp0 [new Agent/SCTP]    $ns multihome-attach-agent $host0_core $sctp0    $sctp0 set mtu_ 1500

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?