Re: [core] CoAP jump mechanism

Carsten Bormann <cabo@tzi.org> Thu, 22 November 2012 14:29 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 6AAAF21F84DA for <core@ietfa.amsl.com>; Thu, 22 Nov 2012 06:29:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -106.394
X-Spam-Level:
X-Spam-Status: No, score=-106.394 tagged_above=-999 required=5 tests=[AWL=-0.145, BAYES_00=-2.599, HELO_EQ_DE=0.35, RCVD_IN_DNSWL_MED=-4, USER_IN_WHITELIST=-100]
Received: from mail.ietf.org ([64.170.98.30]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Y1WVtMTpl3vx for <core@ietfa.amsl.com>; Thu, 22 Nov 2012 06:29:48 -0800 (PST)
Received: from informatik.uni-bremen.de (mailhost.informatik.uni-bremen.de [IPv6:2001:638:708:30c9::12]) by ietfa.amsl.com (Postfix) with ESMTP id 89FF421F890D for <core@ietf.org>; Thu, 22 Nov 2012 06:29:48 -0800 (PST)
X-Virus-Scanned: amavisd-new at informatik.uni-bremen.de
Received: from smtp-fb3.informatik.uni-bremen.de (smtp-fb3.informatik.uni-bremen.de [134.102.224.120]) by informatik.uni-bremen.de (8.14.3/8.14.3) with ESMTP id qAMETf9M027318 for <core@ietf.org>; Thu, 22 Nov 2012 15:29:41 +0100 (CET)
Received: from [192.168.217.105] (p5489334E.dip.t-dialin.net [84.137.51.78]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by smtp-fb3.informatik.uni-bremen.de (Postfix) with ESMTPSA id 4580411E; Thu, 22 Nov 2012 15:29:41 +0100 (CET)
Mime-Version: 1.0 (Mac OS X Mail 6.2 \(1499\))
Content-Type: text/plain; charset="iso-8859-1"
From: Carsten Bormann <cabo@tzi.org>
In-Reply-To: <CAB6izESt20ADVWitaeiTL_D=qQfiKBdJ=QPczUV1xU_HFL2drg@mail.gmail.com>
Date: Thu, 22 Nov 2012 15:29:40 +0100
Content-Transfer-Encoding: quoted-printable
Message-Id: <9160F42C-566E-445C-BF13-F57B6F67C740@tzi.org>
References: <55877B3AFB359744BA0F2140E36F52B514D26D1F@MBX10.d.ethz.ch> <5DC25716-A8E1-4FC7-B932-3079CFB703C4@tzi.org> <55877B3AFB359744BA0F2140E36F52B514D26E8B@MBX10.d.ethz.ch> <46A1DF3F04371240B504290A071B4DB63C877351@szxeml509-mbx> <CAB6izESt20ADVWitaeiTL_D=qQfiKBdJ=QPczUV1xU_HFL2drg@mail.gmail.com>
To: Klaus Hartke <hartke@tzi.org>
X-Mailer: Apple Mail (2.1499)
Cc: "core@ietf.org WG" <core@ietf.org>
Subject: Re: [core] CoAP jump mechanism
X-BeenThere: core@ietf.org
X-Mailman-Version: 2.1.12
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: <http://www.ietf.org/mail-archive/web/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: Thu, 22 Nov 2012 14:29:49 -0000

On Nov 22, 2012, at 12:23, Klaus Hartke <hartke@tzi.org> wrote:

> a zoo of mechanisms
> to work around them:
> 
> * option count: (1) OC field, (2) end-of-options marker;
> * delta: (1) option header, (2) jump by 15, (3) long jump;
> * option length: (1) option header, (2) elongated option header.

The three numbers have a different use, a different nature, and a different distribution function.
For all of them, there is a likely small case and less likely larger cases.
So having two cases in each of them is just fine.
The delta is a bit more different because it can get very large due to the way we changed the registration policies.  So we have three (actually: four) cases.
I think we have lamented about the operation wound left by the surgical removal of fenceposts already :-)
Yes, there is a little scar on the code because of that.  But this is ten lines of code.
(I also have a design in mind that would be nine lines of code.  But let's not go there at this point...)

Honestly, what worries me myself a bit more is that many implementers these days have trouble figuring out arithmetic.
As another data point, base32 was replaced by base16 in draft-farrell-decade-ni-10.txt because implementers thought that juggling 5-bit units in 8-bit bytes was "too hard" (and this isn't even about constrained systems).  Well, it doesn't make too much of a difference here, so we are now stuck with base16.
I learn from that: protocols should be designed to be implementable requiring minimal arithmetic skills from the implementers, and I'm happy to accept this as another non-technical requirement.
I think we are safe here with CoAP for option count and option length. 
For delta, where the design is now a tiny bit suboptimal, we probably should write a couple more lines in the lwig document.
Fortunately, all these number ranges are small enough that implementers can (and should!) write exhaustive automatic tests for them.

Grüße, Carsten