📄 test-suite-cbq.tcl
字号:
# Figure 12 from the link-sharing paper.# WRR, Ancestor-Only link-sharing.# ~/newr/rm/testA.com# Class Test/AO -superclass TestSuiteTest/AO instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-wrr set test_ CBQ_AO $self next 0}Test/AO instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ set stopTime 40.1 set maxbytes 187500 set cbqalgorithm_ ancestor-only $topo_ instvar cbqlink_ $self create_twoagency $self insert_twoagency $cbqlink_ $self four_cbrs $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_AO $ns_ run}## Figure 13 from the link-sharing paper.# WRR, Top link-sharing.# ~/newr/rm/testA.com#Class Test/TL -superclass TestSuiteTest/TL instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-wrr set test_ CBQ_TL $self next 0}Test/TL instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ set stopTime 40.1 set maxbytes 187500 set cbqalgorithm_ top-level $topo_ instvar cbqlink_ $self create_twoagency $self insert_twoagency $cbqlink_ $self four_cbrs $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_TL $ns_ run}### I AM HERE## Figure 11 from the link-sharing paper.# WRR, Formal (new) link-sharing.# ~/newr/rm/testA.com#Class Test/FORMAL -superclass TestSuiteTest/FORMAL instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-wrr set test_ CBQ_FORMAL $self next 0}Test/FORMAL instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ set stopTime 40.1 set maxbytes 187500 set cbqalgorithm_ formal $topo_ instvar cbqlink_ $self create_twoagency $self insert_twoagency $cbqlink_ $self four_cbrs $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_FORMAL $ns_ run}TestSuite instproc finish_max tname { global quiet $self instvar ns_ tchan_ testName_ exec ../../bin/getrc -s 2 -d 3 out.tr | \ ../../bin/raw2xg -s 0.01 -m 90 -t $tname > temp.rands if {$quiet == "false"} { exec xgraph -bb -tk -nl -m -x time -y packets temp.rands & } ## now use default graphing tool to make a data file ## if so desired if { [info exists tchan_] && $quiet == "false" } { $self plotQueue $testName_ } $ns_ halt}## Figure 11 from the link-sharing paper, but Formal (old) link-sharing.# WRR. # ~/newr/rm/testA.com DELETED## # To send five back-to-back packets for $audClass,# maxidle should be 0.004 seconds# To send 50 back-to-back packets, maxidle should be 0.25 secondsClass Test/MAX1 -superclass TestSuiteTest/MAX1 instproc init topo { $self instvar net_ defNet_ test_ Queue set limit_ 1000 set net_ $topo set defNet_ cbq1-wrr set test_ CBQ_MAX1 $self next 0}Test/MAX1 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 2.1 set maxbytes 187500 set cbqalgorithm_ formal $topo_ instvar cbqlink_ $self create_flat2 0.25 0 $self insert_flat2 $cbqlink_ $self two_cbrs 1000 1000 0.001 0.01 1 [$cbqlink_ queue] algorithm $cbqalgorithm_ TestSuite instproc finish tname { $self finish_max $tname } $self traceQueues $node_(r1) [$self openTrace $stopTime CBQ_MAX1] $ns_ run}Class Test/MAX2 -superclass TestSuiteTest/MAX2 instproc init topo { $self instvar net_ defNet_ test_ Queue set limit_ 1000 set net_ $topo set defNet_ cbq1-wrr set test_ CBQ_MAX2 $self next 0}Test/MAX2 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 2.1 set maxbytes 187500 set cbqalgorithm_ formal $topo_ instvar cbqlink_ $self create_flat2 0.004 0 $self insert_flat2 $cbqlink_ $self two_cbrs 1000 1000 0.001 0.01 1 [$cbqlink_ queue] algorithm $cbqalgorithm_ TestSuite instproc finish tname { $self finish_max $tname } $self traceQueues $node_(r1) [$self openTrace $stopTime CBQ_MAX2] $ns_ run}## Set "extradelay" to 0.024 seconds for a steady-state burst of 2 #Class Test/EXTRA1 -superclass TestSuiteTest/EXTRA1 instproc init topo { $self instvar net_ defNet_ test_ Queue set limit_ 1000 set net_ $topo set defNet_ cbq1-prr set test_ CBQ_EXTRA1 $self next 0}Test/EXTRA1 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 2.1 set maxbytes 187500 set cbqalgorithm_ formal $topo_ instvar cbqlink_ $self create_flat2 auto 0.024 $self insert_flat2 $cbqlink_ $self two_cbrs 1000 1000 0.015 0.01 0 [$cbqlink_ queue] algorithm $cbqalgorithm_ TestSuite instproc finish tname { $self finish_max $tname } $self traceQueues $node_(r1) [$self openTrace $stopTime CBQ_EXTRA1] $ns_ run}## Set "extradelay" to 0.12 seconds for a steady-state burst of 8 #Class Test/EXTRA2 -superclass TestSuiteTest/EXTRA2 instproc init topo { $self instvar net_ defNet_ test_ Queue set limit_ 1000 set net_ $topo set defNet_ cbq1-prr set test_ CBQ_EXTRA2 $self next 0}Test/EXTRA2 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 2.1 set maxbytes 187500 set cbqalgorithm_ formal $topo_ instvar cbqlink_ $self create_flat2 auto 0.12 $self insert_flat2 $cbqlink_ $self two_cbrs 1000 1000 0.015 0.01 0 [$cbqlink_ queue] algorithm $cbqalgorithm_ TestSuite instproc finish tname { $self finish_max $tname } $self traceQueues $node_(r1) [$self openTrace $stopTime CBQ_EXTRA2] $ns_ run}# With Packet-by-Packet Round-robin, it is necessary either to# set a positive value for extradelay, or a negative value for minidle#Class Test/MIN1 -superclass TestSuiteTest/MIN1 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_MIN1 $self next 0}Test/MIN1 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ set cbqalgorithm_ formal set stopTime 4.1 set maxbytes 187500 $topo_ instvar cbqlink_ $self create_flat false 0 $self insert_flat $cbqlink_ $self three_cbrs $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_MIN1 $ns_ run}## Min2 is deprecated### Min3 is like Min1, except extradelay is set to 0.2#Class Test/MIN3 -superclass TestSuiteTest/MIN3 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_MIN3 $self next 0} Test/MIN3 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ set cbqalgorithm_ formal set stopTime 4.1 set maxbytes 187500 $topo_ instvar cbqlink_ $self create_flat false 0.20 $self insert_flat $cbqlink_ $self three_cbrs $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_MIN3 $ns_ run} ## Min1, but with Ancestor-Only link-sharing.# Class Test/MIN4 -superclass TestSuiteTest/MIN4 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_MIN4 $self next 0} Test/MIN4 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ set cbqalgorithm_ ancestor-only set stopTime 4.1 set maxbytes 187500 $topo_ instvar cbqlink_ $self create_flat false 0 $self insert_flat $cbqlink_ $self three_cbrs $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_MIN4 $ns_ run} ## Min5 is deprecated## ## Min6 is like Min4, except extradelay is set to 0.2#Class Test/MIN6 -superclass TestSuiteTest/MIN6 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_MIN6 $self next 0} Test/MIN6 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ set cbqalgorithm_ ancestor-only set stopTime 4.1 set maxbytes 187500 $topo_ instvar cbqlink_ $self create_flat false 0.20 $self insert_flat $cbqlink_ $self three_cbrs $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_MIN6 $ns_ run} ## With Formal link-sharing, the dataClass gets most of the bandwidth.# With Ancestor-Only link-sharing, the audioClass generally gets# to borrow from the not-overlimit root class.# With Top-Level link-sharing, the audioClass is often blocked# from borrowing by an underlimit dataClass# With Ancestor-Only link-sharing, the top class cannot be# allocated 100% of the link bandwidth.#Class Test/TwoAO -superclass TestSuiteTest/TwoAO instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_TwoAO $self next 0} Test/TwoAO instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 8.1 set maxbytes 187500 set cbqalgorithm_ ancestor-only $topo_ instvar cbqlink_ $self create_flat3 0.98 1.0 $self insert_flat2 $cbqlink_ $self two_cbrs 190 500 0.001 0.002 0 $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_TwoAO $ns_ run} # This has a smaller value for maxidle for the root class. Class Test/TwoAO2 -superclass TestSuiteTest/TwoAO2 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_TwoAO2 $self next 0} Test/TwoAO2 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 8.1 set maxbytes 187500 set cbqalgorithm_ ancestor-only $topo_ instvar cbqlink_ $self create_flat3 0.98 0.005 $self insert_flat2 $cbqlink_ $self two_cbrs 190 500 0.001 0.002 0 $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_TwoAO2 $ns_ run} Class Test/TwoAO3 -superclass TestSuiteTest/TwoAO3 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_TwoAO3 $self next 0} Test/TwoAO3 instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 8.1 set maxbytes 187500 set cbqalgorithm_ ancestor-only $topo_ instvar cbqlink_ $self create_flat3 0.99 auto $self insert_flat2 $cbqlink_ $self two_cbrs 190 500 0.001 0.002 0 $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_TwoAO3 $ns_ run} ## With Formal link-sharing, the dataClass gets most of the bandwidth.# With Ancestor-Only link-sharing, the audioClass generally gets# to borrow from the not-overlimit root class.# With Top-Level link-sharing, the audioClass is often blocked# from borrowing by an underlimit dataClass#Class Test/TwoTL -superclass TestSuiteTest/TwoTL instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_TwoTL $self next 0} Test/TwoTL instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 8.1 set maxbytes 187500 set cbqalgorithm_ top-level $topo_ instvar cbqlink_ $self create_flat3 1.0 auto $self insert_flat2 $cbqlink_ $self two_cbrs 190 500 0.001 0.002 0 $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_TwoTL $ns_ run} ## With Formal link-sharing, the dataClass gets most of the bandwidth.# With Ancestor-Only link-sharing, the audioClass generally gets# to borrow from the not-overlimit root class.# With Top-Level link-sharing, the audioClass is often blocked# from borrowing by an underlimit dataClass#Class Test/TwoF -superclass TestSuiteTest/TwoF instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ cbq1-prr set test_ CBQ_TwoF $self next 0} Test/TwoF instproc run {} { $self instvar cbqalgorithm_ ns_ net_ topo_ node_ set stopTime 8.1 set maxbytes 187500 set cbqalgorithm_ formal $topo_ instvar cbqlink_ $self create_flat3 1.0 auto $self insert_flat2 $cbqlink_ $self two_cbrs 190 500 0.001 0.002 0 $self make_fmon $cbqlink_ [$cbqlink_ queue] algorithm $cbqalgorithm_ $self cbrDump4 $cbqlink_ 1.0 $stopTime $maxbytes $self openTrace $stopTime CBQ_TwoF $ns_ run} TestSuite runTest
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -