📄 test-suite-pushback.tcl
字号:
TestSuite instproc setup4 {} { $self instvar ns_ node_ testName_ net_ topo_ cbr_ cbr2_ packetsize_ $self instvar maxAggregates_ set stoptime 60.0 #set dumptime 5.0 set dumptime 1.0 #set stoptime 5.0 set stoptime1 [expr $stoptime + 1.0] set packetsize_ 200 Application/Traffic/CBR set random_ 0 Application/Traffic/CBR set packetSize_ $packetsize_ Agent/TCP set packetSize_ $packetsize_ set slink [$ns_ link $node_(r0) $node_(r1)]; # link to collect stats on set fmon [$ns_ makeflowmon Fid] $ns_ attach-fmon $slink $fmon $self manytcps 0 set maxAggregates_ 6 $self badcbr $self statsDump $dumptime $fmon $packetsize_ 0 # trace only the bottleneck link #$self traceQueues $node_(r1) [$self openTrace $stoptime $testName_] $ns_ at $stoptime1 "$self cleanupAll $testName_"}## Slowly-growing CBR aggregate competing against small TCP aggregates. # No ACC.#Class Test/tcp -superclass TestSuiteTest/tcp instproc init {} { $self instvar net_ test_ set net_ net2 set test_ tcp $self next noTraceFiles}Test/tcp instproc run {} { $self instvar ns_ node_ testName_ net_ topo_ $self setTopo $self setup4 $ns_ run}## Slowly-growing CBR aggregate competing against small TCP aggregates. # No pushback, but with local ACC.#Class Test/tcp-acc -superclass TestSuiteTest/tcp-acc instproc init {} { $self instvar net_ test_ set net_ net2 set test_ tcp-acc Queue/RED/Pushback set rate_limiting_ 1 Test/tcp-acc instproc run {} [Test/tcp info instbody run] $self next noTraceFiles}TestSuite instproc setup4a {} { $self instvar ns_ node_ testName_ net_ topo_ cbr_ cbr2_ packetsize_ $self instvar maxAggregates_ set stoptime 60.0 #set dumptime 5.0 set dumptime 1.0 #set stoptime 5.0 set stoptime1 [expr $stoptime + 1.0] set packetsize_ 200 Application/Traffic/CBR set random_ 0 Application/Traffic/CBR set packetSize_ $packetsize_ Agent/TCP set packetSize_ $packetsize_ set slink [$ns_ link $node_(r0) $node_(r1)]; # link to collect stats on set fmon [$ns_ makeflowmon Fid] $ns_ attach-fmon $slink $fmon $self manytcps 0 $self manytcps 1 $self manytcps 2 $self manytcps 3 $self manytcps 4 $self manytcps 5 set maxAggregates_ 6 $self badcbr $self statsDump $dumptime $fmon $packetsize_ 0 # trace only the bottleneck link #$self traceQueues $node_(r1) [$self openTrace $stoptime $testName_] $ns_ at $stoptime1 "$self cleanupAll $testName_"}## Slowly-growing CBR aggregate competing against large TCP aggregates. # No ACC.#Class Test/tcp1 -superclass TestSuiteTest/tcp1 instproc init {} { $self instvar net_ test_ set net_ net2 set test_ tcp1 $self next noTraceFiles}Test/tcp1 instproc run {} { $self instvar ns_ node_ testName_ net_ topo_ $self setTopo $self setup4a $ns_ run}## Slowly-growing CBR aggregate competing against large TCP aggregates.# No pushback, but with local ACC.#Class Test/tcp1-acc -superclass TestSuiteTest/tcp1-acc instproc init {} { $self instvar net_ test_ set net_ net2 set test_ tcp1-acc Queue/RED/Pushback set rate_limiting_ 1 Test/tcp1-acc instproc run {} [Test/tcp1 info instbody run] $self next noTraceFiles}TestSuite instproc setup4b {} { $self instvar ns_ node_ testName_ net_ topo_ cbr_ cbr2_ packetsize_ $self instvar maxAggregates_ set stoptime 60.0 #set dumptime 5.0 set dumptime 1.0 #set stoptime 5.0 set stoptime1 [expr $stoptime + 1.0] set packetsize_ 200 Application/Traffic/CBR set random_ 0 Application/Traffic/CBR set packetSize_ $packetsize_ Agent/TCP set packetSize_ $packetsize_ set slink [$ns_ link $node_(r0) $node_(r1)]; # link to collect stats on set fmon [$ns_ makeflowmon Fid] $ns_ attach-fmon $slink $fmon $self manytcps 0 $self manytcps 1 $self manytcps 2 $self manytcps 3 $self manytcps 4 $self manytcps 5 set maxAggregates_ 6 $self badtcps $self badtcps $self badtcps $self badtcps $self badtcps $self badtcps $self badtcps $self badtcps $self badtcps $self badtcps $self badtcps $self statsDump $dumptime $fmon $packetsize_ 0 # trace only the bottleneck link #$self traceQueues $node_(r1) [$self openTrace $stoptime $testName_] $ns_ at $stoptime1 "$self cleanupAll $testName_"}## Slowly-growing TCP aggregate competing against large TCP aggregates. # No ACC.#Class Test/tcp2 -superclass TestSuiteTest/tcp2 instproc init {} { $self instvar net_ test_ set net_ net2 set test_ tcp2 $self next noTraceFiles}Test/tcp2 instproc run {} { $self instvar ns_ node_ testName_ net_ topo_ $self setTopo $self setup4b $ns_ run}## Slowly-growing TCP aggregate competing against large TCP aggregates. # No pushback, but with local ACC.#Class Test/tcp2-acc -superclass TestSuiteTest/tcp2-acc instproc init {} { $self instvar net_ test_ set net_ net2 set test_ tcp2-acc Queue/RED/Pushback set rate_limiting_ 1 Test/tcp2-acc instproc run {} [Test/tcp2 info instbody run] $self next noTraceFiles}######################################################33## TestSuite instproc setup5 {} {## $self instvar ns_ node_ testName_ net_ topo_ cbr_ cbr2_ packetsize_## $self instvar maxAggregates_## ## set stoptime 100.0## #set stoptime 5.0## #set dumptime 5.0## set dumptime 1.0## set stoptime1 [expr $stoptime + 1.0]## set packetsize_ 200## Application/Traffic/CBR set random_ 0## Application/Traffic/CBR set packetSize_ $packetsize_## ## set slink [$ns_ link $node_(r0) $node_(r1)]; # link to collect stats on## set fmon [$ns_ makeflowmon Fid]## $ns_ attach-fmon $slink $fmon## ## set udp1 [$ns_ create-connection UDP $node_(s0) Null $node_(d0) 1]## set cbr1 [$udp1 attach-app Traffic/CBR]## $cbr1 set rate_ 0.12Mb## $cbr1 set random_ 0.005## ## set udp2 [$ns_ create-connection UDP $node_(s1) Null $node_(d1) 2]## set cbr2 [$udp2 attach-app Traffic/CBR]## $cbr2 set rate_ 0.08Mb## $cbr2 set random_ 0.005## ## # bad traffic## set udp [$ns_ create-connection UDP $node_(s0) Null $node_(d1) 3]## set cbr_ [$udp attach-app Traffic/CBR]## $cbr_ set rate_ 0.5Mb## $cbr_ set random_ 0.001## $ns_ at 0.0 "$cbr_ start"## ## set udp4 [$ns_ create-connection UDP $node_(s1) Null $node_(d0) 4]## set cbr4 [$udp4 attach-app Traffic/CBR]## $cbr4 set rate_ 0.07Mb## $cbr4 set random_ 0.005## ## set udp5 [$ns_ create-connection UDP $node_(s0) Null $node_(d0) 5]## set cbr5 [$udp5 attach-app Traffic/CBR]## $cbr5 set rate_ 0.06Mb## $cbr5 set random_ 0.005## ## set udp6 [$ns_ create-connection UDP $node_(s0) Null $node_(d0) 6]## set cbr6 [$udp6 attach-app Traffic/CBR]## $cbr6 set rate_ 0.05Mb## $cbr6 set random_ 0.005## ## ## set maxAggregates_ 6## ## $ns_ at 0.2 "$cbr1 start"## $ns_ at 0.1 "$cbr2 start"## $ns_ at 0.3 "$cbr4 start"## $ns_ at 0.4 "$cbr5 start"## ## $self statsDump $dumptime $fmon $packetsize_ 0## # trace only the bottleneck link## #$self traceQueues $node_(r1) [$self openTrace $stoptime $testName_]## $ns_ at $stoptime1 "$self cleanupAll $testName_"## }## ## ### ### Class Test/onoff -superclass TestSuite## Test/onoff instproc init {} {## $self instvar net_ test_## set net_ net2 ## set test_ onoff## $self next noTraceFiles## }## Test/onoff instproc run {} {## $self instvar ns_ node_ testName_ net_ topo_## $self setTopo## $self setup5## $ns_ run## }## ## ### ### Class Test/onoff-acc -superclass TestSuite## Test/onoff-acc instproc init {} {## $self instvar net_ test_## set net_ net2 ## set test_ onoff-acc## Queue/RED/Pushback set rate_limiting_ 1## Test/onoff-acc instproc run {} [Test/onoff info instbody run]## $self next noTraceFiles## }## ######################################################33TestSuite instproc setup2 {} { $self instvar ns_ node_ testName_ net_ topo_ cbr_ cbr2_ packetsize_ $self instvar maxAggregates_ set stoptime 100.0 set dumptime 1.0 set stoptime1 [expr $stoptime + 1.0] set packetsize_ 200 Application/Traffic/CBR set random_ 0 Application/Traffic/CBR set packetSize_ $packetsize_ set slink [$ns_ link $node_(r0) $node_(r1)]; # link to collect stats on set fmon [$ns_ makeflowmon Fid] $ns_ attach-fmon $slink $fmon set udp1 [$ns_ create-connection UDP $node_(s2) Null $node_(d0) 1] set cbr1 [$udp1 attach-app Traffic/CBR] $cbr1 set rate_ 0.2Mb $cbr1 set random_ 0.001 set udp2 [$ns_ create-connection UDP $node_(s3) Null $node_(d0) 2] set cbr2_ [$udp2 attach-app Traffic/CBR] $cbr2_ set rate_ 0.2Mb $cbr2_ set random_ 0.001 # bad traffic set udp [$ns_ create-connection UDP $node_(s0) Null $node_(d1) 3] set cbr_ [$udp attach-app Traffic/CBR] $cbr_ set rate_ 3.0Mb $cbr_ set random_ 0.001 $ns_ at 0.0 "$cbr_ start" # poor traffic set udp6 [$ns_ create-connection UDP $node_(s1) Null $node_(d1) 3] set cbr6_ [$udp attach-app Traffic/CBR] $cbr6_ set rate_ 0.2Mb $cbr6_ set random_ 0.001 $ns_ at 0.0 "$cbr6_ start" set maxAggregates_ 3 $ns_ at 0.2 "$cbr1 start" $ns_ at 0.1 "$cbr2_ start" $self statsDump $dumptime $fmon $packetsize_ 0 # trace only the bottleneck link #$self traceQueues $node_(r1) [$self openTrace $stoptime $testName_] $ns_ at $stoptime1 "$self cleanupAll $testName_"}## CBR flows only, no pushback and no local ACC#Class Test/A_noACC -superclass TestSuiteTest/A_noACC instproc init {} { $self instvar net_ test_ set net_ net3 set test_ A_noACC $self next noTraceFiles}Test/A_noACC instproc run {} { $self instvar ns_ node_ testName_ net_ topo_ $self setTopo $self setup2 $ns_ run}## CBR flows only, local ACC#Class Test/A_ACC -superclass TestSuiteTest/A_ACC instproc init {} { $self instvar net_ test_ set net_ net3 set test_ A_ACC Queue/RED/Pushback set rate_limiting_ 1 Agent/Pushback set enable_pushback_ 0 Test/A_ACC instproc run {} [Test/A_noACC info instbody run] $self next noTraceFiles}## CBR flows only, local and Pushback.#Class Test/A_Push -superclass TestSuiteTest/A_Push instproc init {} { $self instvar net_ test_ set net_ net3 set test_ A_Push Queue/RED/Pushback set rate_limiting_ 1 Agent/Pushback set enable_pushback_ 1 Test/A_Push instproc run {} [Test/A_noACC info instbody run] $self next noTraceFiles}TestSuite runTest
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -