test-suite-sack-full.tcl
上传用户:rrhhcc
上传日期:2015-12-11
资源大小:54129k
文件大小:19k
源码类别:

通讯编程

开发平台:

Visual C++

  1. #
  2. # Copyright (c) 1995 The Regents of the University of California.
  3. # All rights reserved.
  4. #
  5. # Redistribution and use in source and binary forms, with or without
  6. # modification, are permitted provided that the following conditions
  7. # are met:
  8. # 1. Redistributions of source code must retain the above copyright
  9. #    notice, this list of conditions and the following disclaimer.
  10. # 2. Redistributions in binary form must reproduce the above copyright
  11. #    notice, this list of conditions and the following disclaimer in the
  12. #    documentation and/or other materials provided with the distribution.
  13. # 3. All advertising materials mentioning features or use of this software
  14. #    must display the following acknowledgement:
  15. # This product includes software developed by the Computer Systems
  16. # Engineering Group at Lawrence Berkeley Laboratory.
  17. # 4. Neither the name of the University nor of the Laboratory may be used
  18. #    to endorse or promote products derived from this software without
  19. #    specific prior written permission.
  20. #
  21. # THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  22. # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  23. # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  24. # ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  25. # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  26. # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  27. # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  28. # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  29. # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  30. # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  31. # SUCH DAMAGE.
  32. #
  33. # @(#) $Header: /cvsroot/nsnam/ns-2/tcl/test/test-suite-sack-full.tcl,v 1.22 2006/01/24 23:00:07 sallyfloyd Exp $
  34. #
  35. source misc_simple.tcl
  36. remove-all-packet-headers       ; # removes all except common
  37. add-packet-header Flags IP TCP  ; # hdrs reqd for TCP
  38. Agent/TCP set tcpTick_ 0.1
  39. # The default for tcpTick_ is being changed to reflect a changing reality.
  40. Agent/TCP set rfc2988_ false
  41. # The default for rfc2988_ is being changed to true.
  42. # FOR UPDATING GLOBAL DEFAULTS:
  43. Agent/TCP set precisionReduce_ false ;   # default changed on 2006/1/24.
  44. Agent/TCP set rtxcur_init_ 6.0 ;      # Default changed on 2006/01/21
  45. Agent/TCP set updated_rttvar_ false ;  # Variable added on 2006/1/21
  46. Queue/RED set bytes_ false              
  47. # default changed on 10/11/2004.
  48. Queue/RED set queue_in_bytes_ false
  49. # default changed on 10/11/2004.
  50. Queue/RED set q_weight_ 0.002
  51. Queue/RED set thresh_ 5 
  52. Queue/RED set maxthresh_ 15
  53. # The RED parameter defaults are being changed for automatic configuration.
  54. Agent/TCP set useHeaders_ false
  55. # The default is being changed to useHeaders_ true.
  56. Agent/TCP set windowInit_ 1
  57. # The default is being changed to 2.
  58. Agent/TCP set singledup_ 0
  59. # The default is being changed to 1
  60. Agent/TCP set minrto_ 0
  61. # The default is being changed to minrto_ 1
  62. Agent/TCP set syn_ false
  63. Agent/TCP set delay_growth_ false
  64. # In preparation for changing the default values for syn_ and delay_growth_.
  65. set style raw2xg
  66. # set style tcpf2xgr
  67. Trace set show_tcphdr_ 1 ; # needed for plotting ACK numbers
  68. TestSuite instproc finish file {
  69.         global quiet PERL style
  70. set wrap 90
  71. set wrap1 [expr $wrap * 512 + 40]
  72. set space 512
  73. set scale 0.01
  74. if { $style == "tcpf2xgr" } {
  75. set scale [expr $scale * (1.0 / 576.0)]
  76. set space 1
  77. set outtype "xgraph"
  78. set tfile "xxx.tr"
  79. if { $quiet != "true" } {
  80. global TCLSH PERL
  81. exec rm -f $tfile
  82. exec $PERL ../../bin/getrc -b -s 2 -d 3 all.tr > $tfile
  83. puts "Wrote file $tfile (output from getrc -b -s 2 -d 3)..."
  84. exec ../../bin/tcpf2xgr -n $space -s $scale -m $wrap1 $TCLSH $tfile $outtype $file &
  85. puts "copying $tfile to temp.rands"
  86. exec cp $tfile temp.rands ; # needed for compare script
  87. # tcpf2xgr runs xgraph for us
  88. }
  89.   } elseif { $style == "raw2xg" } {
  90. exec $PERL ../../bin/getrc -s 2 -d 3 all.tr | 
  91.    $PERL ../../bin/raw2xg -c -n $space -s 0.01 -m $wrap1 -t $file 
  92.    > temp.rands
  93.         exec $PERL ../../bin/getrc -s 3 -d 2 all.tr | 
  94.            $PERL ../../bin/raw2xg -a -c -f -n $space -s 0.01 -m $wrap1 -t $file > temp1.rands
  95. if {$quiet == "false"} {
  96. # exec xgraph -bb -tk -nl -m -x time -y packets temp.rands &
  97. # to plot acks:
  98. exec xgraph -bb -tk -nl -m -x time -y packets temp.rands temp1.rands &
  99. }
  100.         }
  101.         ## now use default graphing tool to make a data file
  102.         ## if so desired
  103.         exit 0
  104. }
  105. Class Topology
  106. Topology instproc node? num {
  107.     $self instvar node_
  108.     return $node_($num)
  109. }
  110. # Links1 uses 8Mb, 5ms feeders, and a 800Kb 100ms bottleneck.
  111. # Queue-limit on bottleneck is 6 packets. 
  112. Class Topology/net0 -superclass Topology
  113. Topology/net0 instproc init ns {
  114.     $self instvar node_
  115.     set node_(s1) [$ns node]
  116.     set node_(s2) [$ns node]
  117.     set node_(r1) [$ns node]
  118.     set node_(k1) [$ns node]
  119.     $self next
  120.     $ns duplex-link $node_(s1) $node_(r1) 8Mb 5ms DropTail
  121.     $ns duplex-link $node_(s2) $node_(r1) 8Mb 5ms DropTail
  122.     $ns duplex-link $node_(r1) $node_(k1) 800Kb 100ms DropTail
  123.     $ns queue-limit $node_(r1) $node_(k1) 6
  124.     $ns queue-limit $node_(k1) $node_(r1) 6
  125. }
  126. # Links1 uses 10Mb, 5ms feeders, and a 1.5Mb 100ms bottleneck.
  127. # Queue-limit on bottleneck is 23 packets.
  128. Class Topology/net1 -superclass Topology
  129. Topology/net1 instproc init ns {
  130.     $self instvar node_
  131.     set node_(s1) [$ns node]
  132.     set node_(s2) [$ns node]
  133.     set node_(r1) [$ns node]
  134.     set node_(k1) [$ns node]
  135.     $self next 
  136.     $ns duplex-link $node_(s1) $node_(r1) 10Mb 5ms DropTail
  137.     $ns duplex-link $node_(s2) $node_(r1) 10Mb 5ms DropTail
  138.     $ns duplex-link $node_(r1) $node_(k1) 1.5Mb 100ms DropTail
  139.     $ns queue-limit $node_(r1) $node_(k1) 19
  140.     $ns queue-limit $node_(k1) $node_(r1) 19
  141. }
  142. Class Topology/net2 -superclass Topology
  143. Topology/net2 instproc init ns {
  144.     $self instvar node_
  145.     set node_(s1) [$ns node]
  146.     set node_(s2) [$ns node]
  147.     set node_(r1) [$ns node]
  148.     set node_(r2) [$ns node]
  149.     set node_(s3) [$ns node]
  150.     set node_(s4) [$ns node]
  151.     $self next 
  152.     $ns duplex-link $node_(s1) $node_(r1) 10Mb 2ms DropTail
  153.     $ns duplex-link $node_(s2) $node_(r1) 10Mb 3ms DropTail
  154.     $ns duplex-link $node_(r1) $node_(r2) 1.5Mb 20ms RED
  155.     $ns queue-limit $node_(r1) $node_(r2) 25
  156.     $ns queue-limit $node_(r2) $node_(r1) 25
  157.     $ns duplex-link $node_(s3) $node_(r2) 10Mb 4ms DropTail
  158.     $ns duplex-link $node_(s4) $node_(r2) 10Mb 5ms DropTail
  159. }
  160. TestSuite instproc makeproto { aopen popen win fid apptype appstart } {
  161. $self instvar ns_ node_
  162. set tcp1 [new Agent/TCP/FullTcp/Sack]
  163. set sink [new Agent/TCP/FullTcp/Sack]
  164. $ns_ attach-agent $node_($aopen) $tcp1
  165. $ns_ attach-agent $node_($popen) $sink
  166. $tcp1 set window_ $win
  167. $sink set window_ $win
  168. $tcp1 set fid_ $fid
  169. $sink set fid_ $fid
  170. $ns_ connect $tcp1 $sink
  171. # set up TCP-level connections
  172. $sink listen ; # will figure out who its peer is
  173. if { $apptype != "none" } {
  174. set apphandle [$tcp1 attach-app $apptype]
  175. $ns_ at $appstart "$apphandle start"
  176. }
  177. $self tcpDump $tcp1 1.0
  178. return $tcp1
  179. }
  180. # single packet drop
  181. Class Test/sack1 -superclass TestSuite
  182. Test/sack1 instproc init {} {
  183.     $self instvar net_ test_
  184.     set net_ net0
  185.     set test_ sack1
  186.     $self next pktTraceFile
  187. }
  188. Test/sack1 instproc run {} {
  189.     $self instvar ns_ node_ testName_
  190.     $self setTopo
  191.     $self makeproto s1 k1 14 0 FTP 1.0
  192.     # trace only the bottleneck link
  193.     #$self traceQueues $node_(r1) [$self openTrace 5.0 $testName_]
  194.     $ns_ at 5.0 "$self cleanupAll $testName_"
  195.     $ns_ run
  196. }
  197. Class Test/sack1z -superclass TestSuite
  198. Test/sack1z instproc init {} {
  199.     $self instvar net_ test_
  200.     set net_ net0
  201.     set test_ sack1z
  202.     $self next pktTraceFile
  203. }
  204. Test/sack1z instproc run {} {
  205.     $self instvar ns_ node_ testName_
  206.     $self setTopo
  207.     Agent/TCP set maxburst_ 4
  208.     $self makeproto s1 k1 14 0 FTP 0.0
  209.     # trace only the bottleneck link
  210.     #$self traceQueues $node_(r1) [$self openTrace 5.0 $testName_]
  211.     $ns_ at 5.0 "$self cleanupAll $testName_"
  212.     $ns_ run
  213. }
  214. # three packet drops
  215. Class Test/sack1a -superclass TestSuite
  216. Test/sack1a instproc init {} {
  217.     $self instvar net_ test_
  218.     set net_ net0
  219.     set test_ sack1a
  220.     $self next pktTraceFile
  221. }
  222. Test/sack1a instproc run {} {
  223.     $self instvar ns_ node_ testName_
  224.     $self setTopo
  225.     $self makeproto s1 k1 20 0 FTP 0.0
  226.     # trace only the bottleneck link
  227.     #$self traceQueues $node_(r1) [$self openTrace 5.0 $testName_]
  228.     $ns_ at 5.0 "$self cleanupAll $testName_"
  229.     $ns_ run
  230. }
  231. # three packet drops
  232. Class Test/sack1aa -superclass TestSuite
  233. Test/sack1aa instproc init {} {
  234.     $self instvar net_ test_
  235.     set net_ net0
  236.     set test_ sack1aa
  237.     $self next pktTraceFile
  238. }
  239. Test/sack1aa instproc run {} {
  240.     $self instvar ns_ node_ testName_
  241.     $self setTopo
  242.     Agent/TCP set maxburst_ 4
  243.     $self makeproto s1 k1 20 0 FTP 0.0
  244.     # trace only the bottleneck link
  245.     #$self traceQueues $node_(r1) [$self openTrace 5.0 $testName_]
  246.     $ns_ at 5.0 "$self cleanupAll $testName_"
  247.     $ns_ run
  248. }
  249. Class Test/sack1b -superclass TestSuite
  250. Test/sack1b instproc init {} {
  251.     $self instvar net_ test_
  252.     set net_ net0
  253.     set test_ sack1b
  254.     $self next pktTraceFile
  255. }
  256. Test/sack1b instproc run {} {
  257.     $self instvar ns_ node_ testName_
  258.     $self setTopo
  259.     $self makeproto s1 k1 26 0 FTP 0.0
  260.     # trace only the bottleneck link
  261.     #$self traceQueues $node_(r1) [$self openTrace 5.0 $testName_]
  262.     $ns_ at 5.0 "$self cleanupAll $testName_"
  263.     $ns_ run
  264. }
  265. Class Test/sack1c -superclass TestSuite
  266. Test/sack1c instproc init {} {
  267.     $self instvar net_ test_
  268.     set net_ net0
  269.     set test_ sack1c
  270.     $self next pktTraceFile
  271. }
  272. Test/sack1c instproc run {} {
  273.     $self instvar ns_ node_ testName_
  274.     $self setTopo
  275.     $self makeproto s1 k1 27 0 FTP 0.0
  276.     # trace only the bottleneck link
  277.     #$self traceQueues $node_(r1) [$self openTrace 5.0 $testName_]
  278.     $ns_ at 5.0 "$self cleanupAll $testName_"
  279.     $ns_ run
  280. }
  281. Class Test/sack3 -superclass TestSuite
  282. Test/sack3 instproc init {} {
  283.     $self instvar net_ test_
  284.     set net_ net0
  285.     set test_ sack3
  286.     $self next pktTraceFile
  287. }
  288. Test/sack3 instproc run {} {
  289.     $self instvar ns_ node_ testName_
  290.     $self setTopo
  291.     $ns_ queue-limit $node_(r1) $node_(k1) 8
  292.     $ns_ queue-limit $node_(k1) $node_(r1) 8
  293.     [$self makeproto s1 k1 100 0 FTP 0.95] set bugFix_ false
  294.     [$self makeproto s2 k1 16 1 FTP 0.5] set bugFix_ false
  295.     # trace only the bottleneck link
  296.     #$self traceQueues $node_(r1) [$self openTrace 4.0 $testName_]
  297.     $ns_ at 4.0 "$self cleanupAll $testName_"
  298.     $ns_ run
  299. }
  300. Class Test/sack5 -superclass TestSuite
  301. Test/sack5 instproc init {} {
  302.     $self instvar net_ test_
  303.     set net_ net1
  304.     set test_ sack5
  305.     $self next pktTraceFile
  306. }
  307. Test/sack5 instproc run {} {
  308.     $self instvar ns_ node_ testName_
  309.     $self setTopo
  310.     Agent/TCP set window_ 50
  311.     Agent/TCP set bugFix_ false
  312.     $ns_ delay $node_(s1) $node_(r1) 3ms
  313.     $ns_ delay $node_(r1) $node_(s1) 3ms
  314.     [$self makeproto s1 k1 50 0 FTP 1.0] set bugFix_ false
  315.     set tcp2 [$self makeproto s2 k1 50 1 none -1]
  316.     $tcp2 set bugFix_ false
  317.     set ftp2 [$tcp2 attach-app FTP]
  318.     $ns_ at 1.75 "$ftp2 produce 100"
  319.     $ns_ at 6.0 "$self cleanupAll $testName_"
  320.     $ns_ run
  321. }
  322. Class Test/sack5a -superclass TestSuite
  323. Test/sack5a instproc init {} {
  324.     $self instvar net_ test_
  325.     set net_ net1
  326.     set test_ sack5a
  327.     $self next pktTraceFile
  328. }
  329. Test/sack5a instproc run {} {
  330.     $self instvar ns_ node_ testName_
  331.     $self setTopo
  332.     Agent/TCP set maxburst_ 4
  333.     $ns_ delay $node_(s1) $node_(r1) 3ms
  334.     $ns_ delay $node_(r1) $node_(s1) 3ms
  335.     [$self makeproto s1 k1 50 0 FTP 1.0] set bugFix_ false
  336.     set tcp2 [$self makeproto s2 k1 50 1 none -1]
  337.     $tcp2 set bugFix_ false
  338.     set ftp2 [$tcp2 attach-app FTP]
  339.     $ns_ at 1.75 "$ftp2 produce 100"
  340.     # trace only the bottleneck link
  341.     #$self traceQueues $node_(r1) [$self openTrace 6.0 $testName_]
  342.     $ns_ at 6.0 "$self cleanupAll $testName_"
  343.     $ns_ run
  344. }
  345. # shows a long recovery from sack.
  346. Class Test/sackB2 -superclass TestSuite
  347. Test/sackB2 instproc init {} {
  348.     $self instvar net_ test_
  349.     set net_ net0
  350.     set test_ sackB2
  351.     $self next pktTraceFile
  352. }
  353. Test/sackB2 instproc run {} {
  354.     $self instvar ns_ node_ testName_
  355.     $self setTopo
  356.     $ns_ queue-limit $node_(r1) $node_(k1) 9
  357.     $self makeproto s1 k1 50 0 FTP 1.0
  358.     $self makeproto s2 k1 20 1 FTP 1.0
  359.     # trace only the bottleneck link
  360.     #$self traceQueues $node_(r1) [$self openTrace 8.0 $testName_]
  361.     $ns_ at 8.0 "$self cleanupAll $testName_"
  362.     $ns_ run
  363. }
  364. # two packets dropped
  365. Class Test/sackB4 -superclass TestSuite
  366. Test/sackB4 instproc init {} {
  367.     $self instvar net_ test_
  368.     set net_ net2
  369.     set test_ sackB4
  370.     $self next pktTraceFile
  371. }
  372. Test/sackB4 instproc run {} {
  373.     $self instvar ns_ node_ testName_
  374.     $self setTopo
  375.     $ns_ queue-limit $node_(r1) $node_(r2) 29
  376.     $self makeproto s1 r2 40 0 FTP 0.0
  377.     # trace only the bottleneck link
  378.     #$self traceQueues $node_(r1) [$self openTrace 2.0 $testName_]
  379.     $ns_ at 2.0 "$self cleanupAll $testName_"
  380.     $ns_ run
  381. }
  382. # two packets dropped
  383. Class Test/sackB4a -superclass TestSuite
  384. Test/sackB4a instproc init {} {
  385.     $self instvar net_ test_
  386.     set net_ net2
  387.     set test_ sackB4a
  388.     $self next pktTraceFile
  389. }
  390. Test/sackB4a instproc run {} {
  391.     $self instvar ns_ node_ testName_
  392.     $self setTopo
  393.     $ns_ queue-limit $node_(r1) $node_(r2) 29
  394.     Agent/TCP set maxburst_ 4
  395.     $self makeproto s1 r2 40 0 FTP 0.0
  396.     # trace only the bottleneck link
  397.     #$self traceQueues $node_(r1) [$self openTrace 2.0 $testName_]
  398.     $ns_ at 2.0 "$self cleanupAll $testName_"
  399.     $ns_ run
  400. }
  401. # delayed ack not implemented yet
  402. #Class Test/delayedSack -superclass TestSuite
  403. #Test/delayedSack instproc init {} {
  404. #    $self instvar net_ test_
  405. #    set net_    net0
  406. #    set test_ delayedSack
  407. #    $self next pktTraceFile
  408. #}
  409. #Test/delayedSack instproc run {} {
  410. #     $self instvar ns_ node_ testName_
  411. #     $self setTopo
  412. #     set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(k1) 0]
  413. #     $tcp1 set window_ 50
  414. #     # lookup up the sink and set it's delay interval
  415. #     [$node_(k1) agent [$tcp1 dst-port]] set interval 100ms
  416. #     set ftp1 [$tcp1 attach-app FTP]
  417. #     $ns_ at 1.0 "$ftp1 start"
  418. #     $self tcpDump $tcp1 1.0
  419. #     # trace only the bottleneck link
  420. #     #$self traceQueues $node_(r1) [$self openTrace 4.0 $testName_]
  421. #     $ns_ run
  422. # }
  423. ## segregation
  424. #Class Test/phaseSack -superclass TestSuite
  425. #Test/phaseSack instproc init {} {
  426. #    $self instvar net_ test_
  427. #    set net_ net0
  428. #    set test_ phaseSack
  429. #    $self next pktTraceFile
  430. #}
  431. #Test/phaseSack instproc run {} {
  432. #    $self instvar ns_ node_ testName_
  433. #    $self setTopo
  434. #
  435. #    $ns_ delay $node_(s2) $node_(r1) 3ms
  436. #    $ns_ delay $node_(r1) $node_(s2) 3ms
  437. #    $ns_ queue-limit $node_(r1) $node_(k1) 16
  438. #    $ns_ queue-limit $node_(k1) $node_(r1) 100
  439. #
  440. #    set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(k1) 0]
  441. #    $tcp1 set window_ 32
  442. #
  443. #    set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s2) TCPSink/Sack1 $node_(k1) 1]
  444. #    $tcp2 set window_ 32
  445. #
  446. #    set ftp1 [$tcp1 attach-app FTP]
  447. #    set ftp2 [$tcp2 attach-app FTP]
  448. #
  449. #    $ns_ at 5.0 "$ftp1 start"
  450. #    $ns_ at 1.0 "$ftp2 start"
  451. #
  452. #    $self tcpDump $tcp1 5.0
  453. #
  454. #    # trace only the bottleneck link
  455. #    #$self traceQueues $node_(r1) [$self openTrace 25.0 $testName_]
  456. #    $ns_ run
  457. #}
  458. #
  459. ## random overhead, but segregation remains 
  460. #Class Test/phaseSack2 -superclass TestSuite
  461. #Test/phaseSack2 instproc init {} {
  462. #    $self instvar net_ test_
  463. #    set net_ net0
  464. #    set test_ phaseSack2
  465. #    $self next pktTraceFile
  466. #}
  467. #Test/phaseSack2 instproc run {} {
  468. #    $self instvar ns_ node_ testName_
  469. #    $self setTopo
  470. #
  471. #    $ns_ delay $node_(s2) $node_(r1) 3ms
  472. #    $ns_ delay $node_(r1) $node_(s2) 3ms
  473. #    $ns_ queue-limit $node_(r1) $node_(k1) 16
  474. #    $ns_ queue-limit $node_(k1) $node_(r1) 100
  475. #
  476. #    set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(k1) 0]
  477. #    $tcp1 set window_ 32
  478. #    $tcp1 set overhead_ 0.01
  479. #
  480. #    set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s2) TCPSink/Sack1 $node_(k1) 1]
  481. #    $tcp2 set window_ 32
  482. #    $tcp2 set overhead_ 0.01
  483. #    
  484. #    set ftp1 [$tcp1 attach-app FTP]
  485. #    set ftp2 [$tcp2 attach-app FTP]
  486. #    
  487. #    $ns_ at 5.0 "$ftp1 start"
  488. #    $ns_ at 1.0 "$ftp2 start"
  489. #    
  490. #    $self tcpDump $tcp1 5.0
  491. #    
  492. #    # trace only the bottleneck link
  493. #    #$self traceQueues $node_(r1) [$self openTrace 25.0 $testName_]
  494. #    $ns_ run
  495. #}
  496. #
  497. ## no segregation, because of random overhead
  498. #Class Test/phaseSack3 -superclass TestSuite
  499. #Test/phaseSack3 instproc init {} {
  500. #    $self instvar net_ test_
  501. #    set net_ net0
  502. #    set test_ phaseSack3
  503. #    $self next pktTraceFile
  504. #}
  505. #Test/phaseSack3 instproc run {} {
  506. #    $self instvar ns_ node_ testName_
  507. #    $self setTopo
  508. #
  509. #    $ns_ delay $node_(s2) $node_(r1) 9.5ms
  510. #    $ns_ delay $node_(r1) $node_(s2) 9.5ms
  511. #    $ns_ queue-limit $node_(r1) $node_(k1) 16
  512. #    $ns_ queue-limit $node_(k1) $node_(r1) 100
  513. #
  514. #    set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(k1) 0]
  515. #    $tcp1 set window_ 32
  516. #    $tcp1 set overhead_ 0.01
  517. #
  518. #    set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s2) TCPSink/Sack1 $node_(k1) 1]
  519. #    $tcp2 set window_ 32
  520. #    $tcp2 set overhead_ 0.01
  521. #
  522. #    set ftp1 [$tcp1 attach-app FTP]
  523. #    set ftp2 [$tcp2 attach-app FTP]
  524. #
  525. #    $ns_ at 5.0 "$ftp1 start"
  526. #    $ns_ at 1.0 "$ftp2 start"
  527. #
  528. #    $self tcpDump $tcp1 5.0
  529. #
  530. #    # trace only the bottleneck link
  531. #    #$self traceQueues $node_(r1) [$self openTrace 25.0 $testName_]
  532. #    $ns_ run
  533. #}
  534. #Class Test/timersSack -superclass TestSuite
  535. #Test/timersSack instproc init {} {
  536. #    $self instvar net_ test_
  537. #    set net_ net0
  538. #    set test_ timersSack
  539. #    $self next pktTraceFile
  540. #}
  541. #Test/timersSack instproc run {} {
  542. #     $self instvar ns_ node_ testName_
  543. #     $self setTopo
  544. #     $ns_ queue-limit $node_(r1) $node_(k1) 2
  545. #     $ns_ queue-limit $node_(k1) $node_(r1) 100
  546. #     set tcp1 [$ns_ create-connection TCP/Sack1 $node_(s1) TCPSink/Sack1 $node_(k1) 0]
  547. #     $tcp1 set window_ 4
  548. #     # lookup up the sink and set it's delay interval
  549. #     [$node_(k1) agent [$tcp1 dst-port]] set interval 100ms
  550. #     set tcp2 [$ns_ create-connection TCP/Sack1 $node_(s2) TCPSink/Sack1 $node_(k1) 1]
  551. #     $tcp2 set window_ 4
  552. #     # lookup up the sink and set it's delay interval
  553. #     [$node_(k1) agent [$tcp2 dst-port]] set interval 100ms
  554. #     set ftp1 [$tcp1 attach-app FTP]
  555. #     set ftp2 [$tcp2 attach-app FTP]
  556. #     $ns_ at 1.0 "$ftp1 start"
  557. #     $ns_ at 1.3225 "$ftp2 start"
  558. #     $self tcpDump $tcp1 5.0
  559. #     # trace only the bottleneck link
  560. #     #$self traceQueues $node_(r1) [$self openTrace 10.0 $testName_]
  561. #     $ns_ run
  562. # }
  563. TestSuite runTest