⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 test-suite-pushback.tcl

📁 跑leach需要的
💻 TCL
📖 第 1 页 / 共 3 页
字号:
    $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_"}## one complete test with CBR flows only, no pushback and no ACC.#Class Test/cbrs -superclass TestSuiteTest/cbrs instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ cbrs    $self next noTraceFiles}Test/cbrs instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_    $self setTopo    $self setup    $ns_ run}## one complete test with CBR flows only, with ACC.#Class Test/cbrs-acc -superclass TestSuiteTest/cbrs-acc instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ cbrs-acc    Queue/RED/Pushback set rate_limiting_ 1    Test/cbrs-acc instproc run {} [Test/cbrs info instbody run]    $self next noTraceFiles}## one complete test with CBR flows only, with no ACC# CBR flows flows starting and stopping #Class Test/cbrs1 -superclass TestSuiteTest/cbrs1 instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ cbrs1    $self next noTraceFiles}Test/cbrs1 instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_ cbr_ cbr2_    $self setTopo    $self setup    $ns_ at 10.0 "$cbr_ set rate_ 0.1Mb"    $ns_ at 15.0 "$cbr2_ set rate_ 0.5Mb"    $ns_ run}## one complete test with CBR flows only, with ACC # CBR flows flows starting and stopping #Class Test/cbrs-acc1 -superclass TestSuiteTest/cbrs-acc1 instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ cbrs-acc1    Queue/RED/Pushback set rate_limiting_ 1    Test/cbrs-acc1 instproc run {} [Test/cbrs1 info instbody run]    $self next noTraceFiles}TestSuite instproc setup1 {} {    $self instvar ns_ node_ testName_ net_ topo_ cbr_ cbr2_ packetsize_    $self instvar maxAggregates_    set stoptime 50.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.001    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    $self new-cbr $node_(s0) $node_(d0) $packetsize_ 0.12Mb 1 0.1     $self new-cbr $node_(s1) $node_(d1) $packetsize_ 0.08Mb 2 0.2    $self new-cbr $node_(s1) $node_(d1) $packetsize_ 0.07Mb 3 0.3    $self new-cbr $node_(s1) $node_(d1) $packetsize_ 0.06Mb 4 0.4    $self new-cbr $node_(s1) $node_(d1) $packetsize_ 0.04Mb 5 0.5    # bad traffic    set cbr_ [$self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.09Mb 5 0.0]    set maxAggregates_ 5    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.1Mb 5 13.0 39.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.1Mb 5 14.0 38.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 15.0 37.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 16.0 36.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 17.0 35.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 18.0 34.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 19.0 33.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 20.0 32.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 21.0 31.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 22.0 30.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 23.0 29.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 24.0 28.0    $self new-cbr $node_(s0) $node_(d1) $packetsize_ 0.05Mb 5 25.0 27.0    $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_"}## one complete test with CBR flows only, no pushback and no ACC.# Slowly-growing bad CBR aggregate.#Class Test/slowgrow -superclass TestSuiteTest/slowgrow instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ slowgrow    $self next noTraceFiles}Test/slowgrow instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_    $self setTopo    $self setup1    $ns_ run}## one complete test with CBR flows only, with ACC.# Slowly-growing bad CBR aggregate.#Class Test/slowgrow-acc -superclass TestSuiteTest/slowgrow-acc instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ slowgrow-acc    Queue/RED/Pushback set rate_limiting_ 1    Test/slowgrow-acc instproc run {} [Test/slowgrow info instbody run]    $self next noTraceFiles}######################################################33TestSuite instproc setup6 {} {    $self instvar ns_ node_ testName_ net_ topo_ cbr_ cbr2_ packetsize_    $self instvar maxAggregates_    set stoptime 50.0    #set dumptime 5.0    set dumptime 1.0    #set stoptime 5.0    set stoptime1 [expr $stoptime + 1.0]    set packetsize_ 500    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    Application/Traffic/CBR set random_ 0.001     $self new-cbr $node_(s0) $node_(d0) 500 0.12Mb 1 0.1     $self new-tcp $node_(s0) $node_(d0) 500 10 2 1.2    $self new-tcp $node_(s1) $node_(d1) 500 10 3 2.3    $self new-tcp $node_(s1) $node_(d1) 500 10 3 3.4    $self new-tcp $node_(s0) $node_(d1) 500 10 4 5.6    $self new-tcp $node_(s0) $node_(d1) 500 10 4 6.7    $self new-tcp $node_(s1) $node_(d0) 500 20 4 7.7    # bad traffic    set cbr_ [$self new-cbr $node_(s0) $node_(d1) 500 0.1Mb 5 0.0]    $cbr_ set random_ 0.001    set maxAggregates_ 6    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 13.0 39.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 14.0 38.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 15.0 37.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 16.0 36.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 17.0 35.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 18.0 34.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 19.0 33.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 20.0 32.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 21.0 31.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 22.0 30.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 23.0 29.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 24.0 28.0    $self new-cbr $node_(s0) $node_(d1) 500 0.05Mb 5 25.0 27.0    $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 bad CBR aggregate, competing TCP and CBR traffic, no ACC.#Class Test/demo -superclass TestSuiteTest/demo instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ demo    $self next noTraceFiles}Test/demo instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_    $self setTopo    $self setup6    $ns_ run}## Slowly-growing bad CBR aggregate, competing TCP and CBR traffic, local ACC.#Class Test/demo-acc -superclass TestSuiteTest/demo-acc instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ demo-acc    Queue/RED/Pushback set rate_limiting_ 1    Test/demo-acc instproc run {} [Test/demo info instbody run]    $self next noTraceFiles}######################################################33TestSuite instproc manytcps {starttime} {    $self instvar ns_ node_    set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s0) TCPSink/Sack1 $node_(d0) 1 ]    $tcp1 set window_ 10    set ftp1 [$tcp1 attach-app FTP]    $ns_ at $starttime.0 "$ftp1 start"    set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 2 ]    $tcp2 set window_ 12    set ftp2 [$tcp2 attach-app FTP]    $ns_ at $starttime.1 "$ftp2 start"    set tcp3 [$ns_ create-connection TCP/Sack1 $node_(s0) TCPSink/Sack1 $node_(d1) 3 ]    $tcp3 set window_ 15    set ftp3 [$tcp3 attach-app FTP]    $ns_ at $starttime.2 "$ftp3 start"    set tcp4 [$ns_ create-connection TCP/Sack1 $node_(s0) TCPSink/Sack1 $node_(d0) 4 ]    $tcp4 set window_ 8    set ftp4 [$tcp4 attach-app FTP]    $ns_ at $starttime.3 "$ftp4 start"    set tcp5 [$ns_ create-connection TCP/Sack1 $node_(s0) TCPSink/Sack1 $node_(d1) 5 ]    $tcp5 set window_ 4    set ftp5 [$tcp5 attach-app FTP]    $ns_ at $starttime.4 "$ftp5 start"}TestSuite instproc badtcps {} {    $self instvar ns_ node_    Agent/TCP set window_ 100    # bad traffic    set tcp [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp set window_ 1000    set ftp [$tcp attach-app FTP]    $ns_ at 11.0 "$ftp start"    $ns_ at 50.0 "$ftp stop"    set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp1 set window_ 1000    set ftp1 [$tcp attach-app FTP]    $ns_ at 12.0 "$ftp1 start"    $ns_ at 49.0 "$ftp1 stop"    set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp2 set window_ 1000    set ftp2 [$tcp attach-app FTP]    $ns_ at 13.0 "$ftp2 start"    $ns_ at 48.0 "$ftp2 stop"    set tcp3 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp3 set window_ 1000    set ftp3 [$tcp attach-app FTP]    $ns_ at 14.0 "$ftp3 start"    $ns_ at 47.0 "$ftp3 stop"    set tcp4 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp4 set window_ 1000    set ftp4 [$tcp attach-app FTP]    $ns_ at 15.0 "$ftp4 start"    $ns_ at 46.0 "$ftp4 stop"    set tcp [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    set ftp [$tcp attach-app FTP]    $ns_ at 16.0 "$ftp start"    $ns_ at 45.0 "$ftp stop"    set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    set ftp1 [$tcp attach-app FTP]    $ns_ at 17.0 "$ftp1 start"    $ns_ at 44.0 "$ftp1 stop"    set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    set ftp2 [$tcp attach-app FTP]    $ns_ at 18.0 "$ftp2 start"    $ns_ at 43.0 "$ftp2 stop"    set tcp3 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    set ftp3 [$tcp attach-app FTP]    $ns_ at 19.0 "$ftp3 start"    $ns_ at 42.0 "$ftp3 stop"    set tcp4 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    set ftp4 [$tcp attach-app FTP]    $ns_ at 20.0 "$ftp4 start"    $ns_ at 41.0 "$ftp4 stop"    set tcp [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp set window_ 1000    set ftp [$tcp attach-app FTP]    $ns_ at 21.0 "$ftp start"    $ns_ at 40.0 "$ftp stop"    set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp1 set window_ 1000    set ftp1 [$tcp attach-app FTP]    $ns_ at 22.0 "$ftp1 start"    $ns_ at 39.0 "$ftp1 stop"    set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp2 set window_ 1000    set ftp2 [$tcp attach-app FTP]    $ns_ at 23.0 "$ftp2 start"    $ns_ at 38.0 "$ftp2 stop"    set tcp3 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp3 set window_ 1000    set ftp3 [$tcp attach-app FTP]    $ns_ at 24.0 "$ftp3 start"    $ns_ at 37.0 "$ftp3 stop"    set tcp4 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(d0) 5 ]    $tcp4 set window_ 1000    set ftp4 [$tcp attach-app FTP]    $ns_ at 25.0 "$ftp4 start"    $ns_ at 36.0 "$ftp4 stop"}TestSuite instproc badcbr {} {    $self instvar ns_ node_    set udp [$ns_ create-connection UDP $node_(s0) Null $node_(d1) 5]    set cbr_ [$udp attach-app Traffic/CBR]    $cbr_ set rate_ 0.1Mb    $cbr_ set random_ 0.001    $ns_ at 0.0 "$cbr_ start"    $ns_ at 11.0 "$cbr_ set rate_ 0.15Mb"    $ns_ at 12.0 "$cbr_ set rate_ 0.2Mb"    $ns_ at 13.0 "$cbr_ set rate_ 0.25Mb"    $ns_ at 14.0 "$cbr_ set rate_ 0.3Mb"    $ns_ at 15.0 "$cbr_ set rate_ 0.35Mb"    $ns_ at 16.0 "$cbr_ set rate_ 0.4Mb"    $ns_ at 17.0 "$cbr_ set rate_ 0.45Mb"    $ns_ at 18.0 "$cbr_ set rate_ 0.5Mb"    $ns_ at 19.0 "$cbr_ set rate_ 0.55Mb"    $ns_ at 20.0 "$cbr_ set rate_ 0.6Mb"    $ns_ at 21.0 "$cbr_ set rate_ 0.65Mb"    $ns_ at 22.0 "$cbr_ set rate_ 0.7Mb"    $ns_ at 23.0 "$cbr_ set rate_ 0.75Mb"    $ns_ at 24.0 "$cbr_ set rate_ 0.8Mb"    $ns_ at 25.0 "$cbr_ set rate_ 0.855Mb"    $ns_ at 37.0 "$cbr_ set rate_ 0.8Mb"    $ns_ at 37.0 "$cbr_ set rate_ 0.75Mb"    $ns_ at 38.0 "$cbr_ set rate_ 0.7Mb"    $ns_ at 39.0 "$cbr_ set rate_ 0.65Mb"    $ns_ at 40.0 "$cbr_ set rate_ 0.6Mb"    $ns_ at 41.0 "$cbr_ set rate_ 0.55Mb"    $ns_ at 42.0 "$cbr_ set rate_ 0.5Mb"    $ns_ at 43.0 "$cbr_ set rate_ 0.45Mb"    $ns_ at 44.0 "$cbr_ set rate_ 0.4Mb"    $ns_ at 45.0 "$cbr_ set rate_ 0.35Mb"    $ns_ at 46.0 "$cbr_ set rate_ 0.3Mb"    $ns_ at 47.0 "$cbr_ set rate_ 0.25Mb"    $ns_ at 48.0 "$cbr_ set rate_ 0.2Mb"    $ns_ at 49.0 "$cbr_ set rate_ 0.15Mb"    $ns_ at 50.0 "$cbr_ set rate_ 0.1Mb"}

⌨️ 快捷键说明

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