[core] draft-ietf-core-stateless-03.txt: very constrained servers

Carsten Bormann <cabo@tzi.org> Wed, 30 October 2019 15:41 UTC

Return-Path: <cabo@tzi.org>
X-Original-To: core@ietfa.amsl.com
Delivered-To: core@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 3256E12002F for <core@ietfa.amsl.com>; Wed, 30 Oct 2019 08:41:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.199
X-Spam-Level:
X-Spam-Status: No, score=-4.199 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6vd6C9yWo65G for <core@ietfa.amsl.com>; Wed, 30 Oct 2019 08:41:14 -0700 (PDT)
Received: from gabriel-vm-2.zfn.uni-bremen.de (gabriel-vm-2.zfn.uni-bremen.de [134.102.50.17]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 9A25C12022A for <core@ietf.org>; Wed, 30 Oct 2019 08:41:14 -0700 (PDT)
Received: from client-0038.vpn.uni-bremen.de (client-0038.vpn.uni-bremen.de [134.102.107.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by gabriel-vm-2.zfn.uni-bremen.de (Postfix) with ESMTPSA id 473CNT09Fdz10fs; Wed, 30 Oct 2019 16:41:12 +0100 (CET)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\))
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <157237477119.11043.4363082013315464920@ietfa.amsl.com>
Date: Wed, 30 Oct 2019 16:41:12 +0100
X-Mao-Original-Outgoing-Id: 594142868.408064-56c852394aef159759482975ae12f9f5
Content-Transfer-Encoding: quoted-printable
Message-Id: <EF1542CC-A5E2-42F6-AF4E-A541060B52E2@tzi.org>
References: <157237477119.11043.4363082013315464920@ietfa.amsl.com>
To: core <core@ietf.org>
X-Mailer: Apple Mail (2.3445.9.1)
Archived-At: <https://mailarchive.ietf.org/arch/msg/core/JD18p4SrVxQhzcplEoYOZokb1d4>
Subject: [core] draft-ietf-core-stateless-03.txt: very constrained servers
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: "Constrained RESTful Environments \(CoRE\) Working Group list" <core.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/core>, <mailto:core-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/core/>
List-Post: <mailto:core@ietf.org>
List-Help: <mailto:core-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/core>, <mailto:core-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 30 Oct 2019 15:41:21 -0000

On Oct 29, 2019, at 19:46, internet-drafts@ietf.org wrote:
> 
> 
> A New Internet-Draft is available from the on-line Internet-Drafts directories.
> This draft is a work item of the Constrained RESTful Environments WG of the IETF.
> 
>        Title           : Extended Tokens and Stateless Clients in the Constrained Application Protocol (CoAP)
>        Author          : Klaus Hartke
> 	Filename        : draft-ietf-core-stateless-03.txt

Thank you, Klaus.

While I haven’t completed by chair’s review of the new version yet, one issue stands out, as it cannot really be solved beautifully, and it is hard to give advice that properly covers all the situations.

   If a server supports extended token lengths but receives a request
   with a token of a length it is unwilling or unable to handle, it MUST
   NOT reject the message, as that would imply that extended token
   lengths are not supported at all.  Instead, if the server cannot
   handle the request at the time, it SHOULD return a 5.03 (Service
   Unavailable) response; if the server will never be able to handle
   (e.g., because the token is too large), it SHOULD return a 4.00 (Bad
   Request) response.

(…followed by a few design notes that are useful to read.)

The situation that may not be properly covered here is a constrained server that doesn’t have resources to handle a full-size IP packet, e.g. for performing outward adaptation layer fragmentation of the response.

So far, we haven’t really had a “you must be this tall to play” on CoAP, and that includes message size.  We do have recommendations (1152 bytes, Section 4.6 of RFC 7252), but these are more for guiding a client.  A server might have resources that genuine never need large requests, and it has control over the response size (e.g., using block-wise where needed).  With an incoming token of essentially unlimited length (dreaming up a random limit doesn’t help, either), this situation changes.

So what can a constrained server that is limited to, say, 256-byte packets, do?

* It can reject all extended token lengths.  Safe, but makes it less useful for stateless proxying.

* It can accept, say, extended token lengths up to 37 bytes.  Great.  Now, the above means:

If a client sends a request with a 999 byte token, the server

* cannot send a response, because that would need to copy the full token

* cannot send a Reject, because that has a MUST NOT in the text above

So it seems the current text requires it to remain silent.  That sure works, and is easy to implement, but makes for a slow and wasteful discovery process.

Grüße, Carsten