test-suite-full-fixes.tcl
来自「一款用来进行网络模拟的软件」· TCL 代码 · 共 746 行 · 第 1/2 页
TCL
746 行
# Copyright (c) 1995 The Regents of the University of California.Agent/TCP set precisionReduce_ false ; # default changed on 2006/1/24.Agent/TCP set rtxcur_init_ 6.0 ; # Default changed on 2006/01/21Agent/TCP set updated_rttvar_ false ; # Variable added on 2006/1/21# All rights reserved.## Redistribution and use in source and binary forms, with or without# modification, are permitted provided that the following conditions# are met:# 1. Redistributions of source code must retain the above copyright# notice, this list of conditions and the following disclaimer.# 2. Redistributions in binary form must reproduce the above copyright# notice, this list of conditions and the following disclaimer in the# documentation and/or other materials provided with the distribution.# 3. All advertising materials mentioning features or use of this software# must display the following acknowledgement:# This product includes software developed by the Computer Systems# Engineering Group at Lawrence Berkeley Laboratory.# 4. Neither the name of the University nor of the Laboratory may be used# to endorse or promote products derived from this software without# specific prior written permission.## THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE# ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF# SUCH DAMAGE.## test-suite-full-fixes.tcl## Based on ns/tcl/test/test-suite-full.tcl## Modified June 2005 by Michele C. Weigle, Clemson University## For a detailed description of the examples in this file, see# http://www.cs.clemson.edu/~mweigle/research/ns/fixes/#source misc.tclsource topologies-full-fixes.tcl# defaults as of ns-2.1b9 May 2002Agent/TCP set tcpTick_ 0.01Agent/TCP set rfc2988_ trueAgent/TCP set useHeaders_ trueAgent/TCP set windowInit_ 2Agent/TCP set minrto_ 1Agent/TCP set singledup_ 1Trace set show_tcphdr_ 1 ; # needed to plot ack numbers for tracing TestSuite instproc finish testname { $self instvar ns_ $ns_ halt set awkCode { {if (($1=="+" || $1=="d") && (($3=="3" && $4=="2") || ($3=="2" && $4=="3"))) print} } exec awk $awkCode all.tr > temp.rands}#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::# TCP Reno Tests#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#*************************************************************************# Tests to validate bug fixes to Full-TCP Reno in tcp-full.cc## reno-drop-passive-fin -- drop the passive FIN# reno-drop-synack -- drop the SYN/ACK# reno-msg_eof-fin -- send message with MSG_EOF set# reno-drop-lastack -- drop the last ACK in connection teardown##*************************************************************************## reno-drop-passive-fin#Class Test/reno-drop-passive-fin -superclass TestSuiteTest/reno-drop-passive-fin instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0-lossy2 set test_ reno-drop-passive-fin $self next}Test/reno-drop-passive-fin instproc run {} { $self instvar ns_ node_ testName_ topo_ set stopt 5.0 $topo_ instvar lossylink_ set errmodule [$lossylink_ errormodule] set errmodel [$errmodule errormodels] if { [llength $errmodel] > 1 } { puts "reno-drop-passive-fin: confused by >1 err models..abort" exit 1 } $errmodel set offset_ 7.0 $errmodel set burstlen_ 2 # 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.7 "$src advance 5" $ns_ at 2.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}## reno-drop-synack#Class Test/reno-drop-synack -superclass TestSuiteTest/reno-drop-synack instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0-lossy2; # drops are all ACKs set test_ reno-drop-synack $self next}Test/reno-drop-synack instproc run {} { $self instvar ns_ node_ testName_ topo_ set stopt 7 $topo_ instvar lossylink_ set errmodule [$lossylink_ errormodule] set errmodel [$errmodule errormodels] if { [llength $errmodel] > 1 } { puts "reno-drop-synack: confused by >1 err models..abort" exit 1 } $errmodel set offset_ 1.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] 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 packetSize_ 576 $self traceQueues $node_(r1) [$self openTrace $stopt $testName_] $ns_ run}## reno-msg_eof-fin#Class Test/reno-msg_eof-fin -superclass TestSuiteTest/reno-msg_eof-fin instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ reno-msg_eof-fin $self next}Test/reno-msg_eof-fin instproc run {} { $self instvar ns_ node_ testName_ topo_ set stopt 3.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.7 "$src advanceby 5" $ns_ at 1.3 "$src sendmsg 400 MSG_EOF" # 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}## reno-drop-lastack#Class Test/reno-drop-lastack -superclass TestSuiteTest/reno-drop-lastack instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0-lossy; set test_ reno-drop-lastack $self next}Test/reno-drop-lastack instproc run {} { $self instvar ns_ node_ testName_ topo_ set stopt 50.0 $topo_ instvar lossylink_ set errmodule [$lossylink_ errormodule] set errmodel [$errmodule errormodels] if { [llength $errmodel] > 1 } { puts "reno-drop-lastack: confused by >1 err models..abort" exit 1 } $errmodel set offset_ 7.0 $errmodel set burstlen_ 1 $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] 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.7 "$src advanceby 3" $ns_ at 2.0 "$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}#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::# ECN Tests#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::#*************************************************************************# Tests to validate bug fixes to Full-TCP ECN in tcp-full.cc## ecn-drop-synack -- drop the SYN/ACK# ecn-rexmt -- retransmit a packet##*************************************************************************## ecn-rexmt#Class Test/ecn-rexmt -superclass TestSuiteTest/ecn-rexmt instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0-lossy; set test_ ecn-rexmt $self next}Test/ecn-rexmt instproc run {} { $self instvar ns_ node_ testName_ topo_ set stopt 1.6 $topo_ instvar lossylink_ set errmodule [$lossylink_ errormodule] set errmodel [$errmodule errormodels] if { [llength $errmodel] > 1 } { puts "reno-rexmt: confused by >1 err models..abort" exit 1 } $errmodel set offset_ 5.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] 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 packetSize_ 576 $src set ecn_ true $sink set ecn_ true $self traceQueues $node_(r1) [$self openTrace $stopt $testName_] $ns_ run}## ecn-drop-synack#Class Test/ecn-drop-synack -superclass TestSuiteTest/ecn-drop-synack instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0-lossy2; # drops are all ACKs set test_ ecn-drop-synack $self next}Test/ecn-drop-synack instproc run {} { $self instvar ns_ node_ testName_ topo_ set stopt 7 $topo_ instvar lossylink_ set errmodule [$lossylink_ errormodule] set errmodel [$errmodule errormodels] if { [llength $errmodel] > 1 } { puts "ecn-drop-synack: confused by >1 err models..abort" exit 1 } $errmodel set offset_ 1.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] 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
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?