aboutsummaryrefslogtreecommitdiff
path: root/tools/tcpcong_example.txt
blob: 837c3b20c8991966fe2a59c2225e4acf2365a442 (plain)
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
Demonstrations of tcpcong, the Linux eBPF/bcc version.

This tool traces linux kernel's tcp congestion control status change functions,
then calculate duration of every status and record it, at last prints it as 
tables or histogram, which can be used for evaluating the tcp congestion 
algorithm's performance.

For example:

./tcpcong 
Tracing tcp congestion control status duration... Hit Ctrl-C to end.
^C
LAddrPort            RAddrPort             Open_ms Dod_ms Rcov_ms Cwr_ms  Los_ms Chgs 
192.168.219.3/34968   192.168.219.4/19230   884     12     102     507     0      2721
192.168.219.3/34976   192.168.219.4/19230   869     12     133     490     0      2737
192.168.219.3/34982   192.168.219.4/19230   807     0      0       699     0      3158
192.168.219.3/34988   192.168.219.4/19230   892     16     88      508     0      2540
192.168.219.3/38946   192.168.219.4/19229   894     13     97      500     0      2697
192.168.219.3/38950   192.168.219.4/19229   840     10     73      579     1      1840
192.168.219.3/38970   192.168.219.4/19229   862     17     91      534     0      2339
192.168.219.3/38982   192.168.219.4/19229   812     13     92      587     0      2102
192.168.219.3/39070   192.168.219.1/19225   855     7      61      580     0      2826
192.168.219.3/39098   192.168.219.1/19225   880     8      47      568     0      2557
192.168.219.3/39112   192.168.219.1/19225   674     2      10      819     0      2867
192.168.219.3/39120   192.168.219.1/19225   757     1      11      736     0      2978
192.168.219.3/41146   192.168.219.1/19227   736     1      10      758     0      2972
192.168.219.3/41162   192.168.219.1/19227   662     2      10      830     0      2889
192.168.219.3/41178   192.168.219.1/19227   646     2      11      846     0      2858
192.168.219.3/41192   192.168.219.1/19227   812     9      67      615     0      2204
192.168.219.3/43856   192.168.219.2/19225   745     1      5       754     0      3067
192.168.219.3/43858   192.168.219.2/19225   827     4      36      636     0      2130
192.168.219.3/43872   192.168.219.2/19225   739     0      2       764     0      3035
192.168.219.3/43880   192.168.219.2/19225   747     0      3       756     0      3144
192.168.219.3/47230   192.168.219.2/19227   830     4      38      632     0      2554
192.168.219.3/47242   192.168.219.2/19227   782     3      32      687     0      2136
192.168.219.3/47272   192.168.219.2/19227   611     1      3       889     0      2629
192.168.219.3/47294   192.168.219.2/19227   832     3      38      630     0      2631
192.168.219.3/49716   192.168.219.2/19226   846     4      44      610     0      2562
192.168.219.3/49746   192.168.219.2/19226   765     0      4       736     0      2998
192.168.219.3/49760   192.168.219.2/19226   812     2      47      644     0      2273
192.168.219.3/49766   192.168.219.2/19226   724     0      2       779     0      3106
192.168.219.3/54076   192.168.219.1/19226   690     1      9       804     0      2939
192.168.219.3/54096   192.168.219.1/19226   715     2      10      778     0      2974
192.168.219.3/54114   192.168.219.1/19226   878     6      61      558     0      2742
192.168.219.3/54120   192.168.219.1/19226   738     0      9       757     0      2959
192.168.219.3/60926   192.168.219.4/19228   711     11     80      702     0      1870
192.168.219.3/60930   192.168.219.4/19228   785     0      0       720     0      3325
192.168.219.3/60942   192.168.219.4/19228   762     0      1       743     0      3342
192.168.219.3/60948   192.168.219.4/19228   877     11     102     514     0      2654

The example shows all tcp socket's congestion status duration for milliseconds,
open_ms column is the duration of tcp connection in open status whose cwnd can
increase; dod_ms column is the duration of tcp connection in disorder status 
who receives disordered packet; rcov_ms column is the duration of tcp 
connection in recovery status who receives 3 duplicated acks; cwr_ms column 
is the duration of tcp connection who receives explicitly congest notifier and
two acks to reduce the cwnd. the last column chgs prints total status change 
number of the socket.

An interval can be provided, and also optionally a count. Eg, printing output
every 1 second, and including timestamps (-T):
./tcpcong -T 1 3 
Tracing tcp congestion control status duration... Hit Ctrl-C to end.

07:37:55
LAddrPort            RAddrPort             Open_ms Dod_ms Rcov_ms Cwr_ms  Los_ms Chgs 
192.168.219.3/34968   192.168.219.4/19230   742     15     82      311     0      1678
192.168.219.3/34976   192.168.219.4/19230   700     12     98      340     0      1965
192.168.219.3/34982   192.168.219.4/19230   634     0      1       516     0      2471
192.168.219.3/34988   192.168.219.4/19230   692     12     94      354     0      1941
192.168.219.3/38946   192.168.219.4/19229   722     12     90      323     0      2006
192.168.219.3/38950   192.168.219.4/19229   420     7      264     439     1      951
192.168.219.3/38970   192.168.219.4/19229   724     14     90      323     0      1986
192.168.219.3/38982   192.168.219.4/19229   686     13     87      365     0      1675
192.168.219.3/39070   192.168.219.1/19225   653     5      46      446     0      1998
192.168.219.3/39098   192.168.219.1/19225   667     4      38      440     0      2098
192.168.219.3/39112   192.168.219.1/19225   606     0      1       543     0      2146
192.168.219.3/39120   192.168.219.1/19225   492     0      205     453     0      1916
192.168.219.3/41146   192.168.219.1/19227   583     0      3       564     0      2332
192.168.219.3/41162   192.168.219.1/19227   536     0      1       613     0      2192
192.168.219.3/41178   192.168.219.1/19227   499     0      2       649     0      2064
192.168.219.3/41192   192.168.219.1/19227   622     6      34      488     0      1660
192.168.219.3/43856   192.168.219.2/19225   555     0      1       593     0      2359
192.168.219.3/43858   192.168.219.2/19225   618     3      28      502     0      1773
192.168.219.3/43872   192.168.219.2/19225   558     0      0       592     0      2318
192.168.219.3/43880   192.168.219.2/19225   580     0      1       569     0      2303
192.168.219.3/47230   192.168.219.2/19227   646     1      18      485     0      1776
192.168.219.3/47242   192.168.219.2/19227   634     0      20      495     0      1582
192.168.219.3/47272   192.168.219.2/19227   463     0      1       687     0      1854
192.168.219.3/47294   192.168.219.2/19227   636     2      27      486     0      1901
192.168.219.3/49716   192.168.219.2/19226   646     2      28      475     0      1832
192.168.219.3/49746   192.168.219.2/19226   583     0      0       567     0      2333
192.168.219.3/49760   192.168.219.2/19226   628     2      26      495     0      1755
192.168.219.3/49766   192.168.219.2/19226   558     0      0       592     0      2412
192.168.219.3/54076   192.168.219.1/19226   581     0      2       567     0      2042
192.168.219.3/54096   192.168.219.1/19226   554     0      2       594     0      2239
192.168.219.3/54114   192.168.219.1/19226   685     4      33      427     0      1859
192.168.219.3/54120   192.168.219.1/19226   611     0      3       537     0      2322
192.168.219.3/60926   192.168.219.4/19228   681     20     101     347     0      1636
192.168.219.3/60930   192.168.219.4/19228   616     0      1       532     0      2310
192.168.219.3/60942   192.168.219.4/19228   607     0      1       543     0      2433
192.168.219.3/60948   192.168.219.4/19228   597     11     76      293     0      1641

07:37:57
LAddrPort            RAddrPort             Open_ms Dod_ms Rcov_ms Cwr_ms  Los_ms Chgs 
192.168.219.3/34968   192.168.219.4/19230   469     9      255     265     0      1305
192.168.219.3/34976   192.168.219.4/19230   580     11     91      316     0      1916
192.168.219.3/34982   192.168.219.4/19230   566     0      0       433     0      2092
192.168.219.3/34988   192.168.219.4/19230   583     9      63      345     0      1871
192.168.219.3/38946   192.168.219.4/19229   449     16     69      464     0      1425
192.168.219.3/38950   192.168.219.4/19229   569     10     68      349     0      1848
192.168.219.3/38970   192.168.219.4/19229   573     20     66      339     0      1839
192.168.219.3/38982   192.168.219.4/19229   553     9      60      378     0      1483
192.168.219.3/39070   192.168.219.1/19225   471     3      243     280     0      1279
192.168.219.3/39098   192.168.219.1/19225   598     4      37      355     0      1717
192.168.219.3/39112   192.168.219.1/19225   522     0      1       476     0      1816
192.168.219.3/39120   192.168.219.1/19225   518     0      1       480     0      2031
192.168.219.3/41146   192.168.219.1/19227   500     0      3       497     0      1996
192.168.219.3/41162   192.168.219.1/19227   448     0      2       548     0      1849
192.168.219.3/41178   192.168.219.1/19227   441     0      4       554     0      1693
192.168.219.3/41192   192.168.219.1/19227   555     4      34      405     0      1341
192.168.219.3/43856   192.168.219.2/19225   471     0      3       525     0      2118
192.168.219.3/43858   192.168.219.2/19225   541     1      25      430     0      1446
192.168.219.3/43872   192.168.219.2/19225   483     0      1       516     0      2044
192.168.219.3/43880   192.168.219.2/19225   492     0      0       507     0      2073
192.168.219.3/47230   192.168.219.2/19227   581     3      29      385     0      1453
192.168.219.3/47242   192.168.219.2/19227   571     2      22      403     0      1292
192.168.219.3/47272   192.168.219.2/19227   393     0      0       604     0      1516
192.168.219.3/47294   192.168.219.2/19227   575     2      27      393     0      1660
192.168.219.3/49716   192.168.219.2/19226   584     1      25      389     0      1582
192.168.219.3/49746   192.168.219.2/19226   513     0      0       486     0      2017
192.168.219.3/49760   192.168.219.2/19226   560     1      24      412     0      1370
192.168.219.3/49766   192.168.219.2/19226   474     0      0       525     0      2121
192.168.219.3/54076   192.168.219.1/19226   504     0      1       494     0      1724
192.168.219.3/54096   192.168.219.1/19226   490     0      2       507     0      1906
192.168.219.3/54114   192.168.219.1/19226   611     3      25      360     0      1560
192.168.219.3/54120   192.168.219.1/19226   520     0      1       479     0      2010
192.168.219.3/60926   192.168.219.4/19228   527     9      53      408     0      1473
192.168.219.3/60930   192.168.219.4/19228   551     0      0       448     0      1951
192.168.219.3/60942   192.168.219.4/19228   538     0      0       461     0      2038
192.168.219.3/60948   192.168.219.4/19228   511     9      68      295     1      1701

07:37:58
LAddrPort            RAddrPort             Open_ms Dod_ms Rcov_ms Cwr_ms  Los_ms Chgs
192.168.219.3/34968   192.168.219.4/19230   293     1      226     211     0      755
192.168.219.3/34976   192.168.219.4/19230   424     4      36      354     0      1489
192.168.219.3/34982   192.168.219.4/19230   552     0      0       446     0      2249
192.168.219.3/34988   192.168.219.4/19230   493     4      42      327     0      1715
192.168.219.3/38946   192.168.219.4/19229   425     4      37      340     41     1478
192.168.219.3/38950   192.168.219.4/19229   465     5      45      335     0      1586
192.168.219.3/38970   192.168.219.4/19229   531     5      41      420     0      1863
192.168.219.3/38982   192.168.219.4/19229   525     5      41      427     0      1625
192.168.219.3/39070   192.168.219.1/19225   576     4      44      374     0      1787
192.168.219.3/39098   192.168.219.1/19225   596     6      41      355     0      1782
192.168.219.3/39112   192.168.219.1/19225   501     0      3       494     0      1887
192.168.219.3/39120   192.168.219.1/19225   511     0      4       483     0      2070
192.168.219.3/41146   192.168.219.1/19227   503     0      3       492     0      2068
192.168.219.3/41162   192.168.219.1/19227   449     1      3       545     0      1962
192.168.219.3/41178   192.168.219.1/19227   445     0      5       546     0      1907
192.168.219.3/41192   192.168.219.1/19227   436     4      248     309     0      1208
192.168.219.3/43856   192.168.219.2/19225   480     0      0       519     0      2108
192.168.219.3/43858   192.168.219.2/19225   534     3      24      437     0      1644
192.168.219.3/43872   192.168.219.2/19225   480     0      0       519     0      2068
192.168.219.3/43880   192.168.219.2/19225   490     0      0       508     0      2083
192.168.219.3/47230   192.168.219.2/19227   561     3      22      411     0      1556
192.168.219.3/47242   192.168.219.2/19227   550     2      22      424     0      1485
192.168.219.3/47272   192.168.219.2/19227   398     0      0       601     0      1537
192.168.219.3/47294   192.168.219.2/19227   551     1      19      427     0      1712
192.168.219.3/49716   192.168.219.2/19226   570     1      20      405     0      1712
192.168.219.3/49746   192.168.219.2/19226   494     0      0       503     0      2052
192.168.219.3/49760   192.168.219.2/19226   547     1      18      431     0      1673
192.168.219.3/49766   192.168.219.2/19226   497     0      0       501     0      1983
192.168.219.3/54076   192.168.219.1/19226   495     0      4       499     0      1849
192.168.219.3/54096   192.168.219.1/19226   485     0      4       508     0      2037
192.168.219.3/54114   192.168.219.1/19226   603     5      37      354     0      1671
192.168.219.3/54120   192.168.219.1/19226   516     0      1       482     0      2047
192.168.219.3/60926   192.168.219.4/19228   543     5      39      412     0      1708
192.168.219.3/60930   192.168.219.4/19228   530     0      0       469     0      2096
192.168.219.3/60942   192.168.219.4/19228   510     0      0       489     0      2234
192.168.219.3/60948   192.168.219.4/19228   565     4      61      367     0      1956

An local port and remote port can be specified, and also optionally a count.
Eg printing output every 1 second, and including timestamps (-T) for local
ports 30000-40000 and remote ports 19225-19227:
./tcpcong -T -L 30000-40000 -R 19225-19227 1 3    
Tracing tcp congestion control status duration... Hit Ctrl-C to end.

07:39:11
LAddrPort            RAddrPort             Open_ms Dod_ms Rcov_ms Cwr_ms  Los_ms Chgs 
192.168.219.3/39070   192.168.219.1/19225   668     4      32      455     0      1706
192.168.219.3/39098   192.168.219.1/19225   692     4      38      424     0      2110
192.168.219.3/39112   192.168.219.1/19225   564     0      2       593     0      2291
192.168.219.3/39120   192.168.219.1/19225   599     0      4       555     0      2387

07:39:12
LAddrPort            RAddrPort             Open_ms Dod_ms Rcov_ms Cwr_ms  Los_ms Chgs 
192.168.219.3/39070   192.168.219.1/19225   576     3      27      391     0      1525
192.168.219.3/39098   192.168.219.1/19225   580     3      36      379     0      1893
192.168.219.3/39112   192.168.219.1/19225   474     1      10      512     0      2009
192.168.219.3/39120   192.168.219.1/19225   505     1      9       483     0      2022

07:39:13
LAddrPort            RAddrPort             Open_ms Dod_ms Rcov_ms Cwr_ms  Los_ms Chgs 
192.168.219.3/39070   192.168.219.1/19225   546     6      27      418     0      1659
192.168.219.3/39098   192.168.219.1/19225   564     4      40      390     0      1937
192.168.219.3/39112   192.168.219.1/19225   479     0      3       514     0      2008
192.168.219.3/39120   192.168.219.1/19225   515     0      4       479     0      1982

The (-u) option can be specified for recording the duration as miroseconds.
Eg printing output every 1 second, and including timestamps (-T) and 
microseconds (-u) for local ports 30000-40000 and remote ports 19225-19227:
./tcpcong -T -u -L 30000-40000 -R 19225-19227 1 3 
Tracing tcp congestion control status duration... Hit Ctrl-C to end.

07:39:44
LAddrPort            RAddrPort             Open_us Dod_us Rcov_us Cwr_us  Los_us Chgs 
192.168.219.3/39070   192.168.219.1/19225   600971  3232   38601   509796  0      1843
192.168.219.3/39098   192.168.219.1/19225   667184  5585   26285   453575  0      1969
192.168.219.3/39112   192.168.219.1/19225   580982  22     1502    569479  0      2210
192.168.219.3/39120   192.168.219.1/19225   600280  201    955     550752  0      2327

07:39:45
LAddrPort            RAddrPort             Open_us Dod_us Rcov_us Cwr_us  Los_us Chgs 
192.168.219.3/39070   192.168.219.1/19225   567189  2029   25966   404698  0      1612
192.168.219.3/39098   192.168.219.1/19225   597201  2263   24073   376454  0      1578
192.168.219.3/39112   192.168.219.1/19225   500792  846    9297    489264  0      1850
192.168.219.3/39120   192.168.219.1/19225   518700  94     749     480171  0      1967

07:39:46
LAddrPort            RAddrPort             Open_us Dod_us Rcov_us Cwr_us  Los_us Chgs 
192.168.219.3/39070   192.168.219.1/19225   587340  5324   37035   370066  0      1602
192.168.219.3/39098   192.168.219.1/19225   532986  5630   31624   345336  0      1319
192.168.219.3/39112   192.168.219.1/19225   481936  1129   6244    510235  0      1909
192.168.219.3/39120   192.168.219.1/19225   507196  316    6200    485737  0      1957


the ipv6 example with (-u) option can be shown.
Eg printing output every 1 second, and including timestamps (-T) and
microseconds (-u) for local ports 30000-40000 and remote ports 19225-19227:
./tcpcong.py -T -u -L 30000-40000 -R 19225-19227 1 3
Tracing tcp congestion control status duration... Hit Ctrl-C to end.

11:31:55
LAddrPort6                       RAddrPort6                       Open_us Dod_us Rcov_us Cwr_us  Los_us Chgs
fe80::bace:f6ff:fe14:d21c/32810  fe80::bace:f6ff:fe43:fe96/19226  876328  0       0       137957 0      235
fe80::bace:f6ff:fe14:d21c/32812  fe80::bace:f6ff:fe43:fe96/19226  757739  0       0       283114 0      590
fe80::bace:f6ff:fe14:d21c/32814  fe80::bace:f6ff:fe43:fe96/19226  855426  0       0       136134 0      231
fe80::bace:f6ff:fe14:d21c/32816  fe80::bace:f6ff:fe43:fe96/19226  695271  0       0       345443 0      606

11:31:56
LAddrPort6                       RAddrPort6                       Open_us Dod_us Rcov_us Cwr_us  Los_us Chgs
fe80::bace:f6ff:fe14:d21c/32810  fe80::bace:f6ff:fe43:fe96/19226  913925  0       0       81995  0      92
fe80::bace:f6ff:fe14:d21c/32812  fe80::bace:f6ff:fe43:fe96/19226  785024  0       0       202819 0      777
fe80::bace:f6ff:fe14:d21c/32814  fe80::bace:f6ff:fe43:fe96/19226  920963  0       0       80715  0      111
fe80::bace:f6ff:fe14:d21c/32816  fe80::bace:f6ff:fe43:fe96/19226  765172  0       0       222897 0      734

11:31:57
LAddrPort6                       RAddrPort6                       Open_us Dod_us Rcov_us Cwr_us  Los_us Chgs
fe80::bace:f6ff:fe14:d21c/32810  fe80::bace:f6ff:fe43:fe96/19226  839563  0       0       98313  0      149
fe80::bace:f6ff:fe14:d21c/32812  fe80::bace:f6ff:fe43:fe96/19226  534816  0       0       329683 0      495
fe80::bace:f6ff:fe14:d21c/32814  fe80::bace:f6ff:fe43:fe96/19226  841706  103     2404    91273  0      132
fe80::bace:f6ff:fe14:d21c/32816  fe80::bace:f6ff:fe43:fe96/19226  633320  0       0       286584 0      565


The distribution of congestion status duration can be printed as a histogram 
with the -d option and also optionally a count. Eg printing output every 
1 second for microseconds, and including timestamps (-T):
./tcpcong.py -d -u -T 1 2
Tracing tcp congestion control status duration... Hit Ctrl-C to end.

07:40:12

tcp_congest_state = cwr
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 11       |                                        |
         8 -> 15         : 10       |                                        |
        16 -> 31         : 25       |                                        |
        32 -> 63         : 58       |                                        |
        64 -> 127        : 117      |                                        |
       128 -> 255        : 2924     |*******                                 |
       256 -> 511        : 16249    |****************************************|
       512 -> 1023       : 15340    |*************************************   |
      1024 -> 2047       : 786      |*                                       |
      2048 -> 4095       : 24       |                                        |
      4096 -> 8191       : 7        |                                        |
      8192 -> 16383      : 0        |                                        |
     16384 -> 32767      : 0        |                                        |
     32768 -> 65535      : 1        |                                        |
     65536 -> 131071     : 0        |                                        |
    131072 -> 262143     : 1        |                                        |

tcp_congest_state = recovery
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 1        |                                        |
         8 -> 15         : 0        |                                        |
        16 -> 31         : 2        |                                        |
        32 -> 63         : 9        |                                        |
        64 -> 127        : 28       |                                        |
       128 -> 255        : 895      |******************************          |
       256 -> 511        : 1190     |****************************************|
       512 -> 1023       : 384      |************                            |
      1024 -> 2047       : 66       |**                                      |
      2048 -> 4095       : 2        |                                        |
      4096 -> 8191       : 4        |                                        |
      8192 -> 16383      : 2        |                                        |
     16384 -> 32767      : 0        |                                        |
     32768 -> 65535      : 0        |                                        |
     65536 -> 131071     : 0        |                                        |
    131072 -> 262143     : 2        |                                        |

tcp_congest_state = disorder
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 21       |**                                      |
         8 -> 15         : 59       |*****                                   |
        16 -> 31         : 102      |*********                               |
        32 -> 63         : 256      |*************************               |
        64 -> 127        : 409      |****************************************|
       128 -> 255        : 255      |************************                |
       256 -> 511        : 104      |**********                              |
       512 -> 1023       : 8        |                                        |

tcp_congest_state = open
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 11       |                                        |
         4 -> 7          : 266      |                                        |
         8 -> 15         : 319      |                                        |
        16 -> 31         : 396      |*                                       |
        32 -> 63         : 488      |*                                       |
        64 -> 127        : 695      |**                                      |
       128 -> 255        : 4395     |*************                           |
       256 -> 511        : 13329    |****************************************|
       512 -> 1023       : 12727    |**************************************  |
      1024 -> 2047       : 3327     |*********                               |
      2048 -> 4095       : 601      |*                                       |
      4096 -> 8191       : 45       |                                        |
      8192 -> 16383      : 3        |                                        |
     16384 -> 32767      : 1        |                                        |
     32768 -> 65535      : 1        |                                        |

tcp_congest_state = loss
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 0        |                                        |
         8 -> 15         : 0        |                                        |
        16 -> 31         : 0        |                                        |
        32 -> 63         : 0        |                                        |
        64 -> 127        : 0        |                                        |
       128 -> 255        : 1        |****************************************|
       256 -> 511        : 1        |****************************************|
       512 -> 1023       : 0        |                                        |
      1024 -> 2047       : 0        |                                        |
      2048 -> 4095       : 0        |                                        |
      4096 -> 8191       : 0        |                                        |
      8192 -> 16383      : 0        |                                        |
     16384 -> 32767      : 0        |                                        |
     32768 -> 65535      : 1        |****************************************|

07:40:14

tcp_congest_state = cwr
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 7        |                                        |
         4 -> 7          : 162      |                                        |
         8 -> 15         : 591      |*                                       |
        16 -> 31         : 462      |                                        |
        32 -> 63         : 351      |                                        |
        64 -> 127        : 441      |                                        |
       128 -> 255        : 4073     |********                                |
       256 -> 511        : 19188    |****************************************|
       512 -> 1023       : 16127    |*********************************       |
      1024 -> 2047       : 725      |*                                       |
      2048 -> 4095       : 23       |                                        |
      4096 -> 8191       : 3        |                                        |
      8192 -> 16383      : 2        |                                        |
     16384 -> 32767      : 0        |                                        |
     32768 -> 65535      : 4        |                                        |
     65536 -> 131071     : 0        |                                        |
    131072 -> 262143     : 2        |                                        |

tcp_congest_state = recovery
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 3        |                                        |
         8 -> 15         : 16       |                                        |
        16 -> 31         : 22       |                                        |
        32 -> 63         : 37       |*                                       |
        64 -> 127        : 75       |**                                      |
       128 -> 255        : 1082     |*******************************         |
       256 -> 511        : 1364     |****************************************|
       512 -> 1023       : 369      |**********                              |
      1024 -> 2047       : 67       |*                                       |
      2048 -> 4095       : 0        |                                        |
      4096 -> 8191       : 2        |                                        |
      8192 -> 16383      : 0        |                                        |
     16384 -> 32767      : 0        |                                        |
     32768 -> 65535      : 0        |                                        |
     65536 -> 131071     : 0        |                                        |
    131072 -> 262143     : 5        |                                        |

tcp_congest_state = disorder
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 4        |                                        |
         4 -> 7          : 43       |****                                    |
         8 -> 15         : 107      |***********                             |
        16 -> 31         : 145      |***************                         |
        32 -> 63         : 312      |*********************************       |
        64 -> 127        : 370      |****************************************|
       128 -> 255        : 256      |***************************             |
       256 -> 511        : 101      |**********                              |
       512 -> 1023       : 8        |                                        |

tcp_congest_state = open
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 21       |                                        |
         4 -> 7          : 359      |                                        |
         8 -> 15         : 516      |*                                       |
        16 -> 31         : 484      |*                                       |
        32 -> 63         : 522      |*                                       |
        64 -> 127        : 818      |**                                      |
       128 -> 255        : 5081     |*************                           |
       256 -> 511        : 14852    |****************************************|
       512 -> 1023       : 13753    |*************************************   |
      1024 -> 2047       : 3224     |********                                |
      2048 -> 4095       : 598      |*                                       |
      4096 -> 8191       : 41       |                                        |
      8192 -> 16383      : 0        |                                        |
     16384 -> 32767      : 1        |                                        |
     32768 -> 65535      : 0        |                                        |
     65536 -> 131071     : 0        |                                        |
    131072 -> 262143     : 1        |                                        |

tcp_congest_state = loss
     usecs               : count     distribution
         0 -> 1          : 0        |                                        |
         2 -> 3          : 0        |                                        |
         4 -> 7          : 0        |                                        |
         8 -> 15         : 0        |                                        |
        16 -> 31         : 0        |                                        |
        32 -> 63         : 0        |                                        |
        64 -> 127        : 1        |******                                  |
       128 -> 255        : 0        |                                        |
       256 -> 511        : 2        |*************                           |
       512 -> 1023       : 6        |****************************************|
      1024 -> 2047       : 0        |                                        |
      2048 -> 4095       : 0        |                                        |
      4096 -> 8191       : 0        |                                        |
      8192 -> 16383      : 0        |                                        |
     16384 -> 32767      : 0        |                                        |
     32768 -> 65535      : 1        |******                                  |


USAGE:
./tcpcong -h
usage: tcpcong [-h] [-L LOCALPORT] [-R REMOTEPORT] [-T] [-d] [-u]
                  [interval] [outputs]

Summarize tcp socket congestion control status duration

positional arguments:
  interval              output interval, in seconds
  outputs               number of outputs

optional arguments:
  -h, --help            show this help message and exit
  -L LOCALPORT, --localport LOCALPORT
                        trace local ports only
  -R REMOTEPORT, --remoteport REMOTEPORT
                        trace the dest ports only
  -T, --timestamp       include timestamp on output
  -d, --dist            show distributions as histograms
  -u, --microseconds    output in microseconds

examples:
    ./tcpcong                 # show tcp congestion status duration
    ./tcpcong 1 10            # show 1 second summaries, 10 times
    ./tcpcong -L 3000-3006 1  # 1s summaries, local port 3000-3006
    ./tcpcong -R 5000-5005 1  # 1s summaries, remote port 5000-5005
    ./tcpcong -uT 1           # 1s summaries, microseconds, and timestamps
    ./tcpcong -d              # show the duration as histograms