CoAP Implementation Guidance
draft-ietf-lwig-coap-02

The information below is for an old version of the document
Document Type Active Internet-Draft (lwig WG)
Last updated 2015-06-27
Replaces draft-kovatsch-lwig-coap
Stream IETF
Intended RFC status (None)
Formats plain text pdf html bibtex
Stream WG state WG Document
Document shepherd No shepherd assigned
IESG IESG state I-D Exists
Consensus Boilerplate Unknown
Telechat date
Responsible AD (None)
Send notices to (None)
LWIG Working Group                                           M. Kovatsch
Internet-Draft                                                ETH Zurich
Intended status: Informational                               O. Bergmann
Expires: December 29, 2015                               C. Bormann, Ed.
                                                 Universitaet Bremen TZI
                                                           June 27, 2015

                      CoAP Implementation Guidance
                        draft-ietf-lwig-coap-02

Abstract

   The Constrained Application Protocol (CoAP) is designed for resource-
   constrained nodes and networks, e.g., sensor nodes in a low-power
   lossy network (LLN).  Yet to implement this Internet protocol on
   Class 1 devices (as per RFC 7228, ~ 10 KiB of RAM and ~ 100 KiB of
   ROM) also lightweight implementation techniques are necessary.  This
   document provides lessons learned from implementing CoAP for tiny,
   battery-operated networked embedded systems.  In particular, it
   provides guidance on correct implementation of the CoAP specification
   RFC 7252, memory optimizations, and customized protocol parameters.

Status of This Memo

   This Internet-Draft is submitted in full conformance with the
   provisions of BCP 78 and BCP 79.

   Internet-Drafts are working documents of the Internet Engineering
   Task Force (IETF).  Note that other groups may also distribute
   working documents as Internet-Drafts.  The list of current Internet-
   Drafts is at http://datatracker.ietf.org/drafts/current/.

   Internet-Drafts are draft documents valid for a maximum of six months
   and may be updated, replaced, or obsoleted by other documents at any
   time.  It is inappropriate to use Internet-Drafts as reference
   material or to cite them other than as "work in progress."

   This Internet-Draft will expire on December 29, 2015.

Copyright Notice

   Copyright (c) 2015 IETF Trust and the persons identified as the
   document authors.  All rights reserved.

   This document is subject to BCP 78 and the IETF Trust's Legal
   Provisions Relating to IETF Documents
   (http://trustee.ietf.org/license-info) in effect on the date of

Kovatsch, et al.        Expires December 29, 2015               [Page 1]
Internet-Draft        CoAP Implementation Guidance             June 2015

   publication of this document.  Please review these documents
   carefully, as they describe your rights and restrictions with respect
   to this document.  Code Components extracted from this document must
   include Simplified BSD License text as described in Section 4.e of
   the Trust Legal Provisions and are provided without warranty as
   described in the Simplified BSD License.

Table of Contents

   1.  Introduction  . . . . . . . . . . . . . . . . . . . . . . . .   3
   2.  Protocol Implementation . . . . . . . . . . . . . . . . . . .   4
     2.1.  Client/Server Model . . . . . . . . . . . . . . . . . . .   4
     2.2.  Message Processing  . . . . . . . . . . . . . . . . . . .   5
       2.2.1.  On-the-fly Processing . . . . . . . . . . . . . . . .   5
       2.2.2.  Internal Data Structure . . . . . . . . . . . . . . .   6
     2.3.  Duplicate Rejection . . . . . . . . . . . . . . . . . . .   6
     2.4.  Token Usage . . . . . . . . . . . . . . . . . . . . . . .   7
       2.4.1.  Tokens for Observe  . . . . . . . . . . . . . . . . .   7
       2.4.2.  Tokens for Blockwise Transfers  . . . . . . . . . . .   8
     2.5.  Transmission States . . . . . . . . . . . . . . . . . . .   9
       2.5.1.  Request/Response Layer  . . . . . . . . . . . . . . .   9
       2.5.2.  Message Layer . . . . . . . . . . . . . . . . . . . .  10
     2.6.  Out-of-band Information . . . . . . . . . . . . . . . . .  11
     2.7.  Programming Model . . . . . . . . . . . . . . . . . . . .  12
       2.7.1.  Client  . . . . . . . . . . . . . . . . . . . . . . .  12
       2.7.2.  Server  . . . . . . . . . . . . . . . . . . . . . . .  13
   3.  Optimizations . . . . . . . . . . . . . . . . . . . . . . . .  14
     3.1.  Message Buffers . . . . . . . . . . . . . . . . . . . . .  14
     3.2.  Retransmissions . . . . . . . . . . . . . . . . . . . . .  14
     3.3.  Observable Resources  . . . . . . . . . . . . . . . . . .  15
     3.4.  Blockwise Transfers . . . . . . . . . . . . . . . . . . .  16
     3.5.  Deduplication with Sequential MIDs  . . . . . . . . . . .  16
   4.  Alternative Configurations  . . . . . . . . . . . . . . . . .  19
     4.1.  Transmission Parameters . . . . . . . . . . . . . . . . .  19
     4.2.  CoAP over IPv4  . . . . . . . . . . . . . . . . . . . . .  20
   5.  Binding to specific lower-layer APIs  . . . . . . . . . . . .  20
     5.1.  Berkeley Socket Interface . . . . . . . . . . . . . . . .  20
       5.1.1.  Responding from the right address . . . . . . . . . .  20
     5.2.  Java  . . . . . . . . . . . . . . . . . . . . . . . . . .  21
     5.3.  Multicast detection . . . . . . . . . . . . . . . . . . .  21
Show full document text