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

📄 test-suite-full.tcl

📁 这个软件的功能是实现多播协议
💻 TCL
📖 第 1 页 / 共 3 页
字号:
Class Test/ecn1 -superclass TestSuiteTest/ecn1 instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0-lossy	set test_ ecn1	$self next}Test/ecn1 instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "ecn1: confused by >1 err models..abort"		exit 1	}	$errmodel set offset_ 10.0	$errmodel set period_ 30.0	$errmodel set markecn_ true; # mark ecn's, don't drop	# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$ns_ connect $src $sink	# set up TCP-level connections	$sink listen	set ftp1 [$src attach-app FTP]	$ns_ at 0.7 "$ftp1 start"	# set up special params for this test	$src set window_ 100	$src set delay_growth_ true	$src set tcpTick_ 0.500	$src set packetSize_ 576	$src set ecn_ true	$sink set ecn_ true	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}Class Test/ecn2 -superclass TestSuiteTest/ecn2 instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0-lossy	set test_ ecn2	$self next}Test/ecn2 instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "ecn2: confused by >1 err models..abort"		exit 1	}	#$errmodel set offset_ 30.0	$errmodel set offset_ 130.0	$errmodel set period_ 100.0	$errmodel set markecn_ true; # mark ecn's, don't drop	# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$ns_ connect $src $sink	# set up TCP-level connections	$sink listen	set ftp1 [$src attach-app FTP]	$ns_ at 0.7 "$ftp1 start"	# set up special params for this test	$src set window_ 100	$src set delay_growth_ true	$src set tcpTick_ 0.500	$src set packetSize_ 576	$src set ecn_ true	$sink set ecn_ true	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}Class Test/droppedfin -superclass TestSuiteTest/droppedfin instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0-lossy	set test_ droppedfin	$self next}Test/droppedfin instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "droppedfin: confused by >1 err models..abort"		exit 1	}	$errmodel set offset_ 10.0	$errmodel set period_ 100.0	# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$ns_ connect $src $sink	# set up TCP-level connections	$sink listen	set ftp1 [$src attach-app FTP]	$ns_ at 0.7 "$ftp1 start"	$ns_ at 1.5 "$src close"	# set up special params for this test	$src set window_ 100	$src set delay_growth_ true	$src set tcpTick_ 0.500	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}Class Test/smallpkts -superclass TestSuiteTest/smallpkts instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0	set test_ smallpkts	$self next}Test/smallpkts instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$sink set interval_ 200ms	$ns_ connect $src $sink	# set up TCP-level connections	$sink listen	$ns_ at 0.5 "$src advance-bytes 30"	$ns_ at 0.75 "$src advance-bytes 300"	# set up special params for this test	$src set window_ 100	$src set delay_growth_ true	$src set tcpTick_ 0.500	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## this test sets the receiver's notion of the mss larger than# the sender and sets segsperack to 3.  So, only if there is# > 3*4192 bytes accumulated would an ACK occur [i.e. never].# So, because the# delack timer is set for 200ms, the upshot here is that# we see ACKs as pushed out by this timer only#Class Test/telnet -superclass TestSuiteTest/telnet instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0	set test_ telnet(200ms-delack)	$self next}Test/telnet instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$sink set interval_ 200ms	$sink set segsize_ 4192; # or wait up to 3*4192 bytes to ACK	$sink set segsperack_ 3	$ns_ connect $src $sink	# set up TCP-level connections	$sink listen	set telnet1 [$src attach-app Telnet]	$telnet1 set interval_ 0ms	$ns_ at 0.5 "$telnet1 start"	# set up special params for this test	$src set window_ 100	$src set delay_growth_ true	$src set tcpTick_ 0.500	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## this test is the same as the last one, but changes the# receiver's notion of the mss, delack interval, and segs-per-ack.# The output indicates some places where ACKs are generated due# to the timer and other are due to meeting the segs-per-ack limit# before the timer#Class Test/telnet2 -superclass TestSuiteTest/telnet2 instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0	set test_ telnet2(3segperack-600ms-delack)	$self next}Test/telnet2 instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$sink set interval_ 600ms	$sink set segsize_ 536; # or wait up to 3*536 bytes to ACK	$sink set segsperack_ 3	$ns_ connect $src $sink	# set up TCP-level connections	$sink listen	set telnet1 [$src attach-app Telnet]	$telnet1 set interval_ 0ms	$ns_ at 0.5 "$telnet1 start"	# set up special params for this test	$src set window_ 100	$src set delay_growth_ true	$src set tcpTick_ 0.500	$src set segsize_ 536	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## this test exercises the "slow_start_restart_" option# with ssr set to false, illustrates the line-rate-bursts which occur# after the window has grown large but the app has stopped writes#Class Test/SSR -superclass TestSuiteTest/SSR instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0	set test_ slow-start-restart	$self next}Test/SSR instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$ns_ connect $src $sink	# set up TCP-level connections	$src set slow_start_restart_ false	$sink listen	$ns_ at 0.5 "$src advance-bytes 10000"	$ns_ at 5.0 "$src advance-bytes 10000"	# set up special params for this test	$src set window_ 100	$src set slow_start_restart true	$src set delay_growth_ true	$src set tcpTick_ 0.500	$src set segsize_ 536	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## same test as SSR, but this time turn slow_start_restart on#Class Test/SSR2 -superclass TestSuiteTest/SSR2 instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0	set test_ slow-start-restart-fix	$self next}Test/SSR2 instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$ns_ connect $src $sink	# set up TCP-level connections	$src set slow_start_restart_ true	$sink listen	$ns_ at 0.5 "$src advance-bytes 10000"	$ns_ at 5.0 "$src advance-bytes 10000"	# set up special params for this test	$src set window_ 100	$src set slow_start_restart true	$src set delay_growth_ true	$src set tcpTick_ 0.500	$src set segsize_ 536	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## A test of the timestamp option#Class Test/tsopt -superclass TestSuiteTest/tsopt instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0	set test_ tsopt	$self next}Test/tsopt instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$sink set timestamps_ true	$ns_ connect $src $sink	# set up TCP-level connections	$src set timestamps_ true	$sink listen	$ns_ at 0.5 "$src advance-bytes 100000"	# set up special params for this test	$src set window_ 100	$src set delay_growth_ true	$src set tcpTick_ 0.500	$src set segsize_ 536	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## A test where we are window limited#Class Test/winlimited -superclass TestSuiteTest/winlimited instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0	set test_ winlimited	$self next}Test/winlimited instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 10.0		# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp]	set sink [new Agent/TCP/FullTcp]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	$ns_ connect $src $sink	# set up TCP-level connections	$sink listen	$ns_ at 0.5 "$src advance-bytes 100000"	# set up special params for this test	$src set window_ 5	$src set delay_growth_ true	$src set tcpTick_ 0.500	$src set segsize_ 536	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}TestSuite runTest

⌨️ 快捷键说明

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