📄 test-suite-ecn.tcl
字号:
Agent/TCP set bugFix_ true set test_ ecn_drop2_tahoe $self next}Test/ecn_drop2_tahoe instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Tahoe 3.0 $self drop_pkt 235 $ns_ run}# Packet loss only.Class Test/ecn_noecn_tahoe -superclass TestSuiteTest/ecn_noecn_tahoe 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_tahoe Test/ecn_noecn_tahoe instproc run {} [Test/ecn_drop_tahoe info instbody run ] $self next}# Multiple dup acks with bugFix_Class Test/ecn_bursty_tahoe -superclass TestSuiteTest/ecn_bursty_tahoe 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_tahoe $self next}Test/ecn_bursty_tahoe instproc run {} { $self instvar ns_ $self ecnsetup Tahoe 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_tahoe -superclass TestSuiteTest/ecn_burstyEcn_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true Agent/TCP set old_ecn_ 1 set test_ ecn_burstyEcn_tahoe Test/ecn_burstyEcn_tahoe instproc run {} [Test/ecn_bursty_tahoe info instbody run ] $self next}# Multiple dup acks without bugFix_Class Test/ecn_noBugfix_tahoe -superclass TestSuiteTest/ecn_noBugfix_tahoe 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_tahoe Test/ecn_noBugfix_tahoe instproc run {} [Test/ecn_bursty_tahoe info instbody run ] $self next}# ECN followed by timeout.Class Test/ecn_timeout_tahoe -superclass TestSuiteTest/ecn_timeout_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_timeout_tahoe $self next}Test/ecn_timeout_tahoe instproc run {} { $self instvar ns_ $self ecnsetup Tahoe 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 268} $ns_ run}# Only the timeout.Class Test/ecn_timeout2_tahoe -superclass TestSuiteTest/ecn_timeout2_tahoe 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_timeout2_tahoe $self next}Test/ecn_timeout2_tahoe instproc run {} { $self instvar ns_ $self ecnsetup Tahoe 3.0 1 $self drop_pkts {241 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 268} $ns_ run}# The timeout with the ECN in the middle of dropped packets.Class Test/ecn_timeout3_tahoe -superclass TestSuiteTest/ecn_timeout3_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_timeout3_tahoe $self next}Test/ecn_timeout3_tahoe instproc run {} { $self instvar ns_ $self ecnsetup Tahoe 3.0 1 $self drop_pkts {241 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 268 269 270} $ns_ run}# Packet drops with a window of one packet.Class Test/ecn_smallwin_tahoe -superclass TestSuiteTest/ecn_smallwin_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true Agent/TCP set bugFix_ true set net_ net2-lossy set test_ ecn_smallwin_tahoe $self next}Test/ecn_smallwin_tahoe instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 0 $self ecnsetup Tahoe 6.0 1 $self drop_pkts {4 8 9 10 11 100 115 118 119} $ns_ run}# ECN with a window of one packet.Class Test/ecn_smallwinEcn_tahoe -superclass TestSuiteTest/ecn_smallwinEcn_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_smallwinEcn_tahoe $self next}Test/ecn_smallwinEcn_tahoe instproc run {} { $self instvar ns_ errmodel1 Agent/TCP set old_ecn_ 0 $self ecnsetup Tahoe 10.0 1 $self drop_pkts {4 8 9 11 12 13 120 135 143 148 150 151 152 153} $errmodel1 set markecn_ true $ns_ run}# ECN, cwnd 4, packet 4 is dropped, and then packet 6 is marked. # The retransmit timer expires, packet 4 is retransmitted, and then the# ECN bit is set on the retransmitted packet.# When the ACK for packet 4 comes in, the retransmit timer must not get # cancelled.Class Test/ecn_smallwin1Ecn_tahoe -superclass TestSuiteTest/ecn_smallwin1Ecn_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net3-lossy Agent/TCP set bugFix_ true set test_ ecn_smallwin1Ecn_tahoe $self next}Test/ecn_smallwin1Ecn_tahoe instproc run {} { $self instvar ns_ errmodel1 errmodel2 Agent/TCP set old_ecn_ 0 $self ecnsetup Tahoe 10.0 1 $self drop_pkts {4 8 9 11 12 13 120 135 143 148 150 153} $errmodel1 set markecn_ true $self drop_pkts2 {6} $errmodel2 set markecn_ false $ns_ run}# ECN with a window of one packet, slow_start_restart_ false.Class Test/ecn_smallwin2Ecn_tahoe -superclass TestSuiteTest/ecn_smallwin2Ecn_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true Agent/TCP set slow_start_restart_ false set test_ ecn_smallwin2Ecn_tahoe Test/ecn_smallwin2Ecn_tahoe instproc run {} [Test/ecn_smallwinEcn_tahoe info instbody run ] $self next}Class Test/ecn_smallwin3Ecn_tahoe -superclass TestSuiteTest/ecn_smallwin3Ecn_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net3-lossy Agent/TCP set bugFix_ true Agent/TCP set slow_start_restart_ false set test_ ecn_smallwin3Ecn_tahoe Test/ecn_smallwin3Ecn_tahoe instproc run {} [Test/ecn_smallwin1Ecn_tahoe info instbody run ] $self next}# Packet drops for the second packet.Class Test/ecn_secondpkt_tahoe -superclass TestSuiteTest/ecn_secondpkt_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true Agent/TCP set bugFix_ true set net_ net2-lossy set test_ ecn_secondpkt_tahoe $self next}Test/ecn_secondpkt_tahoe instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 0 $self ecnsetup Tahoe 2.0 1 $self drop_pkts {1 3} $ns_ run}# ECN for the second packet.Class Test/ecn_secondpktEcn_tahoe -superclass TestSuiteTest/ecn_secondpktEcn_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_secondpktEcn_tahoe $self next}Test/ecn_secondpktEcn_tahoe instproc run {} { $self instvar ns_ errmodel1 Agent/TCP set old_ecn_ 0 $self ecnsetup Tahoe 2.0 1 $self drop_pkts {1 3} $errmodel1 set markecn_ true $ns_ run}# ECN for the second packet.Class Test/ecn_secondpkt1Ecn_tahoe -superclass TestSuiteTest/ecn_secondpkt1Ecn_tahoe instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_secondpkt1Ecn_tahoe Test/ecn_secondpkt1Ecn_tahoe instproc run {} [Test/ecn_secondpktEcn_tahoe info instbody run ] $self next}######################################################################## Delayed Ack Tahoe Tests ######################################################################### Plain ECNClass Test/ecn_nodrop_tahoe_delack -superclass TestSuiteTest/ecn_nodrop_tahoe_delack instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_nodrop_tahoe_delack $self next}Test/ecn_nodrop_tahoe_delack instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Tahoe 3.0 0 1 $self drop_pkt 10000 $ns_ run}# Two ECNs close togetherClass Test/ecn_twoecn_tahoe_delack -superclass TestSuiteTest/ecn_twoecn_tahoe_delack instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_twoecn_tahoe_delack $self next}Test/ecn_twoecn_tahoe_delack instproc run {} { $self instvar ns_ lossmodel Agent/TCP set old_ecn_ 1 $self ecnsetup Tahoe 3.0 0 1 $self drop_pkt 243 $lossmodel set markecn_ true $ns_ run}# ECN followed by packet loss.Class Test/ecn_drop_tahoe_delack -superclass TestSuiteTest/ecn_drop_tahoe_delack instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_drop_tahoe_delack $self next}Test/ecn_drop_tahoe_delack instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Tahoe 3.0 0 1 $self drop_pkt 243 $ns_ run}# ECN preceded by packet loss.Class Test/ecn_drop1_tahoe_delack -superclass TestSuiteTest/ecn_drop1_tahoe_delack instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_drop1_tahoe_delack $self next}Test/ecn_drop1_tahoe_delack instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Tahoe 3.0 0 1 $self drop_pkt 241 $ns_ run}# ECN with a window of one packet.Class Test/ecn_smallwinEcn_tahoe_delack -superclass TestSuiteTest/ecn_smallwinEcn_tahoe_delack instproc init {} { $self instvar net_ test_ Queue/RED set setbit_ true set net_ net2-lossy Agent/TCP set bugFix_ true set test_ ecn_smallwinEcn_tahoe_delack $self next}Test/ecn_smallwinEcn_tahoe_delack instproc run {} { $self instvar ns_ errmodel1 Agent/TCP set old_ecn_ 0 $self ecnsetup Tahoe 10.0 1 1 $self drop_pkts {4 8 9 11 12 13 120 135 143 148 150 151 152 153} $errmodel1 set markecn_ true $ns_ run}######################################################################## Reno Tests ######################################################################### Plain ECNClass Test/ecn_nodrop_reno -superclass TestSuiteTest/ecn_nodrop_reno 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 $self next}Test/ecn_nodrop_reno 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 -superclass TestSuiteTest/ecn_twoecn_reno 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 $self next}Test/ecn_twoecn_reno 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 -superclass TestSuiteTest/ecn_drop_reno 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 $self next}Test/ecn_drop_reno instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Reno 3.0 $self drop_pkt 243 $ns_ run}# ECN preceded by packet loss.# NO.Class Test/ecn_drop1_reno -superclass TestSuiteTest/ecn_drop1_reno 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 $self next}Test/ecn_drop1_reno instproc run {} { $self instvar ns_ Agent/TCP set old_ecn_ 1 $self ecnsetup Reno 3.0 $self drop_pkt 241 $ns_ run}# Packet loss only.Class Test/ecn_noecn_reno -superclass TestSuiteTest/ecn_noecn_reno 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 Test/ecn_noecn_reno instproc run {} [Test/ecn_drop_reno info instbody run ] $self next}# Multiple dup acks with bugFix_Class Test/ecn_bursty_reno -superclass TestSuiteTest/ecn_bursty_reno 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 $self next}Test/ecn_bursty_reno 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 -superclass TestSuiteTest/ecn_burstyEcn_reno 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 Test/ecn_burstyEcn_reno instproc run {} [Test/ecn_bursty_reno info instbody run ] $self next}# Multiple dup acks without bugFix_Class Test/ecn_noBugfix_reno -superclass TestSuiteTest/ecn_noBugfix_reno 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 Test/ecn_noBugfix_reno instproc run {} [Test/ecn_bursty_reno info instbody run ] $self next}# ECN followed by timeout.Class Test/ecn_timeout_reno -superclass TestSuiteTest/ecn_timeout_reno 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 $self next
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -