idnits 2.17.1 draft-ietf-tcpm-urgent-data-00.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** The document seems to lack a License Notice according IETF Trust Provisions of 28 Dec 2009, Section 6.b.i or Provisions of 12 Sep 2009 Section 6.b -- however, there's a paragraph with a matching beginning. Boilerplate error? (You're using the IETF Trust Provisions' Section 6.b License Notice from 12 Feb 2009 rather than one of the newer Notices. 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 : ---------------------------------------------------------------------------- == There are 1 instance of lines with non-RFC2606-compliant FQDNs in the document. == There are 1 instance of lines with non-RFC6890-compliant IPv4 addresses in the document. If these are example addresses, they should be changed. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (May 20, 2009) is 5448 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'UNPv1' is defined on line 343, but no explicit reference was found in the text ** Obsolete normative reference: RFC 793 (Obsoleted by RFC 9293) -- Obsolete informational reference (is this intentional?): RFC 961 (Obsoleted by RFC 991) Summary: 2 errors (**), 0 flaws (~~), 4 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 TCP Maintenance and Minor F. Gont 3 Extensions (tcpm) UTN/FRH 4 Internet-Draft A. Yourtchenko 5 Intended status: Standards Track Cisco 6 Expires: November 21, 2009 May 20, 2009 8 On the implementation of TCP urgent data 9 draft-ietf-tcpm-urgent-data-00.txt 11 Status of this Memo 13 This Internet-Draft is submitted to IETF in full conformance with the 14 provisions of BCP 78 and BCP 79. 16 Internet-Drafts are working documents of the Internet Engineering 17 Task Force (IETF), its areas, and its working groups. Note that 18 other groups may also distribute working documents as Internet- 19 Drafts. 21 Internet-Drafts are draft documents valid for a maximum of six months 22 and may be updated, replaced, or obsoleted by other documents at any 23 time. It is inappropriate to use Internet-Drafts as reference 24 material or to cite them other than as "work in progress." 26 The list of current Internet-Drafts can be accessed at 27 http://www.ietf.org/ietf/1id-abstracts.txt. 29 The list of Internet-Draft Shadow Directories can be accessed at 30 http://www.ietf.org/shadow.html. 32 This Internet-Draft will expire on November 21, 2009. 34 Copyright Notice 36 Copyright (c) 2009 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents in effect on the date of 41 publication of this document (http://trustee.ietf.org/license-info). 42 Please review these documents carefully, as they describe your rights 43 and restrictions with respect to this document. 45 Abstract 47 This document analyzes how current TCP implementations process TCP 48 urgent indications, and how the behavior of some widely-deployed 49 middle-boxes affect how urgent indications are processed by end 50 systems. This document updates the relevant specifications such that 51 they accommodate current practice in processing TCP urgent 52 indications, and raises awareness about the reliability of TCP urgent 53 indications in the current Internet. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 58 2. Specification of TCP urgent data . . . . . . . . . . . . . . . 3 59 2.1. Semantics of urgent inications . . . . . . . . . . . . . . 3 60 2.2. Semantics of the Urgent Pointer . . . . . . . . . . . . . 4 61 2.3. Allowed length of urgent data . . . . . . . . . . . . . . 4 62 3. Current implementation practice of TCP urgent data . . . . . . 4 63 3.1. Semantics of urgent indications . . . . . . . . . . . . . 4 64 3.2. Semantics of the Urgent Pointer . . . . . . . . . . . . . 5 65 3.3. Allowed length of urgent data . . . . . . . . . . . . . . 5 66 3.4. Interaction of middle-boxes with urgent data . . . . . . . 6 67 4. Updating RFC 1122 . . . . . . . . . . . . . . . . . . . . . . 6 68 5. Security Considerations . . . . . . . . . . . . . . . . . . . 6 69 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 7 70 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 7 71 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 7 72 8.1. Normative References . . . . . . . . . . . . . . . . . . . 7 73 8.2. Informative References . . . . . . . . . . . . . . . . . . 8 74 Appendix A. Survey of the processing of urgent data by some 75 popular implementations . . . . . . . . . . . . . . . 8 76 A.1. FreeBSD . . . . . . . . . . . . . . . . . . . . . . . . . 8 77 A.2. Linux . . . . . . . . . . . . . . . . . . . . . . . . . . 9 78 A.3. NetBSD . . . . . . . . . . . . . . . . . . . . . . . . . . 9 79 A.4. OpenBSD . . . . . . . . . . . . . . . . . . . . . . . . . 9 80 A.5. Cisco IOS, versions 12.2(18)SXF7, 12.4(15)T7 . . . . . . . 9 81 A.6. Microsoft Windows 2000, Service Pack 4 . . . . . . . . . . 10 82 A.7. Microsoft Windows 2008 . . . . . . . . . . . . . . . . . . 10 83 A.8. Microsoft Windows 95 . . . . . . . . . . . . . . . . . . . 10 84 Appendix B. Changes from previous versions of the draft (to 85 be removed by the RFC Editor before publishing 86 this document as an RFC) . . . . . . . . . . . . . . 10 87 B.1. Changes from draft-gont-tcpm-urgent-data-01 . . . . . . . 10 88 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 10 90 1. Introduction 92 TCP incorporates a "urgent mechanism" that allows the sending user to 93 stimulate the receiving user to accept some urgent data and to permit 94 the receiving TCP to indicate to the receiving user when all the 95 currently known urgent data has been received by the user. This 96 mechanism permits a point in the data stream to be designated as the 97 end of urgent information. Whenever this point is in advance of the 98 receive sequence number (RCV.NXT) at the receiving TCP, that TCP must 99 tell the user to go into "urgent mode"; when the receive sequence 100 number catches up to the urgent pointer, the TCP must tell user to go 101 into "normal mode" [RFC0793]. 103 The URG control flag indicates that the "Urgent Pointer" field is 104 meaningful and must be added to the segment sequence number to yield 105 the urgent pointer. The absence of this flag indicates that there is 106 no urgent data outstanding [RFC0793]. 108 This document analyzes how current TCP implementations process TCP 109 urgent indications, and how the behavior of some widely-deployed 110 middle-boxes affect the processing of urgent indications by hosts. 111 This document updates the relevant specifications such that they 112 accommodate current practice in processing TCP urgent indications, 113 and also raises awareness about the reliability of TCP urgent 114 indications in the current Internet. 116 Section 2 describes what the current IETF secifications state with 117 respect to TCP urgent indications. Section 3 describes how current 118 TCP implementations actually process TCP urgent indications. 119 Section 4 updates RFC 1122 [RFC1122] such that it accommodates 120 current practice in processing TCP urgent indications. 122 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 123 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 124 document are to be interpreted as described in RFC 2119 [RFC2119]. 126 2. Specification of TCP urgent data 128 2.1. Semantics of urgent inications 130 As discussed in Section 1, the TCP urgent mechanism permits a point 131 in the data stream to be designated as the end of urgent information. 132 Whenever this point is in advance of the receive sequence number 133 (RCV.NXT) at the receiving TCP, that TCP must tell the user to go 134 into "urgent mode"; when the receive sequence number catches up to 135 the urgent pointer, the TCP must tell user to go into "normal mode". 136 This means, for example, that data that were received as "normal 137 data" might become "urgent data" if an urgent indication is received 138 in some successive TCP segment before those data are consumed by the 139 TCP user. 141 The TCP urgent mechanism is NOT a mechanism for sending "out-of-band" 142 data: the "urgent data" should be delivered "in-line" to the TCP 143 user. 145 2.2. Semantics of the Urgent Pointer 147 There is some ambiguity in RFC 793 [RFC0793] with respect to the 148 semantics of the Urgent Pointer. Section 3.1 (page 17) of RFC 793 149 [RFC0793] states that the Urgent Pointer "communicates the current 150 value of the urgent pointer as a positive offset from the sequence 151 number in this segment. The urgent pointer points to the sequence 152 number of the octet following the urgent data. This field is only be 153 interpreted in segments with the URG control bit set." However, 154 Section 3.9 (page 56) of RFC 793 [RFC0793] states, when describing 155 the processing of the SEND call in the ESTABLISHED and CLOSE-WAIT 156 states, that "If the urgent flag is set, then SND.UP <- SND.NXT-1 and 157 set the urgent pointer in the outgoing segments". 159 RFC 961 [RFC0961] clarified this ambiguity in RFC 793 stating that 160 "Page 17 is wrong. The urgent pointer points to the last octet of 161 urgent data (not to the first octet of non-urgent data)". RFC 1122 162 [RFC1122] formally updated RFC 793 by stating, in Section 4.2.2.4 163 (page 84), that "the urgent pointer points to the sequence number of 164 the LAST octet (not LAST+1) in a sequence of urgent data." 166 2.3. Allowed length of urgent data 168 RFC 793 [RFC0793] allows TCP peers to send urgent data of any length, 169 as the TCP urgent mechanism simply provides a pointer to an 170 interesting point in the data stream. In this respect, Section 171 4.2.2.4 (page 84) of RFC 1122 explicitly states that "A TCP MUST 172 support a sequence of urgent data of any length". 174 3. Current implementation practice of TCP urgent data 176 3.1. Semantics of urgent indications 178 As discussed in Section 1, the TCP urgent mechanism simply permits a 179 point in the data stream to be designated as the end of urgent 180 information, but does NOT provide a mechanism for sending out of band 181 data. 183 Unfortunately, virtually all TCP implementations process TCP urgent 184 data differently. By default, the "last byte of urgent data" is 185 delivered "out of band" to the application. That is, it is not 186 delivered as part of the normal data stream. For example, the "out 187 of band" byte is read by an application when a recv(2) system call 188 with the MSG_OOB flag set is issued. 190 Most implementations provide a socket option (SO_OOBINLINE) that 191 allows an application to override the default processing of urgent 192 data, so that they are delivered "in band" to the application, thus 193 providing the semantics intended by the IETF specifications. 195 3.2. Semantics of the Urgent Pointer 197 All the popular implementations that the authors of this document 198 have been able to test interpret the semantics of the TCP Urgent 199 Pointer as specified in Section 3.1 of RFC 793. This means that even 200 when RFC 1122 officially updated RFC 793 to clarify the ambiguity in 201 the semantics of the Urgent Pointer, this clarification never 202 reflected into actual implementations (i.e., virtually all 203 implementations default to the semantics of the urgent pointer 204 specified in Section 3.1 of RFC 793). 206 Some operating systems provide a system-wide toggle to override this 207 behavior, and interpret the semantics of the Urgent Pointer as 208 clarified in RFC 1122. However, this system-wide toggle has been 209 found to be inconsistent. For example, Linux provides a the sysctl 210 "tcp_stdurg" (e.g., net.ivp4.tcp_stdurg) that, when set, supposedly 211 changes the system behavior to interpret the semantics of the TCP 212 Urgent Pointer as described in RFC 1122. However, this sysctl 213 changes the semantics of the Urgent Pointer only for incoming 214 segments, but not for outgoing segments. This means that if this 215 sysctl is set, an application might be unable to interoperate with 216 itself. 218 3.3. Allowed length of urgent data 220 While Section 4.2.2.4 (page 84) of RFC 1122 explicitly states that "A 221 TCP MUST support a sequence of urgent data of any length", in 222 practice all those implementations that interpret TCP urgent 223 indications as a mechanism for sending out-of-band data keep a buffer 224 of a single byte for storing the "last byte of urgent data". Thus, 225 if successive indications of urgent data are received before the 226 application reads the pending "out of band" byte, that pending byte 227 will be discarded (i.e., overwritten by the new byte of urgent data). 229 In order to avoid urgent data from being discarded, some 230 implementations queue each of the received "urgent bytes", so that 231 even if another urgent indication is received before the pending 232 urgent data are consumed by the application, those bytes do not need 233 to be discarded. Some of these implementations have been known to 234 fail to enforce any limits on the amount of urgent data that they 235 queue, thus resulting vulnerable to trivial resource exhaustion 236 attacks [CPNI-TCP]. 238 3.4. Interaction of middle-boxes with urgent data 240 As a result of the publication of Network Intrusion Detection (NIDs) 241 evasion techniques based on urgent data [phrack] , some middle-boxes 242 modify the TCP data stream such that urgent data is put "in band", 243 that is, they are accessible by the read(2) or recv(2) calls without 244 the MSG_OOB flag. Examples of such middle-boxes are Cisco PIX 245 firewall [Cisco-PIX]. This should discourage applications to depend 246 on urgent data for their corect operation, as urgent data may not be 247 not reliable in the current Internet. 249 4. Updating RFC 1122 251 Firstly, considering that as long as both the TCP sender and the TCP 252 receiver implement the same semantics for the Urgent Pointer there is 253 no functional difference in having the Urgent Pointer point to "the 254 sequence number of the octet following the urgent data" vs. "the last 255 octet of urgent data", and since all known implementations interpret 256 the semantics of the Urgent Pointer as pointing to "the sequence 257 number of the octet following the urgent data", we propose that RFC 258 1122 [RFC1122] be updated such that "the urgent pointer points to the 259 sequence number of the octet following the urgent data" (in segments 260 with the URG control bit set), thus accommodating virtually all 261 existing TCP implementations. 263 Secondly, we strongly encourage applications that employ Sockets API 264 to set the SO_OOBINLINE socket option, such that urgent data is 265 delivered inline, as intended by the IETF specifications. 266 Furthermore, we discourage the use of the MSG_OOB flag in recv(2) 267 calls to retrieve the "urgent data". 269 Finally, considering the discussion in Section 3.4, we discourage 270 applications to depend on the TCP urgent mechanism for correct 271 operation, as urgent data may not be reliable in the current 272 Internet. 274 5. Security Considerations 276 Given that there are two different interpretations of the semantics 277 of the Urgent Pointer in current implementations, and that either 278 middle-boxes (such as packet scrubbers) or the end-systems themselves 279 could cause the urgent data to be processed "in band", there exists 280 ambiguity in how TCP urgent data sent by a TCP will be processed by 281 the intended recipient. This might make it difficult for a Network 282 Intrusion Detection System (NIDS) to track the application-layer data 283 transferred to the destination system, and thus lead to false 284 negatives or false positives in the NIDS [CPNI-TCP]. 286 Probably the best way to avoid the security implications of TCP 287 urgent data is to avoid having application protocols depend on the 288 use of TCP urgent data altogether. Packet scrubbers could probably 289 be configured to clear the URG bit, and set the Urgent Pointer to 290 zero. This would basically cause the urgent data to be put "in 291 band". However, this might cause interoperability problems or 292 undesired behavior in the applications running on top of TCP. 294 6. IANA Considerations 296 This document has no actions for IANA. 298 7. Acknowledgements 300 The authors of this document would like to thank (in alphabetical 301 order) David Borman, Alfred Hoenes, Carlos Pignataro, Anantha 302 Ramaiah, Joe Touch, and Dan Wing for providing valuable feedback on 303 earlier versions of this document. 305 Additionally, Fernando would like to thank David Borman and Joe Touch 306 for a fruitful discussion about TCP urgent mode at IETF 73 307 (Minneapolis). 309 8. References 311 8.1. Normative References 313 [RFC0793] Postel, J., "Transmission Control Protocol", STD 7, 314 RFC 793, September 1981. 316 [RFC1122] Braden, R., "Requirements for Internet Hosts - 317 Communication Layers", STD 3, RFC 1122, October 1989. 319 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 320 Requirement Levels", BCP 14, RFC 2119, March 1997. 322 8.2. Informative References 324 [CPNI-TCP] 325 CPNI, "Security Assessment of the Transmission Control 326 Protocol (TCP)", (to be published) . 328 [Cisco-PIX] 329 Cisco PIX, "http://www.cisco.com/en/US/docs/security/asa/ 330 asa70/command/reference/tz.html#wp1288756". 332 [FreeBSD] The FreeBSD project, "http://www.freebsd.org". 334 [Linux] The Linux Project, "http://www.kernel.org". 336 [NetBSD] The NetBSD project, "http://www.netbsd.org". 338 [OpenBSD] The OpenBSD project, "http://www.openbsd.org". 340 [RFC0961] Reynolds, J. and J. Postel, "Official ARPA-Internet 341 protocols", RFC 961, December 1985. 343 [UNPv1] Stevens, W., "UNIX Network Programming, Volume 1. 344 Networking APIs: Sockets and XTI", Prentice Hall PTR , 345 1997. 347 [Windows2000] 348 Microsoft Windows 2000, "http://technet.microsoft.com/ 349 en-us/library/bb726981(printer).aspx". 351 [Windows95] 352 Microsoft Windows 95, 353 "ftp://ftp.demon.co.uk/pub/mirrors/win95netfaq/ 354 faq-c.html". 356 [phrack] Ko, Y., Ko, S., and M. Ko, "NIDS Evasion Method named 357 "SeolMa"", Phrack Magazine, Volume 0x0b, Issue 0x39, Phile 358 #0x03 of 0x12 http://www.phrack.org/ 359 issues.html?issue=57&id=3#article, 2001. 361 Appendix A. Survey of the processing of urgent data by some popular 362 implementations 364 A.1. FreeBSD 366 FreeBSD [FreeBSD] interprets the semantics of the urgent pointer as 367 specified in RFC 793. It does not provide any sysctl to override 368 this behavior. However, it provides the SO_OOBINLINE that when set 369 causes TCP urgent data to be put "in band". That is, it will be 370 accessible by the read(2) or recv(2) calls without the MSG_OOB flag. 372 FreeBSD supports only one byte of urgent data. That is, only the 373 byte preceding the Urgent Pointer is considered as "urgent data". 375 A.2. Linux 377 Linux [Linux] interprets the semantics of the urgent pointer as 378 specified in RFC 793. It provides the net.ipv4.tcp_stdurg sysctl to 379 override this behavior to interpret the Urgent Pointer as specified 380 by RFC 1122. However, this sysctl only affects the processing of 381 incoming segments (the Urgent Pointer in outgoing segments will still 382 be set as specified in RFC 793). 384 Linux supports only one byte of urgent data. That is, only the byte 385 preceding the Urgent Pointer is considered as "urgent data". 387 A.3. NetBSD 389 NetBSD [NetBSD] interprets the semantics of the urgent pointer as 390 specified in RFC 793. It does not provide any sysctl to override 391 this behavior. However, it provides the SO_OOBINLINE that when set 392 causes TCP urgent data to be put "in band". That is, it will be 393 accessible by the read(2) or recv(2) calls without the MSG_OOB flag. 395 NetBSD supports only one byte of urgent data. That is, only the byte 396 preceding the Urgent Pointer is considered as "urgent data". 398 A.4. OpenBSD 400 OpenBSD [OpenBSD] interprets the semantics of the urgent pointer as 401 specified in RFC 793. It does not provide any sysctl to override 402 this behavior. However, it provides the SO_OOBINLINE that when set 403 causes TCP urgent data to be put "in band". That is, it will be 404 accessible by the read(2) or recv(2) calls without the MSG_OOB flag. 406 OpenBSD supports only one byte of urgent data. That is, only the 407 byte preceding the Urgent Pointer is considered as "urgent data". 409 A.5. Cisco IOS, versions 12.2(18)SXF7, 12.4(15)T7 411 Cisco IOS, versions 12.2(18)SXF7, 12.4(15)T7 interpret the semantics 412 of the urgent pointer as specified in RFC 793. However, tests 413 performed with an HTTP server running on Cisco IOS version 414 12.2(18)SXF7 and 12.4(15)T7 suggest that urgent data is processed "in 415 band". That is, they are accessible together with "normal" data. 416 The TCP debugs on the Cisco IOS device do explicitly mention the 417 presence of urgent data, and thus we infer that the behavior is 418 different depending on the application. 420 A.6. Microsoft Windows 2000, Service Pack 4 422 Microsoft Windows 2000 [Windows2000] interprets the semantics of the 423 urgent pointer as specified in RFC 793. It provides the 424 TcpUseRFC1122UrgentPointer system-wide variable to override this 425 behavior to interpret the Urgent Pointer as specified by RFC 1122. 426 However, the tests performed with the sample server application 427 compiled using the cygwin environment, has shown that the default 428 behavior is to return the urgent data "in band". 430 A.7. Microsoft Windows 2008 432 Microsoft Windows 2008 interprets the semantics of the urgent pointer 433 as specified in RFC 793. 435 A.8. Microsoft Windows 95 437 Microsoft Windows 95 interprets the semantics of the urgent pointer 438 as specified in RFC 793. It provides the BSDUrgent system-wide 439 variable to override this behavior to interpret the Urgent Pointer as 440 specified by RFC 1122. Windows 95 supports only one byte of urgent 441 data. That is, only the byte preceding the Urgent Pointer is 442 considered as "urgent data". [Windows95] 444 Appendix B. Changes from previous versions of the draft (to be removed 445 by the RFC Editor before publishing this document as an 446 RFC) 448 B.1. Changes from draft-gont-tcpm-urgent-data-01 450 o Draft resubmitted as draft-ietf, as a result of wg consensus on 451 adopting the document as a tcpm wg item. 453 Authors' Addresses 455 Fernando Gont 456 Universidad Tecnologica Nacional / Facultad Regional Haedo 457 Evaristo Carriego 2644 458 Haedo, Provincia de Buenos Aires 1706 459 Argentina 461 Phone: +54 11 4650 8472 462 Email: fernando@gont.com.ar 463 URI: http://www.gont.com.ar 465 Andrew Yourtchenko 466 Cisco 467 De Kleetlaan, 7 468 Diegem B-1831 469 Belgium 471 Phone: +32 2 704 5494 472 Email: ayourtch@cisco.com