File: test-suite-tcpLinux.tcl

package info (click to toggle)
ns2 2.35%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 78,120 kB
  • sloc: cpp: 172,923; tcl: 107,127; perl: 6,391; sh: 6,143; ansic: 5,846; makefile: 812; awk: 525; csh: 355
file content (491 lines) | stat: -rw-r--r-- 17,522 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
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
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
# Copyright (c) 1995 The Regents of the University of California.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# 1. Redistributions of source code must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
#    notice, this list of conditions and the following disclaimer in the
#    documentation and/or other materials provided with the distribution.
# 3. All advertising materials mentioning features or use of this software
#    must display the following acknowledgement:
#	This product includes software developed by the Computer Systems
#	Engineering Group at Lawrence Berkeley Laboratory.
# 4. Neither the name of the University nor of the Laboratory may be used
#    to endorse or promote products derived from this software without
#    specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
# @(#) $Header: /cvsroot/nsnam/ns-2/tcl/test/test-suite-tcpLinux.tcl,v 1.3 2010/04/03 20:40:15 tom_henderson Exp $
#


# This is mostly copied from test-suite-tcpHighspeed

source misc_simple.tcl
remove-all-packet-headers       ; # removes all except common
add-packet-header Flags IP TCP  ; # hdrs reqd for validation test

# FOR UPDATING GLOBAL DEFAULTS:
Agent/TCP set minrto_ 1
# default changed on 10/14/2004.
Queue/RED set bytes_ false              
# default changed on 10/11/2004.
Queue/RED set queue_in_bytes_ false
# default changed on 10/11/2004.
Agent/TCPSink set SYN_immediate_ack_ false
# default changed 02/2010.

# Uncomment the line below to use a random seed for the
#  random number generator.
# ns-random 0

TestSuite instproc finish file {
        global quiet PERL
	$self instvar cwnd_chan_ testName_

        if { [info exists cwnd_chan_] } {
                $self plot_cwnd 1 $testName_ all.cwnd1
    		exec cp temp.cwnd temp.rands
        }
}

Class Topology

Topology instproc node? num {
    $self instvar node_
    return $node_($num)
}


#net 2a:
# s1 =(2ms)=              =(4ms)= s3
#           r1 -(30ms)- r2 
# s2 =(3ms)=              =(5ms)= s4
#
# =: 100Mbps (DropTail)
# -: 30Mbps (RED)
Class Topology/net2red -superclass Topology
Topology/net2red instproc init ns {
    $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]

    $self next
    $ns duplex-link $node_(s1) $node_(r1) 100Mb 2ms DropTail
    $ns duplex-link $node_(s2) $node_(r1) 100Mb 3ms DropTail
    $ns duplex-link $node_(r1) $node_(r2) 30Mb 30ms RED
    # The delay-bandwidth product of this link is 225 1000-byte packets.
    $ns queue-limit $node_(r1) $node_(r2) 100
    $ns queue-limit $node_(r2) $node_(r1) 100
    $ns duplex-link $node_(s3) $node_(r2) 100Mb 4ms DropTail
    $ns duplex-link $node_(s4) $node_(r2) 100Mb 5ms DropTail
    set bottleneck [[$ns link $node_(r1) $node_(r2)] queue]
    $bottleneck set thresh_ 1
    $bottleneck set maxthresh_ 100
    $bottleneck set q_weight_ 0.01
    $bottleneck set mean_pktsize_ 1500
    $bottleneck set linterm_ 10
    $bottleneck set setbit_ false
    $bottleneck set queue_in_bytes_ false
}

Class Topology/net2droptail -superclass Topology
Topology/net2droptail instproc init ns {
    $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]

    $self next
    $ns duplex-link $node_(s1) $node_(r1) 100Mb 2ms DropTail
    $ns duplex-link $node_(s2) $node_(r1) 100Mb 3ms DropTail
    $ns duplex-link $node_(r1) $node_(r2) 30Mb 30ms DropTail
    # The delay-bandwidth product of this link is 225 1000-byte packets.
    $ns queue-limit $node_(r1) $node_(r2) 100
    $ns queue-limit $node_(r2) $node_(r1) 100
    $ns duplex-link $node_(s3) $node_(r2) 100Mb 4ms DropTail
    $ns duplex-link $node_(s4) $node_(r2) 100Mb 5ms DropTail
}
############################################################

# To use windows larger than 1024 pkts, it is necessary to set
# MWS in tcp-sink.h. 

Class Test/tcpLinuxBase -superclass TestSuite
Test/tcpLinuxBase instproc init {} {
    $self instvar net_ test_ guide_ cc_
    set net_ net2red
    set test_	tcpLinuxBase
    set cc_ "naive_reno"
    set guide_	"TCP Linux, base ($cc_ with $net_)"
    $self next noTraceFiles
}
Test/tcpLinuxBase instproc run {} {
    global quiet
    $self instvar ns_ node_ testName_ dumpfile_  guide_ cc_
    if {$quiet == "false"} {puts $guide_}
    $self setTopo
    Agent/TCP set window_ 30000
    set stopTime  240.0
    set stopTime0 [expr $stopTime - 0.001]
    set stopTime2 [expr $stopTime + 0.001]

    set tcp1 \
     [$ns_ create-connection TCP/Linux $node_(s1) TCPSink/Sack1/DelAck $node_(s3) 0]
    set ftp1 [$tcp1 attach-app FTP]
    $self enable_tracecwnd $ns_ $tcp1
    $ns_ at 0.0 "$tcp1 select_ca $cc_"
    $ns_ at 0.0 "$tcp1 set_ca_default_param linux debug_level 2"
    $ns_ at 0.1 "$ftp1 start"
    $ns_ at $stopTime0 "$ftp1 stop"

    set tcp2 \
     [$ns_ create-connection TCP/Linux $node_(s2) TCPSink/Sack1/DelAck $node_(s4) 1]
    set ftp2 [$tcp2 attach-app FTP]
    $self enable_tracecwnd $ns_ $tcp2 all.cwnd1
    $ns_ at 0.0 "$tcp2 select_ca $cc_"
    $ns_ at 60.0 "$ftp2 start"
    $ns_ at 160.0 "$ftp2 stop"

    $ns_ at $stopTime "$tcp1 set cwnd_ 1"
    $ns_ at $stopTime "$tcp2 set cwnd_ 1"
    $ns_ at $stopTime "$self cleanupAll $testName_" 
    $ns_ at $stopTime2 "exit 0"
    $ns_ run
}

Class Test/tcpLinuxDropTail_reno -superclass TestSuite
Test/tcpLinuxDropTail_reno instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ reno
    set net_	net2droptail
    set test_	tcpLinuxDropTail_reno
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_reno instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_reno -superclass TestSuite
Test/tcpLinuxRED_reno instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ reno
    set net_	net2red
    set test_	tcpLinuxRED_reno
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_reno instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_vegas -superclass TestSuite
Test/tcpLinuxDropTail_vegas instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ vegas 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_vegas
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_vegas instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_vegas -superclass TestSuite
Test/tcpLinuxRED_vegas instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ vegas 
    set net_	net2red
    set test_	tcpLinuxRED_vegas
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_vegas instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_htcp -superclass TestSuite
Test/tcpLinuxDropTail_htcp instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ htcp 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_htcp
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_htcp instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_htcp -superclass TestSuite
Test/tcpLinuxRED_htcp instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ htcp 
    set net_	net2red
    set test_	tcpLinuxRED_htcp
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_htcp instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_bic -superclass TestSuite
Test/tcpLinuxDropTail_bic instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ bic 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_bic
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_bic instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_bic -superclass TestSuite
Test/tcpLinuxRED_bic instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ bic 
    set net_	net2red
    set test_	tcpLinuxRED_bic
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_bic instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_cubic -superclass TestSuite
Test/tcpLinuxDropTail_cubic instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ cubic 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_cubic
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_cubic instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_cubic -superclass TestSuite
Test/tcpLinuxRED_cubic instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ cubic 
    set net_	net2red
    set test_	tcpLinuxRED_cubic
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_cubic instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_hybla -superclass TestSuite
Test/tcpLinuxDropTail_hybla instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ hybla 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_hybla
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_hybla instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_hybla -superclass TestSuite
Test/tcpLinuxRED_hybla instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ hybla 
    set net_	net2red
    set test_	tcpLinuxRED_hybla
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_hybla instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_lp -superclass TestSuite
Test/tcpLinuxDropTail_lp instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ lp 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_lp
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_lp instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_lp -superclass TestSuite
Test/tcpLinuxRED_lp instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ lp 
    set net_	net2red
    set test_	tcpLinuxRED_lp
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_lp instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_compound -superclass TestSuite
Test/tcpLinuxDropTail_compound instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ compound 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_compound
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_compound instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_compound -superclass TestSuite
Test/tcpLinuxRED_compound instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ compound 
    set net_	net2red
    set test_	tcpLinuxRED_compound
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_compound instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_veno -superclass TestSuite
Test/tcpLinuxDropTail_veno instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ veno 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_veno
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_veno instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_veno -superclass TestSuite
Test/tcpLinuxRED_veno instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ veno 
    set net_	net2red
    set test_	tcpLinuxRED_veno
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_veno instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_yeah -superclass TestSuite
Test/tcpLinuxDropTail_yeah instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ yeah 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_yeah
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_yeah instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_yeah -superclass TestSuite
Test/tcpLinuxRED_yeah instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ yeah 
    set net_	net2red
    set test_	tcpLinuxRED_yeah
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_yeah instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_illinois -superclass TestSuite
Test/tcpLinuxDropTail_illinois instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ illinois 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_illinois
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_illinois instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_illinois -superclass TestSuite
Test/tcpLinuxRED_illinois instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ illinois 
    set net_	net2red
    set test_	tcpLinuxRED_illinois
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_illinois instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxDropTail_westwood -superclass TestSuite
Test/tcpLinuxDropTail_westwood instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ westwood 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_westwood
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_westwood instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_westwood -superclass TestSuite
Test/tcpLinuxRED_westwood instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ westwood 
    set net_	net2red
    set test_	tcpLinuxRED_westwood
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_westwood instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}


Class Test/tcpLinuxDropTail_highspeed -superclass TestSuite
Test/tcpLinuxDropTail_highspeed instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ highspeed 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_highspeed
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_highspeed instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_highspeed -superclass TestSuite
Test/tcpLinuxRED_highspeed instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ highspeed 
    set net_	net2red
    set test_	tcpLinuxRED_highspeed
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_highspeed instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}


Class Test/tcpLinuxDropTail_scalable -superclass TestSuite
Test/tcpLinuxDropTail_scalable instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ scalable 
    set net_	net2droptail
    set test_	tcpLinuxDropTail_scalable
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxDropTail_scalable instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}

Class Test/tcpLinuxRED_scalable -superclass TestSuite
Test/tcpLinuxRED_scalable instproc init {} {
    $self instvar test_ guide_ cc_ net_
    set cc_ scalable 
    set net_	net2red
    set test_	tcpLinuxRED_scalable
    set guide_	"TCP Linux congestion control: $cc_ with $net_"
    Test/tcpLinuxRED_scalable instproc run {} [Test/tcpLinuxBase info instbody run ]
    $self next noTraceFiles
}



TestSuite runTest