idnits 2.17.1 draft-ananth-tcpm-persist-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Sep 2009 rather than the newer Notice from 28 Dec 2009. (See https://trustee.ietf.org/license-info/) Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- ** The document seems to lack a Security Considerations section. ** The document seems to lack an IANA Considerations section. (See Section 2.2 of https://www.ietf.org/id-info/checklist for how to handle the case when there are no actions for IANA.) ** The abstract seems to contain references ([RFC1122]), which it shouldn't. Please replace those with straight textual mentions of the documents in question. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords. (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'MUST not' in this paragraph: The document addresses the fact that terminating TCP connections stuck in the persist condition does not violate RFC 1122 or RFC 793. It also suggests that TCP MUST not abort any connection until either explicitly requested by the application to do so. The implementation guidelines of the request and the action are documented in Section 7, and the details of mitigating the DoS attack are left to the implementer. -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (January 8, 2010) is 5220 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- == Unused Reference: 'RFC0793' is defined on line 206, but no explicit reference was found in the text == Unused Reference: 'RFC2119' is defined on line 212, but no explicit reference was found in the text -- Obsolete informational reference (is this intentional?): RFC 793 (Obsoleted by RFC 9293) -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) Summary: 4 errors (**), 0 flaws (~~), 5 warnings (==), 4 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TCP Maintenance and Minor M. Bashyam 3 Extensions Working Group Ocarina Networks, Inc 4 Internet-Draft M. Jethanandani 5 Intended status: Informational A. Ramaiah 6 Expires: July 12, 2010 Cisco Systems 7 January 8, 2010 9 Clarification of sender behaviour in persist condition. 10 draft-ananth-tcpm-persist-02.txt 12 Abstract 14 This document attempts to clarify the notion of the Zero Window 15 Probes (ZWP) described in RFC 1122 [RFC1122]. In particular, it 16 clarifies the actions that can be taken on connections which are 17 experiencing the ZWP condition. The motivation for this document 18 stems from the belief that TCP implementations strictly adhering to 19 the current RFC language have the potential to become vulnerable to 20 Denial of Service (DoS) scenarios. 22 Status of this Memo 24 This Internet-Draft is submitted to IETF in full conformance with the 25 provisions of BCP 78 and BCP 79. 27 Internet-Drafts are working documents of the Internet Engineering 28 Task Force (IETF), its areas, and its working groups. Note that 29 other groups may also distribute working documents as Internet- 30 Drafts. 32 Internet-Drafts are draft documents valid for a maximum of six months 33 and may be updated, replaced, or obsoleted by other documents at any 34 time. It is inappropriate to use Internet-Drafts as reference 35 material or to cite them other than as "work in progress." 37 The list of current Internet-Drafts can be accessed at 38 http://www.ietf.org/ietf/1id-abstracts.txt. 40 The list of Internet-Draft Shadow Directories can be accessed at 41 http://www.ietf.org/shadow.html. 43 This Internet-Draft will expire on July 12, 2010. 45 Copyright Notice 47 Copyright (c) 2010 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents 52 (http://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 63 2. Discussion on RFC 1122 Requirement . . . . . . . . . . . . . . 4 64 3. Description of Attack . . . . . . . . . . . . . . . . . . . . 5 65 4. Clarification Regarding RFC 1122 Requirements . . . . . . . . 6 66 5. Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . 7 67 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 8 68 7. Programming Considerations . . . . . . . . . . . . . . . . . . 9 69 8. Informative References . . . . . . . . . . . . . . . . . . . . 10 70 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 11 72 1. Introduction 74 According to RFC 1122 [RFC1122] Section 4.2.2.17: A TCP MAY keep it's 75 offered receive window closed indefinitely. As long as the receiving 76 TCP continues to send acknowledgments in response to the probe 77 segments, the sending TCP MUST allow the connection to stay open. It 78 is important to remember that ACK (acknowledgement) segments that 79 contain no data are not reliably transmitted by TCP. Therefore zero 80 window probing SHOULD be supported to prevent a connection from 81 hanging forever if ACK segments that re-opens the window is lost. 82 The condition where the sender goes into the ZWP mode is typically 83 known as the persist condition. 85 2. Discussion on RFC 1122 Requirement 87 It needs to be emphasised that TCP MUST NOT take any action of its 88 own when a particular connection is in persist state for a long time. 89 As per RFC 1122 as long as the ACK's are being received for window 90 probes, it can continue to stay in persist mode. This is important 91 because typically applications would want the TCP connection to stay 92 open unless it explicitly closes the connection. For example take 93 the case of user running a print job and the printer ran out of paper 94 waiting for the user intervention. It would be premature for TCP to 95 take action on its own. Hence TCP cannot act as a resource manager 96 and it is the system or application's responsibility to take 97 appropriate action. 99 At the same time, many existing TCP implementations that adhere 100 strictly to the above verbiage of RFC 1122, may fall victim to DOS 101 attacks, if appropriate measures are not followed. For example, if 102 we take the case of a busy server where multiple clients can 103 advertise a zero forever (by reliably acknowledging the ZWP's), it 104 could eventually lead to the resource exhaustion in the system. In 105 such cases the system would need to take appropriate action on the 106 TCP connection to reclaim the resources. The document is not 107 intended to provide any advice on any particular resource management 108 scheme that can be implemented to circumvent DOS issues arising due 109 to the connections stuck in the persist state. The problem is 110 applicable to TCP and TCP derived transport protocols like SCTP. 112 3. Description of Attack 114 If TCP implementations strictly follow RFC 1122 and there is no 115 instruction on what to do in persist condition, connections will 116 encounter an indefinite wait. To illustrate this, consider the case 117 where the client application opens a TCP connection with a HTTP 118 [RFC2616] server, sends a GET request for a large page and stops 119 reading the response. This would cause the client TCP to advertise a 120 zero window to the server. For every large HTTP response, the server 121 is left holding on to all the response data in it's send queue. If 122 the client never clears the persist condition, the server will 123 continue to hold that data indefinitely. Multiple such TCP 124 connections stuck in the same scenario on the server would cause 125 resource depletion resulting in a DoS situation on the server. 127 Applications on the sender can transfer all the data to the TCP 128 socket and subsequently close the socket leaving the connection in 129 orphaned state. If the application on the receiver refuses to read 130 the data, the orphaned connection will be left holding the data 131 indefinitely in its send queue. 133 If the above scenario persists for an extended period of time, it 134 will lead to TCP buffers and connection blocks starvation causing 135 legitimate existing connections and new connection attempts to fail. 137 CERT is putting a advisory in this regard[VU723308] and is making 138 vendors aware of this DoS scenario. 140 4. Clarification Regarding RFC 1122 Requirements 142 A consequence of adhering to the above requirement mandated by RFC 143 1122 is that multiple TCP receivers advertising a zero window to a 144 server could exhaust the connection and buffer resources of the 145 sender. In such cases, and specially when the receiver is reliably 146 acknowledging zero window probe, to achieve robustness, the system 147 should be able to take appropriate action on those TCP connections 148 and reclaim resources. A possible action could be to terminate the 149 connection and such an action is in the spirit of RFC 1122. 151 In order to accomplish this action, TCP MAY provide a feedback 152 regarding the persist condition to the application if requested to do 153 so or the application or the resource manager can query the health of 154 the TCP connection which would allow it to take the desired action. 155 All such actions are in complete compliance of RFC 793 and RFC 1122. 157 5. Conclusion 159 The document addresses the fact that terminating TCP connections 160 stuck in the persist condition does not violate RFC 1122 or RFC 793. 161 It also suggests that TCP MUST not abort any connection until either 162 explicitly requested by the application to do so. The implementation 163 guidelines of the request and the action are documented in Section 7, 164 and the details of mitigating the DoS attack are left to the 165 implementer. 167 6. Acknowledgments 169 This document was inspired by the recent discussions that took place 170 regarding the TCP persist condition issue in the TCPM WG mailing list 171 [TCPM]. The outcome of those discussions was to come up with a draft 172 that would clarify the intentions of the ZWP referred by RFC 1122. 173 We would like to thank Mark Allman and David Borman for clarifying 174 the objective behind this draft. 176 7. Programming Considerations 178 To enable a server to clear connections in persist condition and 179 reclaim resources, a socket interface needs to be defined. Note, 180 this condition is mutually exclusive from a persist condition where 181 we are not getting zero windows acknowledgement for the probes. 183 PERSIST_TIMEOUT 185 Format: setsockopt(fd, SOL_TCP, PERSIST_TIMEOUT, 186 persist_timeout_value) 188 The interface allows applications to inform TCP that when the local 189 connection stays in persist condition it can be cleared after a set 190 time. Note that the default value of this option is indefinite. 192 TCP sender will save the current time in the connection block when it 193 receives a zero window ACK. This time is referred to as the persist 194 entry time. Thereafter every time the probe timer expires and before 195 it sends another probe or an ACK carrying zero window is received a 196 check will be done to see how long the connection has been in persist 197 condition by comparing the current time to the persist entry time. 198 If the timeout has been exceeded, the connection will be aborted. 200 Any time a ACK is received that advertises a non-zero window, the 201 persist entry time is cleared to take the connection out of persist 202 condition. 204 8. Informative References 206 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 207 RFC 793, September 1981. 209 [RFC1122] Braden, R., "Requirements for Internet Hosts - 210 Communication Layers", STD 3, RFC 1122, October 1989. 212 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 213 Requirement Levels", BCP 14, RFC 2119, March 1997. 215 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 216 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 217 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 219 [TCPM] TCPM, "IETF TCPM Working Group and mailing list 220 http://www.ietf.org/html.charters/tcpm-charter.html". 222 [VU723308] 223 Manion, "Vulnerability in Web Servers 224 http://www.kb.cert.org/vuls/id/723308", July 2009. 226 Authors' Addresses 228 Murali Bashyam 229 Ocarina Networks, Inc 230 42 Airport parkway 231 San Jose, CA 95110 232 USA 234 Phone: +1 (408) 512-2966 235 Email: mbashyam@ocarinanetworks.com 237 Mahesh Jethanandani 238 Cisco Systems 239 170 Tasman Drive 240 San Jose, CA 95134 241 USA 243 Phone: +1 (408) 527-8230 244 Email: mahesh@cisco.com 246 Anantha Ramaiah 247 Cisco Systems 248 170 Tasman Drive 249 San Jose, CA 95134 250 USA 252 Phone: +1 (408) 525-6486 253 Email: ananth@cisco.com