📄 test-suite-ecn-full.tcl
字号:
} elseif {$tcptype == "Sack1"} { set tcp [$ns_ create-connection TCP/Sack1 $node_(s1) \ TCPSink/Sack1 $node_(s3) 2] } else { set tcp [$ns_ create-connection TCP/$tcptype $node_(s1) \ TCPSink $node_(s3) 2] } $tcp set window_ 30 $tcp set ecn_ 1 set ftp [$tcp attach-app FTP] $ns_ at $starttime "$ftp start"}# TestSuite instproc second_tcp { tcptype starttime } {# $self tcpconnection $tcptype 2 0 0 # }# Drop the specified packet.TestSuite instproc drop_pkt { number } { $self instvar ns_ lossmodel set lossmodel [$self setloss] $lossmodel set offset_ $number $lossmodel set period_ 10000}TestSuite instproc drop_pkts pkts { $self instvar ns_ errmodel1 set emod [$self emod] set errmodel1 [new ErrorModel/List] $errmodel1 droplist $pkts $emod insert $errmodel1 $emod bind $errmodel1 1}######################################################################## Reno Tests ######################################################################### Plain ECNClass Test/ecn_nodrop_reno_full -superclass TestSuiteTest/ecn_nodrop_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_nodrop_reno_full $self next pktTraceFile}Test/ecn_nodrop_reno_full instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Reno 3.0 $self drop_pkt 10000 $ns_ run}# Two ECNs close togetherClass Test/ecn_twoecn_reno_full -superclass TestSuiteTest/ecn_twoecn_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_twoecn_reno_full $self next pktTraceFile}Test/ecn_twoecn_reno_full instproc run {} { $self instvar ns_ lossmodel Agent/TCP set old_ecn_ 1 $self ecnsetup Reno 3.0 $self drop_pkt 243 $lossmodel set markecn_ true $ns_ run}# ECN followed by packet loss.Class Test/ecn_drop_reno_full -superclass TestSuiteTest/ecn_drop_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_drop_reno_full $self next pktTraceFile}Test/ecn_drop_reno_full instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Reno 3.0 $self drop_pkt 243 $ns_ run}# This shows ECN preceded by packet loss,Class Test/ecn_drop1_reno_full -superclass TestSuiteTest/ecn_drop1_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_drop1_reno_full $self next pktTraceFile}Test/ecn_drop1_reno_full instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Reno 3.0 $self drop_pkt 237 $ns_ run}# Packet loss only.Class Test/ecn_noecn_reno_full -superclass TestSuiteTest/ecn_noecn_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true Queue/RED set thresh_ 1000 Queue/RED set maxthresh_ 1000 set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_noecn_reno_full Test/ecn_noecn_reno_full instproc run {} [Test/ecn_drop_reno_full info instbody run ] $self next pktTraceFile}# Multiple dup acks with bugFix_Class Test/ecn_bursty_reno_full -superclass TestSuiteTest/ecn_bursty_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true Queue/RED set thresh_ 100 Queue/RED set maxthresh_ 100 set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_bursty_reno_full $self next pktTraceFile}Test/ecn_bursty_reno_full instproc run {} { $self instvar ns_ $self ecnsetup Reno 3.0 set lossmodel [$self setloss] $lossmodel set offset_ 245 $lossmodel set burstlen_ 15 $lossmodel set period_ 10000 $ns_ run}# Multiple dup acks following ECNClass Test/ecn_burstyEcn_reno_full -superclass TestSuiteTest/ecn_burstyEcn_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_burstyEcn_reno_full Test/ecn_burstyEcn_reno_full instproc run {} [Test/ecn_bursty_reno_full info instbody run ] $self next pktTraceFile}# Multiple dup acks without bugFix_Class Test/ecn_noBugfix_reno_full -superclass TestSuiteTest/ecn_noBugfix_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set thresh_ 100 Queue/RED set maxthresh_ 100 Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ false set test_ ecn_noBugfix_reno_full Test/ecn_noBugfix_reno_full instproc run {} [Test/ecn_bursty_reno_full info instbody run ] $self next pktTraceFile}# ECN followed by timeout.Class Test/ecn_timeout_reno_full -superclass TestSuiteTest/ecn_timeout_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_timeout_reno_full $self next pktTraceFile}Test/ecn_timeout_reno_full instproc run {} { $self instvar ns_ $self ecnsetup Reno 3.0 1 $self drop_pkts {242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267} $ns_ run}# ECN followed by a timeout, followed by an ECN representing a# new instance of congestion.Class Test/ecn_timeout1_reno_full -superclass TestSuiteTest/ecn_timeout1_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_timeout1_reno_full $self next pktTraceFile}Test/ecn_timeout1_reno_full instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Reno 3.0 1 $self drop_pkts {245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262} $self second_tcp Tahoe 1.2 $ns_ run}# Packet drops with a window of one packet.Class Test/ecn_smallwin_reno_full -superclass TestSuiteTest/ecn_smallwin_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true Agent/TCP set bugFix_ true set net_ net2-lossy set test_ ecn_smallwin_reno_full $self next pktTraceFile}Test/ecn_smallwin_reno_full instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 0 $self ecnsetup Reno 6.0 1 $self drop_pkts {4 8 9 10 11 100 115 118 119 121 122} $ns_ run}#ECN with a window of one packet.Class Test/ecn_smallwinEcn_reno_full -superclass TestSuiteTest/ecn_smallwinEcn_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true Agent/TCP set rfc2988_ true set test_ ecn_smallwinEcn_reno_full $self next pktTraceFile}Test/ecn_smallwinEcn_reno_full instproc run {} { $self instvar ns_ errmodel1 Agent/TCP set old_ecn_ 0 $self ecnsetup Reno 10.0 1 $self drop_pkts {4 8 9 10 11 100 115 118 119 121 122} #$self drop_pkts {6 10 11 13 14 15 122 137 145 150 152 153 154 155} $errmodel1 set markecn_ true $ns_ run}# Packet drops for the second packet.Class Test/ecn_secondpkt_reno_full -superclass TestSuiteTest/ecn_secondpkt_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true Agent/TCP set bugFix_ true set net_ net2-lossy set test_ ecn_secondpkt_reno_full $self next pktTraceFile}Test/ecn_secondpkt_reno_full instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 0 $self ecnsetup Reno 2.0 1 $self drop_pkts {3 5} $ns_ run}# ECN for the second packet.Class Test/ecn_secondpktEcn_reno_full -superclass TestSuiteTest/ecn_secondpktEcn_reno_full instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_secondpktEcn_reno_full $self next pktTraceFile}Test/ecn_secondpktEcn_reno_full instproc run {} { $self instvar ns_ errmodel1 Agent/TCP set old_ecn_ 0 $self ecnsetup Reno 2.0 1 #$self drop_pkts {2 4} $self drop_pkts {3 5} $errmodel1 set markecn_ true $ns_ run}TestSuite runTest
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -