📄 test-suite-friendly.tcl
字号:
if {$quiet == "false"} { $ns_ at $stopTime2 "close $tracefile" } $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0" # trace only the bottleneck link $ns_ run}# This test uses EWMA for estimating the loss event rate.Class Test/slowStartEWMA -superclass TestSuiteTest/slowStartEWMA instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ slowStartEWMA set guide_ \ "TFRC with EWMA for estimating the loss event rate." Agent/TFRCSink set algo_ 2 Test/slowStartEWMA instproc run {} [Test/slowStart info instbody run ] $self next pktTraceFile}# This test uses Fixed Windows for estimating the loss event rate.Class Test/slowStartFixed -superclass TestSuiteTest/slowStartFixed instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ slowStartFixed set guide_ \ "TFRC with Fixed Windows for estimating the loss event rate." Agent/TFRCSink set algo_ 3 Test/slowStartFixed instproc run {} [Test/slowStart info instbody run ] $self next pktTraceFile}Class Test/ecn -superclass TestSuiteTest/ecn instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ ecn set guide_ \ "TFRC with ECN." Agent/TFRC set ecn_ 1 Queue/RED set setbit_ true Test/ecn instproc run {} [Test/slowStart info instbody run ] $self next pktTraceFile}Class Test/slowStartTcp -superclass TestSuiteTest/slowStartTcp instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ slowStartTcp set guide_ \ "TCP" $self next pktTraceFile}Test/slowStartTcp instproc run {} { global quiet $self instvar ns_ node_ testName_ interval_ dumpfile_ guide_ if {$quiet == "false"} {puts $guide_} $self setTopo set interval_ 0.1 set stopTime 40.0 set stopTime0 [expr $stopTime - 0.001] set stopTime2 [expr $stopTime + 0.001] set dumpfile_ [open temp.s w] if {$quiet == "false"} { set tracefile [open all.tr w] $ns_ trace-all $tracefile } set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(s3) 0] set ftp1 [$tcp1 attach-app FTP] $ns_ at 0.0 "$ftp1 start" $ns_ at 30 "$ftp1 stop" set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(s3) 1] set ftp2 [$tcp2 attach-app FTP] $ns_ at 16 "$ftp2 start" $ns_ at $stopTime "$ftp2 stop" $self tfccDump 1 $tcp1 $interval_ $dumpfile_ $self tfccDump 2 $tcp2 $interval_ $dumpfile_ $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_" #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_] $ns_ at $stopTime "$self cleanupAll $testName_" if {$quiet == "false"} { $ns_ at $stopTime2 "close $tracefile" } $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0" # trace only the bottleneck link $ns_ run}Class Test/impulseDiscount -superclass TestSuiteTest/impulseDiscount instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulseDiscount set guide_ \ "TFRC with discount_ true, for discounting older loss intervals." Agent/TFRCSink set discount_ 1 Agent/TFRC set df_ 0.25 Agent/TFRC set ca_ 0 Agent/TFRCSink set smooth_ 0 Test/impulseDiscount instproc run {} [Test/impulseCA info instbody run ] $self next pktTraceFile}Class Test/impulseDiscountCA -superclass TestSuiteTest/impulseDiscountCA instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulseDiscountCA set guide_ \ "TFRC with discount_ and ca_ true, smooth_ false." Agent/TFRCSink set discount_ 1 Agent/TFRC set df_ 0.95 Agent/TFRC set ca_ 1 Agent/TFRCSink set smooth_ 0 Test/impulseDiscountCA instproc run {} [Test/impulseCA info instbody run ] $self next pktTraceFile}Class Test/impulse -superclass TestSuiteTest/impulse instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulse set guide_ \ "TFRC with smooth_, discount_, and ca_ all false." Agent/TFRCSink set discount_ 0 Agent/TFRC set df_ 0.25 Agent/TFRC set ca_ 0 Agent/TFRCSink set smooth_ 0 Test/impulse instproc run {} [Test/impulseCA info instbody run ] $self next pktTraceFile}Class Test/impulseCA -superclass TestSuiteTest/impulseCA instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulseCA set guide_ \ "TFRC with ca_ true, for Sqrt(RTT) based congestion avoidance mode." Agent/TFRCSink set discount_ 0 Agent/TFRCSink set smooth_ 0 Agent/TFRC set df_ 0.95 Agent/TFRC set ca_ 1# Test/impulseCA instproc run {} [Test/impulseCA info instbody run ] $self next pktTraceFile}Test/impulseCA instproc run {} { global quiet $self instvar ns_ node_ testName_ interval_ dumpfile_ guide_ if {$quiet == "false"} {puts $guide_} $self setTopo set interval_ 0.1 set stopTime 40.0 set stopTime0 [expr $stopTime - 0.001] set stopTime2 [expr $stopTime + 0.001] set dumpfile_ [open temp.s w] if {$quiet == "false"} { set tracefile [open all.tr w] $ns_ trace-all $tracefile } set tf1 [$ns_ create-connection TFRC $node_(s1) TFRCSink $node_(s3) 0] $ns_ at 0.0 "$tf1 start" $ns_ at $stopTime "$tf1 stop" set tf2 [$ns_ create-connection TFRC $node_(s2) TFRCSink $node_(s4) 1] $ns_ at 10.0 "$tf2 start" $ns_ at 20.0 "$tf2 stop" $self tfccDump 1 $tf1 $interval_ $dumpfile_ $self tfccDump 2 $tf2 $interval_ $dumpfile_ $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_" #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_] $ns_ at $stopTime "$self cleanupAll $testName_" if {$quiet == "false"} { $ns_ at $stopTime2 "close $tracefile" } $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0" # trace only the bottleneck link $ns_ run}# Feedback 4 times per roundtrip time.Class Test/impulseMultReportDiscount -superclass TestSuiteTest/impulseMultReportDiscount instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulseMultReportDiscount set guide_ \ "TFRC with feedback four times per round-trip time, discount_ true, ca_ false." Agent/TFRCSink set NumFeedback_ 4 Agent/TFRCSink set discount_ 1 Agent/TFRC set df_ 0.25 Agent/TFRC set ca_ 0 Test/impulseMultReportDiscount instproc run {} [Test/impulseMultReport info instbody run ] $self next pktTraceFile}# Feedback 4 times per roundtrip time.Class Test/impulseMultReportDiscountCA -superclass TestSuiteTest/impulseMultReportDiscountCA instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulseMultReportDiscountCA set guide_ \ "TFRC with feedback four times per RTT, discount_ and ca_ true." Agent/TFRCSink set NumFeedback_ 4 Agent/TFRCSink set discount_ 1 Agent/TFRC set df_ 0.95 Agent/TFRC set ca_ 1 Test/impulseMultReportDiscountCA instproc run {} [Test/impulseMultReport info instbody run ] $self next pktTraceFile}Class Test/impulseMultReport -superclass TestSuiteTest/impulseMultReport instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulseMultReport set guide_ \ "TFRC with feedback four times per RTT, discount_ and ca_ false." Agent/TFRCSink set NumFeedback_ 4 Agent/TFRCSink set discount_ 0 Agent/TFRC set df_ 0.25 Agent/TFRC set ca_ 0 $self next pktTraceFile}Class Test/impulseMultReportCA -superclass TestSuiteTest/impulseMultReportCA instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulseMultReportCA set guide_ \ "TFRC with feedback four times per RTT, discount_ false, ca_ true." Agent/TFRCSink set NumFeedback_ 4 Agent/TFRCSink set discount_ 0 Agent/TFRC set df_ 0.95 Agent/TFRC set ca_ 1 Test/impulseMultReportCA instproc run {} [Test/impulseMultReport info instbody run ] $self next pktTraceFile}Test/impulseMultReport instproc run {} { global quiet $self instvar ns_ node_ testName_ interval_ dumpfile_ guide_ if {$quiet == "false"} {puts $guide_} $self setTopo set interval_ 0.1 set stopTime 40.0 set stopTime0 [expr $stopTime - 0.001] set stopTime2 [expr $stopTime + 0.001] set dumpfile_ [open temp.s w] if {$quiet == "false"} { set tracefile [open all.tr w] $ns_ trace-all $tracefile } set tf1 [$ns_ create-connection TFRC $node_(s1) TFRCSink $node_(s3) 0] $ns_ at 0.0 "$tf1 start" set tf2 [$ns_ create-connection TFRC $node_(s2) TFRCSink $node_(s4) 1] $ns_ at 10.0 "$tf2 start" $ns_ at 20.0 "$tf2 stop" $self tfccDump 1 $tf1 $interval_ $dumpfile_ $self tfccDump 2 $tf2 $interval_ $dumpfile_ $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_" #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_] $ns_ at $stopTime "$self cleanupAll $testName_" if {$quiet == "false"} { $ns_ at $stopTime2 "close $tracefile" } $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0" # trace only the bottleneck link $ns_ run}Class Test/impulseTcp -superclass TestSuiteTest/impulseTcp instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ impulseTcp set guide_ \ "TFRC with discount_, smooth_, and ca_ false." $self next pktTraceFile}Test/impulseTcp instproc run {} { global quiet $self instvar ns_ node_ testName_ interval_ dumpfile_ guide_ if {$quiet == "false"} {puts $guide_} $self setTopo set interval_ 0.1 set stopTime 40.0 set stopTime0 [expr $stopTime - 0.001] set stopTime2 [expr $stopTime + 0.001] set dumpfile_ [open temp.s w] if {$quiet == "false"} { set tracefile [open all.tr w] $ns_ trace-all $tracefile } set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(s3) 0] set ftp1 [$tcp1 attach-app FTP] $ns_ at 0.0 "$ftp1 start" set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s2) TCPSink/Sack1 $node_(s4) 1] set ftp2 [$tcp2 attach-app FTP] $ns_ at 10.0 "$ftp2 start" $ns_ at 20.0 "$ftp2 stop" $self tfccDump 1 $tcp1 $interval_ $dumpfile_ $self tfccDump 2 $tcp2 $interval_ $dumpfile_ $ns_ at $stopTime0 "close $dumpfile_; $self finish_1 $testName_" #$self traceQueues $node_(r1) [$self openTrace $stopTime $testName_] $ns_ at $stopTime "$self cleanupAll $testName_" if {$quiet == "false"} { $ns_ at $stopTime2 "close $tracefile" } $ns_ at $stopTime2 "exec cp temp2.rands temp.rands; exit 0" # trace only the bottleneck link $ns_ run}# Two TFRC connections and three TCP connections.Class Test/two-friendly -superclass TestSuiteTest/two-friendly instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ two-friendly set guide_ \ "Two TFRC and three TCP connections, ca_ false." Agent/TFRC set df_ 0.25 Agent/TFRC set ca_ 0 Agent/TCP set timerfix_ false # The default is being changed to true. $self next pktTraceFile}# Two TFRC connections and three TCP connections.Class Test/two-friendlyCA -superclass TestSuiteTest/two-friendlyCA instproc init {} { $self instvar net_ test_ guide_ set net_ net2 set test_ two-friendlyCA Agent/TFRCSink set discount_ 0 set guide_ \ "Two TFRC and three TCP connections, ca_ true." Agent/TFRC set df_ 0.95 Agent/TFRC set ca_ 1 Agent/TCP set timerfix_ false # The default is being changed to true. Test/two-friendlyCA instproc run {} [Test/two-friendly info instbody run ] $self next pktTraceFile}Test/two-friendly instproc run {} { global quiet $self instvar ns_ node_ testName_ interval_ dumpfile_ guide_ if {$quiet == "false"} {puts $guide_} $self setTopo set interval_ 0.1 set stopTime 30.0 set stopTime0 [expr $stopTime - 0.001] set stopTime2 [expr $stopTime + 0.001] set dumpfile_ [open temp.s w] if {$quiet == "false"} {
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -