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

📄 test-suite-cbq.tcl

📁 柯老师网站上找到的
💻 TCL
📖 第 1 页 / 共 3 页
字号:
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}   ## This tests the dynamic allocation of bandwidth to classes.#Class Test/TwoDynamic -superclass TestSuiteTest/TwoDynamic instproc init topo {         $self instvar net_ defNet_ test_        set net_ $topo        set defNet_ cbq1-prr        set test_ CBQ_TwoDynamic        $self next 0} Test/TwoDynamic instproc run {} {        $self instvar cbqalgorithm_ ns_ net_ topo_ node_        $self instvar topclass_ audioclass_ dataclass_        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_TwoDynamic        $ns_ at 2.0 "$audioclass_ newallot 0.4; $dataclass_ newallot 0.6"        $ns_ at 5.0 "$audioclass_ newallot 0.2; $dataclass_ newallot 0.8"        $ns_ run}## This tests the dynamic allocation of bandwidth to classes.# For this test the two classes have the same priority level.# This is packet-by-packet round robin.## At time 6.0, each class is allocated 80% of the link bandwidth.# Because this is packet-by-packet round robin, bandwidth is distributed# according to the packet sizes of the two classes;  the Audio class# has 190-byte packets, while the Data class has 500-byte packets.#Class Test/TwoDynamic1 -superclass TestSuiteTest/TwoDynamic1 instproc init topo {         $self instvar net_ defNet_ test_        set net_ $topo        set defNet_ cbq1-prr        set test_ CBQ_TwoDynamic1        $self next 0} Test/TwoDynamic1 instproc run {} {        $self instvar cbqalgorithm_ ns_ net_ topo_ node_        $self instvar topclass_ audioclass_ dataclass_        set stopTime 8.1        set maxbytes 187500        set cbqalgorithm_ formal        $topo_ instvar cbqlink_         $self create_flat4 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_TwoDynamic1        $ns_ at 2.0 "$audioclass_ newallot 0.4; $dataclass_ newallot 0.6"        $ns_ at 4.0 "$audioclass_ newallot 0.2; $dataclass_ newallot 0.8"	$ns_ at 6.0 "$audioclass_ newallot 0.8; $dataclass_ newallot 0.8"        $ns_ run}# This tests the dynamic allocation of bandwidth to classes.# For this test the two classes have the same priority level.# This is weighted round robin.## At time 6.0, each class is allocated 80% of the link bandwidth.# Because this is weighted round robin, each class receives# half of the link bandwidth. #Class Test/TwoDynamic1WRR -superclass TestSuiteTest/TwoDynamic1WRR instproc init topo {         $self instvar net_ defNet_ test_        set net_ $topo        set defNet_ cbq1-wrr        set test_ CBQ_TwoDynamic1WRR        $self next 0} Test/TwoDynamic1WRR instproc run {} {        $self instvar cbqalgorithm_ ns_ net_ topo_ node_        $self instvar topclass_ audioclass_ dataclass_        set stopTime 8.1        set maxbytes 187500        set cbqalgorithm_ formal        $topo_ instvar cbqlink_         $self create_flat4 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_TwoDynamic1WRR        $ns_ at 2.0 "$audioclass_ newallot 0.4; $dataclass_ newallot 0.6"        $ns_ at 4.0 "$audioclass_ newallot 0.2; $dataclass_ newallot 0.8"	$ns_ at 6.0 "$audioclass_ newallot 0.8; $dataclass_ newallot 0.8"        $ns_ run}# This tests the dynamic allocation of bandwidth to classes.# For this test the two classes have the same priority level.# This is weighted round robin.## The purpose of this test is to illustrate the number of bytes# in a single round of the weighted round robin.#Class Test/TwoWRR -superclass TestSuiteTest/TwoWRR instproc init topo {         $self instvar net_ defNet_ test_        set net_ $topo        set defNet_ cbq1-wrr        set test_ CBQ_TwoWRR        $self next 0} Test/TwoWRR instproc run {} {        $self instvar cbqalgorithm_ ns_ net_ topo_ node_ test_        $self instvar topclass_ audioclass_ dataclass_        set stopTime 0.4        set maxbytes 187500        set cbqalgorithm_ formal        $topo_ instvar cbqlink_ 	$self create_flat4 1.0 auto 0.039 .961 200        $self insert_flat2 $cbqlink_	$self two_cbrs 40 1000 0.002 0.005 0        $self make_fmon $cbqlink_        [$cbqlink_ queue] algorithm $cbqalgorithm_ 	TestSuite instproc finish tname { $self finish_max $tname }	$self traceQueues $node_(r1) [$self openTrace $stopTime $test_]	$ns_ at 0.1 "$audioclass_ newallot 0.075; $dataclass_ newallot 0.925"	$ns_ at 0.2 "$audioclass_ newallot 0.138; $dataclass_ newallot 0.862"	$ns_ at 0.3 "$audioclass_ newallot 0.069; $dataclass_ newallot 0.431"        $ns_ run}TestSuite runTest

⌨️ 快捷键说明

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