test-suite-full-fixes.tcl

来自「一款用来进行网络模拟的软件」· TCL 代码 · 共 746 行 · 第 1/2 页

TCL
746
字号
	# 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 packetSize_ 576	$src set ecn_ true	$sink set ecn_ true	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#                         TCP SACK Tests#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#*************************************************************************# Tests to validate bug fixes to Full-TCP SACK in tcp-full.cc##  sack-send-past-fin -- as long as cwnd allows, sender sends packets even#                        when there is no new data#  sack-ecn-drop-mark -- SACK behavior when seeing 3 DUPACKS after ECN#  sack-burst -- SACK sends large number of old packets#  sack-burst-2 -- SACK sends large number of old packets#  sack-illegal-sack-block -- dropped FIN#  sack-dropwin -- drop a full window of packets#*************************************************************************## sack-send-past-fin#Class Test/sack-send-past-fin -superclass TestSuiteTest/sack-send-past-fin instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0-lossy	set test_ sack-send-past-fin	$self next}Test/sack-send-past-fin instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 3.0		$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "sack-send-past-fin: confused by >1 err models..abort"		exit 1	}	$errmodel set offset_ 11.0	$errmodel set burstlen_ 1	# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp/Sack]	set sink [new Agent/TCP/FullTcp/Sack]	$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 "$ftp1 stop"	# set up special params for this test	$src set window_ 20	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## sack-ecn-drop-mark## This test is to illustrate the bug in the Full-TCP SACK+ECN # implementation that occurs when a packet loss is detected# in the same window of ACKs as an ECN-Echo bit.Class Test/sack-ecn-drop-mark -superclass TestSuiteTest/sack-ecn-drop-mark instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0-lossy	set test_ sack-ecn-drop-mark	$self next}Test/sack-ecn-drop-mark instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 2.1	$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "sack-ecn: confused by >1 err models..abort"		exit 1	}	$errmodel set offset_ 20.0	$errmodel set period_ 1000.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/Sack]	set sink [new Agent/TCP/FullTcp/Sack]	$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.7 "$src advance 40"	# set up special params for this test	$src set window_ 70	$src set packetSize_ 576	$src set ecn_ true	$sink set ecn_ true	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## sack-burst#Class Test/sack-burst -superclass TestSuiteTest/sack-burst instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net1-lossy	set test_ sack-burst	$self next}Test/sack-burst instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 23	$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "sack-burst: confused by >1 err models..abort"		exit 1	}	# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp/Sack]	set sink [new Agent/TCP/FullTcp/Sack]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	# set up TCP-level connections	# flow 1 -- one drop early	$ns_ connect $src $sink	$sink listen	$ns_ at 0.0 "$errmodel set offset_ 5"	$ns_ at 0.0 "$errmodel set burstlen_ 1"	$ns_ at 0.0 "$errmodel set period_ 10000"	$ns_ at 0.7 "$src advanceby 10"	$ns_ at 2.0 "$src close"	# flow 2 -- no drops, send more than flow 1, last pckt 	# smaller than full-size	$ns_ at 2.5 "$ns_ connect $src $sink"	$ns_ at 2.6 "$sink listen"	$ns_ at 3.0 "$src advance-bytes 1702"	$ns_ at 7.0 "$src close"	# flow 3 -- one drop late, TIMEOUT	$ns_ at 19.5 "$errmodel set burstlen_ 1"	$ns_ at 19.5 "$errmodel set period_ 52.0"	$ns_ at 20.0 "$ns_ connect $src $sink"	$ns_ at 20.1 "$sink listen"	$ns_ at 20.3 "$src advanceby 48"	$ns_ at 21.372 "$errmodel set period_ 2.0"	$ns_ at 21.380 "$errmodel set burstlen_ 11"	$ns_ at 21.381 "$errmodel set period_ 1000.0"	$ns_ at 30.0 "$src close"	# set up special params for this test	$src set window_ 20	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## sack-burst-2#Class Test/sack-burst-2 -superclass TestSuiteTest/sack-burst-2 instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net1-lossy	set test_ sack-burst-2	$self next}Test/sack-burst-2 instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 3.5	$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "sack-burst-2: confused by >1 err models..abort"		exit 1	}	# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp/Sack]	set sink [new Agent/TCP/FullTcp/Sack]	$ns_ attach-agent $node_(s1) $src	$ns_ attach-agent $node_(k1) $sink	$src set fid_ 0	$sink set fid_ 0	# set up TCP-level connection	# one drop early, SACK recovery	$ns_ connect $src $sink	$sink listen	$ns_ at 0.0 "$errmodel set offset_ 5"	$ns_ at 0.0 "$errmodel set burstlen_ 1"	$ns_ at 0.0 "$errmodel set period_ 10000"	$ns_ at 0.7 "$src advanceby 40"        # cause timeout	$ns_ at 2.0 "$errmodel set period_ 2.0"	$ns_ at 2.0 "$errmodel set burstlen_ 1"	$ns_ at 2.5 "$errmodel set period_ 1000.0"	$ns_ at $stopt "$src close"	# set up special params for this test	$src set window_ 20	$src set packetSize_ 576	$self traceQueues $node_(s1) [$self openTrace $stopt $testName_]	$ns_ run}## sack-illegal-sack-block#Class Test/sack-illegal-sack-block -superclass TestSuiteTest/sack-illegal-sack-block instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0-lossy	set test_ sack-illegal-sack-block	$self next}Test/sack-illegal-sack-block instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 2.0		$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "sack-illegal-sack-block: confused by >1 err models..abort"		exit 1	}	$errmodel set offset_ 8.0	$errmodel set burstlen_ 1	# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp/Sack]	set sink [new Agent/TCP/FullTcp/Sack]	$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.3 "$src close"	# set up special params for this test	$src set window_ 100	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run}## sack-dropwin#Class Test/sack-dropwin -superclass TestSuiteTest/sack-dropwin instproc init topo {	$self instvar net_ defNet_ test_	set net_ $topo	set defNet_ net0-lossy	set test_ sack-dropwin	$self next}Test/sack-dropwin instproc run {} {	$self instvar ns_ node_ testName_ topo_	set stopt 5.5	$topo_ instvar lossylink_	set errmodule [$lossylink_ errormodule]	set errmodel [$errmodule errormodels]	if { [llength $errmodel] > 1 } {		puts "sack-dropwin: confused by >1 err models..abort"		exit 1	}	$errmodel set offset_ 47.0	$errmodel set burstlen_ 10	$errmodel set period_ 1000	# set up connection (do not use "create-connection" method because	# we need a handle on the sink object)	set src [new Agent/TCP/FullTcp/Sack]	set sink [new Agent/TCP/FullTcp/Sack]	$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_ 10	$src set packetSize_ 576	$self traceQueues $node_(r1) [$self openTrace $stopt $testName_]	$ns_ run} TestSuite runTest

⌨️ 快捷键说明

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