draft-ietf-core-block-06.txt   draft-ietf-core-block-07.txt 
CoRE Working Group C. Bormann CoRE Working Group C. Bormann
Internet-Draft Universitaet Bremen TZI Internet-Draft Universitaet Bremen TZI
Intended status: Standards Track Z. Shelby, Ed. Intended status: Standards Track Z. Shelby, Ed.
Expires: July 24, 2012 Sensinode Expires: July 30, 2012 Sensinode
January 21, 2012 January 27, 2012
Blockwise transfers in CoAP Blockwise transfers in CoAP
draft-ietf-core-block-06 draft-ietf-core-block-07
Abstract Abstract
CoAP is a RESTful transfer protocol for constrained nodes and CoAP is a RESTful transfer protocol for constrained nodes and
networks. Basic CoAP messages work well for the small payloads we networks. Basic CoAP messages work well for the small payloads we
expect from temperature sensors, light switches, and similar expect from temperature sensors, light switches, and similar
building-automation devices. Occasionally, however, applications building-automation devices. Occasionally, however, applications
will need to transfer larger payloads -- for instance, for firmware will need to transfer larger payloads -- for instance, for firmware
updates. With HTTP, TCP does the grunt work of slicing large updates. With HTTP, TCP does the grunt work of slicing large
payloads up into multiple packets and ensuring that they all arrive payloads up into multiple packets and ensuring that they all arrive
skipping to change at page 2, line 10 skipping to change at page 2, line 10
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on July 24, 2012. This Internet-Draft will expire on July 30, 2012.
Copyright Notice Copyright Notice
Copyright (c) 2012 IETF Trust and the persons identified as the Copyright (c) 2012 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 3, line 12 skipping to change at page 3, line 12
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
2. Block-wise transfers . . . . . . . . . . . . . . . . . . . . . 6 2. Block-wise transfers . . . . . . . . . . . . . . . . . . . . . 6
2.1. The Block Options . . . . . . . . . . . . . . . . . . . . 6 2.1. The Block Options . . . . . . . . . . . . . . . . . . . . 6
2.2. Using the Block Options . . . . . . . . . . . . . . . . . 10 2.2. Using the Block Options . . . . . . . . . . . . . . . . . 10
3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
4. HTTP Mapping Considerations . . . . . . . . . . . . . . . . . 19 4. HTTP Mapping Considerations . . . . . . . . . . . . . . . . . 20
5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 5. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22
6. Security Considerations . . . . . . . . . . . . . . . . . . . 22 6. Security Considerations . . . . . . . . . . . . . . . . . . . 23
6.1. Mitigating Resource Exhaustion Attacks . . . . . . . . . . 22 6.1. Mitigating Resource Exhaustion Attacks . . . . . . . . . . 23
6.2. Mitigating Amplification Attacks . . . . . . . . . . . . . 23 6.2. Mitigating Amplification Attacks . . . . . . . . . . . . . 24
7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 24 7. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 25
8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 25 8. References . . . . . . . . . . . . . . . . . . . . . . . . . . 26
8.1. Normative References . . . . . . . . . . . . . . . . . . . 25 8.1. Normative References . . . . . . . . . . . . . . . . . . . 26
8.2. Informative References . . . . . . . . . . . . . . . . . . 25 8.2. Informative References . . . . . . . . . . . . . . . . . . 26
Appendix A. Historical Note . . . . . . . . . . . . . . . . . . . 26 Appendix A. Historical Note . . . . . . . . . . . . . . . . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 27 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 28
1. Introduction 1. Introduction
The CoRE WG is tasked with standardizing an Application Protocol for The CoRE WG is tasked with standardizing an Application Protocol for
Constrained Networks/Nodes, CoAP. This protocol is intended to Constrained Networks/Nodes, CoAP. This protocol is intended to
provide RESTful [REST] services not unlike HTTP [RFC2616], while provide RESTful [REST] services not unlike HTTP [RFC2616], while
reducing the complexity of implementation as well as the size of reducing the complexity of implementation as well as the size of
packets exchanged in order to make these services useful in a highly packets exchanged in order to make these services useful in a highly
constrained network of themselves highly constrained nodes. constrained network of themselves highly constrained nodes.
skipping to change at page 7, line 28 skipping to change at page 7, line 28
in that message to the payload of which it pertains) it indicates a in that message to the payload of which it pertains) it indicates a
block-wise transfer and describes how this block-wise payload forms block-wise transfer and describes how this block-wise payload forms
part of the entire body being transferred ("descriptive usage"). part of the entire body being transferred ("descriptive usage").
Where it is present in the opposite direction, it provides additional Where it is present in the opposite direction, it provides additional
control on how that payload will be formed or was processed ("control control on how that payload will be formed or was processed ("control
usage"). usage").
Implementation of either Block option is intended to be optional. Implementation of either Block option is intended to be optional.
However, when it is present in a CoAP message, it MUST be processed However, when it is present in a CoAP message, it MUST be processed
(or the message rejected); therefore it is identified as a critical (or the message rejected); therefore it is identified as a critical
option. option. It MUST NOT occur more than once.
Three items of information may need to be transferred in a Block Three items of information may need to be transferred in a Block
option: option:
o The size of the block (SZX); o The size of the block (SZX);
o whether more blocks are following (M); o whether more blocks are following (M);
o the relative number of the block (NUM) within a sequence of blocks o the relative number of the block (NUM) within a sequence of blocks
with the given size. with the given size.
skipping to change at page 16, line 34 skipping to change at page 16, line 34
| CON [MID=1238], GET, /status, 2/5/0/64 ------> | | CON [MID=1238], GET, /status, 2/5/0/64 ------> |
| | | |
| <------ ACK [MID=1238], 2.05 Content, 2/5/0/64 | | <------ ACK [MID=1238], 2.05 Content, 2/5/0/64 |
Figure 6: Blockwise GET with late negotiation and lost ACK Figure 6: Blockwise GET with late negotiation and lost ACK
The following examples demonstrate a PUT exchange; a POST exchange The following examples demonstrate a PUT exchange; a POST exchange
looks the same, with different requirements on atomicity/idempotence. looks the same, with different requirements on atomicity/idempotence.
To ensure that the blocks relate to the same version of the resource To ensure that the blocks relate to the same version of the resource
representation carried in the request, the client in Figure 7 sets representation carried in the request, the client in Figure 7 sets
the Token to "v17" in all requests. Note that, as with the GET, the the Token to "v17" in all requests. Note that, similar to GET, the
responses to the requests that have a more bit in the request Block2 responses to the requests that have a more bit in the request Block1
Option are provisional; only the final response tells the client that Option are provisional; only the final response tells the client that
the PUT succeeded. the PUT succeeded.
CLIENT SERVER CLIENT SERVER
| | | |
| CON [MID=1234], PUT, /options, v17, 1/0/1/128 ------> | | CON [MID=1234], PUT, /options, v17, 1/0/1/128 ------> |
| | | |
| <------ ACK [MID=1234], 2.04 Changed, 1/0/1/128 | | <------ ACK [MID=1234], 2.04 Changed, 1/0/1/128 |
| | | |
| CON [MID=1235], PUT, /options, v17, 1/1/1/128 ------> | | CON [MID=1235], PUT, /options, v17, 1/1/1/128 ------> |
skipping to change at page 19, line 5 skipping to change at page 18, line 25
| CON [MID=1236], PUT, /options, v17, 1/5/1/32 ------> | | CON [MID=1236], PUT, /options, v17, 1/5/1/32 ------> |
| | | |
| <------ ACK [MID=1235], 2.04 Changed, 1/5/1/32 | | <------ ACK [MID=1235], 2.04 Changed, 1/5/1/32 |
| | | |
| CON [MID=1237], PUT, /options, v17, 1/6/0/32 ------> | | CON [MID=1237], PUT, /options, v17, 1/6/0/32 ------> |
| | | |
| <------ ACK [MID=1236], 2.04 Changed, 1/6/0/32 | | <------ ACK [MID=1236], 2.04 Changed, 1/6/0/32 |
Figure 9: Simple atomic blockwise PUT with negotiation Figure 9: Simple atomic blockwise PUT with negotiation
Block options may be used in both directions of a single exchange.
The following example demonstrates a blockwise POST request,
resulting in a separate blockwise response. The client in Figure 10
sets the Token to "37a" in all requests, which is echoed in all
response CONs in the separate response.
CLIENT SERVER
| |
| CON [MID=1234], POST, /soap, 37a, 1/0/1/128 ------> |
| |
| <------ ACK [MID=1234], 2.01 Created, 1/0/1/128 |
| |
| CON [MID=1235], POST, /soap, 37a, 1/1/1/128 ------> |
| |
| <------ ACK [MID=1235], 2.01 Created, 1/1/1/128 |
| |
| CON [MID=1236], POST, /soap, 37a, 1/2/0/128 ------> |
| |
| <------ ACK [MID=1236], 0, 1/2/0/128 |
| |
| <------ CON [MID=4712], 2.01 Created, 37a, 2/0/1/128 |
| |
| ACK [MID=4712], 0, 2/0/1/128 ------> |
| |
| <------ CON [MID=4713], 2.01 Created, 37a, 2/1/1/128 |
| |
| ACK [MID=4713], 0, 2/1/1/128 ------> |
| |
| <------ CON [MID=4714], 2.01 Created, 37a, 2/2/1/128 |
| |
| ACK [MID=4714], 0, 2/2/1/128 ------> |
| |
| <------ CON [MID=4715], 2.01 Created, 37a, 2/3/0/128 |
| |
| ACK [MID=4715], 0, 2/3/0/128 ------> |
Figure 10: Atomic blockwise POST with separate blockwise response
4. HTTP Mapping Considerations 4. HTTP Mapping Considerations
In this subsection, we give some brief examples for the influence the In this subsection, we give some brief examples for the influence the
Block options might have on intermediaries that map between CoAP and Block options might have on intermediaries that map between CoAP and
HTTP. HTTP.
For mapping CoAP requests to HTTP, the intermediary may want to map For mapping CoAP requests to HTTP, the intermediary may want to map
the sequence of block-wise transfers into a single HTTP transfer. the sequence of block-wise transfers into a single HTTP transfer.
E.g., for a GET request, the intermediary could perform the HTTP E.g., for a GET request, the intermediary could perform the HTTP
request once the first block has been requested and could then request once the first block has been requested and could then
 End of changes. 7 change blocks. 
18 lines changed or deleted 56 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/