📄 test-suite-tcp-init-win.tcl
字号:
Agent/TCP set windowInitOption_ 2 set tcp1 [$self make_tcp s1 k1 0 Reno] $tcp1 set packetSize_ 1000 set tcp2 [$self make_tcp s2 k1 1 Reno] $tcp2 set packetSize_ 1500 set tcp3 [$self make_tcp s2 k1 2 Reno] $tcp3 set packetSize_ 2500 $self run_test $tcp1 $tcp2 $tcp3 1.0 1.0 16}Class Test/reno2 -superclass TestSuiteTest/reno2 instproc init {} { $self instvar net_ test_ set net_ net6 set test_ reno2(static_initial_windows) $self next}Test/reno2 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo set tcp1 [$self make_tcp s1 k1 0 Reno] $tcp1 set windowInit_ 6 set tcp2 [$self make_tcp s2 k1 1 Reno] $tcp2 set syn_ true $tcp2 set delay_growth_ true set tcp3 [$self make_tcp s2 k1 2 Reno] $tcp3 set windowInit_ 6 $tcp3 set syn_ true $tcp3 set delay_growth_ true $self run_test $tcp1 $tcp2 $tcp3 1.0 1.0 16}Class Test/reno3 -superclass TestSuiteTest/reno3 instproc init {} { $self instvar net_ test_ set net_ net6 set test_ reno3(dropped_syn) $self next}## Drop the n-th packet for flow on link.TestSuite instproc drop_pkt { link flow n } { set em [new ErrorModule Fid] set errmodel [new ErrorModel/Periodic] $errmodel unit pkt $errmodel set offset_ n $errmodel set period_ 1000.0 $link errormodule $em $em insert $errmodel $em bind $errmodel $flow}Test/reno3 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo Agent/TCP set syn_ true Agent/TCP set delay_growth_ true Agent/TCP set windowInitOption_ 2 set tcp1 [$self make_tcp s1 k1 0 Reno] $tcp1 set packetSize_ 1000 $self drop_pkt [$ns_ link $node_(r1) $node_(k1)] 0 1 $self runall_test $tcp1 10.0 10.0 }Class Test/reno4 -superclass TestSuiteTest/reno4 instproc init {} { $self instvar net_ test_ set net_ net7 set test_ reno4(fast_retransmit) Queue/RED set ns1_compat_ true $self next}Test/reno4 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo Agent/TCP set packetSize_ 1000 Agent/TCP set windowInitOption_ 2 Agent/TCP set syn_ true Agent/TCP set delay_growth_ true set tcp1 [$self make_tcp s1 k1 0 Reno] set tcp2 [$self make_tcp s2 k1 1 Reno] $self second_test $tcp1 $tcp2}Class Test/newreno1 -superclass TestSuiteTest/newreno1 instproc init {} { $self instvar net_ test_ set net_ net6 set test_ newreno1(variable_packet_sizes) $self next}Test/newreno1 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo Agent/TCP set syn_ true Agent/TCP set delay_growth_ true Agent/TCP set windowInitOption_ 2 set tcp1 [$self make_tcp s1 k1 0 Newreno] $tcp1 set packetSize_ 1000 set tcp2 [$self make_tcp s2 k1 1 Newreno] $tcp2 set packetSize_ 1500 set tcp3 [$self make_tcp s2 k1 2 Newreno] $tcp3 set packetSize_ 2500 $self run_test $tcp1 $tcp2 $tcp3 1.0 1.0 16}Class Test/newreno2 -superclass TestSuiteTest/newreno2 instproc init {} { $self instvar net_ test_ set net_ net6 set test_ newreno2(static_initial_windows) $self next}Test/newreno2 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo set tcp1 [$self make_tcp s1 k1 0 Newreno] $tcp1 set windowInit_ 6 set tcp2 [$self make_tcp s2 k1 1 Newreno] $tcp2 set syn_ true $tcp2 set delay_growth_ true set tcp3 [$self make_tcp s2 k1 2 Newreno] $tcp3 set windowInit_ 6 $tcp3 set syn_ true $tcp3 set delay_growth_ true $self run_test $tcp1 $tcp2 $tcp3 1.0 1.0 16}Class Test/newreno3 -superclass TestSuiteTest/newreno3 instproc init {} { $self instvar net_ test_ set net_ net6 set test_ newreno3(dropped_syn) $self next}## Drop the n-th packet for flow on link.TestSuite instproc drop_pkt { link flow n } { set em [new ErrorModule Fid] set errmodel [new ErrorModel/Periodic] $errmodel unit pkt $errmodel set offset_ n $errmodel set period_ 1000.0 $link errormodule $em $em insert $errmodel $em bind $errmodel $flow}Test/newreno3 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo Agent/TCP set syn_ true Agent/TCP set delay_growth_ true Agent/TCP set windowInitOption_ 2 set tcp1 [$self make_tcp s1 k1 0 Newreno] $tcp1 set packetSize_ 1000 $self drop_pkt [$ns_ link $node_(r1) $node_(k1)] 0 1 $self runall_test $tcp1 10.0 10.0 }Class Test/newreno4 -superclass TestSuiteTest/newreno4 instproc init {} { $self instvar net_ test_ set net_ net7 set test_ newreno4(fast_retransmit) Queue/RED set ns1_compat_ true $self next}Test/newreno4 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo Agent/TCP set packetSize_ 1000 Agent/TCP set windowInitOption_ 2 Agent/TCP set syn_ true Agent/TCP set delay_growth_ true set tcp1 [$self make_tcp s1 k1 0 Newreno] set tcp2 [$self make_tcp s2 k1 1 Newreno] $self second_test $tcp1 $tcp2}Class Test/sack1 -superclass TestSuiteTest/sack1 instproc init {} { $self instvar net_ test_ set net_ net6 set test_ sack1(variable_packet_sizes) $self next}Test/sack1 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo Agent/TCP set syn_ true Agent/TCP set delay_growth_ true Agent/TCP set windowInitOption_ 2 set tcp1 [$self make_tcp s1 k1 0 Sack] $tcp1 set packetSize_ 1000 set tcp2 [$self make_tcp s2 k1 1 Sack] $tcp2 set packetSize_ 1500 set tcp3 [$self make_tcp s2 k1 2 Sack] $tcp3 set packetSize_ 2500 $self run_test $tcp1 $tcp2 $tcp3 1.0 1.0 16}Class Test/sack2 -superclass TestSuiteTest/sack2 instproc init {} { $self instvar net_ test_ set net_ net6 set test_ sack2(static_initial_windows) $self next}Test/sack2 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo set tcp1 [$self make_tcp s1 k1 0 Sack] $tcp1 set windowInit_ 6 set tcp2 [$self make_tcp s2 k1 1 Sack] $tcp2 set syn_ true $tcp2 set delay_growth_ true set tcp3 [$self make_tcp s2 k1 2 Sack] $tcp3 set windowInit_ 6 $tcp3 set syn_ true $tcp3 set delay_growth_ true $self run_test $tcp1 $tcp2 $tcp3 1.0 1.0 16}Class Test/sack3 -superclass TestSuiteTest/sack3 instproc init {} { $self instvar net_ test_ set net_ net6 set test_ sack3(dropped_syn) $self next}## Drop the n-th packet for flow on link.TestSuite instproc drop_pkt { link flow n } { set em [new ErrorModule Fid] set errmodel [new ErrorModel/Periodic] $errmodel unit pkt $errmodel set offset_ n $errmodel set period_ 1000.0 $link errormodule $em $em insert $errmodel $em bind $errmodel $flow}Test/sack3 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo Agent/TCP set syn_ true Agent/TCP set delay_growth_ true Agent/TCP set windowInitOption_ 2 set tcp1 [$self make_tcp s1 k1 0 Sack] $tcp1 set packetSize_ 1000 $self drop_pkt [$ns_ link $node_(r1) $node_(k1)] 0 1 $self runall_test $tcp1 10.0 10.0 }Class Test/sack4 -superclass TestSuiteTest/sack4 instproc init {} { $self instvar net_ test_ set net_ net7 set test_ sack4(fast_retransmit) Queue/RED set ns1_compat_ true $self next}Test/sack4 instproc run {} { $self instvar ns_ node_ testName_ $self setTopo Agent/TCP set packetSize_ 1000 Agent/TCP set windowInitOption_ 2 Agent/TCP set syn_ true Agent/TCP set delay_growth_ true set tcp1 [$self make_tcp s1 k1 0 Sack] set tcp2 [$self make_tcp s2 k1 1 Sack] $self second_test $tcp1 $tcp2}TestSuite runTest### Local Variables:### mode: tcl### tcl-indent-level: 8### tcl-default-application: ns### End:
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -