home *** CD-ROM | disk | FTP | other *** search
/ Internet Core Protocols / Oreilly-InternetCoreProtocols.iso / RFCs / rfc2525.txt < prev    next >
Encoding:
Text File  |  1999-10-14  |  137.3 KB  |  3,420 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7. Network Working Group                                          V. Paxson
  8. Request for Comments: 2525                                        Editor
  9. Category: Informational                                     ACIRI / ICSI
  10.                                                                M. Allman
  11.                             NASA Glenn Research Center/Sterling Software
  12.                                                                S. Dawson
  13.                                           Real-Time Computing Laboratory
  14.                                                                W. Fenner
  15.                                                               Xerox PARC
  16.                                                                J. Griner
  17.                                               NASA Glenn Research Center
  18.                                                               I. Heavens
  19.                                                     Spider Software Ltd.
  20.                                                                 K. Lahey
  21.                                            NASA Ames Research Center/MRJ
  22.                                                                 J. Semke
  23.                                         Pittsburgh Supercomputing Center
  24.                                                                  B. Volz
  25.                                             Process Software Corporation
  26.                                                               March 1999
  27.  
  28.  
  29.                    Known TCP Implementation Problems
  30.  
  31. Status of this Memo
  32.  
  33.    This memo provides information for the Internet community.  It does
  34.    not specify an Internet standard of any kind.  Distribution of this
  35.    memo is unlimited.
  36.  
  37. Copyright Notice
  38.  
  39.    Copyright (C) The Internet Society (1999).  All Rights Reserved.
  40.  
  41. Table of Contents
  42.  
  43.    1.  INTRODUCTION....................................................2
  44.    2.  KNOWN IMPLEMENTATION PROBLEMS...................................3
  45.      2.1  No initial slow start........................................3
  46.      2.2  No slow start after retransmission timeout...................6
  47.      2.3  Uninitialized CWND...........................................9
  48.      2.4  Inconsistent retransmission.................................11
  49.      2.5  Failure to retain above-sequence data.......................13
  50.      2.6  Extra additive constant in congestion avoidance.............17
  51.      2.7  Initial RTO too low.........................................23
  52.      2.8  Failure of window deflation after loss recovery.............26
  53.      2.9  Excessively short keepalive connection timeout..............28
  54.      2.10 Failure to back off retransmission timeout..................31
  55.  
  56.  
  57.  
  58. Paxson, et. al.              Informational                      [Page 1]
  59.  
  60. RFC 2525              TCP Implementation Problems             March 1999
  61.  
  62.  
  63.      2.11 Insufficient interval between keepalives....................34
  64.      2.12 Window probe deadlock.......................................36
  65.      2.13 Stretch ACK violation.......................................40
  66.      2.14 Retransmission sends multiple packets.......................43
  67.      2.15 Failure to send FIN notification promptly...................45
  68.      2.16 Failure to send a RST after Half Duplex Close...............47
  69.      2.17 Failure to RST on close with data pending...................50
  70.      2.18 Options missing from TCP MSS calculation....................54
  71.    3.  SECURITY CONSIDERATIONS........................................56
  72.    4.  ACKNOWLEDGEMENTS...............................................56
  73.    5.  REFERENCES.....................................................57
  74.    6.  AUTHORS' ADDRESSES.............................................58
  75.    7.  FULL COPYRIGHT STATEMENT.......................................60
  76.  
  77. 1. Introduction
  78.  
  79.    This memo catalogs a number of known TCP implementation problems.
  80.    The goal in doing so is to improve conditions in the existing
  81.    Internet by enhancing the quality of current TCP/IP implementations.
  82.    It is hoped that both performance and correctness issues can be
  83.    resolved by making implementors aware of the problems and their
  84.    solutions.  In the long term, it is hoped that this will provide a
  85.    reduction in unnecessary traffic on the network, the rate of
  86.    connection failures due to protocol errors, and load on network
  87.    servers due to time spent processing both unsuccessful connections
  88.    and retransmitted data.  This will help to ensure the stability of
  89.    the global Internet.
  90.  
  91.    Each problem is defined as follows:
  92.  
  93.    Name of Problem
  94.       The name associated with the problem.  In this memo, the name is
  95.       given as a subsection heading.
  96.  
  97.    Classification
  98.       One or more problem categories for which the problem is
  99.       classified:  "congestion control", "performance", "reliability",
  100.       "resource management".
  101.  
  102.    Description
  103.       A definition of the problem, succinct but including necessary
  104.       background material.
  105.  
  106.    Significance
  107.       A brief summary of the sorts of environments for which the problem
  108.       is significant.
  109.  
  110.  
  111.  
  112.  
  113.  
  114. Paxson, et. al.              Informational                      [Page 2]
  115.  
  116. RFC 2525              TCP Implementation Problems             March 1999
  117.  
  118.  
  119.    Implications
  120.       Why the problem is viewed as a problem.
  121.  
  122.    Relevant RFCs
  123.       The RFCs defining the TCP specification with which the problem
  124.       conflicts.  These RFCs often qualify behavior using terms such as
  125.       MUST, SHOULD, MAY, and others written capitalized.  See RFC 2119
  126.       for the exact interpretation of these terms.
  127.  
  128.    Trace file demonstrating the problem
  129.       One or more ASCII trace files demonstrating the problem, if
  130.       applicable.
  131.  
  132.    Trace file demonstrating correct behavior
  133.       One or more examples of how correct behavior appears in a trace,
  134.       if applicable.
  135.  
  136.    References
  137.       References that further discuss the problem.
  138.  
  139.    How to detect
  140.       How to test an implementation to see if it exhibits the problem.
  141.       This discussion may include difficulties and subtleties associated
  142.       with causing the problem to manifest itself, and with interpreting
  143.       traces to detect the presence of the problem (if applicable).
  144.  
  145.    How to fix
  146.       For known causes of the problem, how to correct the
  147.       implementation.
  148.  
  149. 2. Known implementation problems
  150.  
  151. 2.1.
  152.  
  153.    Name of Problem
  154.       No initial slow start
  155.  
  156.    Classification
  157.       Congestion control
  158.  
  159.    Description
  160.       When a TCP begins transmitting data, it is required by RFC 1122,
  161.       4.2.2.15, to engage in a "slow start" by initializing its
  162.       congestion window, cwnd, to one packet (one segment of the maximum
  163.       size).  (Note that an experimental change to TCP, documented in
  164.       [RFC2414], allows an initial value somewhat larger than one
  165.       packet.)  It subsequently increases cwnd by one packet for each
  166.       ACK it receives for new data.  The minimum of cwnd and the
  167.  
  168.  
  169.  
  170. Paxson, et. al.              Informational                      [Page 3]
  171.  
  172. RFC 2525              TCP Implementation Problems             March 1999
  173.  
  174.  
  175.       receiver's advertised window bounds the highest sequence number
  176.       the TCP can transmit.  A TCP that fails to initialize and
  177.       increment cwnd in this fashion exhibits "No initial slow start".
  178.  
  179.    Significance
  180.       In congested environments, detrimental to the performance of other
  181.       connections, and possibly to the connection itself.
  182.  
  183.    Implications
  184.       A TCP failing to slow start when beginning a connection results in
  185.       traffic bursts that can stress the network, leading to excessive
  186.       queueing delays and packet loss.
  187.  
  188.       Implementations exhibiting this problem might do so because they
  189.       suffer from the general problem of not including the required
  190.       congestion window.  These implementations will also suffer from
  191.       "No slow start after retransmission timeout".
  192.  
  193.       There are different shades of "No initial slow start".  From the
  194.       perspective of stressing the network, the worst is a connection
  195.       that simply always sends based on the receiver's advertised
  196.       window, with no notion of a separate congestion window.  Another
  197.       form is described in "Uninitialized CWND" below.
  198.  
  199.    Relevant RFCs
  200.       RFC 1122 requires use of slow start.  RFC 2001 gives the specifics
  201.       of slow start.
  202.  
  203.    Trace file demonstrating it
  204.       Made using tcpdump [Jacobson89] recording at the connection
  205.       responder.  No losses reported by the packet filter.
  206.  
  207.    10:40:42.244503 B > A: S 1168512000:1168512000(0) win 32768
  208.                            <mss 1460,nop,wscale 0> (DF) [tos 0x8]
  209.    10:40:42.259908 A > B: S 3688169472:3688169472(0)
  210.                            ack 1168512001 win 32768 <mss 1460>
  211.    10:40:42.389992 B > A: . ack 1 win 33580 (DF) [tos 0x8]
  212.    10:40:42.664975 A > B: P 1:513(512) ack 1 win 32768
  213.    10:40:42.700185 A > B: . 513:1973(1460) ack 1 win 32768
  214.    10:40:42.718017 A > B: . 1973:3433(1460) ack 1 win 32768
  215.    10:40:42.762945 A > B: . 3433:4893(1460) ack 1 win 32768
  216.    10:40:42.811273 A > B: . 4893:6353(1460) ack 1 win 32768
  217.    10:40:42.829149 A > B: . 6353:7813(1460) ack 1 win 32768
  218.    10:40:42.853687 B > A: . ack 1973 win 33580 (DF) [tos 0x8]
  219.    10:40:42.864031 B > A: . ack 3433 win 33580 (DF) [tos 0x8]
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. Paxson, et. al.              Informational                      [Page 4]
  227.  
  228. RFC 2525              TCP Implementation Problems             March 1999
  229.  
  230.  
  231.       After the third packet, the connection is established.  A, the
  232.       connection responder, begins transmitting to B, the connection
  233.       initiator.  Host A quickly sends 6 packets comprising 7812 bytes,
  234.       even though the SYN exchange agreed upon an MSS of 1460 bytes
  235.       (implying an initial congestion window of 1 segment corresponds to
  236.       1460 bytes), and so A should have sent at most 1460 bytes.
  237.  
  238.       The ACKs sent by B to A in the last two lines indicate that this
  239.       trace is not a measurement error (slow start really occurring but
  240.       the corresponding ACKs having been dropped by the packet filter).
  241.  
  242.       A second trace confirmed that the problem is repeatable.
  243.  
  244.    Trace file demonstrating correct behavior
  245.       Made using tcpdump recording at the connection originator.  No
  246.       losses reported by the packet filter.
  247.  
  248.    12:35:31.914050 C > D: S 1448571845:1448571845(0)
  249.                             win 4380 <mss 1460>
  250.    12:35:32.068819 D > C: S 1755712000:1755712000(0)
  251.                             ack 1448571846 win 4096
  252.    12:35:32.069341 C > D: . ack 1 win 4608
  253.    12:35:32.075213 C > D: P 1:513(512) ack 1 win 4608
  254.    12:35:32.286073 D > C: . ack 513 win 4096
  255.    12:35:32.287032 C > D: . 513:1025(512) ack 1 win 4608
  256.    12:35:32.287506 C > D: . 1025:1537(512) ack 1 win 4608
  257.    12:35:32.432712 D > C: . ack 1537 win 4096
  258.    12:35:32.433690 C > D: . 1537:2049(512) ack 1 win 4608
  259.    12:35:32.434481 C > D: . 2049:2561(512) ack 1 win 4608
  260.    12:35:32.435032 C > D: . 2561:3073(512) ack 1 win 4608
  261.    12:35:32.594526 D > C: . ack 3073 win 4096
  262.    12:35:32.595465 C > D: . 3073:3585(512) ack 1 win 4608
  263.    12:35:32.595947 C > D: . 3585:4097(512) ack 1 win 4608
  264.    12:35:32.596414 C > D: . 4097:4609(512) ack 1 win 4608
  265.    12:35:32.596888 C > D: . 4609:5121(512) ack 1 win 4608
  266.    12:35:32.733453 D > C: . ack 4097 win 4096
  267.  
  268.    References
  269.       This problem is documented in [Paxson97].
  270.  
  271.    How to detect
  272.       For implementations always manifesting this problem, it shows up
  273.       immediately in a packet trace or a sequence plot, as illustrated
  274.       above.
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282. Paxson, et. al.              Informational                      [Page 5]
  283.  
  284. RFC 2525              TCP Implementation Problems             March 1999
  285.  
  286.  
  287.    How to fix
  288.       If the root problem is that the implementation lacks a notion of a
  289.       congestion window, then unfortunately this requires significant
  290.       work to fix.  However, doing so is important, as such
  291.       implementations also exhibit "No slow start after retransmission
  292.       timeout".
  293.  
  294. 2.2.
  295.  
  296.    Name of Problem
  297.       No slow start after retransmission timeout
  298.  
  299.    Classification
  300.       Congestion control
  301.  
  302.    Description
  303.       When a TCP experiences a retransmission timeout, it is required by
  304.       RFC 1122, 4.2.2.15, to engage in "slow start" by initializing its
  305.       congestion window, cwnd, to one packet (one segment of the maximum
  306.       size).  It subsequently increases cwnd by one packet for each ACK
  307.       it receives for new data until it reaches the "congestion
  308.       avoidance" threshold, ssthresh, at which point the congestion
  309.       avoidance algorithm for updating the window takes over.  A TCP
  310.       that fails to enter slow start upon a timeout exhibits "No slow
  311.       start after retransmission timeout".
  312.  
  313.    Significance
  314.       In congested environments, severely detrimental to the performance
  315.       of other connections, and also the connection itself.
  316.  
  317.    Implications
  318.       Entering slow start upon timeout forms one of the cornerstones of
  319.       Internet congestion stability, as outlined in [Jacobson88].  If
  320.       TCPs fail to do so, the network becomes at risk of suffering
  321.       "congestion collapse" [RFC896].
  322.  
  323.    Relevant RFCs
  324.       RFC 1122 requires use of slow start after loss.  RFC 2001 gives
  325.       the specifics of how to implement slow start.  RFC 896 describes
  326.       congestion collapse.
  327.  
  328.       The retransmission timeout discussed here should not be confused
  329.       with the separate "fast recovery" retransmission mechanism
  330.       discussed in RFC 2001.
  331.  
  332.    Trace file demonstrating it
  333.       Made using tcpdump recording at the sending TCP (A).  No losses
  334.       reported by the packet filter.
  335.  
  336.  
  337.  
  338. Paxson, et. al.              Informational                      [Page 6]
  339.  
  340. RFC 2525              TCP Implementation Problems             March 1999
  341.  
  342.  
  343.    10:40:59.090612 B > A: . ack 357125 win 33580 (DF) [tos 0x8]
  344.    10:40:59.222025 A > B: . 357125:358585(1460) ack 1 win 32768
  345.    10:40:59.868871 A > B: . 357125:358585(1460) ack 1 win 32768
  346.    10:41:00.016641 B > A: . ack 364425 win 33580 (DF) [tos 0x8]
  347.    10:41:00.036709 A > B: . 364425:365885(1460) ack 1 win 32768
  348.    10:41:00.045231 A > B: . 365885:367345(1460) ack 1 win 32768
  349.    10:41:00.053785 A > B: . 367345:368805(1460) ack 1 win 32768
  350.    10:41:00.062426 A > B: . 368805:370265(1460) ack 1 win 32768
  351.    10:41:00.071074 A > B: . 370265:371725(1460) ack 1 win 32768
  352.    10:41:00.079794 A > B: . 371725:373185(1460) ack 1 win 32768
  353.    10:41:00.089304 A > B: . 373185:374645(1460) ack 1 win 32768
  354.    10:41:00.097738 A > B: . 374645:376105(1460) ack 1 win 32768
  355.    10:41:00.106409 A > B: . 376105:377565(1460) ack 1 win 32768
  356.    10:41:00.115024 A > B: . 377565:379025(1460) ack 1 win 32768
  357.    10:41:00.123576 A > B: . 379025:380485(1460) ack 1 win 32768
  358.    10:41:00.132016 A > B: . 380485:381945(1460) ack 1 win 32768
  359.    10:41:00.141635 A > B: . 381945:383405(1460) ack 1 win 32768
  360.    10:41:00.150094 A > B: . 383405:384865(1460) ack 1 win 32768
  361.    10:41:00.158552 A > B: . 384865:386325(1460) ack 1 win 32768
  362.    10:41:00.167053 A > B: . 386325:387785(1460) ack 1 win 32768
  363.    10:41:00.175518 A > B: . 387785:389245(1460) ack 1 win 32768
  364.    10:41:00.210835 A > B: . 389245:390705(1460) ack 1 win 32768
  365.    10:41:00.226108 A > B: . 390705:392165(1460) ack 1 win 32768
  366.    10:41:00.241524 B > A: . ack 389245 win 8760 (DF) [tos 0x8]
  367.  
  368.       The first packet indicates the ack point is 357125.  130 msec
  369.       after receiving the ACK, A transmits the packet after the ACK
  370.       point, 357125:358585.  640 msec after this transmission, it
  371.       retransmits 357125:358585, in an apparent retransmission timeout.
  372.       At this point, A's cwnd should be one MSS, or 1460 bytes, as A
  373.       enters slow start.  The trace is consistent with this possibility.
  374.  
  375.       B replies with an ACK of 364425, indicating that A has filled a
  376.       sequence hole.  At this point, A's cwnd should be 1460*2 = 2920
  377.       bytes, since in slow start receiving an ACK advances cwnd by MSS.
  378.       However, A then launches 19 consecutive packets, which is
  379.       inconsistent with slow start.
  380.  
  381.       A second trace confirmed that the problem is repeatable.
  382.  
  383.    Trace file demonstrating correct behavior
  384.       Made using tcpdump recording at the sending TCP (C).  No losses
  385.       reported by the packet filter.
  386.  
  387.    12:35:48.442538 C > D: P 465409:465921(512) ack 1 win 4608
  388.    12:35:48.544483 D > C: . ack 461825 win 4096
  389.    12:35:48.703496 D > C: . ack 461825 win 4096
  390.    12:35:49.044613 C > D: . 461825:462337(512) ack 1 win 4608
  391.  
  392.  
  393.  
  394. Paxson, et. al.              Informational                      [Page 7]
  395.  
  396. RFC 2525              TCP Implementation Problems             March 1999
  397.  
  398.  
  399.    12:35:49.192282 D > C: . ack 465921 win 2048
  400.    12:35:49.192538 D > C: . ack 465921 win 4096
  401.    12:35:49.193392 C > D: P 465921:466433(512) ack 1 win 4608
  402.    12:35:49.194726 C > D: P 466433:466945(512) ack 1 win 4608
  403.    12:35:49.350665 D > C: . ack 466945 win 4096
  404.    12:35:49.351694 C > D: . 466945:467457(512) ack 1 win 4608
  405.    12:35:49.352168 C > D: . 467457:467969(512) ack 1 win 4608
  406.    12:35:49.352643 C > D: . 467969:468481(512) ack 1 win 4608
  407.    12:35:49.506000 D > C: . ack 467969 win 3584
  408.  
  409.       After C transmits the first packet shown to D, it takes no action
  410.       in response to D's ACKs for 461825, because the first packet
  411.       already reached the advertised window limit of 4096 bytes above
  412.       461825.  600 msec after transmitting the first packet, C
  413.       retransmits 461825:462337, presumably due to a timeout.  Its
  414.       congestion window is now MSS (512 bytes).
  415.  
  416.       D acks 465921, indicating that C's retransmission filled a
  417.       sequence hole.  This ACK advances C's cwnd from 512 to 1024.  Very
  418.       shortly after, D acks 465921 again in order to update the offered
  419.       window from 2048 to 4096.  This ACK does not advance cwnd since it
  420.       is not for new data.  Very shortly after, C responds to the newly
  421.       enlarged window by transmitting two packets.  D acks both,
  422.       advancing cwnd from 1024 to 1536.  C in turn transmits three
  423.       packets.
  424.  
  425.    References
  426.       This problem is documented in [Paxson97].
  427.  
  428.    How to detect
  429.       Packet loss is common enough in the Internet that generally it is
  430.       not difficult to find an Internet path that will force
  431.       retransmission due to packet loss.
  432.  
  433.       If the effective window prior to loss is large enough, however,
  434.       then the TCP may retransmit using the "fast recovery" mechanism
  435.       described in RFC 2001.  In a packet trace, the signature of fast
  436.       recovery is that the packet retransmission occurs in response to
  437.       the receipt of three duplicate ACKs, and subsequent duplicate ACKs
  438.       may lead to the transmission of new data, above both the ack point
  439.       and the highest sequence transmitted so far.  An absence of three
  440.       duplicate ACKs prior to retransmission suffices to distinguish
  441.       between timeout and fast recovery retransmissions.  In the face of
  442.       only observing fast recovery retransmissions, generally it is not
  443.       difficult to repeat the data transfer until observing a timeout
  444.       retransmission.
  445.  
  446.  
  447.  
  448.  
  449.  
  450. Paxson, et. al.              Informational                      [Page 8]
  451.  
  452. RFC 2525              TCP Implementation Problems             March 1999
  453.  
  454.  
  455.       Once armed with a trace exhibiting a timeout retransmission,
  456.       determining whether the TCP follows slow start is done by
  457.       computing the correct progression of cwnd and comparing it to the
  458.       amount of data transmitted by the TCP subsequent to the timeout
  459.       retransmission.
  460.  
  461.    How to fix
  462.       If the root problem is that the implementation lacks a notion of a
  463.       congestion window, then unfortunately this requires significant
  464.       work to fix.  However, doing so is critical, for reasons outlined
  465.       above.
  466.  
  467. 2.3.
  468.  
  469.    Name of Problem
  470.       Uninitialized CWND
  471.  
  472.    Classification
  473.       Congestion control
  474.  
  475.    Description
  476.       As described above for "No initial slow start", when a TCP
  477.       connection begins cwnd is initialized to one segment (or perhaps a
  478.       few segments, if experimenting with [RFC2414]).  One particular
  479.       form of "No initial slow start", worth separate mention as the bug
  480.       is fairly widely deployed, is "Uninitialized CWND".  That is,
  481.       while the TCP implements the proper slow start mechanism, it fails
  482.       to initialize cwnd properly, so slow start in fact fails to occur.
  483.  
  484.       One way the bug can occur is if, during the connection
  485.       establishment handshake, the SYN ACK packet arrives without an MSS
  486.       option.  The faulty implementation uses receipt of the MSS option
  487.       to initialize cwnd to one segment; if the option fails to arrive,
  488.       then cwnd is instead initialized to a very large value.
  489.  
  490.    Significance
  491.       In congested environments, detrimental to the performance of other
  492.       connections, and likely to the connection itself.  The burst can
  493.       be so large (see below) that it has deleterious effects even in
  494.       uncongested environments.
  495.  
  496.    Implications
  497.       A TCP exhibiting this behavior is stressing the network with a
  498.       large burst of packets, which can cause loss in the network.
  499.  
  500.    Relevant RFCs
  501.       RFC 1122 requires use of slow start.  RFC 2001 gives the specifics
  502.       of slow start.
  503.  
  504.  
  505.  
  506. Paxson, et. al.              Informational                      [Page 9]
  507.  
  508. RFC 2525              TCP Implementation Problems             March 1999
  509.  
  510.  
  511.    Trace file demonstrating it
  512.       This trace was made using tcpdump running on host A.  Host A is
  513.       the sender and host B is the receiver.  The advertised window and
  514.       timestamp options have been omitted for clarity, except for the
  515.       first segment sent by host A.  Note that A sends an MSS option in
  516.       its initial SYN but B does not include one in its reply.
  517.  
  518.    16:56:02.226937 A > B: S 237585307:237585307(0) win 8192
  519.          <mss 536,nop,wscale 0,nop,nop,timestamp[|tcp]>
  520.    16:56:02.557135 B > A: S 1617216000:1617216000(0)
  521.          ack 237585308 win 16384
  522.    16:56:02.557788 A > B: . ack 1 win 8192
  523.    16:56:02.566014 A > B: . 1:537(536) ack 1
  524.    16:56:02.566557 A > B: . 537:1073(536) ack 1
  525.    16:56:02.567120 A > B: . 1073:1609(536) ack 1
  526.    16:56:02.567662 A > B: P 1609:2049(440) ack 1
  527.    16:56:02.568349 A > B: . 2049:2585(536) ack 1
  528.    16:56:02.568909 A > B: . 2585:3121(536) ack 1
  529.  
  530.       [54 additional burst segments deleted for brevity]
  531.  
  532.    16:56:02.936638 A > B: . 32065:32601(536) ack 1
  533.    16:56:03.018685 B > A: . ack 1
  534.  
  535.       After the three-way handshake, host A bursts 61 segments into the
  536.       network, before duplicate ACKs on the first segment cause a
  537.       retransmission to occur.  Since host A did not wait for the ACK on
  538.       the first segment before sending additional segments, it is
  539.       exhibiting "Uninitialized CWND"
  540.  
  541.    Trace file demonstrating correct behavior
  542.  
  543.       See the example for "No initial slow start".
  544.  
  545.    References
  546.       This problem is documented in [Paxson97].
  547.  
  548.    How to detect
  549.       This problem can be detected by examining a packet trace recorded
  550.       at either the sender or the receiver.  However, the bug can be
  551.       difficult to induce because it requires finding a remote TCP peer
  552.       that does not send an MSS option in its SYN ACK.
  553.  
  554.    How to fix
  555.       This problem can be fixed by ensuring that cwnd is initialized
  556.       upon receipt of a SYN ACK, even if the SYN ACK does not contain an
  557.       MSS option.
  558.  
  559.  
  560.  
  561.  
  562. Paxson, et. al.              Informational                     [Page 10]
  563.  
  564. RFC 2525              TCP Implementation Problems             March 1999
  565.  
  566.  
  567. 2.4.
  568.  
  569.    Name of Problem
  570.       Inconsistent retransmission
  571.  
  572.    Classification
  573.       Reliability
  574.  
  575.    Description
  576.       If, for a given sequence number, a sending TCP retransmits
  577.       different data than previously sent for that sequence number, then
  578.       a strong possibility arises that the receiving TCP will
  579.       reconstruct a different byte stream than that sent by the sending
  580.       application, depending on which instance of the sequence number it
  581.       accepts.
  582.  
  583.       Such a sending TCP exhibits "Inconsistent retransmission".
  584.  
  585.    Significance
  586.       Critical for all environments.
  587.  
  588.    Implications
  589.       Reliable delivery of data is a fundamental property of TCP.
  590.  
  591.    Relevant RFCs
  592.       RFC 793, section 1.5, discusses the central role of reliability in
  593.       TCP operation.
  594.  
  595.    Trace file demonstrating it
  596.       Made using tcpdump recording at the receiving TCP (B).  No losses
  597.       reported by the packet filter.
  598.  
  599.    12:35:53.145503 A > B: FP 90048435:90048461(26)
  600.                              ack 393464682 win 4096
  601.                                         4500 0042 9644 0000
  602.                     3006 e4c2 86b1 0401 83f3 010a b2a4 0015
  603.                     055e 07b3 1773 cb6a 5019 1000 68a9 0000
  604.    data starts here>504f 5254 2031 3334 2c31 3737*2c34 2c31
  605.                     2c31 3738 2c31 3635 0d0a
  606.    12:35:53.146479 B > A: R 393464682:393464682(0) win 8192
  607.    12:35:53.851714 A > B: FP 90048429:90048463(34)
  608.                           ack 393464682 win 4096
  609.                                         4500 004a 965b 0000
  610.                     3006 e4a3 86b1 0401 83f3 010a b2a4 0015
  611.                     055e 07ad 1773 cb6a 5019 1000 8bd3 0000
  612.    data starts here>5041 5356 0d0a 504f 5254 2031 3334 2c31
  613.                     3737*2c31 3035 2c31 3431 2c34 2c31 3539
  614.                     0d0a
  615.  
  616.  
  617.  
  618. Paxson, et. al.              Informational                     [Page 11]
  619.  
  620. RFC 2525              TCP Implementation Problems             March 1999
  621.  
  622.  
  623.       The sequence numbers shown in this trace are absolute and not
  624.       adjusted to reflect the ISN.  The 4-digit hex values show a dump
  625.       of the packet's IP and TCP headers, as well as payload.  A first
  626.       sends to B data for 90048435:90048461.  The corresponding data
  627.       begins with hex words 504f, 5254, etc.
  628.  
  629.       B responds with a RST.  Since the recording location was local to
  630.       B, it is unknown whether A received the RST.
  631.  
  632.       A then sends 90048429:90048463, which includes six sequence
  633.       positions below the earlier transmission, all 26 positions of the
  634.       earlier transmission, and two additional sequence positions.
  635.  
  636.       The retransmission disagrees starting just after sequence
  637.       90048447, annotated above with a leading '*'.  These two bytes
  638.       were originally transmitted as hex 2c34 but retransmitted as hex
  639.       2c31.  Subsequent positions disagree as well.
  640.  
  641.       This behavior has been observed in other traces involving
  642.       different hosts.  It is unknown how to repeat it.
  643.  
  644.       In this instance, no corruption would occur, since B has already
  645.       indicated it will not accept further packets from A.
  646.  
  647.       A second example illustrates a slightly different instance of the
  648.       problem.  The tracing again was made with tcpdump at the receiving
  649.       TCP (D).
  650.  
  651.    22:23:58.645829 C > D: P 185:212(27) ack 565 win 4096
  652.                                         4500 0043 90a3 0000
  653.                     3306 0734 cbf1 9eef 83f3 010a 0525 0015
  654.                     a3a2 faba 578c 70a4 5018 1000 9a53 0000
  655.    data starts here>504f 5254 2032 3033 2c32 3431 2c31 3538
  656.                     2c32 3339 2c35 2c34 330d 0a
  657.    22:23:58.646805 D > C: . ack 184 win 8192
  658.                                         4500 0028 beeb 0000
  659.                     3e06 ce06 83f3 010a cbf1 9eef 0015 0525
  660.                     578c 70a4 a3a2 fab9 5010 2000 342f 0000
  661.    22:31:36.532244 C > D: FP 186:213(27) ack 565 win 4096
  662.                                         4500 0043 9435 0000
  663.                     3306 03a2 cbf1 9eef 83f3 010a 0525 0015
  664.                     a3a2 fabb 578c 70a4 5019 1000 9a51 0000
  665.    data starts here>504f 5254 2032 3033 2c32 3431 2c31 3538
  666.                     2c32 3339 2c35 2c34 330d 0a
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674. Paxson, et. al.              Informational                     [Page 12]
  675.  
  676. RFC 2525              TCP Implementation Problems             March 1999
  677.  
  678.  
  679.       In this trace, sequence numbers are relative.  C sends 185:212,
  680.       but D only sends an ACK for 184 (so sequence number 184 is
  681.       missing).  C then sends 186:213.  The packet payload is identical
  682.       to the previous payload, but the base sequence number is one
  683.       higher, resulting in an inconsistent retransmission.
  684.  
  685.       Neither trace exhibits checksum errors.
  686.  
  687.    Trace file demonstrating correct behavior
  688.       (Omitted, as presumably correct behavior is obvious.)
  689.  
  690.    References
  691.       None known.
  692.  
  693.    How to detect
  694.       This problem unfortunately can be very difficult to detect, since
  695.       available experience indicates it is quite rare that it is
  696.       manifested.  No "trigger" has been identified that can be used to
  697.       reproduce the problem.
  698.  
  699.    How to fix
  700.       In the absence of a known "trigger", we cannot always assess how
  701.       to fix the problem.
  702.  
  703.       In one implementation (not the one illustrated above), the problem
  704.       manifested itself when (1) the sender received a zero window and
  705.       stalled; (2) eventually an ACK arrived that offered a window
  706.       larger than that in effect at the time of the stall; (3) the
  707.       sender transmitted out of the buffer of data it held at the time
  708.       of the stall, but (4) failed to limit this transfer to the buffer
  709.       length, instead using the newly advertised (and larger) offered
  710.       window.  Consequently, in addition to the valid buffer contents,
  711.       it sent whatever garbage values followed the end of the buffer.
  712.       If it then retransmitted the corresponding sequence numbers, at
  713.       that point it sent the correct data, resulting in an inconsistent
  714.       retransmission.  Note that this instance of the problem reflects a
  715.       more general problem, that of initially transmitting incorrect
  716.       data.
  717.  
  718. 2.5.
  719.  
  720.    Name of Problem
  721.       Failure to retain above-sequence data
  722.  
  723.    Classification
  724.       Congestion control, performance
  725.  
  726.  
  727.  
  728.  
  729.  
  730. Paxson, et. al.              Informational                     [Page 13]
  731.  
  732. RFC 2525              TCP Implementation Problems             March 1999
  733.  
  734.  
  735.    Description
  736.       When a TCP receives an "above sequence" segment, meaning one with
  737.       a sequence number exceeding RCV.NXT but below RCV.NXT+RCV.WND, it
  738.       SHOULD queue the segment for later delivery (RFC 1122, 4.2.2.20).
  739.       (See RFC 793 for the definition of RCV.NXT and RCV.WND.)  A TCP
  740.       that fails to do so is said to exhibit "Failure to retain above-
  741.       sequence data".
  742.  
  743.       It may sometimes be appropriate for a TCP to discard above-
  744.       sequence data to reclaim memory.  If they do so only rarely, then
  745.       we would not consider them to exhibit this problem.  Instead, the
  746.       particular concern is with TCPs that always discard above-sequence
  747.       data.
  748.  
  749.    Significance
  750.       In environments prone to packet loss, detrimental to the
  751.       performance of both other connections and the connection itself.
  752.  
  753.    Implications
  754.       In times of congestion, a failure to retain above-sequence data
  755.       will lead to numerous otherwise-unnecessary retransmissions,
  756.       aggravating the congestion and potentially reducing performance by
  757.       a large factor.
  758.  
  759.    Relevant RFCs
  760.       RFC 1122 revises RFC 793 by upgrading the latter's MAY to a SHOULD
  761.       on this issue.
  762.  
  763.    Trace file demonstrating it
  764.       Made using tcpdump recording at the receiving TCP.  No losses
  765.       reported by the packet filter.
  766.  
  767.       B is the TCP sender, A the receiver.  A exhibits failure to retain
  768.       above sequence-data:
  769.  
  770.    10:38:10.164860 B > A: . 221078:221614(536) ack 1 win 33232 [tos 0x8]
  771.    10:38:10.170809 B > A: . 221614:222150(536) ack 1 win 33232 [tos 0x8]
  772.    10:38:10.177183 B > A: . 222150:222686(536) ack 1 win 33232 [tos 0x8]
  773.    10:38:10.225039 A > B: . ack 222686 win 25800
  774.  
  775.       Here B has sent up to (relative) sequence 222686 in-sequence, and
  776.       A accordingly acknowledges.
  777.  
  778.    10:38:10.268131 B > A: . 223222:223758(536) ack 1 win 33232 [tos 0x8]
  779.    10:38:10.337995 B > A: . 223758:224294(536) ack 1 win 33232 [tos 0x8]
  780.    10:38:10.344065 B > A: . 224294:224830(536) ack 1 win 33232 [tos 0x8]
  781.    10:38:10.350169 B > A: . 224830:225366(536) ack 1 win 33232 [tos 0x8]
  782.    10:38:10.356362 B > A: . 225366:225902(536) ack 1 win 33232 [tos 0x8]
  783.  
  784.  
  785.  
  786. Paxson, et. al.              Informational                     [Page 14]
  787.  
  788. RFC 2525              TCP Implementation Problems             March 1999
  789.  
  790.  
  791.    10:38:10.362445 B > A: . 225902:226438(536) ack 1 win 33232 [tos 0x8]
  792.    10:38:10.368579 B > A: . 226438:226974(536) ack 1 win 33232 [tos 0x8]
  793.    10:38:10.374732 B > A: . 226974:227510(536) ack 1 win 33232 [tos 0x8]
  794.    10:38:10.380825 B > A: . 227510:228046(536) ack 1 win 33232 [tos 0x8]
  795.    10:38:10.387027 B > A: . 228046:228582(536) ack 1 win 33232 [tos 0x8]
  796.    10:38:10.393053 B > A: . 228582:229118(536) ack 1 win 33232 [tos 0x8]
  797.    10:38:10.399193 B > A: . 229118:229654(536) ack 1 win 33232 [tos 0x8]
  798.    10:38:10.405356 B > A: . 229654:230190(536) ack 1 win 33232 [tos 0x8]
  799.  
  800.       A now receives 13 additional packets from B.  These are above-
  801.       sequence because 222686:223222 was dropped.  The packets do
  802.       however fit within the offered window of 25800.  A does not
  803.       generate any duplicate ACKs for them.
  804.  
  805.       The trace contributor (V. Paxson) verified that these 13 packets
  806.       had valid IP and TCP checksums.
  807.  
  808.    10:38:11.917728 B > A: . 222686:223222(536) ack 1 win 33232 [tos 0x8]
  809.    10:38:11.930925 A > B: . ack 223222 win 32232
  810.  
  811.       B times out for 222686:223222 and retransmits it.  Upon receiving
  812.       it, A only acknowledges 223222.  Had it retained the valid above-
  813.       sequence packets, it would instead have ack'd 230190.
  814.  
  815.    10:38:12.048438 B > A: . 223222:223758(536) ack 1 win 33232 [tos 0x8]
  816.    10:38:12.054397 B > A: . 223758:224294(536) ack 1 win 33232 [tos 0x8]
  817.    10:38:12.068029 A > B: . ack 224294 win 31696
  818.  
  819.       B retransmits two more packets, and A only acknowledges them.
  820.       This pattern continues as B retransmits the entire set of
  821.       previously-received packets.
  822.  
  823.       A second trace confirmed that the problem is repeatable.
  824.  
  825.    Trace file demonstrating correct behavior
  826.       Made using tcpdump recording at the receiving TCP (C).  No losses
  827.       reported by the packet filter.
  828.  
  829.    09:11:25.790417 D > C: . 33793:34305(512) ack 1 win 61440
  830.    09:11:25.791393 D > C: . 34305:34817(512) ack 1 win 61440
  831.    09:11:25.792369 D > C: . 34817:35329(512) ack 1 win 61440
  832.    09:11:25.792369 D > C: . 35329:35841(512) ack 1 win 61440
  833.    09:11:25.793345 D > C: . 36353:36865(512) ack 1 win 61440
  834.    09:11:25.794321 C > D: . ack 35841 win 59904
  835.  
  836.       A sequence hole occurs because 35841:36353 has been dropped.
  837.  
  838.  
  839.  
  840.  
  841.  
  842. Paxson, et. al.              Informational                     [Page 15]
  843.  
  844. RFC 2525              TCP Implementation Problems             March 1999
  845.  
  846.  
  847.    09:11:25.794321 D > C: . 36865:37377(512) ack 1 win 61440
  848.    09:11:25.794321 C > D: . ack 35841 win 59904
  849.    09:11:25.795297 D > C: . 37377:37889(512) ack 1 win 61440
  850.    09:11:25.795297 C > D: . ack 35841 win 59904
  851.    09:11:25.796273 C > D: . ack 35841 win 61440
  852.    09:11:25.798225 D > C: . 37889:38401(512) ack 1 win 61440
  853.    09:11:25.799201 C > D: . ack 35841 win 61440
  854.    09:11:25.807009 D > C: . 38401:38913(512) ack 1 win 61440
  855.    09:11:25.807009 C > D: . ack 35841 win 61440
  856.    (many additional lines omitted)
  857.    09:11:25.884113 D > C: . 52737:53249(512) ack 1 win 61440
  858.    09:11:25.884113 C > D: . ack 35841 win 61440
  859.  
  860.       Each additional, above-sequence packet C receives from D elicits a
  861.       duplicate ACK for 35841.
  862.  
  863.       09:11:25.887041 D > C: . 35841:36353(512) ack 1 win 61440
  864.       09:11:25.887041 C > D: . ack 53249 win 44032
  865.  
  866.       D retransmits 35841:36353 and C acknowledges receipt of data all
  867.       the way up to 53249.
  868.  
  869.    References
  870.       This problem is documented in [Paxson97].
  871.  
  872.    How to detect
  873.       Packet loss is common enough in the Internet that generally it is
  874.       not difficult to find an Internet path that will result in some
  875.       above-sequence packets arriving.  A TCP that exhibits "Failure to
  876.       retain ..." may not generate duplicate ACKs for these packets.
  877.       However, some TCPs that do retain above-sequence data also do not
  878.       generate duplicate ACKs, so failure to do so does not definitively
  879.       identify the problem.  Instead, the key observation is whether
  880.       upon retransmission of the dropped packet, data that was
  881.       previously above-sequence is acknowledged.
  882.  
  883.       Two considerations in detecting this problem using a packet trace
  884.       are that it is easiest to do so with a trace made at the TCP
  885.       receiver, in order to unambiguously determine which packets
  886.       arrived successfully, and that such packets may still be correctly
  887.       discarded if they arrive with checksum errors.  The latter can be
  888.       tested by capturing the entire packet contents and performing the
  889.       IP and TCP checksum algorithms to verify their integrity; or by
  890.       confirming that the packets arrive with the same checksum and
  891.       contents as that with which they were sent, with a presumption
  892.       that the sending TCP correctly calculates checksums for the
  893.       packets it transmits.
  894.  
  895.  
  896.  
  897.  
  898. Paxson, et. al.              Informational                     [Page 16]
  899.  
  900. RFC 2525              TCP Implementation Problems             March 1999
  901.  
  902.  
  903.       It is considerably easier to verify that an implementation does
  904.       NOT exhibit this problem.  This can be done by recording a trace
  905.       at the data sender, and observing that sometimes after a
  906.       retransmission the receiver acknowledges a higher sequence number
  907.       than just that which was retransmitted.
  908.  
  909.    How to fix
  910.       If the root problem is that the implementation lacks buffer, then
  911.       then unfortunately this requires significant work to fix.
  912.       However, doing so is important, for reasons outlined above.
  913.  
  914. 2.6.
  915.  
  916.    Name of Problem
  917.       Extra additive constant in congestion avoidance
  918.  
  919.    Classification
  920.       Congestion control / performance
  921.  
  922.    Description
  923.       RFC 1122 section 4.2.2.15 states that TCP MUST implement
  924.       Jacobson's "congestion avoidance" algorithm [Jacobson88], which
  925.       calls for increasing the congestion window, cwnd, by:
  926.  
  927.            MSS * MSS / cwnd
  928.  
  929.       for each ACK received for new data [RFC2001].  This has the effect
  930.       of increasing cwnd by approximately one segment in each round trip
  931.       time.
  932.  
  933.       Some TCP implementations add an additional fraction of a segment
  934.       (typically MSS/8) to cwnd for each ACK received for new data
  935.       [Stevens94, Wright95]:
  936.  
  937.            (MSS * MSS / cwnd) + MSS/8
  938.  
  939.       These implementations exhibit "Extra additive constant in
  940.       congestion avoidance".
  941.  
  942.    Significance
  943.       May be detrimental to performance even in completely uncongested
  944.       environments (see Implications).
  945.  
  946.       In congested environments, may also be detrimental to the
  947.       performance of other connections.
  948.  
  949.  
  950.  
  951.  
  952.  
  953.  
  954. Paxson, et. al.              Informational                     [Page 17]
  955.  
  956. RFC 2525              TCP Implementation Problems             March 1999
  957.  
  958.  
  959.    Implications
  960.       The extra additive term allows a TCP to more aggressively open its
  961.       congestion window (quadratic rather than linear increase).  For
  962.       congested networks, this can increase the loss rate experienced by
  963.       all connections sharing a bottleneck with the aggressive TCP.
  964.  
  965.       However, even for completely uncongested networks, the extra
  966.       additive term can lead to diminished performance, as follows.  In
  967.       congestion avoidance, a TCP sender probes the network path to
  968.       determine its available capacity, which often equates to the
  969.       number of buffers available at a bottleneck link.  With linear
  970.       congestion avoidance, the TCP only probes for sufficient capacity
  971.       (buffer) to hold one extra packet per RTT.
  972.  
  973.       Thus, when it exceeds the available capacity, generally only one
  974.       packet will be lost (since on the previous RTT it already found
  975.       that the path could sustain a window with one less packet in
  976.       flight).  If the congestion window is sufficiently large, then the
  977.       TCP will recover from this single loss using fast retransmission
  978.       and avoid an expensive (in terms of performance) retransmission
  979.       timeout.
  980.  
  981.       However, when the additional additive term is used, then cwnd can
  982.       increase by more than one packet per RTT, in which case the TCP
  983.       probes more aggressively.  If in the previous RTT it had reached
  984.       the available capacity of the path, then the excess due to the
  985.       extra increase will again be lost, but now this will result in
  986.       multiple losses from the flight instead of a single loss.  TCPs
  987.       that do not utilize SACK [RFC2018] generally will not recover from
  988.       multiple losses without incurring a retransmission timeout
  989.       [Fall96,Hoe96], significantly diminishing performance.
  990.  
  991.    Relevant RFCs
  992.       RFC 1122 requires use of the "congestion avoidance" algorithm.
  993.       RFC 2001 outlines the fast retransmit/fast recovery algorithms.
  994.       RFC 2018 discusses the SACK option.
  995.  
  996.    Trace file demonstrating it
  997.       Recorded using tcpdump running on the same FDDI LAN as host A.
  998.       Host A is the sender and host B is the receiver.  The connection
  999.       establishment specified an MSS of 4,312 bytes and a window scale
  1000.       factor of 4.  We omit the establishment and the first 2.5 MB of
  1001.       data transfer, as the problem is best demonstrated when the window
  1002.       has grown to a large value.  At the beginning of the trace
  1003.       excerpt, the congestion window is 31 packets.  The connection is
  1004.       never receiver-window limited, so we omit window advertisements
  1005.       from the trace for clarity.
  1006.  
  1007.  
  1008.  
  1009.  
  1010. Paxson, et. al.              Informational                     [Page 18]
  1011.  
  1012. RFC 2525              TCP Implementation Problems             March 1999
  1013.  
  1014.  
  1015.    11:42:07.697951 B > A: . ack 2383006
  1016.    11:42:07.699388 A > B: . 2508054:2512366(4312)
  1017.    11:42:07.699962 A > B: . 2512366:2516678(4312)
  1018.    11:42:07.700012 B > A: . ack 2391630
  1019.    11:42:07.701081 A > B: . 2516678:2520990(4312)
  1020.    11:42:07.701656 A > B: . 2520990:2525302(4312)
  1021.    11:42:07.701739 B > A: . ack 2400254
  1022.    11:42:07.702685 A > B: . 2525302:2529614(4312)
  1023.    11:42:07.703257 A > B: . 2529614:2533926(4312)
  1024.    11:42:07.703295 B > A: . ack 2408878
  1025.    11:42:07.704414 A > B: . 2533926:2538238(4312)
  1026.    11:42:07.704989 A > B: . 2538238:2542550(4312)
  1027.    11:42:07.705040 B > A: . ack 2417502
  1028.    11:42:07.705935 A > B: . 2542550:2546862(4312)
  1029.    11:42:07.706506 A > B: . 2546862:2551174(4312)
  1030.    11:42:07.706544 B > A: . ack 2426126
  1031.    11:42:07.707480 A > B: . 2551174:2555486(4312)
  1032.    11:42:07.708051 A > B: . 2555486:2559798(4312)
  1033.    11:42:07.708088 B > A: . ack 2434750
  1034.    11:42:07.709030 A > B: . 2559798:2564110(4312)
  1035.    11:42:07.709604 A > B: . 2564110:2568422(4312)
  1036.    11:42:07.710175 A > B: . 2568422:2572734(4312) *
  1037.  
  1038.    11:42:07.710215 B > A: . ack 2443374
  1039.    11:42:07.710799 A > B: . 2572734:2577046(4312)
  1040.    11:42:07.711368 A > B: . 2577046:2581358(4312)
  1041.    11:42:07.711405 B > A: . ack 2451998
  1042.    11:42:07.712323 A > B: . 2581358:2585670(4312)
  1043.    11:42:07.712898 A > B: . 2585670:2589982(4312)
  1044.    11:42:07.712938 B > A: . ack 2460622
  1045.    11:42:07.713926 A > B: . 2589982:2594294(4312)
  1046.    11:42:07.714501 A > B: . 2594294:2598606(4312)
  1047.    11:42:07.714547 B > A: . ack 2469246
  1048.    11:42:07.715747 A > B: . 2598606:2602918(4312)
  1049.    11:42:07.716287 A > B: . 2602918:2607230(4312)
  1050.    11:42:07.716328 B > A: . ack 2477870
  1051.    11:42:07.717146 A > B: . 2607230:2611542(4312)
  1052.    11:42:07.717717 A > B: . 2611542:2615854(4312)
  1053.    11:42:07.717762 B > A: . ack 2486494
  1054.    11:42:07.718754 A > B: . 2615854:2620166(4312)
  1055.    11:42:07.719331 A > B: . 2620166:2624478(4312)
  1056.    11:42:07.719906 A > B: . 2624478:2628790(4312) **
  1057.  
  1058.    11:42:07.719958 B > A: . ack 2495118
  1059.    11:42:07.720500 A > B: . 2628790:2633102(4312)
  1060.    11:42:07.721080 A > B: . 2633102:2637414(4312)
  1061.    11:42:07.721739 B > A: . ack 2503742
  1062.    11:42:07.722348 A > B: . 2637414:2641726(4312)
  1063.  
  1064.  
  1065.  
  1066. Paxson, et. al.              Informational                     [Page 19]
  1067.  
  1068. RFC 2525              TCP Implementation Problems             March 1999
  1069.  
  1070.  
  1071.    11:42:07.722918 A > B: . 2641726:2646038(4312)
  1072.    11:42:07.769248 B > A: . ack 2512366
  1073.  
  1074.       The receiver's acknowledgment policy is one ACK per two packets
  1075.       received.  Thus, for each ACK arriving at host A, two new packets
  1076.       are sent, except when cwnd increases due to congestion avoidance,
  1077.       in which case three new packets are sent.
  1078.  
  1079.       With an ack-every-two-packets policy, cwnd should only increase
  1080.       one MSS per 2 RTT.  However, at the point marked "*" the window
  1081.       increases after 7 ACKs have arrived, and then again at "**" after
  1082.       6 more ACKs.
  1083.  
  1084.       While we do not have space to show the effect, this trace suffered
  1085.       from repeated timeout retransmissions due to multiple packet
  1086.       losses during a single RTT.
  1087.  
  1088.    Trace file demonstrating correct behavior
  1089.       Made using the same host and tracing setup as above, except now
  1090.       A's TCP has been modified to remove the MSS/8 additive constant.
  1091.       Tcpdump reported 77 packet drops; the excerpt below is fully
  1092.       self-consistent so it is unlikely that any of these occurred
  1093.       during the excerpt.
  1094.  
  1095.       We again begin when cwnd is 31 packets (this occurs significantly
  1096.       later in the trace, because the congestion avoidance is now less
  1097.       aggressive with opening the window).
  1098.  
  1099.    14:22:21.236757 B > A: . ack 5194679
  1100.    14:22:21.238192 A > B: . 5319727:5324039(4312)
  1101.    14:22:21.238770 A > B: . 5324039:5328351(4312)
  1102.    14:22:21.238821 B > A: . ack 5203303
  1103.    14:22:21.240158 A > B: . 5328351:5332663(4312)
  1104.    14:22:21.240738 A > B: . 5332663:5336975(4312)
  1105.    14:22:21.270422 B > A: . ack 5211927
  1106.    14:22:21.271883 A > B: . 5336975:5341287(4312)
  1107.    14:22:21.272458 A > B: . 5341287:5345599(4312)
  1108.    14:22:21.279099 B > A: . ack 5220551
  1109.    14:22:21.280539 A > B: . 5345599:5349911(4312)
  1110.    14:22:21.281118 A > B: . 5349911:5354223(4312)
  1111.    14:22:21.281183 B > A: . ack 5229175
  1112.    14:22:21.282348 A > B: . 5354223:5358535(4312)
  1113.    14:22:21.283029 A > B: . 5358535:5362847(4312)
  1114.    14:22:21.283089 B > A: . ack 5237799
  1115.    14:22:21.284213 A > B: . 5362847:5367159(4312)
  1116.    14:22:21.284779 A > B: . 5367159:5371471(4312)
  1117.    14:22:21.285976 B > A: . ack 5246423
  1118.    14:22:21.287465 A > B: . 5371471:5375783(4312)
  1119.  
  1120.  
  1121.  
  1122. Paxson, et. al.              Informational                     [Page 20]
  1123.  
  1124. RFC 2525              TCP Implementation Problems             March 1999
  1125.  
  1126.  
  1127.    14:22:21.288036 A > B: . 5375783:5380095(4312)
  1128.    14:22:21.288073 B > A: . ack 5255047
  1129.    14:22:21.289155 A > B: . 5380095:5384407(4312)
  1130.    14:22:21.289725 A > B: . 5384407:5388719(4312)
  1131.    14:22:21.289762 B > A: . ack 5263671
  1132.    14:22:21.291090 A > B: . 5388719:5393031(4312)
  1133.    14:22:21.291662 A > B: . 5393031:5397343(4312)
  1134.    14:22:21.291701 B > A: . ack 5272295
  1135.    14:22:21.292870 A > B: . 5397343:5401655(4312)
  1136.    14:22:21.293441 A > B: . 5401655:5405967(4312)
  1137.    14:22:21.293481 B > A: . ack 5280919
  1138.    14:22:21.294476 A > B: . 5405967:5410279(4312)
  1139.    14:22:21.295053 A > B: . 5410279:5414591(4312)
  1140.    14:22:21.295106 B > A: . ack 5289543
  1141.    14:22:21.296306 A > B: . 5414591:5418903(4312)
  1142.    14:22:21.296878 A > B: . 5418903:5423215(4312)
  1143.    14:22:21.296917 B > A: . ack 5298167
  1144.    14:22:21.297716 A > B: . 5423215:5427527(4312)
  1145.    14:22:21.298285 A > B: . 5427527:5431839(4312)
  1146.    14:22:21.298324 B > A: . ack 5306791
  1147.    14:22:21.299413 A > B: . 5431839:5436151(4312)
  1148.    14:22:21.299986 A > B: . 5436151:5440463(4312)
  1149.    14:22:21.303696 B > A: . ack 5315415
  1150.    14:22:21.305177 A > B: . 5440463:5444775(4312)
  1151.    14:22:21.305755 A > B: . 5444775:5449087(4312)
  1152.    14:22:21.308032 B > A: . ack 5324039
  1153.    14:22:21.309525 A > B: . 5449087:5453399(4312)
  1154.    14:22:21.310101 A > B: . 5453399:5457711(4312)
  1155.    14:22:21.310144 B > A: . ack 5332663           ***
  1156.  
  1157.    14:22:21.311615 A > B: . 5457711:5462023(4312)
  1158.    14:22:21.312198 A > B: . 5462023:5466335(4312)
  1159.    14:22:21.341876 B > A: . ack 5341287
  1160.    14:22:21.343451 A > B: . 5466335:5470647(4312)
  1161.    14:22:21.343985 A > B: . 5470647:5474959(4312)
  1162.    14:22:21.350304 B > A: . ack 5349911
  1163.    14:22:21.351852 A > B: . 5474959:5479271(4312)
  1164.    14:22:21.352430 A > B: . 5479271:5483583(4312)
  1165.    14:22:21.352484 B > A: . ack 5358535
  1166.    14:22:21.353574 A > B: . 5483583:5487895(4312)
  1167.    14:22:21.354149 A > B: . 5487895:5492207(4312)
  1168.    14:22:21.354205 B > A: . ack 5367159
  1169.    14:22:21.355467 A > B: . 5492207:5496519(4312)
  1170.    14:22:21.356039 A > B: . 5496519:5500831(4312)
  1171.    14:22:21.357361 B > A: . ack 5375783
  1172.    14:22:21.358855 A > B: . 5500831:5505143(4312)
  1173.    14:22:21.359424 A > B: . 5505143:5509455(4312)
  1174.    14:22:21.359465 B > A: . ack 5384407
  1175.  
  1176.  
  1177.  
  1178. Paxson, et. al.              Informational                     [Page 21]
  1179.  
  1180. RFC 2525              TCP Implementation Problems             March 1999
  1181.  
  1182.  
  1183.    14:22:21.360605 A > B: . 5509455:5513767(4312)
  1184.    14:22:21.361181 A > B: . 5513767:5518079(4312)
  1185.    14:22:21.361225 B > A: . ack 5393031
  1186.    14:22:21.362485 A > B: . 5518079:5522391(4312)
  1187.    14:22:21.363057 A > B: . 5522391:5526703(4312)
  1188.    14:22:21.363096 B > A: . ack 5401655
  1189.    14:22:21.364236 A > B: . 5526703:5531015(4312)
  1190.    14:22:21.364810 A > B: . 5531015:5535327(4312)
  1191.    14:22:21.364867 B > A: . ack 5410279
  1192.    14:22:21.365819 A > B: . 5535327:5539639(4312)
  1193.    14:22:21.366386 A > B: . 5539639:5543951(4312)
  1194.    14:22:21.366427 B > A: . ack 5418903
  1195.    14:22:21.367586 A > B: . 5543951:5548263(4312)
  1196.    14:22:21.368158 A > B: . 5548263:5552575(4312)
  1197.    14:22:21.368199 B > A: . ack 5427527
  1198.    14:22:21.369189 A > B: . 5552575:5556887(4312)
  1199.    14:22:21.369758 A > B: . 5556887:5561199(4312)
  1200.    14:22:21.369803 B > A: . ack 5436151
  1201.    14:22:21.370814 A > B: . 5561199:5565511(4312)
  1202.    14:22:21.371398 A > B: . 5565511:5569823(4312)
  1203.    14:22:21.375159 B > A: . ack 5444775
  1204.    14:22:21.376658 A > B: . 5569823:5574135(4312)
  1205.    14:22:21.377235 A > B: . 5574135:5578447(4312)
  1206.    14:22:21.379303 B > A: . ack 5453399
  1207.    14:22:21.380802 A > B: . 5578447:5582759(4312)
  1208.    14:22:21.381377 A > B: . 5582759:5587071(4312)
  1209.    14:22:21.381947 A > B: . 5587071:5591383(4312) ****
  1210.  
  1211.       "***" marks the end of the first round trip.  Note that cwnd did
  1212.       not increase (as evidenced by each ACK eliciting two new data
  1213.       packets).  Only at "****", which comes near the end of the second
  1214.       round trip, does cwnd increase by one packet.
  1215.  
  1216.       This trace did not suffer any timeout retransmissions.  It
  1217.       transferred the same amount of data as the first trace in about
  1218.       half as much time.  This difference is repeatable between hosts A
  1219.       and B.
  1220.  
  1221.    References
  1222.       [Stevens94] and [Wright95] discuss this problem.  The problem of
  1223.       Reno TCP failing to recover from multiple losses except via a
  1224.       retransmission timeout is discussed in [Fall96,Hoe96].
  1225.  
  1226.  
  1227.  
  1228.  
  1229.  
  1230.  
  1231.  
  1232.  
  1233.  
  1234. Paxson, et. al.              Informational                     [Page 22]
  1235.  
  1236. RFC 2525              TCP Implementation Problems             March 1999
  1237.  
  1238.  
  1239.    How to detect
  1240.       If source code is available, that is generally the easiest way to
  1241.       detect this problem.  Search for each modification to the cwnd
  1242.       variable; (at least) one of these will be for congestion
  1243.       avoidance, and inspection of the related code should immediately
  1244.       identify the problem if present.
  1245.  
  1246.       The problem can also be detected by closely examining packet
  1247.       traces taken near the sender.  During congestion avoidance, cwnd
  1248.       will increase by an additional segment upon the receipt of
  1249.       (typically) eight acknowledgements without a loss.  This increase
  1250.       is in addition to the one segment increase per round trip time (or
  1251.       two round trip times if the receiver is using delayed ACKs).
  1252.  
  1253.       Furthermore, graphs of the sequence number vs. time, taken from
  1254.       packet traces, are normally linear during congestion avoidance.
  1255.       When viewing packet traces of transfers from senders exhibiting
  1256.       this problem, the graphs appear quadratic instead of linear.
  1257.  
  1258.       Finally, the traces will show that, with sufficiently large
  1259.       windows, nearly every loss event results in a timeout.
  1260.  
  1261.    How to fix
  1262.       This problem may be corrected by removing the "+ MSS/8" term from
  1263.       the congestion avoidance code that increases cwnd each time an ACK
  1264.       of new data is received.
  1265.  
  1266. 2.7.
  1267.  
  1268.    Name of Problem
  1269.       Initial RTO too low
  1270.  
  1271.    Classification
  1272.       Performance
  1273.  
  1274.    Description
  1275.       When a TCP first begins transmitting data, it lacks the RTT
  1276.       measurements necessary to have computed an adaptive retransmission
  1277.       timeout (RTO).  RFC 1122, 4.2.3.1, states that a TCP SHOULD
  1278.       initialize RTO to 3 seconds.  A TCP that uses a lower value
  1279.       exhibits "Initial RTO too low".
  1280.  
  1281.    Significance
  1282.       In environments with large RTTs (where "large" means any value
  1283.       larger than the initial RTO), TCPs will experience very poor
  1284.       performance.
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290. Paxson, et. al.              Informational                     [Page 23]
  1291.  
  1292. RFC 2525              TCP Implementation Problems             March 1999
  1293.  
  1294.  
  1295.    Implications
  1296.       Whenever RTO < RTT, very poor performance can result as packets
  1297.       are unnecessarily retransmitted (because RTO will expire before an
  1298.       ACK for the packet can arrive) and the connection enters slow
  1299.       start and congestion avoidance.  Generally, the algorithms for
  1300.       computing RTO avoid this problem by adding a positive term to the
  1301.       estimated RTT.  However, when a connection first begins it must
  1302.       use some estimate for RTO, and if it picks a value less than RTT,
  1303.       the above problems will arise.
  1304.  
  1305.       Furthermore, when the initial RTO < RTT, it can take a long time
  1306.       for the TCP to correct the problem by adapting the RTT estimate,
  1307.       because the use of Karn's algorithm (mandated by RFC 1122,
  1308.       4.2.3.1) will discard many of the candidate RTT measurements made
  1309.       after the first timeout, since they will be measurements of
  1310.       retransmitted segments.
  1311.  
  1312.    Relevant RFCs
  1313.       RFC 1122 states that TCPs SHOULD initialize RTO to 3 seconds and
  1314.       MUST implement Karn's algorithm.
  1315.  
  1316.    Trace file demonstrating it
  1317.       The following trace file was taken using tcpdump at host A, the
  1318.       data sender.  The advertised window and SYN options have been
  1319.       omitted for clarity.
  1320.  
  1321.    07:52:39.870301 A > B: S 2786333696:2786333696(0)
  1322.    07:52:40.548170 B > A: S 130240000:130240000(0) ack 2786333697
  1323.    07:52:40.561287 A > B: P 1:513(512) ack 1
  1324.    07:52:40.753466 A > B: . 1:513(512) ack 1
  1325.    07:52:41.133687 A > B: . 1:513(512) ack 1
  1326.    07:52:41.458529 B > A: . ack 513
  1327.    07:52:41.458686 A > B: . 513:1025(512) ack 1
  1328.    07:52:41.458797 A > B: P 1025:1537(512) ack 1
  1329.    07:52:41.541633 B > A: . ack 513
  1330.    07:52:41.703732 A > B: . 513:1025(512) ack 1
  1331.    07:52:42.044875 B > A: . ack 513
  1332.    07:52:42.173728 A > B: . 513:1025(512) ack 1
  1333.    07:52:42.330861 B > A: . ack 1537
  1334.    07:52:42.331129 A > B: . 1537:2049(512) ack 1
  1335.    07:52:42.331262 A > B: P 2049:2561(512) ack 1
  1336.    07:52:42.623673 A > B: . 1537:2049(512) ack 1
  1337.    07:52:42.683203 B > A: . ack 1537
  1338.    07:52:43.044029 B > A: . ack 1537
  1339.    07:52:43.193812 A > B: . 1537:2049(512) ack 1
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346. Paxson, et. al.              Informational                     [Page 24]
  1347.  
  1348. RFC 2525              TCP Implementation Problems             March 1999
  1349.  
  1350.  
  1351.       Note from the SYN/SYN-ACK exchange, the RTT is over 600 msec.
  1352.       However, from the elapsed time between the third and fourth lines
  1353.       (the first packet being sent and then retransmitted), it is
  1354.       apparent the RTO was initialized to under 200 msec.  The next line
  1355.       shows that this value has doubled to 400 msec (correct exponential
  1356.       backoff of RTO), but that still does not suffice to avoid an
  1357.       unnecessary retransmission.
  1358.  
  1359.       Finally, an ACK from B arrives for the first segment.  Later two
  1360.       more duplicate ACKs for 513 arrive, indicating that both the
  1361.       original and the two retransmissions arrived at B.  (Indeed, a
  1362.       concurrent trace at B showed that no packets were lost during the
  1363.       entire connection).  This ACK opens the congestion window to two
  1364.       packets, which are sent back-to-back, but at 07:52:41.703732 RTO
  1365.       again expires after a little over 200 msec, leading to an
  1366.       unnecessary retransmission, and the pattern repeats.  By the end
  1367.       of the trace excerpt above, 1536 bytes have been successfully
  1368.       transmitted from A to B, over an interval of more than 2 seconds,
  1369.       reflecting terrible performance.
  1370.  
  1371.    Trace file demonstrating correct behavior
  1372.       The following trace file was taken using tcpdump at host C, the
  1373.       data sender.  The advertised window and SYN options have been
  1374.       omitted for clarity.
  1375.  
  1376.    17:30:32.090299 C > D: S 2031744000:2031744000(0)
  1377.    17:30:32.900325 D > C: S 262737964:262737964(0) ack 2031744001
  1378.    17:30:32.900326 C > D: . ack 1
  1379.    17:30:32.910326 C > D: . 1:513(512) ack 1
  1380.    17:30:34.150355 D > C: . ack 513
  1381.    17:30:34.150356 C > D: . 513:1025(512) ack 1
  1382.    17:30:34.150357 C > D: . 1025:1537(512) ack 1
  1383.    17:30:35.170384 D > C: . ack 1025
  1384.    17:30:35.170385 C > D: . 1537:2049(512) ack 1
  1385.    17:30:35.170386 C > D: . 2049:2561(512) ack 1
  1386.    17:30:35.320385 D > C: . ack 1537
  1387.    17:30:35.320386 C > D: . 2561:3073(512) ack 1
  1388.    17:30:35.320387 C > D: . 3073:3585(512) ack 1
  1389.    17:30:35.730384 D > C: . ack 2049
  1390.  
  1391.       The initial SYN/SYN-ACK exchange shows that RTT is more than 800
  1392.       msec, and for some subsequent packets it rises above 1 second, but
  1393.       C's retransmit timer does not ever expire.
  1394.  
  1395.    References
  1396.       This problem is documented in [Paxson97].
  1397.  
  1398.  
  1399.  
  1400.  
  1401.  
  1402. Paxson, et. al.              Informational                     [Page 25]
  1403.  
  1404. RFC 2525              TCP Implementation Problems             March 1999
  1405.  
  1406.  
  1407.    How to detect
  1408.       This problem is readily detected by inspecting a packet trace of
  1409.       the startup of a TCP connection made over a long-delay path.  It
  1410.       can be diagnosed from either a sender-side or receiver-side trace.
  1411.       Long-delay paths can often be found by locating remote sites on
  1412.       other continents.
  1413.  
  1414.    How to fix
  1415.       As this problem arises from a faulty initialization, one hopes
  1416.       fixing it requires a one-line change to the TCP source code.
  1417.  
  1418. 2.8.
  1419.  
  1420.    Name of Problem
  1421.       Failure of window deflation after loss recovery
  1422.  
  1423.    Classification
  1424.       Congestion control / performance
  1425.  
  1426.    Description
  1427.       The fast recovery algorithm allows TCP senders to continue to
  1428.       transmit new segments during loss recovery.  First, fast
  1429.       retransmission is initiated after a TCP sender receives three
  1430.       duplicate ACKs.  At this point, a retransmission is sent and cwnd
  1431.       is halved.  The fast recovery algorithm then allows additional
  1432.       segments to be sent when sufficient additional duplicate ACKs
  1433.       arrive.  Some implementations of fast recovery compute when to
  1434.       send additional segments by artificially incrementing cwnd, first
  1435.       by three segments to account for the three duplicate ACKs that
  1436.       triggered fast retransmission, and subsequently by 1 MSS for each
  1437.       new duplicate ACK that arrives.  When cwnd allows, the sender
  1438.       transmits new data segments.
  1439.  
  1440.       When an ACK arrives that covers new data, cwnd is to be reduced by
  1441.       the amount by which it was artificially increased.  However, some
  1442.       TCP implementations fail to "deflate" the window, causing an
  1443.       inappropriate amount of data to be sent into the network after
  1444.       recovery.  One cause of this problem is the "header prediction"
  1445.       code, which is used to handle incoming segments that require
  1446.       little work.  In some implementations of TCP, the header
  1447.       prediction code does not check to make sure cwnd has not been
  1448.       artificially inflated, and therefore does not reduce the
  1449.       artificially increased cwnd when appropriate.
  1450.  
  1451.    Significance
  1452.       TCP senders that exhibit this problem will transmit a burst of
  1453.       data immediately after recovery, which can degrade performance, as
  1454.       well as network stability.  Effectively, the sender does not
  1455.  
  1456.  
  1457.  
  1458. Paxson, et. al.              Informational                     [Page 26]
  1459.  
  1460. RFC 2525              TCP Implementation Problems             March 1999
  1461.  
  1462.  
  1463.       reduce the size of cwnd as much as it should (to half its value
  1464.       when loss was detected), if at all.  This can harm the performance
  1465.       of the TCP connection itself, as well as competing TCP flows.
  1466.  
  1467.    Implications
  1468.       A TCP sender exhibiting this problem does not reduce cwnd
  1469.       appropriately in times of congestion, and therefore may contribute
  1470.       to congestive collapse.
  1471.  
  1472.    Relevant RFCs
  1473.       RFC 2001 outlines the fast retransmit/fast recovery algorithms.
  1474.       [Brakmo95] outlines this implementation problem and offers a fix.
  1475.  
  1476.    Trace file demonstrating it
  1477.       The following trace file was taken using tcpdump at host A, the
  1478.       data sender.  The advertised window (which never changed) has been
  1479.       omitted for clarity, except for the first packet sent by each
  1480.       host.
  1481.  
  1482.    08:22:56.825635 A.7505 > B.7505: . 29697:30209(512) ack 1 win 4608
  1483.    08:22:57.038794 B.7505 > A.7505: . ack 27649 win 4096
  1484.    08:22:57.039279 A.7505 > B.7505: . 30209:30721(512) ack 1
  1485.    08:22:57.321876 B.7505 > A.7505: . ack 28161
  1486.    08:22:57.322356 A.7505 > B.7505: . 30721:31233(512) ack 1
  1487.    08:22:57.347128 B.7505 > A.7505: . ack 28673
  1488.    08:22:57.347572 A.7505 > B.7505: . 31233:31745(512) ack 1
  1489.    08:22:57.347782 A.7505 > B.7505: . 31745:32257(512) ack 1
  1490.    08:22:57.936393 B.7505 > A.7505: . ack 29185
  1491.    08:22:57.936864 A.7505 > B.7505: . 32257:32769(512) ack 1
  1492.    08:22:57.950802 B.7505 > A.7505: . ack 29697 win 4096
  1493.    08:22:57.951246 A.7505 > B.7505: . 32769:33281(512) ack 1
  1494.    08:22:58.169422 B.7505 > A.7505: . ack 29697
  1495.    08:22:58.638222 B.7505 > A.7505: . ack 29697
  1496.    08:22:58.643312 B.7505 > A.7505: . ack 29697
  1497.    08:22:58.643669 A.7505 > B.7505: . 29697:30209(512) ack 1
  1498.    08:22:58.936436 B.7505 > A.7505: . ack 29697
  1499.    08:22:59.002614 B.7505 > A.7505: . ack 29697
  1500.    08:22:59.003026 A.7505 > B.7505: . 33281:33793(512) ack 1
  1501.    08:22:59.682902 B.7505 > A.7505: . ack 33281
  1502.    08:22:59.683391 A.7505 > B.7505: P 33793:34305(512) ack 1
  1503.    08:22:59.683748 A.7505 > B.7505: P 34305:34817(512) ack 1 ***
  1504.    08:22:59.684043 A.7505 > B.7505: P 34817:35329(512) ack 1
  1505.    08:22:59.684266 A.7505 > B.7505: P 35329:35841(512) ack 1
  1506.    08:22:59.684567 A.7505 > B.7505: P 35841:36353(512) ack 1
  1507.    08:22:59.684810 A.7505 > B.7505: P 36353:36865(512) ack 1
  1508.    08:22:59.685094 A.7505 > B.7505: P 36865:37377(512) ack 1
  1509.  
  1510.  
  1511.  
  1512.  
  1513.  
  1514. Paxson, et. al.              Informational                     [Page 27]
  1515.  
  1516. RFC 2525              TCP Implementation Problems             March 1999
  1517.  
  1518.  
  1519.       The first 12 lines of the trace show incoming ACKs clocking out a
  1520.       window of data segments.  At this point in the transfer, cwnd is 7
  1521.       segments.  The next 4 lines of the trace show 3 duplicate ACKs
  1522.       arriving from the receiver, followed by a retransmission from the
  1523.       sender.  At this point, cwnd is halved (to 3 segments) and
  1524.       artificially incremented by the three duplicate ACKs that have
  1525.       arrived, making cwnd 6 segments.  The next two lines show 2 more
  1526.       duplicate ACKs arriving, each of which increases cwnd by 1
  1527.       segment.  So, after these two duplicate ACKs arrive the cwnd is 8
  1528.       segments and the sender has permission to send 1 new segment
  1529.       (since there are 7 segments outstanding).  The next line in the
  1530.       trace shows this new segment being transmitted.  The next packet
  1531.       shown in the trace is an ACK from host B that covers the first 7
  1532.       outstanding segments (all but the new segment sent during
  1533.       recovery).  This should cause cwnd to be reduced to 3 segments and
  1534.       2 segments to be transmitted (since there is already 1 outstanding
  1535.       segment in the network).  However, as shown by the last 7 lines of
  1536.       the trace, cwnd is not reduced, causing a line-rate burst of 7 new
  1537.       segments.
  1538.  
  1539.    Trace file demonstrating correct behavior
  1540.       The trace would appear identical to the one above, only it would
  1541.       stop after the line marked "***", because at this point host A
  1542.       would correctly reduce cwnd after recovery, allowing only 2
  1543.       segments to be transmitted, rather than producing a burst of 7
  1544.       segments.
  1545.  
  1546.    References
  1547.       This problem is documented and the performance implications
  1548.       analyzed in [Brakmo95].
  1549.  
  1550.    How to detect
  1551.       Failure of window deflation after loss recovery can be found by
  1552.       examining sender-side packet traces recorded during periods of
  1553.       moderate loss (so cwnd can grow large enough to allow for fast
  1554.       recovery when loss occurs).
  1555.  
  1556.    How to fix
  1557.       When this bug is caused by incorrect header prediction, the fix is
  1558.       to add a predicate to the header prediction test that checks to
  1559.       see whether cwnd is inflated; if so, the header prediction test
  1560.       fails and the usual ACK processing occurs, which (in this case)
  1561.       takes care to deflate the window.  See [Brakmo95] for details.
  1562.  
  1563. 2.9.
  1564.  
  1565.    Name of Problem
  1566.       Excessively short keepalive connection timeout
  1567.  
  1568.  
  1569.  
  1570. Paxson, et. al.              Informational                     [Page 28]
  1571.  
  1572. RFC 2525              TCP Implementation Problems             March 1999
  1573.  
  1574.  
  1575.    Classification
  1576.       Reliability
  1577.  
  1578.    Description
  1579.       Keep-alive is a mechanism for checking whether an idle connection
  1580.       is still alive.  According to RFC 1122, keepalive should only be
  1581.       invoked in server applications that might otherwise hang
  1582.       indefinitely and consume resources unnecessarily if a client
  1583.       crashes or aborts a connection during a network failure.
  1584.  
  1585.       RFC 1122 also specifies that if a keep-alive mechanism is
  1586.       implemented it MUST NOT interpret failure to respond to any
  1587.       specific probe as a dead connection.  The RFC does not specify a
  1588.       particular mechanism for timing out a connection when no response
  1589.       is received for keepalive probes.  However, if the mechanism does
  1590.       not allow ample time for recovery from network congestion or
  1591.       delay, connections may be timed out unnecessarily.
  1592.  
  1593.    Significance
  1594.       In congested networks, can lead to unwarranted termination of
  1595.       connections.
  1596.  
  1597.    Implications
  1598.       It is possible for the network connection between two peer
  1599.       machines to become congested or to exhibit packet loss at the time
  1600.       that a keep-alive probe is sent on a connection.  If the keep-
  1601.       alive mechanism does not allow sufficient time before dropping
  1602.       connections in the face of unacknowledged probes, connections may
  1603.       be dropped even when both peers of a connection are still alive.
  1604.  
  1605.    Relevant RFCs
  1606.       RFC 1122 specifies that the keep-alive mechanism may be provided.
  1607.       It does not specify a mechanism for determining dead connections
  1608.       when keepalive probes are not acknowledged.
  1609.  
  1610.    Trace file demonstrating it
  1611.       Made using the Orchestra tool at the peer of the machine using
  1612.       keep-alive.  After connection establishment, incoming keep-alives
  1613.       were dropped by Orchestra to simulate a dead connection.
  1614.  
  1615.    22:11:12.040000 A > B: 22666019:0 win 8192 datasz 4 SYN
  1616.    22:11:12.060000 B > A: 2496001:22666020 win 4096 datasz 4 SYN ACK
  1617.    22:11:12.130000 A > B: 22666020:2496002 win 8760 datasz 0 ACK
  1618.    (more than two hours elapse)
  1619.    00:23:00.680000 A > B: 22666019:2496002 win 8760 datasz 1 ACK
  1620.    00:23:01.770000 A > B: 22666019:2496002 win 8760 datasz 1 ACK
  1621.    00:23:02.870000 A > B: 22666019:2496002 win 8760 datasz 1 ACK
  1622.    00:23.03.970000 A > B: 22666019:2496002 win 8760 datasz 1 ACK
  1623.  
  1624.  
  1625.  
  1626. Paxson, et. al.              Informational                     [Page 29]
  1627.  
  1628. RFC 2525              TCP Implementation Problems             March 1999
  1629.  
  1630.  
  1631.    00:23.05.070000 A > B: 22666019:2496002 win 8760 datasz 1 ACK
  1632.  
  1633.       The initial three packets are the SYN exchange for connection
  1634.       setup.  About two hours later, the keepalive timer fires because
  1635.       the connection has been idle.  Keepalive probes are transmitted a
  1636.       total of 5 times, with a 1 second spacing between probes, after
  1637.       which the connection is dropped.  This is problematic because a 5
  1638.       second network outage at the time of the first probe results in
  1639.       the connection being killed.
  1640.  
  1641.    Trace file demonstrating correct behavior
  1642.       Made using the Orchestra tool at the peer of the machine using
  1643.       keep-alive.  After connection establishment, incoming keep-alives
  1644.       were dropped by Orchestra to simulate a dead connection.
  1645.  
  1646.    16:01:52.130000 A > B: 1804412929:0 win 4096 datasz 4 SYN
  1647.    16:01:52.360000 B > A: 16512001:1804412930 win 4096 datasz 4 SYN ACK
  1648.    16:01:52.410000 A > B: 1804412930:16512002 win 4096 datasz 0 ACK
  1649.    (two hours elapse)
  1650.    18:01:57.170000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1651.    18:03:12.220000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1652.    18:04:27.270000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1653.    18:05:42.320000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1654.    18:06:57.370000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1655.    18:08:12.420000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1656.    18:09:27.480000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1657.    18:10:43.290000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1658.    18:11:57.580000 A > B: 1804412929:16512002 win 4096 datasz 0 ACK
  1659.    18:13:12.630000 A > B: 1804412929:16512002 win 4096 datasz 0 RST ACK
  1660.  
  1661.       In this trace, when the keep-alive timer expires, 9 keepalive
  1662.       probes are sent at 75 second intervals.  75 seconds after the last
  1663.       probe is sent, a final RST segment is sent indicating that the
  1664.       connection has been closed.  This implementation waits about 11
  1665.       minutes before timing out the connection, while the first
  1666.       implementation shown allows only 5 seconds.
  1667.  
  1668.    References
  1669.       This problem is documented in [Dawson97].
  1670.  
  1671.    How to detect
  1672.       For implementations manifesting this problem, it shows up on a
  1673.       packet trace after the keepalive timer fires if the peer machine
  1674.       receiving the keepalive does not respond.  Usually the keepalive
  1675.       timer will fire at least two hours after keepalive is turned on,
  1676.       but it may be sooner if the timer value has been configured lower,
  1677.       or if the keepalive mechanism violates the specification (see
  1678.       Insufficient interval between keepalives problem).  In this
  1679.  
  1680.  
  1681.  
  1682. Paxson, et. al.              Informational                     [Page 30]
  1683.  
  1684. RFC 2525              TCP Implementation Problems             March 1999
  1685.  
  1686.  
  1687.       example, suppressing the response of the peer to keepalive probes
  1688.       was accomplished using the Orchestra toolkit, which can be
  1689.       configured to drop packets.  It could also have been done by
  1690.       creating a connection, turning on keepalive, and disconnecting the
  1691.       network connection at the receiver machine.
  1692.  
  1693.    How to fix
  1694.       This problem can be fixed by using a different method for timing
  1695.       out keepalives that allows a longer period of time to elapse
  1696.       before dropping the connection.  For example, the algorithm for
  1697.       timing out on dropped data could be used.  Another possibility is
  1698.       an algorithm such as the one shown in the trace above, which sends
  1699.       9 probes at 75 second intervals and then waits an additional 75
  1700.       seconds for a response before closing the connection.
  1701.  
  1702. 2.10.
  1703.  
  1704.    Name of Problem
  1705.       Failure to back off retransmission timeout
  1706.  
  1707.    Classification
  1708.       Congestion control / reliability
  1709.  
  1710.    Description
  1711.       The retransmission timeout is used to determine when a packet has
  1712.       been dropped in the network.  When this timeout has expired
  1713.       without the arrival of an ACK, the segment is retransmitted. Each
  1714.       time a segment is retransmitted, the timeout is adjusted according
  1715.       to an exponential backoff algorithm, doubling each time.  If a TCP
  1716.       fails to receive an ACK after numerous attempts at retransmitting
  1717.       the same segment, it terminates the connection.  A TCP that fails
  1718.       to double its retransmission timeout upon repeated timeouts is
  1719.       said to exhibit "Failure to back off retransmission timeout".
  1720.  
  1721.    Significance
  1722.       Backing off the retransmission timer is a cornerstone of network
  1723.       stability in the presence of congestion.  Consequently, this bug
  1724.       can have severe adverse affects in congested networks.  It also
  1725.       affects TCP reliability in congested networks, as discussed in the
  1726.       next section.
  1727.  
  1728.    Implications
  1729.       It is possible for the network connection between two TCP peers to
  1730.       become congested or to exhibit packet loss at the time that a
  1731.       retransmission is sent on a connection.  If the retransmission
  1732.       mechanism does not allow sufficient time before dropping
  1733.  
  1734.  
  1735.  
  1736.  
  1737.  
  1738. Paxson, et. al.              Informational                     [Page 31]
  1739.  
  1740. RFC 2525              TCP Implementation Problems             March 1999
  1741.  
  1742.  
  1743.       connections in the face of unacknowledged segments, connections
  1744.       may be dropped even when, by waiting longer, the connection could
  1745.       have continued.
  1746.  
  1747.    Relevant RFCs
  1748.       RFC 1122 specifies mandatory exponential backoff of the
  1749.       retransmission timeout, and the termination of connections after
  1750.       some period of time (at least 100 seconds).
  1751.  
  1752.    Trace file demonstrating it
  1753.       Made using tcpdump on an intermediate host:
  1754.  
  1755.    16:51:12.671727 A > B: S 510878852:510878852(0) win 16384
  1756.    16:51:12.672479 B > A: S 2392143687:2392143687(0)
  1757.                             ack 510878853 win 16384
  1758.    16:51:12.672581 A > B: . ack 1 win 16384
  1759.    16:51:15.244171 A > B: P 1:3(2) ack 1 win 16384
  1760.    16:51:15.244933 B > A: . ack 3 win 17518  (DF)
  1761.  
  1762.    <receiving host disconnected>
  1763.  
  1764.    16:51:19.381176 A > B: P 3:5(2) ack 1 win 16384
  1765.    16:51:20.162016 A > B: P 3:5(2) ack 1 win 16384
  1766.    16:51:21.161936 A > B: P 3:5(2) ack 1 win 16384
  1767.    16:51:22.161914 A > B: P 3:5(2) ack 1 win 16384
  1768.    16:51:23.161914 A > B: P 3:5(2) ack 1 win 16384
  1769.    16:51:24.161879 A > B: P 3:5(2) ack 1 win 16384
  1770.    16:51:25.161857 A > B: P 3:5(2) ack 1 win 16384
  1771.    16:51:26.161836 A > B: P 3:5(2) ack 1 win 16384
  1772.    16:51:27.161814 A > B: P 3:5(2) ack 1 win 16384
  1773.    16:51:28.161791 A > B: P 3:5(2) ack 1 win 16384
  1774.    16:51:29.161769 A > B: P 3:5(2) ack 1 win 16384
  1775.    16:51:30.161750 A > B: P 3:5(2) ack 1 win 16384
  1776.    16:51:31.161727 A > B: P 3:5(2) ack 1 win 16384
  1777.  
  1778.    16:51:32.161701 A > B: R 5:5(0) ack 1 win 16384
  1779.  
  1780.       The initial three packets are the SYN exchange for connection
  1781.       setup, then a single data packet, to verify that data can be
  1782.       transferred.  Then the connection to the destination host was
  1783.       disconnected, and more data sent.  Retransmissions occur every
  1784.       second for 12 seconds, and then the connection is terminated with
  1785.       a RST.  This is problematic because a 12 second pause in
  1786.       connectivity could result in the termination of a connection.
  1787.  
  1788.    Trace file demonstrating correct behavior
  1789.       Again, a tcpdump taken from a third host:
  1790.  
  1791.  
  1792.  
  1793.  
  1794. Paxson, et. al.              Informational                     [Page 32]
  1795.  
  1796. RFC 2525              TCP Implementation Problems             March 1999
  1797.  
  1798.  
  1799.    16:59:05.398301 A > B: S 2503324757:2503324757(0) win 16384
  1800.    16:59:05.399673 B > A: S 2492674648:2492674648(0)
  1801.                            ack 2503324758 win 16384
  1802.    16:59:05.399866 A > B: . ack 1 win 17520
  1803.    16:59:06.538107 A > B: P 1:3(2) ack 1 win 17520
  1804.    16:59:06.540977 B > A: . ack 3 win 17518  (DF)
  1805.  
  1806.    <receiving host disconnected>
  1807.  
  1808.    16:59:13.121542 A > B: P 3:5(2) ack 1 win 17520
  1809.    16:59:14.010928 A > B: P 3:5(2) ack 1 win 17520
  1810.    16:59:16.010979 A > B: P 3:5(2) ack 1 win 17520
  1811.    16:59:20.011229 A > B: P 3:5(2) ack 1 win 17520
  1812.    16:59:28.011896 A > B: P 3:5(2) ack 1 win 17520
  1813.    16:59:44.013200 A > B: P 3:5(2) ack 1 win 17520
  1814.    17:00:16.015766 A > B: P 3:5(2) ack 1 win 17520
  1815.    17:01:20.021308 A > B: P 3:5(2) ack 1 win 17520
  1816.    17:02:24.027752 A > B: P 3:5(2) ack 1 win 17520
  1817.    17:03:28.034569 A > B: P 3:5(2) ack 1 win 17520
  1818.    17:04:32.041567 A > B: P 3:5(2) ack 1 win 17520
  1819.    17:05:36.048264 A > B: P 3:5(2) ack 1 win 17520
  1820.    17:06:40.054900 A > B: P 3:5(2) ack 1 win 17520
  1821.  
  1822.    17:07:44.061306 A > B: R 5:5(0) ack 1 win 17520
  1823.  
  1824.       In this trace, when the retransmission timer expires, 12
  1825.       retransmissions are sent at exponentially-increasing intervals,
  1826.       until the interval value reaches 64 seconds, at which time the
  1827.       interval stops growing.  64 seconds after the last retransmission,
  1828.       a final RST segment is sent indicating that the connection has
  1829.       been closed.  This implementation waits about 9 minutes before
  1830.       timing out the connection, while the first implementation shown
  1831.       allows only 12 seconds.
  1832.  
  1833.    References
  1834.       None known.
  1835.  
  1836.    How to detect
  1837.       A simple transfer can be easily interrupted by disconnecting the
  1838.       receiving host from the network.  tcpdump or another appropriate
  1839.       tool should show the retransmissions being sent.  Several trials
  1840.       in a low-rtt environment may be required to demonstrate the bug.
  1841.  
  1842.    How to fix
  1843.       For one of the implementations studied, this problem seemed to be
  1844.       the result of an error introduced with the addition of the
  1845.       Brakmo-Peterson RTO algorithm [Brakmo95], which can return a value
  1846.       of zero where the older Jacobson algorithm always returns a
  1847.  
  1848.  
  1849.  
  1850. Paxson, et. al.              Informational                     [Page 33]
  1851.  
  1852. RFC 2525              TCP Implementation Problems             March 1999
  1853.  
  1854.  
  1855.       positive value.  Brakmo and Peterson specified an additional step
  1856.       of min(rtt + 2, RTO) to avoid problems with this.  Unfortunately,
  1857.       in the implementation this step was omitted when calculating the
  1858.       exponential backoff for the RTO.  This results in an RTO of 0
  1859.       seconds being multiplied by the backoff, yielding again zero, and
  1860.       then being subjected to a later MAX operation that increases it to
  1861.       1 second, regardless of the backoff factor.
  1862.  
  1863.       A similar TCP persist failure has the same cause.
  1864.  
  1865. 2.11.
  1866.  
  1867.    Name of Problem
  1868.       Insufficient interval between keepalives
  1869.  
  1870.    Classification
  1871.       Reliability
  1872.  
  1873.    Description
  1874.       Keep-alive is a mechanism for checking whether an idle connection
  1875.       is still alive.  According to RFC 1122, keep-alive may be included
  1876.       in an implementation.  If it is included, the interval between
  1877.       keep-alive packets MUST be configurable, and MUST default to no
  1878.       less than two hours.
  1879.  
  1880.    Significance
  1881.       In congested networks, can lead to unwarranted termination of
  1882.       connections.
  1883.  
  1884.    Implications
  1885.       According to RFC 1122, keep-alive is not required of
  1886.       implementations because it could: (1) cause perfectly good
  1887.       connections to break during transient Internet failures; (2)
  1888.       consume unnecessary bandwidth ("if no one is using the connection,
  1889.       who cares if it is still good?"); and (3) cost money for an
  1890.       Internet path that charges for packets.  Regarding this last
  1891.       point, we note that in addition the presence of dial-on-demand
  1892.       links in the route can greatly magnify the cost penalty of excess
  1893.       keepalives, potentially forcing a full-time connection on a link
  1894.       that would otherwise only be connected a few minutes a day.
  1895.  
  1896.       If keepalive is provided the RFC states that the required inter-
  1897.       keepalive distance MUST default to no less than two hours.  If it
  1898.       does not, the probability of connections breaking increases, the
  1899.       bandwidth used due to keepalives increases, and cost increases
  1900.       over paths which charge per packet.
  1901.  
  1902.  
  1903.  
  1904.  
  1905.  
  1906. Paxson, et. al.              Informational                     [Page 34]
  1907.  
  1908. RFC 2525              TCP Implementation Problems             March 1999
  1909.  
  1910.  
  1911.    Relevant RFCs
  1912.       RFC 1122 specifies that the keep-alive mechanism may be provided.
  1913.       It also specifies the two hour minimum for the default interval
  1914.       between keepalive probes.
  1915.  
  1916.    Trace file demonstrating it
  1917.       Made using the Orchestra tool at the peer of the machine using
  1918.       keep-alive.  Machine A was configured to use default settings for
  1919.       the keepalive timer.
  1920.  
  1921.    11:36:32.910000 A > B: 3288354305:0      win 28672 datasz 4 SYN
  1922.    11:36:32.930000 B > A: 896001:3288354306 win 4096  datasz 4 SYN ACK
  1923.    11:36:32.950000 A > B: 3288354306:896002 win 28672 datasz 0 ACK
  1924.  
  1925.    11:50:01.190000 A > B: 3288354305:896002 win 28672 datasz 0 ACK
  1926.    11:50:01.210000 B > A: 896002:3288354306 win 4096  datasz 0 ACK
  1927.  
  1928.    12:03:29.410000 A > B: 3288354305:896002 win 28672 datasz 0 ACK
  1929.    12:03:29.430000 B > A: 896002:3288354306 win 4096  datasz 0 ACK
  1930.  
  1931.    12:16:57.630000 A > B: 3288354305:896002 win 28672 datasz 0 ACK
  1932.    12:16:57.650000 B > A: 896002:3288354306 win 4096  datasz 0 ACK
  1933.  
  1934.    12:30:25.850000 A > B: 3288354305:896002 win 28672 datasz 0 ACK
  1935.    12:30:25.870000 B > A: 896002:3288354306 win 4096  datasz 0 ACK
  1936.  
  1937.    12:43:54.070000 A > B: 3288354305:896002 win 28672 datasz 0 ACK
  1938.    12:43:54.090000 B > A: 896002:3288354306 win 4096  datasz 0 ACK
  1939.  
  1940.       The initial three packets are the SYN exchange for connection
  1941.       setup.  About 13 minutes later, the keepalive timer fires because
  1942.       the connection is idle.  The keepalive is acknowledged, and the
  1943.       timer fires again in about 13 more minutes.  This behavior
  1944.       continues indefinitely until the connection is closed, and is a
  1945.       violation of the specification.
  1946.  
  1947.    Trace file demonstrating correct behavior
  1948.       Made using the Orchestra tool at the peer of the machine using
  1949.       keep-alive.  Machine A was configured to use default settings for
  1950.       the keepalive timer.
  1951.  
  1952.    17:37:20.500000 A > B: 34155521:0       win 4096 datasz 4 SYN
  1953.    17:37:20.520000 B > A: 6272001:34155522 win 4096 datasz 4 SYN ACK
  1954.    17:37:20.540000 A > B: 34155522:6272002 win 4096 datasz 0 ACK
  1955.  
  1956.    19:37:25.430000 A > B: 34155521:6272002 win 4096 datasz 0 ACK
  1957.    19:37:25.450000 B > A: 6272002:34155522 win 4096 datasz 0 ACK
  1958.  
  1959.  
  1960.  
  1961.  
  1962. Paxson, et. al.              Informational                     [Page 35]
  1963.  
  1964. RFC 2525              TCP Implementation Problems             March 1999
  1965.  
  1966.  
  1967.    21:37:30.560000 A > B: 34155521:6272002 win 4096 datasz 0 ACK
  1968.    21:37:30.570000 B > A: 6272002:34155522 win 4096 datasz 0 ACK
  1969.  
  1970.    23:37:35.580000 A > B: 34155521:6272002 win 4096 datasz 0 ACK
  1971.    23:37:35.600000 B > A: 6272002:34155522 win 4096 datasz 0 ACK
  1972.  
  1973.    01:37:40.620000 A > B: 34155521:6272002 win 4096 datasz 0 ACK
  1974.    01:37:40.640000 B > A: 6272002:34155522 win 4096 datasz 0 ACK
  1975.  
  1976.    03:37:45.590000 A > B: 34155521:6272002 win 4096 datasz 0 ACK
  1977.    03:37:45.610000 B > A: 6272002:34155522 win 4096 datasz 0 ACK
  1978.  
  1979.       The initial three packets are the SYN exchange for connection
  1980.       setup.  Just over two hours later, the keepalive timer fires
  1981.       because the connection is idle.  The keepalive is acknowledged,
  1982.       and the timer fires again just over two hours later.  This
  1983.       behavior continues indefinitely until the connection is closed.
  1984.  
  1985.    References
  1986.       This problem is documented in [Dawson97].
  1987.  
  1988.    How to detect
  1989.       For implementations manifesting this problem, it shows up on a
  1990.       packet trace.  If the connection is left idle, the keepalive
  1991.       probes will arrive closer together than the two hour minimum.
  1992.  
  1993. 2.12.
  1994.  
  1995.    Name of Problem
  1996.       Window probe deadlock
  1997.  
  1998.    Classification
  1999.       Reliability
  2000.  
  2001.    Description
  2002.       When an application reads a single byte from a full window, the
  2003.       window should not be updated, in order to avoid Silly Window
  2004.       Syndrome (SWS; see [RFC813]).  If the remote peer uses a single
  2005.       byte of data to probe the window, that byte can be accepted into
  2006.       the buffer.  In some implementations, at this point a negative
  2007.       argument to a signed comparison causes all further new data to be
  2008.       considered outside the window; consequently, it is discarded
  2009.       (after sending an ACK to resynchronize).  These discards include
  2010.       the ACKs for the data packets sent by the local TCP, so the TCP
  2011.       will consider the data unacknowledged.
  2012.  
  2013.  
  2014.  
  2015.  
  2016.  
  2017.  
  2018. Paxson, et. al.              Informational                     [Page 36]
  2019.  
  2020. RFC 2525              TCP Implementation Problems             March 1999
  2021.  
  2022.  
  2023.       Consequently, the application may be unable to complete sending
  2024.       new data to the remote peer, because it has exhausted the transmit
  2025.       buffer available to its local TCP, and buffer space is never being
  2026.       freed because incoming ACKs that would do so are being discarded.
  2027.       If the application does not read any more data, which may happen
  2028.       due to its failure to complete such sends, then deadlock results.
  2029.  
  2030.    Significance
  2031.       It's relatively rare for applications to use TCP in a manner that
  2032.       can exercise this problem.  Most applications only transmit bulk
  2033.       data if they know the other end is prepared to receive the data.
  2034.       However, if a client fails to consume data, putting the server in
  2035.       persist mode, and then consumes a small amount of data, it can
  2036.       mistakenly compute a negative window.  At this point the client
  2037.       will discard all further packets from the server, including ACKs
  2038.       of the client's own data, since they are not inside the
  2039.       (impossibly-sized) window.  If subsequently the client consumes
  2040.       enough data to then send a window update to the server, the
  2041.       situation will be rectified.  That is, this situation can only
  2042.       happen if the client consumes 1 < N < MSS bytes, so as not to
  2043.       cause a window update, and then starts its own transmission
  2044.       towards the server of more than a window's worth of data.
  2045.  
  2046.    Implications
  2047.       TCP connections will hang and eventually time out.
  2048.  
  2049.    Relevant RFCs
  2050.       RFC 793 describes zero window probing.  RFC 813 describes Silly
  2051.       Window Syndrome.
  2052.  
  2053.    Trace file demonstrating it
  2054.       Trace made from a version of tcpdump modified to print out the
  2055.       sequence number attached to an ACK even if it's dataless.  An
  2056.       unmodified tcpdump would not print seq:seq(0); however, for this
  2057.       bug, the sequence number in the ACK is important for unambiguously
  2058.       determining how the TCP is behaving.
  2059.  
  2060.    [ Normal connection startup and data transmission from B to A.
  2061.      Options, including MSS of 16344 in both directions, omitted
  2062.      for clarity. ]
  2063.    16:07:32.327616 A > B: S 65360807:65360807(0) win 8192
  2064.    16:07:32.327304 B > A: S 65488807:65488807(0) ack 65360808 win 57344
  2065.    16:07:32.327425 A > B: . 1:1(0) ack 1 win 57344
  2066.    16:07:32.345732 B > A: P 1:2049(2048) ack 1 win 57344
  2067.    16:07:32.347013 B > A: P 2049:16385(14336) ack 1 win 57344
  2068.    16:07:32.347550 B > A: P 16385:30721(14336) ack 1 win 57344
  2069.    16:07:32.348683 B > A: P 30721:45057(14336) ack 1 win 57344
  2070.    16:07:32.467286 A > B: . 1:1(0) ack 45057 win 12288
  2071.  
  2072.  
  2073.  
  2074. Paxson, et. al.              Informational                     [Page 37]
  2075.  
  2076. RFC 2525              TCP Implementation Problems             March 1999
  2077.  
  2078.  
  2079.    16:07:32.467854 B > A: P 45057:57345(12288) ack 1 win 57344
  2080.  
  2081.    [ B fills up A's offered window ]
  2082.    16:07:32.667276 A > B: . 1:1(0) ack 57345 win 0
  2083.  
  2084.    [ B probes A's window with a single byte ]
  2085.    16:07:37.467438 B > A: . 57345:57346(1) ack 1 win 57344
  2086.  
  2087.    [ A resynchronizes without accepting the byte ]
  2088.    16:07:37.467678 A > B: . 1:1(0) ack 57345 win 0
  2089.  
  2090.    [ B probes A's window again ]
  2091.    16:07:45.467438 B > A: . 57345:57346(1) ack 1 win 57344
  2092.  
  2093.    [ A resynchronizes and accepts the byte (per the ack field) ]
  2094.    16:07:45.667250 A > B: . 1:1(0) ack 57346 win 0
  2095.  
  2096.    [ The application on A has started generating data.  The first
  2097.      packet A sends is small due to a memory allocation bug. ]
  2098.    16:07:51.358459 A > B: P 1:2049(2048) ack 57346 win 0
  2099.  
  2100.    [ B acks A's first packet ]
  2101.    16:07:51.467239 B > A: . 57346:57346(0) ack 2049 win 57344
  2102.  
  2103.    [ This looks as though A accepted B's ACK and is sending
  2104.      another packet in response to it.  In fact, A is trying
  2105.      to resynchronize with B, and happens to have data to send
  2106.      and can send it because the first small packet didn't use
  2107.      up cwnd. ]
  2108.    16:07:51.467698 A > B: . 2049:14337(12288) ack 57346 win 0
  2109.  
  2110.    [ B acks all of the data that A has sent ]
  2111.    16:07:51.667283 B > A: . 57346:57346(0) ack 14337 win 57344
  2112.  
  2113.    [ A tries to resynchronize.  Notice that by the packets
  2114.      seen on the network, A and B *are* in fact synchronized;
  2115.      A only thinks that they aren't. ]
  2116.    16:07:51.667477 A > B: . 14337:14337(0) ack 57346 win 0
  2117.  
  2118.    [ A's retransmit timer fires, and B acks all of the data.
  2119.      A once again tries to resynchronize. ]
  2120.    16:07:52.467682 A > B: . 1:14337(14336) ack 57346 win 0
  2121.    16:07:52.468166 B > A: . 57346:57346(0) ack 14337 win 57344
  2122.    16:07:52.468248 A > B: . 14337:14337(0) ack 57346 win 0
  2123.  
  2124.    [ A's retransmit timer fires again, and B acks all of the data.
  2125.      A once again tries to resynchronize. ]
  2126.    16:07:55.467684 A > B: . 1:14337(14336) ack 57346 win 0
  2127.  
  2128.  
  2129.  
  2130. Paxson, et. al.              Informational                     [Page 38]
  2131.  
  2132. RFC 2525              TCP Implementation Problems             March 1999
  2133.  
  2134.  
  2135.    16:07:55.468172 B > A: . 57346:57346(0) ack 14337 win 57344
  2136.    16:07:55.468254 A > B: . 14337:14337(0) ack 57346 win 0
  2137.  
  2138.    Trace file demonstrating correct behavior
  2139.       Made between the same two hosts after applying the bug fix
  2140.       mentioned below (and using the same modified tcpdump).
  2141.  
  2142.    [ Connection starts up with data transmission from B to A.
  2143.      Note that due to a separate bug (the fact that A and B
  2144.      are communicating over a loopback driver), B erroneously
  2145.      skips slow start. ]
  2146.    17:38:09.510854 A > B: S 3110066585:3110066585(0) win 16384
  2147.    17:38:09.510926 B > A: S 3110174850:3110174850(0)
  2148.                             ack 3110066586 win 57344
  2149.    17:38:09.510953 A > B: . 1:1(0) ack 1 win 57344
  2150.    17:38:09.512956 B > A: P 1:2049(2048) ack 1 win 57344
  2151.    17:38:09.513222 B > A: P 2049:16385(14336) ack 1 win 57344
  2152.    17:38:09.513428 B > A: P 16385:30721(14336) ack 1 win 57344
  2153.    17:38:09.513638 B > A: P 30721:45057(14336) ack 1 win 57344
  2154.    17:38:09.519531 A > B: . 1:1(0) ack 45057 win 12288
  2155.    17:38:09.519638 B > A: P 45057:57345(12288) ack 1 win 57344
  2156.  
  2157.    [ B fills up A's offered window ]
  2158.    17:38:09.719526 A > B: . 1:1(0) ack 57345 win 0
  2159.  
  2160.    [ B probes A's window with a single byte.  A resynchronizes
  2161.      without accepting the byte ]
  2162.    17:38:14.499661 B > A: . 57345:57346(1) ack 1 win 57344
  2163.    17:38:14.499724 A > B: . 1:1(0) ack 57345 win 0
  2164.  
  2165.    [ B probes A's window again.  A resynchronizes and accepts
  2166.      the byte, as indicated by the ack field ]
  2167.    17:38:19.499764 B > A: . 57345:57346(1) ack 1 win 57344
  2168.    17:38:19.519731 A > B: . 1:1(0) ack 57346 win 0
  2169.  
  2170.    [ B probes A's window with a single byte.  A resynchronizes
  2171.      without accepting the byte ]
  2172.    17:38:24.499865 B > A: . 57346:57347(1) ack 1 win 57344
  2173.    17:38:24.499934 A > B: . 1:1(0) ack 57346 win 0
  2174.  
  2175.    [ The application on A has started generating data.
  2176.      B acks A's data and A accepts the ACKs and the
  2177.      data transfer continues ]
  2178.    17:38:28.530265 A > B: P 1:2049(2048) ack 57346 win 0
  2179.    17:38:28.719914 B > A: . 57346:57346(0) ack 2049 win 57344
  2180.  
  2181.    17:38:28.720023 A > B: . 2049:16385(14336) ack 57346 win 0
  2182.    17:38:28.720089 A > B: . 16385:30721(14336) ack 57346 win 0
  2183.  
  2184.  
  2185.  
  2186. Paxson, et. al.              Informational                     [Page 39]
  2187.  
  2188. RFC 2525              TCP Implementation Problems             March 1999
  2189.  
  2190.  
  2191.    17:38:28.720370 B > A: . 57346:57346(0) ack 30721 win 57344
  2192.  
  2193.    17:38:28.720462 A > B: . 30721:45057(14336) ack 57346 win 0
  2194.    17:38:28.720526 A > B: P 45057:59393(14336) ack 57346 win 0
  2195.    17:38:28.720824 A > B: P 59393:73729(14336) ack 57346 win 0
  2196.    17:38:28.721124 B > A: . 57346:57346(0) ack 73729 win 47104
  2197.  
  2198.    17:38:28.721198 A > B: P 73729:88065(14336) ack 57346 win 0
  2199.    17:38:28.721379 A > B: P 88065:102401(14336) ack 57346 win 0
  2200.  
  2201.    17:38:28.721557 A > B: P 102401:116737(14336) ack 57346 win 0
  2202.    17:38:28.721863 B > A: . 57346:57346(0) ack 116737 win 36864
  2203.  
  2204.    References
  2205.       None known.
  2206.  
  2207.    How to detect
  2208.       Initiate a connection from a client to a server.  Have the server
  2209.       continuously send data until its buffers have been full for long
  2210.       enough to exhaust the window.  Next, have the client read 1 byte
  2211.       and then delay for long enough that the server TCP sends a window
  2212.       probe.  Now have the client start sending data.  At this point, if
  2213.       it ignores the server's ACKs, then the client's TCP suffers from
  2214.       the problem.
  2215.  
  2216.    How to fix
  2217.       In one implementation known to exhibit the problem (derived from
  2218.       4.3-Reno), the problem was introduced when the macro MAX() was
  2219.       replaced by the function call max() for computing the amount of
  2220.       space in the receive window:
  2221.  
  2222.           tp->rcv_wnd = max(win, (int)(tp->rcv_adv - tp->rcv_nxt));
  2223.  
  2224.       When data has been received into a window beyond what has been
  2225.       advertised to the other side, rcv_nxt > rcv_adv, making this
  2226.       negative.  It's clear from the (int) cast that this is intended,
  2227.       but the unsigned max() function sign-extends so the negative
  2228.       number is "larger".  The fix is to change max() to imax():
  2229.  
  2230.           tp->rcv_wnd = imax(win, (int)(tp->rcv_adv - tp->rcv_nxt));
  2231.  
  2232.       4.3-Tahoe and before did not have this bug, since it used the
  2233.       macro MAX() for this calculation.
  2234.  
  2235. 2.13.
  2236.  
  2237.    Name of Problem
  2238.       Stretch ACK violation
  2239.  
  2240.  
  2241.  
  2242. Paxson, et. al.              Informational                     [Page 40]
  2243.  
  2244. RFC 2525              TCP Implementation Problems             March 1999
  2245.  
  2246.  
  2247.    Classification
  2248.       Congestion Control/Performance
  2249.  
  2250.    Description
  2251.       To improve efficiency (both computer and network) a data receiver
  2252.       may refrain from sending an ACK for each incoming segment,
  2253.       according to [RFC1122].  However, an ACK should not be delayed an
  2254.       inordinate amount of time.  Specifically, ACKs SHOULD be sent for
  2255.       every second full-sized segment that arrives.  If a second full-
  2256.       sized segment does not arrive within a given timeout (of no more
  2257.       than 0.5 seconds), an ACK should be transmitted, according to
  2258.       [RFC1122].  A TCP receiver which does not generate an ACK for
  2259.       every second full-sized segment exhibits a "Stretch ACK
  2260.       Violation".
  2261.  
  2262.    Significance
  2263.       TCP receivers exhibiting this behavior will cause TCP senders to
  2264.       generate burstier traffic, which can degrade performance in
  2265.       congested environments.  In addition, generating fewer ACKs
  2266.       increases the amount of time needed by the slow start algorithm to
  2267.       open the congestion window to an appropriate point, which
  2268.       diminishes performance in environments with large bandwidth-delay
  2269.       products.  Finally, generating fewer ACKs may cause needless
  2270.       retransmission timeouts in lossy environments, as it increases the
  2271.       possibility that an entire window of ACKs is lost, forcing a
  2272.       retransmission timeout.
  2273.  
  2274.    Implications
  2275.       When not in loss recovery, every ACK received by a TCP sender
  2276.       triggers the transmission of new data segments.  The burst size is
  2277.       determined by the number of previously unacknowledged segments
  2278.       each ACK covers.  Therefore, a TCP receiver ack'ing more than 2
  2279.       segments at a time causes the sending TCP to generate a larger
  2280.       burst of traffic upon receipt of the ACK.  This large burst of
  2281.       traffic can overwhelm an intervening gateway, leading to higher
  2282.       drop rates for both the connection and other connections passing
  2283.       through the congested gateway.
  2284.  
  2285.       In addition, the TCP slow start algorithm increases the congestion
  2286.       window by 1 segment for each ACK received.  Therefore, increasing
  2287.       the ACK interval (thus decreasing the rate at which ACKs are
  2288.       transmitted) increases the amount of time it takes slow start to
  2289.       increase the congestion window to an appropriate operating point,
  2290.       and the connection consequently suffers from reduced performance.
  2291.       This is especially true for connections using large windows.
  2292.  
  2293.    Relevant RFCs
  2294.       RFC 1122 outlines delayed ACKs as a recommended mechanism.
  2295.  
  2296.  
  2297.  
  2298. Paxson, et. al.              Informational                     [Page 41]
  2299.  
  2300. RFC 2525              TCP Implementation Problems             March 1999
  2301.  
  2302.  
  2303.    Trace file demonstrating it
  2304.       Trace file taken using tcpdump at host B, the data receiver (and
  2305.       ACK originator).  The advertised window (which never changed) and
  2306.       timestamp options have been omitted for clarity, except for the
  2307.       first packet sent by A:
  2308.  
  2309.    12:09:24.820187 A.1174 > B.3999: . 2049:3497(1448) ack 1
  2310.        win 33580 <nop,nop,timestamp 2249877 2249914> [tos 0x8]
  2311.    12:09:24.824147 A.1174 > B.3999: . 3497:4945(1448) ack 1
  2312.    12:09:24.832034 A.1174 > B.3999: . 4945:6393(1448) ack 1
  2313.    12:09:24.832222 B.3999 > A.1174: . ack 6393
  2314.    12:09:24.934837 A.1174 > B.3999: . 6393:7841(1448) ack 1
  2315.    12:09:24.942721 A.1174 > B.3999: . 7841:9289(1448) ack 1
  2316.    12:09:24.950605 A.1174 > B.3999: . 9289:10737(1448) ack 1
  2317.    12:09:24.950797 B.3999 > A.1174: . ack 10737
  2318.    12:09:24.958488 A.1174 > B.3999: . 10737:12185(1448) ack 1
  2319.    12:09:25.052330 A.1174 > B.3999: . 12185:13633(1448) ack 1
  2320.    12:09:25.060216 A.1174 > B.3999: . 13633:15081(1448) ack 1
  2321.    12:09:25.060405 B.3999 > A.1174: . ack 15081
  2322.  
  2323.       This portion of the trace clearly shows that the receiver (host B)
  2324.       sends an ACK for every third full sized packet received.  Further
  2325.       investigation of this implementation found that the cause of the
  2326.       increased ACK interval was the TCP options being used.  The
  2327.       implementation sent an ACK after it was holding 2*MSS worth of
  2328.       unacknowledged data.  In the above case, the MSS is 1460 bytes so
  2329.       the receiver transmits an ACK after it is holding at least 2920
  2330.       bytes of unacknowledged data.  However, the length of the TCP
  2331.       options being used [RFC1323] took 12 bytes away from the data
  2332.       portion of each packet.  This produced packets containing 1448
  2333.       bytes of data.  But the additional bytes used by the options in
  2334.       the header were not taken into account when determining when to
  2335.       trigger an ACK.  Therefore, it took 3 data segments before the
  2336.       data receiver was holding enough unacknowledged data (>= 2*MSS, or
  2337.       2920 bytes in the above example) to transmit an ACK.
  2338.  
  2339.    Trace file demonstrating correct behavior
  2340.       Trace file taken using tcpdump at host B, the data receiver (and
  2341.       ACK originator), again with window and timestamp information
  2342.       omitted except for the first packet:
  2343.  
  2344.    12:06:53.627320 A.1172 > B.3999: . 1449:2897(1448) ack 1
  2345.        win 33580 <nop,nop,timestamp 2249575 2249612> [tos 0x8]
  2346.    12:06:53.634773 A.1172 > B.3999: . 2897:4345(1448) ack 1
  2347.    12:06:53.634961 B.3999 > A.1172: . ack 4345
  2348.    12:06:53.737326 A.1172 > B.3999: . 4345:5793(1448) ack 1
  2349.    12:06:53.744401 A.1172 > B.3999: . 5793:7241(1448) ack 1
  2350.    12:06:53.744592 B.3999 > A.1172: . ack 7241
  2351.  
  2352.  
  2353.  
  2354. Paxson, et. al.              Informational                     [Page 42]
  2355.  
  2356. RFC 2525              TCP Implementation Problems             March 1999
  2357.  
  2358.  
  2359.    12:06:53.752287 A.1172 > B.3999: . 7241:8689(1448) ack 1
  2360.    12:06:53.847332 A.1172 > B.3999: . 8689:10137(1448) ack 1
  2361.    12:06:53.847525 B.3999 > A.1172: . ack 10137
  2362.  
  2363.       This trace shows the TCP receiver (host B) ack'ing every second
  2364.       full-sized packet, according to [RFC1122].  This is the same
  2365.       implementation shown above, with slight modifications that allow
  2366.       the receiver to take the length of the options into account when
  2367.       deciding when to transmit an ACK.
  2368.  
  2369.    References
  2370.       This problem is documented in [Allman97] and [Paxson97].
  2371.  
  2372.    How to detect
  2373.       Stretch ACK violations show up immediately in receiver-side packet
  2374.       traces of bulk transfers, as shown above.  However, packet traces
  2375.       made on the sender side of the TCP connection may lead to
  2376.       ambiguities when diagnosing this problem due to the possibility of
  2377.       lost ACKs.
  2378.  
  2379. 2.14.
  2380.  
  2381.    Name of Problem
  2382.       Retransmission sends multiple packets
  2383.  
  2384.    Classification
  2385.       Congestion control
  2386.  
  2387.    Description
  2388.       When a TCP retransmits a segment due to a timeout expiration or
  2389.       beginning a fast retransmission sequence, it should only transmit
  2390.       a single segment.  A TCP that transmits more than one segment
  2391.       exhibits "Retransmission Sends Multiple Packets".
  2392.  
  2393.       Instances of this problem have been known to occur due to
  2394.       miscomputations involving the use of TCP options.  TCP options
  2395.       increase the TCP header beyond its usual size of 20 bytes.  The
  2396.       total size of header must be taken into account when
  2397.       retransmitting a packet.  If a TCP sender does not account for the
  2398.       length of the TCP options when determining how much data to
  2399.       retransmit, it will send too much data to fit into a single
  2400.       packet.  In this case, the correct retransmission will be followed
  2401.       by a short segment (tinygram) containing data that may not need to
  2402.       be retransmitted.
  2403.  
  2404.       A specific case is a TCP using the RFC 1323 timestamp option,
  2405.       which adds 12 bytes to the standard 20-byte TCP header.  On
  2406.       retransmission of a packet, the 12 byte option is incorrectly
  2407.  
  2408.  
  2409.  
  2410. Paxson, et. al.              Informational                     [Page 43]
  2411.  
  2412. RFC 2525              TCP Implementation Problems             March 1999
  2413.  
  2414.  
  2415.       interpreted as part of the data portion of the segment.  A
  2416.       standard TCP header and a new 12-byte option is added to the data,
  2417.       which yields a transmission of 12 bytes more data than contained
  2418.       in the original segment.  This overflow causes a smaller packet,
  2419.       with 12 data bytes, to be transmitted.
  2420.  
  2421.    Significance
  2422.       This problem is somewhat serious for congested environments
  2423.       because the TCP implementation injects more packets into the
  2424.       network than is appropriate.  However, since a tinygram is only
  2425.       sent in response to a fast retransmit or a timeout, it does not
  2426.       effect the sustained sending rate.
  2427.  
  2428.    Implications
  2429.       A TCP exhibiting this behavior is stressing the network with more
  2430.       traffic than appropriate, and stressing routers by increasing the
  2431.       number of packets they must process.  The redundant tinygram will
  2432.       also elicit a duplicate ACK from the receiver, resulting in yet
  2433.       another unnecessary transmission.
  2434.  
  2435.    Relevant RFCs
  2436.       RFC 1122 requires use of slow start after loss; RFC 2001
  2437.       explicates slow start; RFC 1323 describes the timestamp option
  2438.       that has been observed to lead to some implementations exhibiting
  2439.       this problem.
  2440.  
  2441.    Trace file demonstrating it
  2442.       Made using tcpdump recording at a machine on the same subnet as
  2443.       Host A.  Host A is the sender and Host B is the receiver.  The
  2444.       advertised window and timestamp options have been omitted for
  2445.       clarity, except for the first segment sent by host A.  In
  2446.       addition, portions of the trace file not pertaining to the packet
  2447.       in question have been removed (missing packets are denoted by
  2448.       "[...]" in the trace).
  2449.  
  2450.    11:55:22.701668 A > B: . 7361:7821(460) ack 1
  2451.        win 49324 <nop,nop,timestamp 3485348 3485113>
  2452.    11:55:22.702109 A > B: . 7821:8281(460) ack 1
  2453.    [...]
  2454.  
  2455.    11:55:23.112405 B > A: . ack 7821
  2456.    11:55:23.113069 A > B: . 12421:12881(460) ack 1
  2457.    11:55:23.113511 A > B: . 12881:13341(460) ack 1
  2458.    11:55:23.333077 B > A: . ack 7821
  2459.    11:55:23.336860 B > A: . ack 7821
  2460.    11:55:23.340638 B > A: . ack 7821
  2461.    11:55:23.341290 A > B: . 7821:8281(460) ack 1
  2462.    11:55:23.341317 A > B: . 8281:8293(12) ack 1
  2463.  
  2464.  
  2465.  
  2466. Paxson, et. al.              Informational                     [Page 44]
  2467.  
  2468. RFC 2525              TCP Implementation Problems             March 1999
  2469.  
  2470.  
  2471.    11:55:23.498242 B > A: . ack 7821
  2472.    11:55:23.506850 B > A: . ack 7821
  2473.    11:55:23.510630 B > A: . ack 7821
  2474.  
  2475.    [...]
  2476.  
  2477.    11:55:23.746649 B > A: . ack 10581
  2478.  
  2479.       The second line of the above trace shows the original transmission
  2480.       of a segment which is later dropped.  After 3 duplicate ACKs, line
  2481.       9 of the trace shows the dropped packet (7821:8281), with a 460-
  2482.       byte payload, being retransmitted.  Immediately following this
  2483.       retransmission, a packet with a 12-byte payload is unnecessarily
  2484.       sent.
  2485.  
  2486.    Trace file demonstrating correct behavior
  2487.       The trace file would be identical to the one above, with a single
  2488.       line:
  2489.  
  2490.       11:55:23.341317 A > B: . 8281:8293(12) ack 1
  2491.  
  2492.       omitted.
  2493.  
  2494.    References
  2495.       [Brakmo95]
  2496.  
  2497.    How to detect
  2498.       This problem can be detected by examining a packet trace of the
  2499.       TCP connections of a machine using TCP options, during which a
  2500.       packet is retransmitted.
  2501.  
  2502. 2.15.
  2503.  
  2504.    Name of Problem
  2505.       Failure to send FIN notification promptly
  2506.  
  2507.    Classification
  2508.       Performance
  2509.  
  2510.    Description
  2511.       When an application closes a connection, the corresponding TCP
  2512.       should send the FIN notification promptly to its peer (unless
  2513.       prevented by the congestion window).  If a TCP implementation
  2514.       delays in sending the FIN notification, for example due to waiting
  2515.       until unacknowledged data has been acknowledged, then it is said
  2516.       to exhibit "Failure to send FIN notification promptly".
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522. Paxson, et. al.              Informational                     [Page 45]
  2523.  
  2524. RFC 2525              TCP Implementation Problems             March 1999
  2525.  
  2526.  
  2527.       Also, while not strictly required, FIN segments should include the
  2528.       PSH flag to ensure expedited delivery of any pending data at the
  2529.       receiver.
  2530.  
  2531.    Significance
  2532.       The greatest impact occurs for short-lived connections, since for
  2533.       these the additional time required to close the connection
  2534.       introduces the greatest relative delay.
  2535.  
  2536.       The additional time can be significant in the common case of the
  2537.       sender waiting for an ACK that is delayed by the receiver.
  2538.  
  2539.    Implications
  2540.       Can diminish total throughput as seen at the application layer,
  2541.       because connection termination takes longer to complete.
  2542.  
  2543.    Relevant RFCs
  2544.       RFC 793 indicates that a receiver should treat an incoming FIN
  2545.       flag as implying the push function.
  2546.  
  2547.    Trace file demonstrating it
  2548.       Made using tcpdump (no losses reported by the packet filter).
  2549.  
  2550.    10:04:38.68 A > B: S 1031850376:1031850376(0) win 4096
  2551.                    <mss 1460,wscale 0,eol> (DF)
  2552.    10:04:38.71 B > A: S 596916473:596916473(0) ack 1031850377
  2553.                    win 8760 <mss 1460> (DF)
  2554.    10:04:38.73 A > B: . ack 1 win 4096 (DF)
  2555.    10:04:41.98 A > B: P 1:4(3) ack 1 win 4096 (DF)
  2556.    10:04:42.15 B > A: . ack 4 win 8757 (DF)
  2557.    10:04:42.23 A > B: P 4:7(3) ack 1 win 4096 (DF)
  2558.    10:04:42.25 B > A: P 1:11(10) ack 7 win 8754 (DF)
  2559.    10:04:42.32 A > B: . ack 11 win 4096 (DF)
  2560.    10:04:42.33 B > A: P 11:51(40) ack 7 win 8754 (DF)
  2561.    10:04:42.51 A > B: . ack 51 win 4096 (DF)
  2562.    10:04:42.53 B > A: F 51:51(0) ack 7 win 8754 (DF)
  2563.    10:04:42.56 A > B: FP 7:7(0) ack 52 win 4096 (DF)
  2564.    10:04:42.58 B > A: . ack 8 win 8754 (DF)
  2565.  
  2566.       Machine B in the trace above does not send out a FIN notification
  2567.       promptly if there is any data outstanding.  It instead waits for
  2568.       all unacknowledged data to be acknowledged before sending the FIN
  2569.       segment.  The connection was closed at 10:04.42.33 after
  2570.       requesting 40 bytes to be sent.  However, the FIN notification
  2571.       isn't sent until 10:04.42.51, after the (delayed) acknowledgement
  2572.       of the 40 bytes of data.
  2573.  
  2574.  
  2575.  
  2576.  
  2577.  
  2578. Paxson, et. al.              Informational                     [Page 46]
  2579.  
  2580. RFC 2525              TCP Implementation Problems             March 1999
  2581.  
  2582.  
  2583.    Trace file demonstrating correct behavior
  2584.       Made using tcpdump (no losses reported by the packet filter).
  2585.  
  2586.    10:27:53.85 C > D: S 419744533:419744533(0) win 4096
  2587.                    <mss 1460,wscale 0,eol> (DF)
  2588.    10:27:53.92 D > C: S 10082297:10082297(0) ack 419744534
  2589.                    win 8760 <mss 1460> (DF)
  2590.    10:27:53.95 C > D: . ack 1 win 4096 (DF)
  2591.    10:27:54.42 C > D: P 1:4(3) ack 1 win 4096 (DF)
  2592.    10:27:54.62 D > C: . ack 4 win 8757 (DF)
  2593.    10:27:54.76 C > D: P 4:7(3) ack 1 win 4096 (DF)
  2594.    10:27:54.89 D > C: P 1:11(10) ack 7 win 8754 (DF)
  2595.    10:27:54.90 D > C: FP 11:51(40) ack7 win 8754 (DF)
  2596.    10:27:54.92 C > D: . ack 52 win 4096 (DF)
  2597.    10:27:55.01 C > D: FP 7:7(0) ack 52 win 4096 (DF)
  2598.    10:27:55.09 D > C: . ack 8 win 8754 (DF)
  2599.  
  2600.       Here, Machine D sends a FIN with 40 bytes of data even before the
  2601.       original 10 octets have been acknowledged. This is correct
  2602.       behavior as it provides for the highest performance.
  2603.  
  2604.    References
  2605.       This problem is documented in [Dawson97].
  2606.  
  2607.    How to detect
  2608.       For implementations manifesting this problem, it shows up on a
  2609.       packet trace.
  2610.  
  2611. 2.16.
  2612.  
  2613.    Name of Problem
  2614.       Failure to send a RST after Half Duplex Close
  2615.  
  2616.    Classification
  2617.       Resource management
  2618.  
  2619.    Description
  2620.       RFC 1122 4.2.2.13 states that a TCP SHOULD send a RST if data is
  2621.       received after "half duplex close", i.e. if it cannot be delivered
  2622.       to the application.  A TCP that fails to do so is said to exhibit
  2623.       "Failure to send a RST after Half Duplex Close".
  2624.  
  2625.    Significance
  2626.       Potentially serious for TCP endpoints that manage large numbers of
  2627.       connections, due to exhaustion of memory and/or process slots
  2628.       available for managing connection state.
  2629.  
  2630.  
  2631.  
  2632.  
  2633.  
  2634. Paxson, et. al.              Informational                     [Page 47]
  2635.  
  2636. RFC 2525              TCP Implementation Problems             March 1999
  2637.  
  2638.  
  2639.    Implications
  2640.       Failure to send the RST can lead to permanently hung TCP
  2641.       connections.  This problem has been demonstrated when HTTP clients
  2642.       abort connections, common when users move on to a new page before
  2643.       the current page has finished downloading.  The HTTP client closes
  2644.       by transmitting a FIN while the server is transmitting images,
  2645.       text, etc.  The server TCP receives the FIN,  but its application
  2646.       does not close the connection until all data has been queued for
  2647.       transmission.  Since the server will not transmit a FIN until all
  2648.       the preceding data has been transmitted, deadlock results if the
  2649.       client TCP does not consume the pending data or tear down the
  2650.       connection: the window decreases to zero, since the client cannot
  2651.       pass the data to the application, and the server sends probe
  2652.       segments.  The client acknowledges the probe segments with a zero
  2653.       window. As mandated in RFC1122 4.2.2.17, the probe segments are
  2654.       transmitted forever.  Server connection state remains in
  2655.       CLOSE_WAIT, and eventually server processes are exhausted.
  2656.  
  2657.       Note that there are two bugs.  First, probe segments should be
  2658.       ignored if the window can never subsequently increase.  Second, a
  2659.       RST should be sent when data is received after half duplex close.
  2660.       Fixing the first bug, but not the second, results in the probe
  2661.       segments eventually timing out the connection, but the server
  2662.       remains in CLOSE_WAIT for a significant and unnecessary period.
  2663.  
  2664.    Relevant RFCs
  2665.       RFC 1122 sections 4.2.2.13 and 4.2.2.17.
  2666.  
  2667.    Trace file demonstrating it
  2668.       Made using an unknown network analyzer.  No drop information
  2669.       available.
  2670.  
  2671.    client.1391 > server.8080: S 0:1(0) ack: 0 win: 2000 <mss: 5b4>
  2672.    server.8080 > client.1391: SA 8c01:8c02(0) ack: 1 win: 8000 <mss:100>
  2673.    client.1391 > server.8080: PA
  2674.    client.1391 > server.8080: PA 1:1c2(1c1) ack: 8c02 win: 2000
  2675.    server.8080 > client.1391: [DF] PA 8c02:8cde(dc) ack: 1c2 win: 8000
  2676.    server.8080 > client.1391: [DF] A 8cde:9292(5b4) ack: 1c2 win: 8000
  2677.    server.8080 > client.1391: [DF] A 9292:9846(5b4) ack: 1c2 win: 8000
  2678.    server.8080 > client.1391: [DF] A 9846:9dfa(5b4) ack: 1c2 win: 8000
  2679.    client.1391 > server.8080: PA
  2680.    server.8080 > client.1391: [DF] A 9dfa:a3ae(5b4) ack: 1c2 win: 8000
  2681.    server.8080 > client.1391: [DF] A a3ae:a962(5b4) ack: 1c2 win: 8000
  2682.    server.8080 > client.1391: [DF] A a962:af16(5b4) ack: 1c2 win: 8000
  2683.    server.8080 > client.1391: [DF] A af16:b4ca(5b4) ack: 1c2 win: 8000
  2684.    client.1391 > server.8080: PA
  2685.    server.8080 > client.1391: [DF] A b4ca:ba7e(5b4) ack: 1c2 win: 8000
  2686.    server.8080 > client.1391: [DF] A b4ca:ba7e(5b4) ack: 1c2 win: 8000
  2687.  
  2688.  
  2689.  
  2690. Paxson, et. al.              Informational                     [Page 48]
  2691.  
  2692. RFC 2525              TCP Implementation Problems             March 1999
  2693.  
  2694.  
  2695.    client.1391 > server.8080: PA
  2696.    server.8080 > client.1391: [DF] A ba7e:bdfa(37c) ack: 1c2 win: 8000
  2697.    client.1391 > server.8080: PA
  2698.    server.8080 > client.1391: [DF] A bdfa:bdfb(1) ack: 1c2 win: 8000
  2699.    client.1391 > server.8080: PA
  2700.  
  2701.    [ HTTP client aborts and enters FIN_WAIT_1 ]
  2702.  
  2703.    client.1391 > server.8080: FPA
  2704.  
  2705.    [ server ACKs the FIN and enters CLOSE_WAIT ]
  2706.  
  2707.    server.8080 > client.1391: [DF] A
  2708.  
  2709.    [ client enters FIN_WAIT_2 ]
  2710.  
  2711.    server.8080 > client.1391: [DF] A bdfa:bdfb(1) ack: 1c3 win: 8000
  2712.  
  2713.    [ server continues to try to send its data ]
  2714.  
  2715.    client.1391 > server.8080: PA < window = 0 >
  2716.    server.8080 > client.1391: [DF] A bdfa:bdfb(1) ack: 1c3 win: 8000
  2717.    client.1391 > server.8080: PA < window = 0 >
  2718.    server.8080 > client.1391: [DF] A bdfa:bdfb(1) ack: 1c3 win: 8000
  2719.    client.1391 > server.8080: PA < window = 0 >
  2720.    server.8080 > client.1391: [DF] A bdfa:bdfb(1) ack: 1c3 win: 8000
  2721.    client.1391 > server.8080: PA < window = 0 >
  2722.    server.8080 > client.1391: [DF] A bdfa:bdfb(1) ack: 1c3 win: 8000
  2723.    client.1391 > server.8080: PA < window = 0 >
  2724.  
  2725.    [ ... repeat ad exhaustium ... ]
  2726.  
  2727.    Trace file demonstrating correct behavior
  2728.       Made using an unknown network analyzer.  No drop information
  2729.       available.
  2730.  
  2731.    client > server D=80 S=59500 Syn Seq=337 Len=0 Win=8760
  2732.    server > client D=59500 S=80 Syn Ack=338 Seq=80153 Len=0 Win=8760
  2733.    client > server D=80 S=59500 Ack=80154 Seq=338 Len=0 Win=8760
  2734.  
  2735.    [ ... normal data omitted ... ]
  2736.  
  2737.    client > server D=80 S=59500 Ack=14559 Seq=596 Len=0 Win=8760
  2738.    server > client D=59500 S=80 Ack=596 Seq=114559 Len=1460 Win=8760
  2739.  
  2740.    [ client closes connection ]
  2741.  
  2742.    client > server D=80 S=59500 Fin Seq=596 Len=0 Win=8760
  2743.  
  2744.  
  2745.  
  2746. Paxson, et. al.              Informational                     [Page 49]
  2747.  
  2748. RFC 2525              TCP Implementation Problems             March 1999
  2749.  
  2750.  
  2751.    server > client D=59500 S=80 Ack=597 Seq=116019 Len=1460 Win=8760
  2752.  
  2753.    [ client sends RST (RFC1122 4.2.2.13) ]
  2754.  
  2755.    client > server D=80 S=59500 Rst Seq=597 Len=0 Win=0
  2756.    server > client D=59500 S=80 Ack=597 Seq=117479 Len=1460 Win=8760
  2757.    client > server D=80 S=59500 Rst Seq=597 Len=0 Win=0
  2758.    server > client D=59500 S=80 Ack=597 Seq=118939 Len=1460 Win=8760
  2759.    client > server D=80 S=59500 Rst Seq=597 Len=0 Win=0
  2760.    server > client D=59500 S=80 Ack=597 Seq=120399 Len=892 Win=8760
  2761.    client > server D=80 S=59500 Rst Seq=597 Len=0 Win=0
  2762.    server > client D=59500 S=80 Ack=597 Seq=121291 Len=1460 Win=8760
  2763.    client > server D=80 S=59500 Rst Seq=597 Len=0 Win=0
  2764.  
  2765.       "client" sends a number of RSTs, one in response to each incoming
  2766.       packet from "server".  One might wonder why "server" keeps sending
  2767.       data packets after it has received a RST from "client"; the
  2768.       explanation is that "server" had already transmitted all five of
  2769.       the data packets before receiving the first RST from "client", so
  2770.       it is too late to avoid transmitting them.
  2771.  
  2772.    How to detect
  2773.       The problem can be detected by inspecting packet traces of a
  2774.       large, interrupted bulk transfer.
  2775.  
  2776. 2.17.
  2777.  
  2778.    Name of Problem
  2779.       Failure to RST on close with data pending
  2780.  
  2781.    Classification
  2782.       Resource management
  2783.  
  2784.    Description
  2785.       When an application closes a connection in such a way that it can
  2786.       no longer read any received data, the TCP SHOULD, per section
  2787.       4.2.2.13 of RFC 1122, send a RST if there is any unread received
  2788.       data, or if any new data is received. A TCP that fails to do so
  2789.       exhibits "Failure to RST on close with data pending".
  2790.  
  2791.       Note that, for some TCPs, this situation can be caused by an
  2792.       application "crashing" while a peer is sending data.
  2793.  
  2794.       We have observed a number of TCPs that exhibit this problem.  The
  2795.       problem is less serious if any subsequent data sent to the now-
  2796.       closed connection endpoint elicits a RST (see illustration below).
  2797.  
  2798.  
  2799.  
  2800.  
  2801.  
  2802. Paxson, et. al.              Informational                     [Page 50]
  2803.  
  2804. RFC 2525              TCP Implementation Problems             March 1999
  2805.  
  2806.  
  2807.    Significance
  2808.       This problem is most significant for endpoints that engage in
  2809.       large numbers of connections, as their ability to do so will be
  2810.       curtailed as they leak away resources.
  2811.  
  2812.    Implications
  2813.       Failure to reset the connection can lead to permanently hung
  2814.       connections, in which the remote endpoint takes no further action
  2815.       to tear down the connection because it is waiting on the local TCP
  2816.       to first take some action.  This is particularly the case if the
  2817.       local TCP also allows the advertised window to go to zero, and
  2818.       fails to tear down the connection when the remote TCP engages in
  2819.       "persist" probes (see example below).
  2820.  
  2821.    Relevant RFCs
  2822.       RFC 1122 section 4.2.2.13.  Also, 4.2.2.17 for the zero-window
  2823.       probing discussion below.
  2824.  
  2825.    Trace file demonstrating it
  2826.       Made using tcpdump.  No drop information available.
  2827.  
  2828.    13:11:46.04 A > B: S 458659166:458659166(0) win 4096
  2829.                        <mss 1460,wscale 0,eol> (DF)
  2830.    13:11:46.04 B > A: S 792320000:792320000(0) ack 458659167
  2831.                        win 4096
  2832.    13:11:46.04 A > B: . ack 1 win 4096 (DF)
  2833.    13:11.55.80 A > B: . 1:513(512) ack 1 win 4096 (DF)
  2834.    13:11.55.80 A > B: . 513:1025(512) ack 1 win 4096 (DF)
  2835.    13:11:55.83 B > A: . ack 1025 win 3072
  2836.    13:11.55.84 A > B: . 1025:1537(512) ack 1 win 4096 (DF)
  2837.    13:11.55.84 A > B: . 1537:2049(512) ack 1 win 4096 (DF)
  2838.    13:11.55.85 A > B: . 2049:2561(512) ack 1 win 4096 (DF)
  2839.    13:11:56.03 B > A: . ack 2561 win 1536
  2840.    13:11.56.05 A > B: . 2561:3073(512) ack 1 win 4096 (DF)
  2841.    13:11.56.06 A > B: . 3073:3585(512) ack 1 win 4096 (DF)
  2842.    13:11.56.06 A > B: . 3585:4097(512) ack 1 win 4096 (DF)
  2843.    13:11:56.23 B > A: . ack 4097 win 0
  2844.    13:11:58.16 A > B: . 4096:4097(1) ack 1 win 4096 (DF)
  2845.    13:11:58.16 B > A: . ack 4097 win 0
  2846.    13:12:00.16 A > B: . 4096:4097(1) ack 1 win 4096 (DF)
  2847.    13:12:00.16 B > A: . ack 4097 win 0
  2848.    13:12:02.16 A > B: . 4096:4097(1) ack 1 win 4096 (DF)
  2849.    13:12:02.16 B > A: . ack 4097 win 0
  2850.    13:12:05.37 A > B: . 4096:4097(1) ack 1 win 4096 (DF)
  2851.    13:12:05.37 B > A: . ack 4097 win 0
  2852.    13:12:06.36 B > A: F 1:1(0) ack 4097 win 0
  2853.    13:12:06.37 A > B: . ack 2 win 4096 (DF)
  2854.    13:12:11.78 A > B: . 4096:4097(1) ack 2 win 4096 (DF)
  2855.  
  2856.  
  2857.  
  2858. Paxson, et. al.              Informational                     [Page 51]
  2859.  
  2860. RFC 2525              TCP Implementation Problems             March 1999
  2861.  
  2862.  
  2863.    13:12:11.78 B > A: . ack 4097 win 0
  2864.    13:12:24.59 A > B: . 4096:4097(1) ack 2 win 4096 (DF)
  2865.    13:12:24.60 B > A: . ack 4097 win 0
  2866.    13:12:50.22 A > B: . 4096:4097(1) ack 2 win 4096 (DF)
  2867.    13:12:50.22 B > A: . ack 4097 win 0
  2868.  
  2869.       Machine B in the trace above does not drop received data when the
  2870.       socket is "closed" by the application (in this case, the
  2871.       application process was terminated). This occurred at
  2872.       approximately 13:12:06.36 and resulted in the FIN being sent in
  2873.       response to the close. However, because there is no longer an
  2874.       application to deliver the data to, the TCP should have instead
  2875.       sent a RST.
  2876.  
  2877.       Note: Machine A's zero-window probing is also broken.  It is
  2878.       resending old data, rather than new data. Section 3.7 in RFC 793
  2879.       and Section 4.2.2.17 in RFC 1122 discuss zero-window probing.
  2880.  
  2881.    Trace file demonstrating better behavior
  2882.       Made using tcpdump.  No drop information available.
  2883.  
  2884.       Better, but still not fully correct, behavior, per the discussion
  2885.       below.  We show this behavior because it has been observed for a
  2886.       number of different TCP implementations.
  2887.  
  2888.    13:48:29.24 C > D: S 73445554:73445554(0) win 4096
  2889.                        <mss 1460,wscale 0,eol> (DF)
  2890.    13:48:29.24 D > C: S 36050296:36050296(0) ack 73445555
  2891.                        win 4096 <mss 1460,wscale 0,eol> (DF)
  2892.    13:48:29.25 C > D: . ack 1 win 4096 (DF)
  2893.    13:48:30.78 C > D: . 1:1461(1460) ack 1 win 4096 (DF)
  2894.    13:48:30.79 C > D: . 1461:2921(1460) ack 1 win 4096 (DF)
  2895.    13:48:30.80 D > C: . ack 2921 win 1176 (DF)
  2896.    13:48:32.75 C > D: . 2921:4097(1176) ack 1 win 4096 (DF)
  2897.    13:48:32.82 D > C: . ack 4097 win 0 (DF)
  2898.    13:48:34.76 C > D: . 4096:4097(1) ack 1 win 4096 (DF)
  2899.    13:48:34.84 D > C: . ack 4097 win 0 (DF)
  2900.    13:48:36.34 D > C: FP 1:1(0) ack 4097 win 4096 (DF)
  2901.    13:48:36.34 C > D: . 4097:5557(1460) ack 2 win 4096 (DF)
  2902.    13:48:36.34 D > C: R 36050298:36050298(0) win 24576
  2903.    13:48:36.34 C > D: . 5557:7017(1460) ack 2 win 4096 (DF)
  2904.    13:48:36.34 D > C: R 36050298:36050298(0) win 24576
  2905.  
  2906.       In this trace, the application process is terminated on Machine D
  2907.       at approximately 13:48:36.34.  Its TCP sends the FIN with the
  2908.       window opened again (since it discarded the previously received
  2909.       data).  Machine C promptly sends more data, causing Machine D to
  2910.  
  2911.  
  2912.  
  2913.  
  2914. Paxson, et. al.              Informational                     [Page 52]
  2915.  
  2916. RFC 2525              TCP Implementation Problems             March 1999
  2917.  
  2918.  
  2919.       reset the connection since it cannot deliver the data to the
  2920.       application. Ideally, Machine D SHOULD send a RST instead of
  2921.       dropping the data and re-opening the receive window.
  2922.  
  2923.       Note: Machine C's zero-window probing is broken, the same as in
  2924.       the example above.
  2925.  
  2926.    Trace file demonstrating correct behavior
  2927.       Made using tcpdump.  No losses reported by the packet filter.
  2928.  
  2929.    14:12:02.19 E > F: S 1143360000:1143360000(0) win 4096
  2930.    14:12:02.19 F > E: S 1002988443:1002988443(0) ack 1143360001
  2931.                        win 4096 <mss 1460> (DF)
  2932.    14:12:02.19 E > F: . ack 1 win 4096
  2933.    14:12:10.43 E > F: . 1:513(512) ack 1 win 4096
  2934.    14:12:10.61 F > E: . ack 513 win 3584 (DF)
  2935.    14:12:10.61 E > F: . 513:1025(512) ack 1 win 4096
  2936.    14:12:10.61 E > F: . 1025:1537(512) ack 1 win 4096
  2937.    14:12:10.81 F > E: . ack 1537 win 2560 (DF)
  2938.    14:12:10.81 E > F: . 1537:2049(512) ack 1 win 4096
  2939.    14:12:10.81 E > F: . 2049:2561(512) ack 1 win 4096
  2940.    14:12:10.81 E > F: . 2561:3073(512) ack 1 win 4096
  2941.    14:12:11.01 F > E: . ack 3073 win 1024 (DF)
  2942.    14:12:11.01 E > F: . 3073:3585(512) ack 1 win 4096
  2943.    14:12:11.01 E > F: . 3585:4097(512) ack 1 win 4096
  2944.    14:12:11.21 F > E: . ack 4097 win 0 (DF)
  2945.    14:12:15.88 E > F: . 4097:4098(1) ack 1 win 4096
  2946.    14:12:16.06 F > E: . ack 4097 win 0 (DF)
  2947.    14:12:20.88 E > F: . 4097:4098(1) ack 1 win 4096
  2948.    14:12:20.91 F > E: . ack 4097 win 0 (DF)
  2949.    14:12:21.94 F > E: R 1002988444:1002988444(0) win 4096
  2950.  
  2951.       When the application terminates at 14:12:21.94, F immediately
  2952.       sends a RST.
  2953.  
  2954.       Note: Machine E's zero-window probing is (finally) correct.
  2955.  
  2956.    How to detect
  2957.       The problem can often be detected by inspecting packet traces of a
  2958.       transfer in which the receiving application terminates abnormally.
  2959.       When doing so, there can be an ambiguity (if only looking at the
  2960.       trace) as to whether the receiving TCP did indeed have unread data
  2961.       that it could now no longer deliver.  To provoke this to happen,
  2962.       it may help to suspend the receiving application so that it fails
  2963.       to consume any data, eventually exhausting the advertised window.
  2964.       At this point, since the advertised window is zero, we know that
  2965.  
  2966.  
  2967.  
  2968.  
  2969.  
  2970. Paxson, et. al.              Informational                     [Page 53]
  2971.  
  2972. RFC 2525              TCP Implementation Problems             March 1999
  2973.  
  2974.  
  2975.       the receiving TCP has undelivered data buffered up.  Terminating
  2976.       the application process then should suffice to test the
  2977.       correctness of the TCP's behavior.
  2978.  
  2979. 2.18.
  2980.  
  2981.    Name of Problem
  2982.       Options missing from TCP MSS calculation
  2983.  
  2984.    Classification
  2985.       Reliability / performance
  2986.  
  2987.    Description
  2988.       When a TCP determines how much data to send per packet, it
  2989.       calculates a segment size based on the MTU of the path.  It must
  2990.       then subtract from that MTU the size of the IP and TCP headers in
  2991.       the packet.  If IP options and TCP options are not taken into
  2992.       account correctly in this calculation, the resulting segment size
  2993.       may be too large.  TCPs that do so are said to exhibit "Options
  2994.       missing from TCP MSS calculation".
  2995.  
  2996.    Significance
  2997.       In some implementations, this causes the transmission of strangely
  2998.       fragmented packets.  In some implementations with Path MTU (PMTU)
  2999.       discovery [RFC1191], this problem can actually result in a total
  3000.       failure to transmit any data at all, regardless of the environment
  3001.       (see below).
  3002.  
  3003.       Arguably, especially since the wide deployment of firewalls, IP
  3004.       options appear only rarely in normal operations.
  3005.  
  3006.    Implications
  3007.       In implementations using PMTU discovery, this problem can result
  3008.       in packets that are too large for the output interface, and that
  3009.       have the DF (don't fragment) bit set in the IP header.  Thus, the
  3010.       IP layer on the local machine is not allowed to fragment the
  3011.       packet to send it out the interface.  It instead informs the TCP
  3012.       layer of the correct MTU size of the interface; the TCP layer
  3013.       again miscomputes the MSS by failing to take into account the size
  3014.       of IP options; and the problem repeats, with no data flowing.
  3015.  
  3016.    Relevant RFCs
  3017.       RFC 1122 describes the calculation of the effective send MSS.  RFC
  3018.       1191 describes Path MTU discovery.
  3019.  
  3020.  
  3021.  
  3022.  
  3023.  
  3024.  
  3025.  
  3026. Paxson, et. al.              Informational                     [Page 54]
  3027.  
  3028. RFC 2525              TCP Implementation Problems             March 1999
  3029.  
  3030.  
  3031.    Trace file demonstrating it
  3032.       Trace file taking using tcpdump on host C.  The first trace
  3033.       demonstrates the fragmentation that occurs without path MTU
  3034.       discovery:
  3035.  
  3036.    13:55:25.488728 A.65528 > C.discard:
  3037.            P 567833:569273(1440) ack 1 win 17520
  3038.            <nop,nop,timestamp 3839 1026342>
  3039.            (frag 20828:1472@0+)
  3040.            (ttl 62, optlen=8 LSRR{B#} NOP)
  3041.  
  3042.    13:55:25.488943 A > C:
  3043.            (frag 20828:8@1472)
  3044.            (ttl 62, optlen=8 LSRR{B#} NOP)
  3045.  
  3046.    13:55:25.489052 C.discard > A.65528:
  3047.            . ack 566385 win 60816
  3048.            <nop,nop,timestamp 1026345 3839> (DF)
  3049.            (ttl 60, id 41266)
  3050.  
  3051.       Host A repeatedly sends 1440-octet data segments, but these hare
  3052.       fragmented into two packets, one with 1432 octets of data, and
  3053.       another with 8 octets of data.
  3054.  
  3055.       The second trace demonstrates the failure to send any data
  3056.       segments, sometimes seen with hosts doing path MTU discovery:
  3057.  
  3058.    13:55:44.332219 A.65527 > C.discard:
  3059.            S 1018235390:1018235390(0) win 16384
  3060.            <mss 1460,nop,wscale 0,nop,nop,timestamp 3876 0> (DF)
  3061.            (ttl 62, id 20912, optlen=8 LSRR{B#} NOP)
  3062.  
  3063.    13:55:44.333015 C.discard > A.65527:
  3064.            S 1271629000:1271629000(0) ack 1018235391 win 60816
  3065.            <mss 1460,nop,wscale 0,nop,nop,timestamp 1026383 3876> (DF)
  3066.            (ttl 60, id 41427)
  3067.  
  3068.    13:55:44.333206 C.discard > A.65527:
  3069.            S 1271629000:1271629000(0) ack 1018235391 win 60816
  3070.            <mss 1460,nop,wscale 0,nop,nop,timestamp 1026383 3876> (DF)
  3071.            (ttl 60, id 41427)
  3072.  
  3073.       This is all of the activity seen on this connection.  Eventually
  3074.       host C will time out attempting to establish the connection.
  3075.  
  3076.    How to detect
  3077.       The "netcat" utility [Hobbit96] is useful for generating source
  3078.       routed packets:
  3079.  
  3080.  
  3081.  
  3082. Paxson, et. al.              Informational                     [Page 55]
  3083.  
  3084. RFC 2525              TCP Implementation Problems             March 1999
  3085.  
  3086.  
  3087.       1% nc C discard
  3088.       (interactive typing)
  3089.       ^C
  3090.       2% nc C discard < /dev/zero
  3091.       ^C
  3092.       3% nc -g B C discard
  3093.       (interactive typing)
  3094.       ^C
  3095.       4% nc -g B C discard < /dev/zero
  3096.       ^C
  3097.  
  3098.       Lines 1 through 3 should generate appropriate packets, which can
  3099.       be verified using tcpdump.  If the problem is present, line 4
  3100.       should generate one of the two kinds of packet traces shown.
  3101.  
  3102.    How to fix
  3103.       The implementation should ensure that the effective send MSS
  3104.       calculation includes a term for the IP and TCP options, as
  3105.       mandated by RFC 1122.
  3106.  
  3107. 3. Security Considerations
  3108.  
  3109.    This memo does not discuss any specific security-related TCP
  3110.    implementation problems, as the working group decided to pursue
  3111.    documenting those in a separate document.  Some of the implementation
  3112.    problems discussed here, however, can be used for denial-of-service
  3113.    attacks.  Those classified as congestion control present
  3114.    opportunities to subvert TCPs used for legitimate data transfer into
  3115.    excessively loading network elements.  Those classified as
  3116.    "performance", "reliability" and "resource management" may be
  3117.    exploitable for launching surreptitious denial-of-service attacks
  3118.    against the user of the TCP.  Both of these types of attacks can be
  3119.    extremely difficult to detect because in most respects they look
  3120.    identical to legitimate network traffic.
  3121.  
  3122. 4. Acknowledgements
  3123.  
  3124.    Thanks to numerous correspondents on the tcp-impl mailing list for
  3125.    their input:  Steve Alexander, Larry Backman, Jerry Chu, Alan Cox,
  3126.    Kevin Fall, Richard Fox, Jim Gettys, Rick Jones, Allison Mankin, Neal
  3127.    McBurnett, Perry Metzger, der Mouse, Thomas Narten, Andras Olah,
  3128.    Steve Parker, Francesco Potorti`, Luigi Rizzo, Allyn Romanow, Al
  3129.    Smith, Jerry Toporek, Joe Touch, and Curtis Villamizar.
  3130.  
  3131.    Thanks also to Josh Cohen for the traces documenting the "Failure to
  3132.    send a RST after Half Duplex Close" problem; and to John Polstra, who
  3133.    analyzed the "Window probe deadlock" problem.
  3134.  
  3135.  
  3136.  
  3137.  
  3138. Paxson, et. al.              Informational                     [Page 56]
  3139.  
  3140. RFC 2525              TCP Implementation Problems             March 1999
  3141.  
  3142.  
  3143. 5. References
  3144.  
  3145.    [Allman97]   M. Allman, "Fixing Two BSD TCP Bugs," Technical Report
  3146.                 CR-204151, NASA Lewis Research Center, Oct. 1997.
  3147.                 http://roland.grc.nasa.gov/~mallman/papers/bug.ps
  3148.  
  3149.    [RFC2414]    Allman, M., Floyd, S. and C. Partridge, "Increasing
  3150.                 TCP's Initial Window", RFC 2414, September 1998.
  3151.  
  3152.    [RFC1122]    Braden, R., Editor, "Requirements for Internet Hosts --
  3153.                 Communication Layers", STD 3, RFC 1122, October 1989.
  3154.  
  3155.    [RFC2119]    Bradner, S., "Key words for use in RFCs to Indicate
  3156.                 Requirement Levels", BCP 14, RFC 2119, March 1997.
  3157.  
  3158.    [Brakmo95]   L. Brakmo and L. Peterson, "Performance Problems in
  3159.                 BSD4.4 TCP," ACM Computer Communication Review,
  3160.                 25(5):69-86, 1995.
  3161.  
  3162.    [RFC813]     Clark, D., "Window and Acknowledgement Strategy in TCP,"
  3163.                 RFC 813, July 1982.
  3164.  
  3165.    [Dawson97]   S. Dawson, F. Jahanian, and T. Mitton, "Experiments on
  3166.                 Six Commercial TCP Implementations Using a Software
  3167.                 Fault Injection Tool," to appear in Software Practice &
  3168.                 Experience, 1997.  A technical report version of this
  3169.                 paper can be obtained at
  3170.                 ftp://rtcl.eecs.umich.edu/outgoing/sdawson/CSE-TR-298-
  3171.                 96.ps.gz.
  3172.  
  3173.    [Fall96]     K. Fall and S. Floyd, "Simulation-based Comparisons of
  3174.                 Tahoe, Reno, and SACK TCP," ACM Computer Communication
  3175.                 Review, 26(3):5-21, 1996.
  3176.  
  3177.    [Hobbit96]   Hobbit, Avian Research, netcat, available via anonymous
  3178.                 ftp to ftp.avian.org, 1996.
  3179.  
  3180.    [Hoe96]      J. Hoe, "Improving the Start-up Behavior of a Congestion
  3181.                 Control Scheme for TCP," Proc. SIGCOMM '96.
  3182.  
  3183.    [Jacobson88] V. Jacobson, "Congestion Avoidance and Control," Proc.
  3184.                 SIGCOMM '88.  ftp://ftp.ee.lbl.gov/papers/congavoid.ps.Z
  3185.  
  3186.    [Jacobson89] V. Jacobson, C. Leres, and S. McCanne, tcpdump,
  3187.                 available via anonymous ftp to ftp.ee.lbl.gov, Jun.
  3188.                 1989.
  3189.  
  3190.  
  3191.  
  3192.  
  3193.  
  3194. Paxson, et. al.              Informational                     [Page 57]
  3195.  
  3196. RFC 2525              TCP Implementation Problems             March 1999
  3197.  
  3198.  
  3199.    [RFC2018]    Mathis, M., Mahdavi, J., Floyd, S. and A. Romanow, "TCP
  3200.                 Selective Acknowledgement Options", RFC 2018, October
  3201.                 1996.
  3202.  
  3203.    [RFC1191]    Mogul, J. and S. Deering, "Path MTU discovery", RFC
  3204.                 1191, November 1990.
  3205.  
  3206.    [RFC896]     Nagle, J., "Congestion Control in IP/TCP Internetworks",
  3207.                 RFC 896, January 1984.
  3208.  
  3209.    [Paxson97]   V. Paxson, "Automated Packet Trace Analysis of TCP
  3210.                 Implementations," Proc. SIGCOMM '97, available from
  3211.                 ftp://ftp.ee.lbl.gov/papers/vp-tcpanaly-sigcomm97.ps.Z.
  3212.  
  3213.    [RFC793]     Postel, J., Editor, "Transmission Control Protocol," STD
  3214.                 7, RFC 793, September 1981.
  3215.  
  3216.    [RFC2001]    Stevens, W., "TCP Slow Start, Congestion Avoidance, Fast
  3217.                 Retransmit, and Fast Recovery Algorithms", RFC 2001,
  3218.                 January 1997.
  3219.  
  3220.    [Stevens94]  W. Stevens, "TCP/IP Illustrated, Volume 1", Addison-
  3221.                 Wesley Publishing Company, Reading, Massachusetts, 1994.
  3222.  
  3223.    [Wright95]   G. Wright and W. Stevens, "TCP/IP Illustrated, Volume
  3224.                 2", Addison-Wesley Publishing Company, Reading
  3225.                 Massachusetts, 1995.
  3226.  
  3227. 6. Authors' Addresses
  3228.  
  3229.    Vern Paxson
  3230.    ACIRI / ICSI
  3231.    1947 Center Street
  3232.    Suite 600
  3233.    Berkeley, CA 94704-1198
  3234.  
  3235.    Phone: +1 510/642-4274 x302
  3236.    EMail: vern@aciri.org
  3237.  
  3238.  
  3239.  
  3240.  
  3241.  
  3242.  
  3243.  
  3244.  
  3245.  
  3246.  
  3247.  
  3248.  
  3249.  
  3250. Paxson, et. al.              Informational                     [Page 58]
  3251.  
  3252. RFC 2525              TCP Implementation Problems             March 1999
  3253.  
  3254.  
  3255.    Mark Allman <mallman@grc.nasa.gov>
  3256.    NASA Glenn Research Center/Sterling Software
  3257.    Lewis Field
  3258.    21000 Brookpark Road
  3259.    MS 54-2
  3260.    Cleveland, OH 44135
  3261.    USA
  3262.  
  3263.    Phone: +1 216/433-6586
  3264.    Email: mallman@grc.nasa.gov
  3265.  
  3266.    Scott Dawson
  3267.    Real-Time Computing Laboratory
  3268.    EECS Building
  3269.    University of Michigan
  3270.    Ann Arbor, MI  48109-2122
  3271.    USA
  3272.  
  3273.    Phone: +1 313/763-5363
  3274.    EMail: sdawson@eecs.umich.edu
  3275.  
  3276.  
  3277.    William C. Fenner
  3278.    Xerox PARC
  3279.    3333 Coyote Hill Road
  3280.    Palo Alto, CA 94304
  3281.    USA
  3282.  
  3283.    Phone: +1 650/812-4816
  3284.    EMail: fenner@parc.xerox.com
  3285.  
  3286.  
  3287.    Jim Griner <jgriner@grc.nasa.gov>
  3288.    NASA Glenn Research Center
  3289.    Lewis Field
  3290.    21000 Brookpark Road
  3291.    MS 54-2
  3292.    Cleveland, OH 44135
  3293.    USA
  3294.  
  3295.    Phone: +1 216/433-5787
  3296.    EMail: jgriner@grc.nasa.gov
  3297.  
  3298.  
  3299.  
  3300.  
  3301.  
  3302.  
  3303.  
  3304.  
  3305.  
  3306. Paxson, et. al.              Informational                     [Page 59]
  3307.  
  3308. RFC 2525              TCP Implementation Problems             March 1999
  3309.  
  3310.  
  3311.    Ian Heavens
  3312.    Spider Software Ltd.
  3313.    8 John's Place, Leith
  3314.    Edinburgh EH6 7EL
  3315.    UK
  3316.  
  3317.    Phone: +44 131/475-7015
  3318.    EMail: ian@spider.com
  3319.  
  3320.    Kevin Lahey
  3321.    NASA Ames Research Center/MRJ
  3322.    MS 258-6
  3323.    Moffett Field, CA 94035
  3324.    USA
  3325.  
  3326.    Phone: +1 650/604-4334
  3327.    EMail: kml@nas.nasa.gov
  3328.  
  3329.  
  3330.    Jeff Semke
  3331.    Pittsburgh Supercomputing Center
  3332.    4400 Fifth Ave
  3333.    Pittsburgh, PA 15213
  3334.    USA
  3335.  
  3336.    Phone: +1 412/268-4960
  3337.    EMail: semke@psc.edu
  3338.  
  3339.  
  3340.    Bernie Volz
  3341.    Process Software Corporation
  3342.    959 Concord Street
  3343.    Framingham, MA 01701
  3344.    USA
  3345.  
  3346.    Phone: +1 508/879-6994
  3347.    EMail: volz@process.com
  3348.  
  3349.  
  3350.  
  3351.  
  3352.  
  3353.  
  3354.  
  3355.  
  3356.  
  3357.  
  3358.  
  3359.  
  3360.  
  3361.  
  3362. Paxson, et. al.              Informational                     [Page 60]
  3363.  
  3364. RFC 2525              TCP Implementation Problems             March 1999
  3365.  
  3366.  
  3367. 7.  Full Copyright Statement
  3368.  
  3369.    Copyright (C) The Internet Society (1999).  All Rights Reserved.
  3370.  
  3371.    This document and translations of it may be copied and furnished to
  3372.    others, and derivative works that comment on or otherwise explain it
  3373.    or assist in its implementation may be prepared, copied, published
  3374.    and distributed, in whole or in part, without restriction of any
  3375.    kind, provided that the above copyright notice and this paragraph are
  3376.    included on all such copies and derivative works.  However, this
  3377.    document itself may not be modified in any way, such as by removing
  3378.    the copyright notice or references to the Internet Society or other
  3379.    Internet organizations, except as needed for the purpose of
  3380.    developing Internet standards in which case the procedures for
  3381.    copyrights defined in the Internet Standards process must be
  3382.    followed, or as required to translate it into languages other than
  3383.    English.
  3384.  
  3385.    The limited permissions granted above are perpetual and will not be
  3386.    revoked by the Internet Society or its successors or assigns.
  3387.  
  3388.    This document and the information contained herein is provided on an
  3389.    "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING
  3390.    TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
  3391.    BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION
  3392.    HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF
  3393.    MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
  3394.  
  3395.  
  3396.  
  3397.  
  3398.  
  3399.  
  3400.  
  3401.  
  3402.  
  3403.  
  3404.  
  3405.  
  3406.  
  3407.  
  3408.  
  3409.  
  3410.  
  3411.  
  3412.  
  3413.  
  3414.  
  3415.  
  3416.  
  3417.  
  3418. Paxson, et. al.              Informational                     [Page 61]
  3419.  
  3420.