idnits 2.17.1 draft-li-core-coap-payload-length-option-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. 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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (December 16, 2014) is 3418 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) ** Downref: Normative reference to an Informational draft: draft-bormann-coap-misc (ref. 'I-D.bormann-coap-misc') Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 1 comment (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 CoRE K. Li 3 Internet-Draft R. Sun 4 Intended status: Standards Track Huawei Technologies 5 Expires: June 19, 2015 December 16, 2014 7 CoAP Payload-Length Option Extension 8 draft-li-core-coap-payload-length-option-03 10 Abstract 12 This document defines an extension to the Constrained Application 13 Protocol (CoAP) to add one new option: Payload-Length, which is used 14 to indicate the length of the payload of the message. 16 Status of This Memo 18 This Internet-Draft is submitted in full conformance with the 19 provisions of BCP 78 and BCP 79. 21 Internet-Drafts are working documents of the Internet Engineering 22 Task Force (IETF). Note that other groups may also distribute 23 working documents as Internet-Drafts. The list of current Internet- 24 Drafts is at http://datatracker.ietf.org/drafts/current/. 26 Internet-Drafts are draft documents valid for a maximum of six months 27 and may be updated, replaced, or obsoleted by other documents at any 28 time. It is inappropriate to use Internet-Drafts as reference 29 material or to cite them other than as "work in progress." 31 This Internet-Draft will expire on June 19, 2015. 33 Copyright Notice 35 Copyright (c) 2014 IETF Trust and the persons identified as the 36 document authors. All rights reserved. 38 This document is subject to BCP 78 and the IETF Trust's Legal 39 Provisions Relating to IETF Documents 40 (http://trustee.ietf.org/license-info) in effect on the date of 41 publication of this document. Please review these documents 42 carefully, as they describe your rights and restrictions with respect 43 to this document. Code Components extracted from this document must 44 include Simplified BSD License text as described in Section 4.e of 45 the Trust Legal Provisions and are provided without warranty as 46 described in the Simplified BSD License. 48 Table of Contents 50 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 51 1.1. Motivation . . . . . . . . . . . . . . . . . . . . . . . 2 52 1.2. Justification . . . . . . . . . . . . . . . . . . . . . . 2 53 1.3. Terminology . . . . . . . . . . . . . . . . . . . . . . . 3 54 1.4. Requirements Language . . . . . . . . . . . . . . . . . . 3 55 2. Option Definition . . . . . . . . . . . . . . . . . . . . . . 3 56 3. Example . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 57 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 4 58 5. Security Considerations . . . . . . . . . . . . . . . . . . . 4 59 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 5 60 7. Normative References . . . . . . . . . . . . . . . . . . . . 5 61 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 5 63 1. Introduction 65 This specification adds one new option to the Constrained Application 66 Protocol (CoAP): Payload-Length. 68 1.1. Motivation 70 If a CoAP message is transported through UDP, the message length can 71 be obtained from the UDP header. But not all transport mechanisms 72 provide an unambiguous length of the CoAP message. For example, in 73 industry field, there are some data tranport protocols, like RS232, 74 RS422, RS485, which don't provide message length indication. For 75 these cases, an indication of the payload length of the message is 76 needed in CoAP message level. 78 TBD: how about CAN bus protocol, USB 2.0? 80 With this option, it will be easier for the receiver to extract the 81 payload part from the whole message. 83 Another benefit to have this option is to check the integrity of the 84 message length. 86 1.2. Justification 88 To indicate the payload length, another alternative is to use 89 encoding method as specified in section 3.2 of [RFC7252], but it is 90 better to use an Option for this. 92 Reason is that, payload length is an optional feature, and in most of 93 the cases, it is not necessary to be indicated. If we use encoding 94 method, every implementation needs to support this encoding for the 95 payload, not only for the options. If we use an Option for this, it 96 is optional, and it can be optionally implemented where necessary. 98 1.3. Terminology 100 The terms CoAP Server and CoAP Client are used synonymously to Server 101 and Client as specified in the terminology section of [RFC7252]. 103 1.4. Requirements Language 105 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 106 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 107 document are to be interpreted as described in [RFC2119]. 109 2. Option Definition 111 +------+---+---+---+---+----------------+--------+--------+---------+ 112 | Type | C | U | N | R | Name | Format | Length | Default | 113 +------+---+---+---+---+----------------+--------+--------+---------+ 114 | TBD | - | - | - | - | Payload-Length | uint | 0-2 B | (none) | 115 +------+---+---+---+---+----------------+--------+--------+---------+ 117 If this option is present, the value of this option is an unsigned 118 integer giving the length of the payload of the message. Note that 119 this integer can be zero for a zero-length payload, which can in turn 120 be represented by a zero-length option value. 122 The Payload-Length option does not have a default value, so in case 123 of its absence the receiver MUST determine the payload length through 124 other means. This is to keep backward compatibility. If the option 125 is absent, the payload can have any size, and the payload length 126 needs to be determined as it is currently done for UDP. 128 The minimum payload length is 0, and the maximum payload length is 129 2^16-1= 65535. 131 In case that the transport layer does not provide message length 132 indication, the Payload-Length option SHOULD be included in the CoAP 133 message. Otherwise, it MAY be included. 135 This options can be used both in the request and response. 137 This option MUST NOT occur more than once. 139 3. Example 141 In the example below, in the GET request, the payload is empty, so 142 the Payload-Length option has a zero-length option payload. In the 143 response, the payload is "22.3 C", and the Payload-Length is 6. 145 Client Server 146 | | 147 | | 148 +----->| Header: GET (T=CON, Code=1, MID=0x7d38) 149 | GET | Token: 0x53 150 | | Uri-Path: "temperature" 151 | | Payload-Length: 0 152 | | 153 |<- - -+ Header: (T=ACK, Code=0, MID=0x7d38) 154 | | 155 | | 156 |<-----+ Header: 2.05 Content (T=CON, Code=69, MID=0xad7b) 157 | 2.05 | Token: 0x53 158 | | Payload: "22.3 C" 159 | | Payload-Length: 6 160 | | 161 | | 162 +- - ->| Header: (T=ACK, Code=0, MID=0xad7b) 163 | | 165 4. IANA Considerations 167 The IANA is requested to add the following option number entries: 169 +--------+----------------+----------------------------+ 170 | Number | Name | Reference | 171 +--------+----------------+----------------------------+ 172 | TBD | Payload-Length | Section 2 of this document | 173 +--------+----------------+----------------------------+ 175 5. Security Considerations 177 The Payload-Length option defined in this document presents no 178 security considerations beyond those in Section 10 of the base CoAP 179 specification [RFC7252]. 181 6. Acknowledgements 183 The authors of this draft would like to thank Carsten Bormann and 184 Klaus Hartke, for the initial texts in draft [I-D.bormann-coap-misc]. 186 The authors of this draft would like to thank Bert Greevenbosch and 187 Xianghui Sun for the discussion and review. 189 7. Normative References 191 [I-D.bormann-coap-misc] 192 Bormann, C. and K. Hartke, "Miscellaneous additions to 193 CoAP", draft-bormann-coap-misc-27 (work in progress), 194 November 2014. 196 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 197 Requirement Levels", BCP 14, RFC 2119, March 1997. 199 [RFC7252] Shelby, Z., Hartke, K., and C. Bormann, "The Constrained 200 Application Protocol (CoAP)", RFC 7252, June 2014. 202 Authors' Addresses 204 Kepeng Li 205 Huawei Technologies 206 Huawei Base, Bantian, Longgang District 207 Shenzhen, Guangdong 518129 208 P. R. China 210 Phone: +86-755-289718087 211 Email: likepeng@huawei.com 213 Ruinan Sun 214 Huawei Technologies 215 Huawei Base, Bantian, Longgang District 216 Shenzhen, Guangdong 518129 217 P. R. China 219 Phone: +86-755-28970171 220 Email: sunruinan@huawei.com