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

📄 test-suite-pushback.tcl

📁 这个软件的功能是实现多播协议
💻 TCL
📖 第 1 页 / 共 2 页
字号:
    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 flow.#Class Test/slowgrow -superclass TestSuiteTest/slowgrow instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ slowgrow    $self next 0}Test/slowgrow instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_    $self setTopo    $self setup1    $ns_ run}## one complete test with CBR flows only, no pushback and no ACC.# Slowly-growing bad flow, but with local ACC.#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 0}######################################################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 flow.#Class Test/demo -superclass TestSuiteTest/demo instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ demo    $self next 0}Test/demo instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_    $self setTopo    $self setup6    $ns_ run}## Slowly-growing bad flow, but with 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 0}######################################################33TestSuite 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    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 0.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 0.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 0.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 0.3 "$ftp4 start"    set tcp5 [$ns_ create-connection TCP/Sack1 $node_(s0) TCPSink/Sack1 $node_(d1) 6 ]    $tcp5 set window_ 4    set ftp5 [$tcp5 attach-app FTP]    $ns_ at 0.4 "$ftp5 start"    # bad traffic    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    set maxAggregates_ 6    $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"    $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 flow.#Class Test/tcp -superclass TestSuiteTest/tcp instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ tcp    $self next 0}Test/tcp instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_    $self setTopo    $self setup4    $ns_ run}## one complete test with CBR flows only, no pushback and no ACC.# Slowly-growing bad flow, 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 0}######################################################33TestSuite 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 TestSuiteTest/onoff instproc init {} {    $self instvar net_ test_    set net_ net2     set test_ onoff    $self next 0}Test/onoff instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_    $self setTopo    $self setup5    $ns_ run}##Class Test/onoff-acc -superclass TestSuiteTest/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 0}######################################################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_"}## one complete test with 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 0}Test/A_noACC instproc run {} {    $self instvar ns_ node_ testName_ net_ topo_    $self setTopo    $self setup2    $ns_ run}# With ACC only.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 0}# With 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 0}TestSuite runTest

⌨️ 快捷键说明

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