📄 test-suite-simple-full.tcl
字号:
# s1 s3# \ /# 10Mb,2ms \ 1.5Mb,20ms / 10Mb,4ms# r1 --------- r2# 10Mb,3ms / \ 10Mb,5ms# / \# s2 s4 #NodeTopology/6nodes instproc init ns { $self next $self instvar node_ set node_(s1) [$ns node] set node_(s2) [$ns node] set node_(r1) [$ns node] set node_(r2) [$ns node] set node_(s3) [$ns node] set node_(s4) [$ns node]}Class Topology/net2 -superclass NodeTopology/6nodesTopology/net2 instproc init ns { $self next $ns $self instvar node_ Queue/RED set drop_rand_ true $ns duplex-link $node_(s1) $node_(r1) 10Mb 2ms DropTail $ns duplex-link $node_(s2) $node_(r1) 10Mb 3ms DropTail $ns duplex-link $node_(r1) $node_(r2) 1.5Mb 20ms RED $ns queue-limit $node_(r1) $node_(r2) 25 $ns queue-limit $node_(r2) $node_(r1) 25 $ns duplex-link $node_(s3) $node_(r2) 10Mb 4ms DropTail $ns duplex-link $node_(s4) $node_(r2) 10Mb 5ms DropTail if {[$class info instprocs config] != ""} { $self config $ns }}# Definition of test-suite testsClass Test/tahoe1 -superclass TestSuiteTest/tahoe1 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ tahoe $self next}Test/tahoe1 instproc run {} { $self instvar ns_ node_ testName_ # Set up TCP connection set tcp1 [$ns_ create-connection-listen TCP/FullTcp/Tahoe $node_(s1) TCP/FullTcp/Tahoe $node_(k1) 0] $tcp1 set window_ 50 # Set up FTP source set ftp1 [$tcp1 attach-app FTP] $ns_ at 0.0 "$ftp1 start" $self tcpDump $tcp1 1.0 # Trace only the bottleneck link # # Actually, we now trace all activity at the node around the # bottleneck link. This allows us to track acks, as well # packets taking any alternate paths around the bottleneck # link. # $self traceQueues $node_(r1) [$self openTrace 5.0 $testName_] $ns_ run}Class Test/tahoe2 -superclass TestSuiteTest/tahoe2 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ tahoe2 $self next}Test/tahoe2 instproc run {} { $self instvar ns_ node_ testName_ set tcp1 [$ns_ create-connection-listen TCP/FullTcp/Tahoe $node_(s1) TCP/FullTcp/Tahoe $node_(k1) 0] $tcp1 set window_ 14 set ftp1 [$tcp1 attach-app FTP] $ns_ at 1.0 "$ftp1 start" $self tcpDump $tcp1 1.0 # Trace only the bottleneck link $self traceQueues $node_(r1) [$self openTrace 5.0 $testName_] $ns_ run}Class Test/tahoe3 -superclass TestSuiteTest/tahoe3 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ tahoe3 $self next}Test/tahoe3 instproc run {} { $self instvar ns_ node_ testName_ $ns_ queue-limit $node_(r1) $node_(k1) 8 $ns_ queue-limit $node_(k1) $node_(r1) 8 set tcp1 [$ns_ create-connection-listen TCP/FullTcp/Tahoe $node_(s1) TCP/FullTcp/Tahoe $node_(k1) 0] $tcp1 set window_ 100 set tcp2 [$ns_ create-connection-listen TCP/FullTcp/Tahoe $node_(s2) TCP/FullTcp/Tahoe $node_(k1) 1] $tcp2 set window_ 16 set ftp1 [$tcp1 attach-app FTP] set ftp2 [$tcp2 attach-app FTP] $ns_ at 1.0 "$ftp1 start" $ns_ at 0.5 "$ftp2 start" $self tcpDump $tcp1 1.0 # Trace only the bottleneck link $self traceQueues $node_(r1) [$self openTrace 8.0 $testName_] $ns_ run}# Bug-fix doesn't seem to be working as it should here...# Class Test/tahoe4 -superclass TestSuite# Test/tahoe4 instproc init topo {# $self instvar net_ defNet_ test_# set net_ $topo# set defNet_ net0# set test_ tahoe4# $self next# }# Test/tahoe4 instproc run {} {# $self instvar ns_ node_ testName_# # $ns_ delay $node_(s2) $node_(r1) 200ms# $ns_ delay $node_(r1) $node_(s2) 200ms# $ns_ queue-limit $node_(r1) $node_(k1) 11# $ns_ queue-limit $node_(k1) $node_(r1) 11 # # set tcp1 [$ns_ create-connection-listen TCP/FullTcp/Tahoe $node_(s1) TCP/FullTcp/Tahoe $node_(k1) 0]# $tcp1 set window_ 30# set tcp2 [$ns_ create-connection-listen TCP/FullTcp/Tahoe $node_(s2) TCP/FullTcp/Tahoe $node_(k1) 1]# $tcp2 set window_ 30# # set ftp1 [$tcp1 attach-app FTP]# set ftp2 [$tcp2 attach-app FTP]# # $ns_ at 0.0 "$ftp1 start"# $ns_ at 0.0 "$ftp2 start"# # $self tcpDump $tcp1 5.0# # # Trace only the bottleneck link# $self traceQueues $node_(r1) [$self openTrace 25.0 $testName_]# $ns_ run# }# # Class Test/tahoe4-nobugfix -superclass TestSuite# Test/tahoe4-nobugfix instproc init topo {# $self instvar net_ defNet_ test_# set net_ $topo# set defNet_ net0# set test_ tahoe4-nobugfix# Agent/TCP set bugFix_ false# Test/tahoe4-nobugfix instproc run {} [Test/tahoe4 info instbody run ]# $self next# }Class Test/reno1 -superclass TestSuiteTest/reno1 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ reno1 $self next}Test/reno1 instproc run {} { $self instvar ns_ node_ testName_ set tcp1 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(k1) 0] $tcp1 set window_ 14 set ftp1 [$tcp1 attach-app FTP] $ns_ at 1.0 "$ftp1 start" $self tcpDump $tcp1 1.0 # trace only the bottleneck link $self traceQueues $node_(r1) [$self openTrace 5.0 $testName_] $ns_ run}Class Test/reno -superclass TestSuiteTest/reno instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ reno $self next}Test/reno instproc run {} { $self instvar ns_ node_ testName_ set tcp1 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(k1) 0] $tcp1 set window_ 28 $tcp1 set maxcwnd_ 14 set ftp1 [$tcp1 attach-app FTP] $ns_ at 1.0 "$ftp1 start" $self tcpDump $tcp1 1.0 # trace only the bottleneck link $self traceQueues $node_(r1) [$self openTrace 5.0 $testName_] $ns_ run}Class Test/renoA -superclass TestSuiteTest/renoA instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ renoA $self next}Test/renoA instproc run {} { $self instvar ns_ node_ testName_ $ns_ queue-limit $node_(r1) $node_(k1) 8 set tcp1 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(k1) 0] $tcp1 set window_ 28 set tcp2 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(k1) 1] $tcp2 set window_ 4 set tcp3 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(k1) 2] $tcp3 set window_ 4 set ftp1 [$tcp1 attach-app FTP] $ns_ at 1.0 "$ftp1 start" set ftp2 [$tcp2 attach-app FTP] $ns_ at 1.2 "$ftp2 produce 7" set ftp3 [$tcp3 attach-app FTP] $ns_ at 1.2 "$ftp3 produce 7" $self tcpDump $tcp1 1.0 $self tcpDump $tcp2 1.0 $self tcpDump $tcp3 1.0 # Trace only the bottleneck link $self traceQueues $node_(r1) [$self openTrace 5.0 $testName_] $ns_ run}Class Test/reno2 -superclass TestSuiteTest/reno2 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ reno2 $self next}Test/reno2 instproc run {} { $self instvar ns_ node_ testName_ $ns_ queue-limit $node_(r1) $node_(k1) 9 set tcp1 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(k1) 0] $tcp1 set window_ 50 set tcp2 [$ns_ create-connection-listen TCP/FullTcp $node_(s2) TCP/FullTcp $node_(k1) 1] $tcp2 set window_ 20 set ftp1 [$tcp1 attach-app FTP] set ftp2 [$tcp2 attach-app FTP] $ns_ at 1.0 "$ftp1 start" $ns_ at 1.0 "$ftp2 start" $self tcpDump $tcp1 1.0 # Trace only the bottleneck link $self traceQueues $node_(r1) [$self openTrace 10.0 $testName_] $ns_ run}Class Test/reno3 -superclass TestSuiteTest/reno3 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ reno3 $self next}Test/reno3 instproc run {} { $self instvar ns_ node_ testName_ $ns_ queue-limit $node_(r1) $node_(k1) 8 $ns_ queue-limit $node_(k1) $node_(r1) 8 set tcp1 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(k1) 0] $tcp1 set window_ 100 set tcp2 [$ns_ create-connection-listen TCP/FullTcp $node_(s2) TCP/FullTcp $node_(k1) 1] $tcp2 set window_ 16 set ftp1 [$tcp1 attach-app FTP] set ftp2 [$tcp2 attach-app FTP] $ns_ at 1.0 "$ftp1 start" $ns_ at 0.5 "$ftp2 start" $self tcpDump $tcp1 1.0 # Trace only the bottleneck link $self traceQueues $node_(r1) [$self openTrace 8.0 $testName_] $ns_ run}# # Delayed Acknowledgements don't seem to work with FullTcp.# # Class Test/reno4 -superclass TestSuite# Test/reno4 instproc init topo {# $self instvar net_ defNet_ test_# set net_ $topo# set defNet_ net2# set test_ reno4# $self next# }# Test/reno4 instproc run {} {# $self instvar ns_ node_ testName_# # $ns_ queue-limit $node_(r1) $node_(r2) 29# # set tcp1 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(r2) 0]# ## Set delayed acknowledgements somehow!!# $tcp1 set window_ 80# $tcp1 set maxcwnd_ 40# # set ftp1 [$tcp1 attach-app FTP]# $ns_ at 0.0 "$ftp1 start"# # $self tcpDump $tcp1 1.0# # # Trace only the bottleneck link# $self traceQueues $node_(s1) [$self openTrace 2.0 $testName_]# $ns_ run# }# # Class Test/reno4a -superclass TestSuite# Test/reno4a instproc init topo {# $self instvar net_ defNet_ test_# set net_ $topo# set defNet_ net2# set test_ reno4a# $self next# }# Test/reno4a instproc run {} {# $self instvar ns_ node_ testName_# # $ns_ queue-limit $node_(r1) $node_(r2) 29# # set tcp1 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp/DelAck $node_(r2) 0]# $tcp1 set window_ 40# $tcp1 set maxcwnd_ 40# # set ftp1 [$tcp1 attach-app FTP]# $ns_ at 0.0 "$ftp1 start"# # $self tcpDump $tcp1 1.0# # # Trace only the bottleneck link# $self traceQueues $node_(s1) [$self openTrace 4.0 $testName_]# $ns_ run# }Class Test/reno5 -superclass TestSuiteTest/reno5 instproc init topo { $self instvar net_ defNet_ test_ set net_ $topo set defNet_ net0 set test_ reno5 $self next}Test/reno5 instproc run {} { $self instvar ns_ node_ testName_ $ns_ queue-limit $node_(r1) $node_(k1) 9 set tcp1 [$ns_ create-connection-listen TCP/FullTcp $node_(s1) TCP/FullTcp $node_(k1) 0] $tcp1 set window_ 50 $tcp1 set bugFix_ false set tcp2 [$ns_ create-connection-listen TCP/FullTcp $node_(s2) TCP/FullTcp $node_(k1) 1] $tcp2 set window_ 20 $tcp2 set bugFix_ false set ftp1 [$tcp1 attach-app FTP]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -